mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 08:14:23 +01:00
Fix itemstack null checks
This commit is contained in:
parent
9c7b6cd621
commit
8dfac7be08
2 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue