Sanity check the item ID for loaded liquid stacks better.

This commit is contained in:
Christian committed 2013-03-29 21:43:59 -04:00
1 parent 8a4a62ab4e
commit 5ad133c664
1 file changed
+5
@@ -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;