diff options
author | Tec <daniel112092@gmail.com> | 2021-01-25 21:00:03 +0100 |
---|---|---|
committer | Tec <daniel112092@gmail.com> | 2021-01-25 21:00:03 +0100 |
commit | 47e2d590dac90e48fc9d55631a58bcfaf5b03f65 (patch) | |
tree | b4995de7a1ba0f752c2e5a7dc84dba2dd2271d08 | |
parent | f648b467f1b723b6df39040119ee11f6b626bda1 (diff) | |
download | GT5-Unofficial-47e2d590dac90e48fc9d55631a58bcfaf5b03f65.tar.gz GT5-Unofficial-47e2d590dac90e48fc9d55631a58bcfaf5b03f65.tar.bz2 GT5-Unofficial-47e2d590dac90e48fc9d55631a58bcfaf5b03f65.zip |
Implemented power pass cover
4 files changed, 24 insertions, 31 deletions
diff --git a/src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_PowerPassUpgrade.java b/src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_PowerPassUpgrade.java index dbbd5be370..c9bb6da14f 100644 --- a/src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_PowerPassUpgrade.java +++ b/src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_PowerPassUpgrade.java @@ -15,7 +15,7 @@ public class GT_Cover_TM_PowerPassUpgrade extends GT_CoverBehavior { IGregTechTileEntity iGregTechTileEntityOffset = aTileEntity.getIGregTechTileEntityOffset(0, 0, 0); if (iGregTechTileEntityOffset instanceof GT_MetaTileEntity_MultiblockBase_EM) { GT_MetaTileEntity_MultiblockBase_EM multi = (GT_MetaTileEntity_MultiblockBase_EM) iGregTechTileEntityOffset; - return !multi.ePowerPassCapable; + return !multi.ePowerPassCover; } return false; } @@ -25,7 +25,7 @@ public class GT_Cover_TM_PowerPassUpgrade extends GT_CoverBehavior { IGregTechTileEntity iGregTechTileEntityOffset = aTileEntity.getIGregTechTileEntityOffset(0, 0, 0); if (iGregTechTileEntityOffset instanceof GT_MetaTileEntity_MultiblockBase_EM) { GT_MetaTileEntity_MultiblockBase_EM multi = (GT_MetaTileEntity_MultiblockBase_EM) iGregTechTileEntityOffset; - multi.ePowerPassCapable = true; + multi.ePowerPassCover = true; multi.ePowerPass = true; } super.placeCover(aSide, aCover, aTileEntity); @@ -36,7 +36,7 @@ public class GT_Cover_TM_PowerPassUpgrade extends GT_CoverBehavior { IGregTechTileEntity iGregTechTileEntityOffset = aTileEntity.getIGregTechTileEntityOffset(0, 0, 0); if (iGregTechTileEntityOffset instanceof GT_MetaTileEntity_MultiblockBase_EM) { GT_MetaTileEntity_MultiblockBase_EM multi = (GT_MetaTileEntity_MultiblockBase_EM) iGregTechTileEntityOffset; - multi.ePowerPassCapable = false; + multi.ePowerPassCover = false; multi.ePowerPass = false; } return true; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_Container_MultiMachineEM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_Container_MultiMachineEM.java index 7cbd51228e..c2d1012910 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_Container_MultiMachineEM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_Container_MultiMachineEM.java @@ -20,19 +20,18 @@ public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { public long[] eParamsOutl = new long[20]; public byte eCertainMode = 5, eCertainStatus = 127; public boolean ePowerPass = false, eSafeVoid = false, allowedToWork = false; - public boolean ePowerPassButton; - public final boolean eSafeVoidButton, allowedToWorkButton; + public final boolean eSafeVoidButton, allowedToWorkButton,ePowerPassButton; + public boolean ePowerPassCover; - public GT_Container_MultiMachineEM(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, boolean enableSafeVoid, boolean enablePowerButton) { + public GT_Container_MultiMachineEM(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity,boolean enablePowerPassButton, boolean enableSafeVoid, boolean enablePowerButton) { super(aInventoryPlayer, aTileEntity); - ePowerPassButton=false; + ePowerPassButton=enablePowerPassButton; eSafeVoidButton=enableSafeVoid; allowedToWorkButton=enablePowerButton; } public GT_Container_MultiMachineEM(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - ePowerPassButton=eSafeVoidButton=allowedToWorkButton=true; + this(aInventoryPlayer,aTileEntity,true,true,true); } public GT_Container_MultiMachineEM(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, boolean bindInventory) { @@ -73,9 +72,9 @@ public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { IGregTechTileEntity base = mte.getBaseMetaTileEntity(); switch (aSlotIndex) { case 0: - if(ePowerPassButton) { + if(ePowerPassButton || mte.ePowerPassCover) { TecTech.proxy.playSound(base,"fx_click"); - if(mte.ePowerPassCapable){ + if(mte.ePowerPassCover){ mte.ePowerPass ^= true; }else { mte.ePowerPass = false; @@ -123,7 +122,7 @@ public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { eCertainMode = ((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).eCertainMode; eCertainStatus = ((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).eCertainStatus; ePowerPass = ((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).ePowerPass; - ePowerPassButton = ((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).ePowerPassCapable; + ePowerPassCover = ((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).ePowerPassCover; eSafeVoid = ((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).eSafeVoid; allowedToWork = mTileEntity.isAllowedToWork(); @@ -157,7 +156,7 @@ public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { ePowerPass = (par2 & 1) == 1; eSafeVoid = (par2 & 2) == 2; allowedToWork = (par2 & 4) == 4; - ePowerPassButton = (par2 & 8) == 8; + ePowerPassCover = (par2 & 8) == 8; } else if(par1>=128 && par1<208){ int pos=(par1-128)>>2; eParamsOut[pos]=Double.longBitsToDouble(eParamsOutl[pos]=Util.receiveLong(eParamsOutl[pos],par1&0xFFFFFFFC,par1,par2)); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_GUIContainer_MultiMachineEM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_GUIContainer_MultiMachineEM.java index c471698a1c..7794d54621 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_GUIContainer_MultiMachineEM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_GUIContainer_MultiMachineEM.java @@ -18,15 +18,16 @@ import static gregtech.api.enums.GT_Values.RES_PATH_GUI; */ public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Machine { - private String mName; + private final String mName; private static byte counter = 0; - private final boolean eSafeVoidButton, allowedToWorkButton; + private final boolean eSafeVoidButton, allowedToWorkButton,ePowerPassButton; private final GT_Container_MultiMachineEM mContainer; - public GT_GUIContainer_MultiMachineEM(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aTextureFile, boolean enableSafeVoid, boolean enablePowerButton) { + public GT_GUIContainer_MultiMachineEM(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aTextureFile,boolean enablePowerPass, boolean enableSafeVoid, boolean enablePowerButton) { super(new GT_Container_MultiMachineEM(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "multimachines/" + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile)); mContainer=(GT_Container_MultiMachineEM)super.mContainer; mName = aName; + ePowerPassButton=enablePowerPass; eSafeVoidButton=enableSafeVoid; allowedToWorkButton=enablePowerButton; ySize= 192; @@ -34,12 +35,7 @@ public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Mach } public GT_GUIContainer_MultiMachineEM(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aTextureFile) { - super(new GT_Container_MultiMachineEM(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "multimachines/" + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile)); - mContainer=(GT_Container_MultiMachineEM)super.mContainer; - mName = aName; - eSafeVoidButton=allowedToWorkButton=true; - ySize= 192; - xSize = 198; + this(aInventoryPlayer,aTileEntity,aName,aTextureFile,true,true,true); } @Override @@ -107,12 +103,12 @@ public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Mach counter = (byte) ((1 + counter) % 6); GL11.glColor4f(1f, 1f, 1f, 1f); x+= 173; - if (mContainer.ePowerPassButton) { + if (!ePowerPassButton && !mContainer.ePowerPassCover) {//no function + drawTexturedModalRect(x, y + 115, 231, 23, 18, 18); + } else { if (mContainer.ePowerPass) {// drawTexturedModalRect(x, y + 115, 207, 23, 18, 18); } - } else {//no function - drawTexturedModalRect(x, y + 115, 231, 23, 18, 18); } if(!eSafeVoidButton) { diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java index 465ac9ff71..9ba6235c83 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java @@ -121,8 +121,8 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt //if u need to force some things to be fixed - u might need to override doRandomMaintenanceDamage protected byte minRepairStatus = 3; - //can power pass be enabled - public boolean ePowerPassCapable = false; + //is power pass cover present + public boolean ePowerPassCover = false; //functionality toggles - changed by buttons in gui also public boolean ePowerPass = false, eSafeVoid = false; @@ -724,7 +724,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt aNBT.setByte("eFlip", (byte)extendedFacing.getFlip().getIndex()); aNBT.setBoolean("eParam", eParameters); aNBT.setBoolean("ePass", ePowerPass); - aNBT.setBoolean("ePassCapable", ePowerPassCapable); + aNBT.setBoolean("ePowerPassCover", ePowerPassCover); aNBT.setBoolean("eVoid", eSafeVoid); aNBT.setBoolean("eBoom", eDismantleBoom); aNBT.setBoolean("eOK", mMachine); @@ -817,9 +817,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt Flip.byIndex(aNBT.getByte("eFlip"))); eParameters = !aNBT.hasKey("eParam") || aNBT.getBoolean("eParam"); ePowerPass = aNBT.getBoolean("ePass"); - if(aNBT.hasKey("ePassCapable")) { - ePowerPassCapable = aNBT.getBoolean("ePassCapable"); - } + ePowerPassCover = aNBT.getBoolean("ePowerPassCover"); eSafeVoid = aNBT.getBoolean("eVoid"); eDismantleBoom = aNBT.getBoolean("eBoom"); mMachine = aNBT.getBoolean("eOK"); |