diff options
author | moller21 <42100910+moller21@users.noreply.github.com> | 2020-08-23 15:33:20 +0200 |
---|---|---|
committer | moller21 <42100910+moller21@users.noreply.github.com> | 2020-08-23 15:33:20 +0200 |
commit | 3a07aac9a56e9f340954e9092aecf85ba648c405 (patch) | |
tree | 928eaeb65de5518d2a741133024fdd9885ffa3ab /src/main/java/gregtech/api/util | |
parent | 09a56b53995f98535d337aa40c2c75a92a70144c (diff) | |
download | GT5-Unofficial-3a07aac9a56e9f340954e9092aecf85ba648c405.tar.gz GT5-Unofficial-3a07aac9a56e9f340954e9092aecf85ba648c405.tar.bz2 GT5-Unofficial-3a07aac9a56e9f340954e9092aecf85ba648c405.zip |
Attempt at improving chest buffers, also slowing down lower tier ones.
Diffstat (limited to 'src/main/java/gregtech/api/util')
-rw-r--r-- | src/main/java/gregtech/api/util/GT_LanguageManager.java | 2 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GT_Utility.java | 7 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/main/java/gregtech/api/util/GT_LanguageManager.java b/src/main/java/gregtech/api/util/GT_LanguageManager.java index b44b6ffa40..c87e0f7417 100644 --- a/src/main/java/gregtech/api/util/GT_LanguageManager.java +++ b/src/main/java/gregtech/api/util/GT_LanguageManager.java @@ -323,7 +323,7 @@ public class GT_LanguageManager { addStringLocalization("Interaction_DESCRIPTION_Index_214", "Connected"); addStringLocalization("Interaction_DESCRIPTION_Index_215", "Disconnected"); addStringLocalization("Interaction_DESCRIPTION_Index_216", "Deprecated Recipe"); - addStringLocalization("Interaction_DESCRIPTION_Index_217", "Stocking mode. Keeps this many items in destination input slots."); + addStringLocalization("Interaction_DESCRIPTION_Index_217", "Stocking mode. Keeps this many items in destination input slots. This mode can be server unfriendly."); addStringLocalization("Interaction_DESCRIPTION_Index_218", "Transfer size mode. Add exactly this many items in destination input slots as long as there is room."); addStringLocalization("Interaction_DESCRIPTION_Index_500", "Fitting: Loose - More Flow"); addStringLocalization("Interaction_DESCRIPTION_Index_501", "Fitting: Tight - More Efficiency"); diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index 6df77f16bf..a65ed00aed 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -547,7 +547,7 @@ public class GT_Utility { for (int i = 0; i < tGrabSlots.length; i++) tGrabSlots[i] = i; } - if (aTileEntity2 != null && aTileEntity2 instanceof IInventory) { + if (aTileEntity2 instanceof IInventory) { int[] tPutSlots = null; if (aTileEntity2 instanceof ISidedInventory) tPutSlots = ((ISidedInventory) aTileEntity2).getAccessibleSlotsFromSide(aPutTo); @@ -561,13 +561,12 @@ public class GT_Utility { byte tMovedItemCount = 0; ItemStack tGrabStack = aTileEntity1.getStackInSlot(tGrabSlots[i]); if (listContainsItem(aFilter, tGrabStack, true, aInvertFilter)) { - if (isAllowedToTakeFromSlot(aTileEntity1, tGrabSlots[i], aGrabFrom, tGrabStack)) { + if (tGrabStack.stackSize >= aMinMoveAtOnce && isAllowedToTakeFromSlot(aTileEntity1, tGrabSlots[i], aGrabFrom, tGrabStack)) { for (int j = 0; j < tPutSlots.length; j++) { if (isAllowedToPutIntoSlot((IInventory) aTileEntity2, tPutSlots[j], aPutTo, tGrabStack, aMaxTargetStackSize)) { tMovedItemCount += moveStackFromSlotAToSlotB(aTileEntity1, (IInventory) aTileEntity2, tGrabSlots[i], tPutSlots[j], aMaxTargetStackSize, aMinTargetStackSize, (byte) (aMaxMoveAtOnce - tMovedItemCount), aMinMoveAtOnce); - if (tMovedItemCount >= aMaxMoveAtOnce) { + if (tMovedItemCount >= aMaxMoveAtOnce ||(tMovedItemCount > 0 && aMaxTargetStackSize < 64)) return tMovedItemCount; - } } } } |