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.
This commit is contained in:
parent
6b84b38eaa
commit
9d64709e5a
1 changed files with 15 additions and 0 deletions
|
@ -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
|
@Override
|
||||||
public ItemStack decrStackSize( final int amount )
|
public ItemStack decrStackSize( final int amount )
|
||||||
{
|
{
|
||||||
|
|
Reference in a new issue