aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common
diff options
context:
space:
mode:
authorcharles <johnch18@isu.edu>2021-04-12 21:53:20 -0600
committercharles <johnch18@isu.edu>2021-04-12 21:53:20 -0600
commit413703a7aa5964ad481ca7dfa6abc91bdcbdd86f (patch)
treea6121aebdbe14c161886a1c553afd26c57f35052 /src/main/java/gregtech/common
parent85bb71ffc8960659dbdb035fb7fa57932f24e8ab (diff)
downloadGT5-Unofficial-413703a7aa5964ad481ca7dfa6abc91bdcbdd86f.tar.gz
GT5-Unofficial-413703a7aa5964ad481ca7dfa6abc91bdcbdd86f.tar.bz2
GT5-Unofficial-413703a7aa5964ad481ca7dfa6abc91bdcbdd86f.zip
Fixed algorithm, updated flavor text.
Diffstat (limited to 'src/main/java/gregtech/common')
-rw-r--r--src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java36
1 files changed, 20 insertions, 16 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 e07d9d0536..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
@@ -62,19 +62,17 @@ public class GT_MetaTileEntity_ChestBuffer extends GT_MetaTileEntity_Buffer {
protected void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
if (aTimer % tickRate[mTier] > 0) return;
- for (int i = 0; i < MAX; i++ ){
- if(aBaseMetaTileEntity.hasInventoryBeenModified()) {
- fillStacksIntoFirstSlots();
- }
- // 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);
- }
+ if(aBaseMetaTileEntity.hasInventoryBeenModified()) {
+ fillStacksIntoFirstSlots();
+ }
+ // 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, Math.min(MAX, maxStacks[mTier]));
+ }
- if(mSuccess < 0) {
- mSuccess = 0;
- }
+ if(mSuccess < 0) {
+ mSuccess = 0;
}
}
@@ -143,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 = maxStacks[tier] + "/" + 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) {