Fix itemstack null checks

This commit is contained in:
Matthew Messinger 2016-11-22 16:20:23 -05:00
parent 9c7b6cd621
commit 8dfac7be08
2 changed files with 3 additions and 3 deletions

View file

@ -126,7 +126,7 @@ public abstract class AbstractPonyModel extends ModelPlayer {
ItemStack main = clientPlayer.getHeldItemMainhand(); ItemStack main = clientPlayer.getHeldItemMainhand();
ArmPose mainPose; ArmPose mainPose;
if (main == null) { if (main.isEmpty()) {
mainPose = ArmPose.EMPTY; mainPose = ArmPose.EMPTY;
} else { } else {
mainPose = ArmPose.ITEM; mainPose = ArmPose.ITEM;
@ -144,7 +144,7 @@ public abstract class AbstractPonyModel extends ModelPlayer {
ItemStack off = clientPlayer.getHeldItemOffhand(); ItemStack off = clientPlayer.getHeldItemOffhand();
ArmPose offPose; ArmPose offPose;
if (off == null) { if (off.isEmpty()) {
offPose = ArmPose.EMPTY; offPose = ArmPose.EMPTY;
} else { } else {
offPose = ArmPose.ITEM; offPose = ArmPose.ITEM;

View file

@ -69,7 +69,7 @@ public class LayerHeldPonyItem implements LayerRenderer<EntityLivingBase> {
} }
private void renderHeldItem(EntityLivingBase entity, ItemStack drop, ItemCameraTransforms.TransformType transform, EnumHandSide hand) { private void renderHeldItem(EntityLivingBase entity, ItemStack drop, ItemCameraTransforms.TransformType transform, EnumHandSide hand) {
if (drop != null) { if (!drop.isEmpty()) {
GlStateManager.pushMatrix(); GlStateManager.pushMatrix();
AbstractPonyModel thePony = ((IRenderPony) this.livingPonyEntity).getPony().getModel(); AbstractPonyModel thePony = ((IRenderPony) this.livingPonyEntity).getPony().getModel();
PonyData metadata = thePony.metadata; PonyData metadata = thePony.metadata;