From 1a918be6588bbdd17bbe7793d9acad334ccbb5a1 Mon Sep 17 00:00:00 2001 From: Florian Scandella Date: Tue, 29 Aug 2017 22:52:59 +0200 Subject: [PATCH] only calculate difference when it's the same item --- .../tile/inventory/AppEngInternalInventory.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/java/appeng/tile/inventory/AppEngInternalInventory.java b/src/main/java/appeng/tile/inventory/AppEngInternalInventory.java index 35b823223..a711e1af9 100644 --- a/src/main/java/appeng/tile/inventory/AppEngInternalInventory.java +++ b/src/main/java/appeng/tile/inventory/AppEngInternalInventory.java @@ -119,13 +119,16 @@ public class AppEngInternalInventory extends ItemStackHandler implements IIntern ItemStack added = this.getStackInSlot( slot ).copy(); ItemStack removed = this.previousStack.copy(); - if( this.currentOp == InvOperation.INSERT ) + if( !added.isEmpty() && !removed.isEmpty() && Platform.itemComparisons().isEqualItem( added, removed ) ) { - added.grow( -removed.getCount() ); - } - else if( this.currentOp == InvOperation.EXTRACT ) - { - removed.grow( -added.getCount() ); + if( this.currentOp == InvOperation.INSERT ) + { + added.grow( -removed.getCount() ); + } + else if( this.currentOp == InvOperation.EXTRACT ) + { + removed.grow( -added.getCount() ); + } } this.getTileEntity().onChangeInventory( this, slot, this.currentOp, removed, added ); this.getTileEntity().saveChanges();