From b355a66c9721b070d5e66ee49f3fa619c9adccec Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 16 Nov 2016 17:06:53 +0100 Subject: [PATCH] Fix auto split --- .../mod/tile/TileEntityFurnaceDouble.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceDouble.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceDouble.java index 07584a973..7a20385bc 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceDouble.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceDouble.java @@ -51,10 +51,10 @@ public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements if(StackUtil.isValid(first) || StackUtil.isValid(second)){ ItemStack toSplit = StackUtil.getNull(); - if(!StackUtil.isValid(first) && StackUtil.isValid(second)){ + if(!StackUtil.isValid(first) && StackUtil.isValid(second) && StackUtil.getStackSize(second) > 1){ toSplit = second; } - else if(!StackUtil.isValid(second) && StackUtil.isValid(first)){ + else if(!StackUtil.isValid(second) && StackUtil.isValid(first) && StackUtil.getStackSize(first) > 1){ toSplit = first; } else if(ItemUtil.canBeStacked(first, second)){ @@ -69,8 +69,8 @@ public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements if(StackUtil.isValid(toSplit)){ ItemStack splitFirst = toSplit.copy(); ItemStack secondSplit = splitFirst.splitStack(StackUtil.getStackSize(splitFirst)/2); - slots[slot1] = splitFirst; - slots[slot2] = secondSplit; + slots[slot1] = StackUtil.validateCheck(splitFirst); + slots[slot2] = StackUtil.validateCheck(secondSplit); } } }