Fixed separate NPE with the Sigil of Holding.
Added possible fix to an Incense glitch.
This commit is contained in:
parent
eccf747a09
commit
150ed4c6a9
|
@ -77,7 +77,7 @@ public class ItemSacrificialDagger extends Item implements IMeshProvider
|
|||
@Override
|
||||
public void onPlayerStoppedUsing(ItemStack stack, World worldIn, EntityLivingBase entityLiving, int timeLeft)
|
||||
{
|
||||
if (entityLiving instanceof EntityPlayer)
|
||||
if (entityLiving instanceof EntityPlayer && !entityLiving.worldObj.isRemote)
|
||||
PlayerSacrificeHelper.sacrificePlayerHealth((EntityPlayer) entityLiving);
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ public class InventoryHolding extends ItemInventory
|
|||
{
|
||||
ItemStack itemStack = entityPlayer.inventory.getStackInSlot(i);
|
||||
|
||||
if (hasUUID(itemStack))
|
||||
if (itemStack != null && hasUUID(itemStack))
|
||||
{
|
||||
if (itemStack.getTagCompound().getLong(Constants.NBT.MOST_SIG) == parentStackUUID.getMostSignificantBits() && itemStack.getTagCompound().getLong(Constants.NBT.LEAST_SIG) == parentStackUUID.getLeastSignificantBits())
|
||||
{
|
||||
|
@ -84,7 +84,7 @@ public class InventoryHolding extends ItemInventory
|
|||
|
||||
public static boolean hasUUID(ItemStack itemStack)
|
||||
{
|
||||
return itemStack.getTagCompound().hasKey(Constants.NBT.MOST_SIG) && itemStack.getTagCompound().hasKey(Constants.NBT.LEAST_SIG);
|
||||
return itemStack.hasTagCompound() && itemStack.getTagCompound().hasKey(Constants.NBT.MOST_SIG) && itemStack.getTagCompound().hasKey(Constants.NBT.LEAST_SIG);
|
||||
}
|
||||
|
||||
public static void setUUID(ItemStack itemStack)
|
||||
|
|
Loading…
Reference in a new issue