Sanity check the item ID for loaded liquid stacks better.

This commit is contained in:
Christian 2013-03-29 21:43:59 -04:00
parent 8a4a62ab4e
commit 5ad133c664

View file

@ -132,6 +132,11 @@ public class LiquidStack
itemID = liquid.itemID;
itemMeta = liquid.itemMeta;
}
// if the item is not existent, and no liquid dictionary is found, null returns
else if (Item.itemsList[itemID] == null)
{
return null;
}
int amount = nbt.getInteger("Amount");
LiquidStack liquidstack = new LiquidStack(itemID, amount, itemMeta);
return liquidstack.itemID == 0 ? null : liquidstack;