aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authormiozune <miozune@gmail.com>2022-09-28 01:21:36 +0900
committerGitHub <noreply@github.com>2022-09-27 17:21:36 +0100
commit0b1f3692c6b483071dc616086126df54f741d753 (patch)
treecb683fbdec2a97abaa06cdd6ca07ac557818b2e3 /src/main/java
parent7ba969012fd894a8b5fb6de5b7232c4403bfa98a (diff)
downloadGT5-Unofficial-0b1f3692c6b483071dc616086126df54f741d753.tar.gz
GT5-Unofficial-0b1f3692c6b483071dc616086126df54f741d753.tar.bz2
GT5-Unofficial-0b1f3692c6b483071dc616086126df54f741d753.zip
Proper fix for charger slot in Regulator not dropping item stored when broken (#1420)
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java
index edc8ef78e4..71c4cbb258 100644
--- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java
+++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java
@@ -58,7 +58,7 @@ public class GT_MetaTileEntity_Regulator extends GT_MetaTileEntity_Buffer {
@Override
public boolean isValidSlot(int aIndex) {
- return aIndex < 9;
+ return aIndex < 9 || aIndex == rechargerSlotStartIndex();
}
@Override
@@ -132,8 +132,10 @@ public class GT_MetaTileEntity_Regulator extends GT_MetaTileEntity_Buffer {
@Override
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack))
- && (GT_Utility.areStacksEqual(aStack, this.mInventory[(aIndex + 9)]));
+ return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)
+ && aIndex >= 0
+ && aIndex <= 8
+ && GT_Utility.areStacksEqual(aStack, this.mInventory[(aIndex + 9)]);
}
@Override