diff options
Diffstat (limited to 'src/Java/gtPlusPlus/core/util')
-rw-r--r-- | src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java index 486cda42f9..a5cf9527a9 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java @@ -936,11 +936,22 @@ public class ItemUtils { for (int o = 0; o < aInputInventory.getSizeInventory(); o++) { p[o] = aInputInventory.getStackInSlot(o); } - ItemStack[] g = organiseInventory(p); - IInventory aTemp = aInputInventory; + //ItemStack[] g = organiseInventory(p); + + IInventory aTemp = aInputInventory; + for (int i = 0; i < p.length; ++i) { + for (int j = i + 1; j < p.length; ++j) { + if (p[j] != null && (p[i] == null + || GT_Utility.areStacksEqual(p[i], p[j]))) { + GT_Utility.moveStackFromSlotAToSlotB(aTemp, aTemp, j, i, (byte) 64, (byte) 1, (byte) 64, (byte) 1); + } + } + } + + /* for (int o = 0; o < aInputInventory.getSizeInventory(); o++) { aTemp.setInventorySlotContents(o, g[o]); - } + }*/ return aTemp; } |