only calculate difference when it's the same item
This commit is contained in:
@@ -119,6 +119,8 @@ public class AppEngInternalInventory extends ItemStackHandler implements IIntern
|
|||||||
ItemStack added = this.getStackInSlot( slot ).copy();
|
ItemStack added = this.getStackInSlot( slot ).copy();
|
||||||
ItemStack removed = this.previousStack.copy();
|
ItemStack removed = this.previousStack.copy();
|
||||||
|
|
||||||
|
if( !added.isEmpty() && !removed.isEmpty() && Platform.itemComparisons().isEqualItem( added, removed ) )
|
||||||
|
{
|
||||||
if( this.currentOp == InvOperation.INSERT )
|
if( this.currentOp == InvOperation.INSERT )
|
||||||
{
|
{
|
||||||
added.grow( -removed.getCount() );
|
added.grow( -removed.getCount() );
|
||||||
@@ -127,6 +129,7 @@ public class AppEngInternalInventory extends ItemStackHandler implements IIntern
|
|||||||
{
|
{
|
||||||
removed.grow( -added.getCount() );
|
removed.grow( -added.getCount() );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
this.getTileEntity().onChangeInventory( this, slot, this.currentOp, removed, added );
|
this.getTileEntity().onChangeInventory( this, slot, this.currentOp, removed, added );
|
||||||
this.getTileEntity().saveChanges();
|
this.getTileEntity().saveChanges();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user