Moved IRenderManager.addPlayerSkin up one and put stuff with PlayerModels into one spot

This commit is contained in:
Sollace 2018-04-30 08:51:36 +02:00
parent e2c94901c4
commit 4e4b83fb30
3 changed files with 11 additions and 10 deletions

View file

@ -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);
}
/**

View file

@ -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() {

View file

@ -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