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) { private void renderHeldItem(T entity, ItemStack drop, TransformType transform, EnumHandSide hand) {
if (!drop.isEmpty()) { if (!drop.isEmpty()) {
GlStateManager.pushMatrix(); GlStateManager.pushMatrix();
translateToHand(hand); postRenderArm(hand);
if (entity.isSneaking()) { if (entity.isSneaking()) {
GlStateManager.translate(0, 0.2F, 0); 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(); 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(); AbstractPonyModel thePony = ((IRenderPony) getRenderer()).getPlayerModel().getModel();
if (thePony.metadata.hasMagic()) { if (thePony.metadata.hasMagic()) {
ModelPlayerPony playerModel = (ModelPlayerPony) thePony; 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); unicornarm.postRender(0.0625F);
} else { } 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 @Override
protected void translateToHand(EnumHandSide hand) { protected void postRenderArm(EnumHandSide side) {
((ModelIllagerPony) getRenderer().getMainModel()).getArm(hand).postRender(0.0625F); ((ModelIllagerPony) getRenderer().getMainModel()).getArm(side).postRender(0.0625F);
} }
}); });
} }

View file

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

View file

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