From 57e84c3039ef06cfab3b574636c30a54128e4fef Mon Sep 17 00:00:00 2001 From: yueh Date: Sat, 7 Mar 2015 15:45:59 +0100 Subject: [PATCH] Removes creating a ItemStack with a full NBT copy There is no need to create a full copy just to fetch the already available stacksize. It still respects the maximum stacksize of Integer.MAX_VALUE as they copy is doing. Fixes #982 --- src/main/java/appeng/me/storage/CellInventory.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/appeng/me/storage/CellInventory.java b/src/main/java/appeng/me/storage/CellInventory.java index 194ff64ab..9b9eb0bb4 100644 --- a/src/main/java/appeng/me/storage/CellInventory.java +++ b/src/main/java/appeng/me/storage/CellInventory.java @@ -481,8 +481,7 @@ public class CellInventory implements ICellInventory if ( request == null ) return null; - ItemStack sharedItem = request.getItemStack(); - int size = sharedItem.stackSize; + long size = Math.min( Integer.MAX_VALUE, request.getStackSize() ); IAEItemStack Results = null;