Rename 'translateToHand' to better reflect what it does

This commit is contained in:
Sollace 2018-04-27 17:55:30 +02:00
parent 13ba3379c9
commit b00b2745e1
4 changed files with 12 additions and 9 deletions

View file

@ -65,7 +65,7 @@ public class LayerHeldPonyItem<T extends EntityLivingBase> extends AbstractPonyL
private void renderHeldItem(T entity, ItemStack drop, TransformType transform, EnumHandSide hand) {
if (!drop.isEmpty()) {
GlStateManager.pushMatrix();
translateToHand(hand);
postRenderArm(hand);
if (entity.isSneaking()) {
GlStateManager.translate(0, 0.2F, 0);
@ -97,14 +97,17 @@ public class LayerHeldPonyItem<T extends EntityLivingBase> extends AbstractPonyL
return model instanceof AbstractPonyModel && ((AbstractPonyModel) model).metadata.hasMagic();
}
protected void translateToHand(EnumHandSide hand) {
/**
* Renders the main arm
*/
protected void postRenderArm(EnumHandSide side) {
AbstractPonyModel thePony = ((IRenderPony) getRenderer()).getPlayerModel().getModel();
if (thePony.metadata.hasMagic()) {
ModelPlayerPony playerModel = (ModelPlayerPony) thePony;
ModelRenderer unicornarm = hand == EnumHandSide.LEFT ? playerModel.unicornArmLeft : playerModel.unicornArmRight;
ModelRenderer unicornarm = side == EnumHandSide.LEFT ? playerModel.unicornArmLeft : playerModel.unicornArmRight;
unicornarm.postRender(0.0625F);
} else {
((ModelBiped) getRenderer().getMainModel()).postRenderArm(0.0625F, hand);
((ModelBiped) getRenderer().getMainModel()).postRenderArm(0.0625F, side);
}
}

View file

@ -30,8 +30,8 @@ public class RenderPonyEvoker extends RenderPonyMob<EntityEvoker> {
}
@Override
protected void translateToHand(EnumHandSide hand) {
((ModelIllagerPony) getRenderer().getMainModel()).getArm(hand).postRender(0.0625F);
protected void postRenderArm(EnumHandSide side) {
((ModelIllagerPony) getRenderer().getMainModel()).getArm(side).postRender(0.0625F);
}
});
}

View file

@ -33,8 +33,8 @@ public class RenderPonyIllusionIllager extends RenderPonyMob<EntityIllusionIllag
}
@Override
protected void translateToHand(EnumHandSide hand) {
((ModelIllagerPony) getRenderer().getMainModel()).getArm(hand).postRender(0.0625F);
protected void postRenderArm(EnumHandSide side) {
((ModelIllagerPony) getRenderer().getMainModel()).getArm(side).postRender(0.0625F);
}
});
}

View file

@ -31,7 +31,7 @@ public class RenderPonyVindicator extends RenderPonyMob<EntityVindicator> {
}
@Override
protected void translateToHand(EnumHandSide side) {
protected void postRenderArm(EnumHandSide side) {
((ModelIllagerPony) getRenderer().getMainModel()).getArm(side).postRender(0.0625F);
}
});