From 0b1f3692c6b483071dc616086126df54f741d753 Mon Sep 17 00:00:00 2001 From: miozune Date: Wed, 28 Sep 2022 01:21:36 +0900 Subject: Proper fix for charger slot in Regulator not dropping item stored when broken (#1420) --- .../tileentities/automation/GT_MetaTileEntity_Regulator.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/main/java') 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 -- cgit