diff --git a/src/main/java/com/minelittlepony/PonyRenderManager.java b/src/main/java/com/minelittlepony/PonyRenderManager.java index 95a7a0a0..809e305c 100644 --- a/src/main/java/com/minelittlepony/PonyRenderManager.java +++ b/src/main/java/com/minelittlepony/PonyRenderManager.java @@ -3,7 +3,7 @@ package com.minelittlepony; import java.util.Map; import com.google.common.collect.Maps; -import com.minelittlepony.ducks.IRenderManager; +import com.minelittlepony.mixin.MixinRenderManager; import com.minelittlepony.hdskins.gui.EntityPonyModel; import com.minelittlepony.hdskins.gui.RenderPonyModel; import com.minelittlepony.model.player.PlayerModels; @@ -56,13 +56,15 @@ public class PonyRenderManager { registerPlayerSkin(manager, PlayerModels.ALICORN); } - protected void registerPlayerSkin(RenderManager manager, PlayerModels playerModel) { - addPlayerSkin(manager, new RenderPonyPlayer(manager, false, playerModel)); - addPlayerSkin(manager, new RenderPonyPlayer(manager, true, playerModel)); + private void registerPlayerSkin(RenderManager manager, PlayerModels playerModel) { + addPlayerSkin(manager, false, playerModel); + addPlayerSkin(manager, true, playerModel); } - public void addPlayerSkin(RenderManager manager, RenderPonyPlayer renderer) { - ((IRenderManager)manager).addPlayerSkin(renderer.skinId, renderer); + private void addPlayerSkin(RenderManager manager, boolean slimArms, PlayerModels playerModel) { + RenderPonyPlayer renderer = new RenderPonyPlayer(manager, slimArms, playerModel.getModel(slimArms)); + + ((MixinRenderManager)manager).getSkinMap().put(playerModel.getId(slimArms), renderer); } /** diff --git a/src/main/java/com/minelittlepony/ducks/IRenderManager.java b/src/main/java/com/minelittlepony/ducks/IRenderManager.java deleted file mode 100644 index d48b127a..00000000 --- a/src/main/java/com/minelittlepony/ducks/IRenderManager.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.minelittlepony.ducks; - -import net.minecraft.client.renderer.entity.RenderPlayer; - -public interface IRenderManager { - /** - * Registers a new player model to the underlying skinMap object. - * @param key The key to identify it by. - * @param render The renderer to add. - */ - void addPlayerSkin(String key, RenderPlayer render); -} diff --git a/src/main/java/com/minelittlepony/mixin/MixinRenderManager.java b/src/main/java/com/minelittlepony/mixin/MixinRenderManager.java index 8b732680..5f200841 100644 --- a/src/main/java/com/minelittlepony/mixin/MixinRenderManager.java +++ b/src/main/java/com/minelittlepony/mixin/MixinRenderManager.java @@ -2,22 +2,14 @@ package com.minelittlepony.mixin; import java.util.Map; -import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; - -import com.minelittlepony.ducks.IRenderManager; +import org.spongepowered.asm.mixin.gen.Accessor; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderPlayer; @Mixin(RenderManager.class) -public abstract class MixinRenderManager implements IRenderManager { - @Shadow @Final - private Map skinMap; - - @Override - public void addPlayerSkin(String key, RenderPlayer render) { - skinMap.put(key, render); - } +public interface MixinRenderManager { + @Accessor + Map getSkinMap(); } diff --git a/src/main/java/com/minelittlepony/render/player/RenderPonyPlayer.java b/src/main/java/com/minelittlepony/render/player/RenderPonyPlayer.java index 1ef664ac..793cd758 100644 --- a/src/main/java/com/minelittlepony/render/player/RenderPonyPlayer.java +++ b/src/main/java/com/minelittlepony/render/player/RenderPonyPlayer.java @@ -2,7 +2,7 @@ package com.minelittlepony.render.player; import com.minelittlepony.MineLittlePony; import com.minelittlepony.ducks.IPonyAnimationHolder; -import com.minelittlepony.model.player.PlayerModels; +import com.minelittlepony.model.ModelWrapper; import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.client.renderer.GlStateManager; @@ -10,14 +10,8 @@ import net.minecraft.client.renderer.entity.RenderManager; public class RenderPonyPlayer extends RenderPonyBase { - /** - * The id used to find this renderer in the player skin map. - */ - public final String skinId; - - public RenderPonyPlayer(RenderManager renderManager, boolean useSmallArms, PlayerModels model) { - super(renderManager, useSmallArms, model.getModel(useSmallArms)); - skinId = model.getId(useSmallArms); + public RenderPonyPlayer(RenderManager renderManager, boolean useSmallArms, ModelWrapper model) { + super(renderManager, useSmallArms, model); } @Override