Fixed crate bug and imprinter crash

This commit is contained in:
Brian Ricketts 2013-02-02 00:23:41 -06:00
parent b35557d581
commit b9de76e2a2
3 changed files with 6 additions and 1 deletions

View file

@ -5,6 +5,7 @@ import java.io.File;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.server.MinecraftServer;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;

View file

@ -147,6 +147,10 @@ public class BlockCrate extends BlockMachine
if (requestStack.isItemEqual(currentStack))
{
player.inventory.setInventorySlotContents(i, this.putIn(tileEntity, currentStack));
if (player instanceof EntityPlayerMP)
{
((EntityPlayerMP) player).sendContainerToPlayer(player.inventoryContainer);
}
}
}
}

View file

@ -24,7 +24,7 @@ public class SlotCraftingResult extends Slot
@Override
public boolean canTakeStack(EntityPlayer player)
{
return this.container.tileEntity.getIdealRecipe(this.getStack()) != null;
return this.getStack() == null ? false : this.container.tileEntity.getIdealRecipe(this.getStack()) != null;
}
@Override