possible fix for crash loading old crates

Detected when running a bukkit server so unsure if its a mcpc+ thing or
an actual bug.
This commit is contained in:
DarkGuardsman 2013-09-09 00:45:17 -04:00
parent c07803de22
commit 68346fde01

View file

@ -242,8 +242,11 @@ public class TileEntityCrate extends TileEntityInv implements IPacketReceiver, I
else
{
stack = ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("stack"));
if (stack != null)
{
stack.stackSize = count;
}
}
/* Only load sample stack if the read stack is valid */
if (stack != null && stack.itemID != 0 && stack.stackSize > 0)