Fixed create loading items that don't exist

Since the create saves item stacks different than MC it would load them
even if the item they went too no longer existed. I'll work on a more
improved fix for this that will save the unlocalized name so in case the
IDs change the create remembers what was in it.
This commit is contained in:
DarkGuardsman 2013-09-09 00:15:14 -04:00
parent 6f8dd90743
commit c07803de22

View file

@ -16,7 +16,7 @@ public class InventoryCrate extends InvChest
public void buildInventory(ItemStack sampleStack) public void buildInventory(ItemStack sampleStack)
{ {
this.containedItems = new ItemStack[this.getSizeInventory()]; this.containedItems = new ItemStack[this.getSizeInventory()];
if (sampleStack != null) if (sampleStack != null && sampleStack.getItem() != null)
{ {
ItemStack baseStack = sampleStack.copy(); ItemStack baseStack = sampleStack.copy();
int itemsLeft = baseStack.stackSize; int itemsLeft = baseStack.stackSize;