aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorD-Cysteine <54219287+D-Cysteine@users.noreply.github.com>2021-08-05 21:53:49 -0600
committerD-Cysteine <54219287+D-Cysteine@users.noreply.github.com>2021-08-05 21:53:49 -0600
commit0c5284cdff6a2bc8e9e409e61d0a290b1ea3b9d0 (patch)
tree6e22c1ef7dd0248d15c206731c82c2f5ecbd828e /src
parent163ca91875e97fe82410476586e13166e14818c6 (diff)
downloadGT5-Unofficial-0c5284cdff6a2bc8e9e409e61d0a290b1ea3b9d0.tar.gz
GT5-Unofficial-0c5284cdff6a2bc8e9e409e61d0a290b1ea3b9d0.tar.bz2
GT5-Unofficial-0c5284cdff6a2bc8e9e409e61d0a290b1ea3b9d0.zip
Remove bSortStacks check
Diffstat (limited to 'src')
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java20
-rw-r--r--src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ItemDistributor.java15
2 files changed, 9 insertions, 26 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java
index faea347c67..21cf0d73f1 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java
@@ -329,20 +329,18 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
}
protected void fillStacksIntoFirstSlots() {
- if (bSortStacks) {
- for (int i = 0; i < mInventory.length - 1; i++) {
- if (!isValidSlot(i)) {
+ for (int i = 0; i < mInventory.length - 1; i++) {
+ if (!isValidSlot(i)) {
+ continue;
+ }
+
+ for (int j = i + 1; j < mInventory.length; j++) {
+ if (!isValidSlot(j)) {
continue;
}
- for (int j = i + 1; j < mInventory.length; j++) {
- if (!isValidSlot(j)) {
- continue;
- }
-
- if (mInventory[j] != null && (mInventory[i] == null || GT_Utility.areStacksEqual(mInventory[i], mInventory[j])))
- GT_Utility.moveStackFromSlotAToSlotB(getBaseMetaTileEntity(), getBaseMetaTileEntity(), j, i, (byte) 64, (byte) 1, (byte) 64, (byte) 1);
- }
+ if (mInventory[j] != null && (mInventory[i] == null || GT_Utility.areStacksEqual(mInventory[i], mInventory[j])))
+ GT_Utility.moveStackFromSlotAToSlotB(getBaseMetaTileEntity(), getBaseMetaTileEntity(), j, i, (byte) 64, (byte) 1, (byte) 64, (byte) 1);
}
}
}
diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ItemDistributor.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ItemDistributor.java
index 3cf5adff99..a796ce9661 100644
--- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ItemDistributor.java
+++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ItemDistributor.java
@@ -50,21 +50,6 @@ public class GT_MetaTileEntity_ItemDistributor extends GT_MetaTileEntity_Buffer
}
@Override
- protected void fillStacksIntoFirstSlots() {
- // The last slot of mInventory is invalid, so we need to avoid iterating over it.
- // Thus all max indices are reduced by 1 here.
- for (int i = 0; i < this.mInventory.length - 2; i++) {
- for (int j = i + 1; j < this.mInventory.length - 1; j++) {
- if ((this.mInventory[j] != null)
- && ((this.mInventory[i] == null) || (GT_Utility.areStacksEqual(this.mInventory[i], this.mInventory[j])))) {
- GT_Utility.moveStackFromSlotAToSlotB(getBaseMetaTileEntity(), getBaseMetaTileEntity(), j, i, (byte) 64, (byte) 1,
- (byte) 64, (byte) 1);
- }
- }
- }
- }
-
- @Override
public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
return new GT_GUIContainer_ItemDistributor(aPlayerInventory, aBaseMetaTileEntity);
}