Fixes a client crash when poss ball has no NBT

This commit is contained in:
zontreck 2023-12-26 00:52:06 -07:00
parent fef70df3cb
commit dcbbe8802c
3 changed files with 10 additions and 2 deletions

View file

@ -20,6 +20,7 @@ public class PossBallItem extends Item
}
@Override
public boolean isFoil(ItemStack pStack) {
if(!pStack.hasTag()) return false;
if(pStack.getTag().contains("entity"))
{
return true;

View file

@ -146,6 +146,7 @@ public class ThrownPossBall extends ThrowableItemProjectile
tag.remove("entity");
}
item = new ItemStack(ModItems.POSS_BALL.get(), 1);
ItemEntity x;
if(shooter!=null)
@ -161,12 +162,18 @@ public class ThrownPossBall extends ThrowableItemProjectile
int damage = item.getDamageValue();
damage++;
item.setDamageValue(damage);*/
item = new ItemStack(ModItems.POSS_BALL.get(), 1);
// Ensure no entity tag!
tag.remove("entity");
//tag.remove("entity");
/*
if(item.getDamageValue() >= item.getMaxDamage())
return;
*/
ItemEntity entity;