From 4e4b83fb30535eb022739df543b0710b862f48b1 Mon Sep 17 00:00:00 2001 From: Sollace Date: Mon, 30 Apr 2018 08:51:36 +0200 Subject: [PATCH] Moved IRenderManager.addPlayerSkin up one and put stuff with PlayerModels into one spot --- .../java/com/minelittlepony/PonyRenderManager.java | 6 +++--- .../minelittlepony/render/player/RenderPonyBase.java | 5 +---- .../minelittlepony/render/player/RenderPonyPlayer.java | 10 +++++++--- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/minelittlepony/PonyRenderManager.java b/src/main/java/com/minelittlepony/PonyRenderManager.java index 0f58ce31..e2f28bc7 100644 --- a/src/main/java/com/minelittlepony/PonyRenderManager.java +++ b/src/main/java/com/minelittlepony/PonyRenderManager.java @@ -59,9 +59,9 @@ public class PonyRenderManager { registerPlayerSkin(rm, PlayerModels.ALICORN); } - protected void registerPlayerSkin(RenderManager rm, PlayerModels playerModel) { - new RenderPonyPlayer(rm, false, playerModel.getId(false), playerModel.getModel(false)); - new RenderPonyPlayer(rm, true, playerModel.getId(true), playerModel.getModel(true)); + protected void registerPlayerSkin(RenderManager manager, PlayerModels playerModel) { + new RenderPonyPlayer(manager, false, playerModel); + new RenderPonyPlayer(manager, true, playerModel); } /** diff --git a/src/main/java/com/minelittlepony/render/player/RenderPonyBase.java b/src/main/java/com/minelittlepony/render/player/RenderPonyBase.java index 82fa660b..510d2c41 100644 --- a/src/main/java/com/minelittlepony/render/player/RenderPonyBase.java +++ b/src/main/java/com/minelittlepony/render/player/RenderPonyBase.java @@ -1,7 +1,6 @@ package com.minelittlepony.render.player; import com.minelittlepony.MineLittlePony; -import com.minelittlepony.ducks.IRenderManager; import com.minelittlepony.ducks.IRenderPony; import com.minelittlepony.model.AbstractPonyModel; import com.minelittlepony.model.ModelWrapper; @@ -30,7 +29,7 @@ public abstract class RenderPonyBase extends RenderPlayer implements IRenderPony private Pony pony; - public RenderPonyBase(RenderManager manager, boolean useSmallArms, String id, ModelWrapper model) { + public RenderPonyBase(RenderManager manager, boolean useSmallArms, ModelWrapper model) { super(manager, useSmallArms); smallArms = useSmallArms; @@ -38,8 +37,6 @@ public abstract class RenderPonyBase extends RenderPlayer implements IRenderPony layerRenderers.clear(); addExtraLayers(); - - ((IRenderManager)manager).addPlayerSkin(id, this); } protected void addExtraLayers() { diff --git a/src/main/java/com/minelittlepony/render/player/RenderPonyPlayer.java b/src/main/java/com/minelittlepony/render/player/RenderPonyPlayer.java index de9e52f8..b566658c 100644 --- a/src/main/java/com/minelittlepony/render/player/RenderPonyPlayer.java +++ b/src/main/java/com/minelittlepony/render/player/RenderPonyPlayer.java @@ -2,15 +2,19 @@ package com.minelittlepony.render.player; import com.minelittlepony.MineLittlePony; import com.minelittlepony.ducks.IPonyAnimationHolder; -import com.minelittlepony.model.ModelWrapper; +import com.minelittlepony.ducks.IRenderManager; +import com.minelittlepony.model.player.PlayerModels; import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.entity.RenderManager; public class RenderPonyPlayer extends RenderPonyBase { - public RenderPonyPlayer(RenderManager renderManager, boolean useSmallArms, String id, ModelWrapper model) { - super(renderManager, useSmallArms, id, model); + + public RenderPonyPlayer(RenderManager renderManager, boolean useSmallArms, PlayerModels model) { + super(renderManager, useSmallArms, model.getModel(useSmallArms)); + + ((IRenderManager)renderManager).addPlayerSkin(model.getId(useSmallArms), this); } @Override