aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/tileentities/automation
diff options
context:
space:
mode:
authorMauveCloud <mauvecloud@yahoo.com>2017-03-22 10:23:13 -0700
committerMauveCloud <mauvecloud@yahoo.com>2017-03-22 10:23:13 -0700
commite8c819e75fb5cc03eb798442a680b36a04f2a765 (patch)
treee1435dee357acfabf79ad937a9c90d68e817f653 /src/main/java/gregtech/common/tileentities/automation
parentd7203bccbde715d006783615c4c05a646d58ccaa (diff)
parentf4dae834dacbac9d765ad597681a53fc067da674 (diff)
downloadGT5-Unofficial-e8c819e75fb5cc03eb798442a680b36a04f2a765.tar.gz
GT5-Unofficial-e8c819e75fb5cc03eb798442a680b36a04f2a765.tar.bz2
GT5-Unofficial-e8c819e75fb5cc03eb798442a680b36a04f2a765.zip
Merge remote-tracking branch 'refs/remotes/Blood-Asp/unstable' into unstable
Diffstat (limited to 'src/main/java/gregtech/common/tileentities/automation')
-rw-r--r--src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java34
1 files changed, 32 insertions, 2 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 3a89b8c82e..04930ae54b 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
@@ -18,9 +18,10 @@ import java.util.Arrays;
public class GT_MetaTileEntity_Regulator
extends GT_MetaTileEntity_Buffer {
public int[] mTargetSlots = {0, 0, 0, 0, 0, 0, 0, 0, 0};
+ private boolean charge = false, decharge = false;
public GT_MetaTileEntity_Regulator(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 19, "Regulating incoming Items");
+ super(aID, aName, aNameRegional, aTier, 20, "Regulating incoming Items");
}
public GT_MetaTileEntity_Regulator(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
@@ -36,7 +37,7 @@ public class GT_MetaTileEntity_Regulator
}
public boolean isValidSlot(int aIndex) {
- return aIndex < 9;
+ return aIndex < 9 || aIndex == 19;
}
public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
@@ -90,4 +91,33 @@ public class GT_MetaTileEntity_Regulator
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)]));
}
+
+ @Override
+ public int rechargerSlotStartIndex() {
+ return 19;
+ }
+
+ @Override
+ public int dechargerSlotStartIndex() {
+ return 19;
+ }
+
+ @Override
+ public int rechargerSlotCount() {
+ return charge ? 1 : 0;
+ }
+
+ @Override
+ public int dechargerSlotCount() {
+ return decharge ? 1 : 0;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ if (aBaseMetaTileEntity.isServerSide()) {
+ charge = aBaseMetaTileEntity.getStoredEU() / 2 > aBaseMetaTileEntity.getEUCapacity() / 3;
+ decharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3;
+ }
+ }
}