diff options
Diffstat (limited to 'src/main/java/gregtech/common')
-rw-r--r-- | src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java index 73a8fac252..6951f9bb44 100644 --- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java @@ -18,7 +18,9 @@ import java.util.Arrays; import java.util.Comparator; public class GT_MetaTileEntity_ChestBuffer extends GT_MetaTileEntity_Buffer { - private static final int[] tickRate = {400, 200, 100, 20, 4, 1, 1, 1, 1, 1, 1, 1, 1}; + + private static final int[] tickRate = {400, 200, 100, 20, 4, 1, 1, 1, 1, 1, 1, 1, 1}; + private static final int[] maxStacks = { 1, 1, 1, 1, 1, 1, 2, 4, 8, 16, 32, 64, 128}; public GT_MetaTileEntity_ChestBuffer(int aID, String aName, String aNameRegional, int aTier) { @@ -66,7 +68,7 @@ public class GT_MetaTileEntity_ChestBuffer extends GT_MetaTileEntity_Buffer { // mSuccess will be negative if the call is caused by the %200 aTimer, always try to push. Otherwise it will be positive. // For the first 6 ticks after a successful move (49->44), push every tick. Then go to every 5 ticks. if ( (mSuccess <= 0 ) || (mSuccess > 43) || ((mSuccess % 5) == 0 )){ - super.moveItems(aBaseMetaTileEntity, aTimer); + super.moveItems(aBaseMetaTileEntity, aTimer, Math.min(MAX, maxStacks[mTier])); } if(mSuccess < 0) { @@ -139,13 +141,19 @@ public class GT_MetaTileEntity_ChestBuffer extends GT_MetaTileEntity_Buffer { protected static String getTickRateDesc(int tier){ int tickRate = getTickRate(tier); - String s = ""; + String timeStr = ""; + String numStr = ""; + if (maxStacks[tier] > 1) { + numStr = maxStacks[tier] + " items"; + } else { + numStr = "1 item"; + } if (tickRate < 20) - s = "1/" + 20/tickRate + " "; + timeStr = "1/" + 20/tickRate + " "; else if (tickRate > 20) { - s = (tickRate / 20) + "th "; + timeStr = (tickRate / 20) + "th "; } - return "Moves items every " + s + "second"; + return "Moves " + numStr + " every " + timeStr + "second"; } protected static int getTickRate(int tier) { @@ -153,4 +161,9 @@ public class GT_MetaTileEntity_ChestBuffer extends GT_MetaTileEntity_Buffer { return 1; return tickRate[tier]; } + + protected static int getMaxStacks(int tier) { + // Included higher tiers on the off chance they actually work without blowing things up lmao + return tier > 9 ? MAX : Math.min(maxStacks[tier], MAX); + } } |