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
1 changed files with 5 additions and 0 deletions

View File

@ -132,6 +132,11 @@ public class LiquidStack
itemID = liquid.itemID; itemID = liquid.itemID;
itemMeta = liquid.itemMeta; 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"); int amount = nbt.getInteger("Amount");
LiquidStack liquidstack = new LiquidStack(itemID, amount, itemMeta); LiquidStack liquidstack = new LiquidStack(itemID, amount, itemMeta);
return liquidstack.itemID == 0 ? null : liquidstack; return liquidstack.itemID == 0 ? null : liquidstack;