From 9d64709e5ae60fba3e6e54bbe53b3dd03907aeaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Sat, 23 Jul 2016 09:43:23 +0200 Subject: [PATCH] Fixed crash with workbench output Clicking on the output slot with some output items in hand without having ingredients in storage would cause a crash due to MC thinking it could actually take the stack anyway. --- .../mmm/tech/base/workbench/TBWBCraftingSlot.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/java/mmm/tech/base/workbench/TBWBCraftingSlot.java b/src/java/mmm/tech/base/workbench/TBWBCraftingSlot.java index 215c603..c35bc7d 100644 --- a/src/java/mmm/tech/base/workbench/TBWBCraftingSlot.java +++ b/src/java/mmm/tech/base/workbench/TBWBCraftingSlot.java @@ -37,6 +37,21 @@ public class TBWBCraftingSlot } + @Override + public boolean canTakeStack( EntityPlayer playerIn ) + { + if ( !this.getHasStack( ) ) { + return false; + } + final I_CraftingRecipeWrapper wrapper = this.container.getCurrentRecipe( ); + if ( wrapper == null ) { + return false; + } + final IInventory storage = this.container.getStorage( ); + return storage != null && wrapper.getRequirements( ).checkInventory( storage , 1 , this.container.world ); + } + + @Override public ItemStack decrStackSize( final int amount ) {