Quick fix for weird first person fist. Fixes #90

This commit is contained in:
Matthew Messinger 2018-08-16 16:51:16 -04:00
parent c53d2a12f6
commit ca94bfa860

View file

@ -29,7 +29,6 @@ import net.minecraft.client.renderer.entity.layers.LayerArrow;
import net.minecraft.client.resources.DefaultPlayerSkin; import net.minecraft.client.resources.DefaultPlayerSkin;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.EnumHandSide;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import java.util.Map; import java.util.Map;
@ -82,9 +81,11 @@ public class RenderPonyPlayer extends RenderPlayer implements IRenderPony<Abstra
}.register(ISkull.PLAYER); }.register(ISkull.PLAYER);
protected final RenderPony<AbstractClientPlayer> renderPony = new RenderPony<>(this); protected final RenderPony<AbstractClientPlayer> renderPony = new RenderPony<>(this);
private final RenderPlayer renderPlayer;
public RenderPonyPlayer(RenderManager manager, boolean useSmallArms, ModelWrapper model) { public RenderPonyPlayer(RenderManager manager, boolean useSmallArms, ModelWrapper model) {
super(manager, useSmallArms); super(manager, useSmallArms);
renderPlayer = new RenderPlayer(manager, useSmallArms);
mainModel = renderPony.setPonyModel(model); mainModel = renderPony.setPonyModel(model);
@ -141,27 +142,12 @@ public class RenderPonyPlayer extends RenderPlayer implements IRenderPony<Abstra
@Override @Override
public final void renderRightArm(AbstractClientPlayer player) { public final void renderRightArm(AbstractClientPlayer player) {
renderArm(player, EnumHandSide.RIGHT); renderPlayer.renderRightArm(player);
} }
@Override @Override
public final void renderLeftArm(AbstractClientPlayer player) { public final void renderLeftArm(AbstractClientPlayer player) {
renderArm(player, EnumHandSide.LEFT); renderPlayer.renderLeftArm(player);
}
protected void renderArm(AbstractClientPlayer player, EnumHandSide side) {
renderPony.updateModel(player);
bindEntityTexture(player);
GlStateManager.pushMatrix();
GlStateManager.translate(side == EnumHandSide.LEFT ? 0.06 : 0, -0.37, 0);
if (side == EnumHandSide.LEFT) {
super.renderLeftArm(player);
} else {
super.renderRightArm(player);
}
GlStateManager.popMatrix();
} }
@Override @Override