From 5965915bd0549cd289846ea20c9de6037e7faed1 Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 16 Feb 2019 10:43:14 +0100 Subject: Refactor to LedStatus enum --- .../multi/GT_MetaTileEntity_EM_collider.java | 1 + .../multi/GT_MetaTileEntity_EM_computer.java | 41 +++++++++--------- .../multi/GT_MetaTileEntity_EM_dataBank.java | 1 + .../multi/GT_MetaTileEntity_EM_junction.java | 25 +++++------ .../multi/GT_MetaTileEntity_EM_switch.java | 21 +++++----- .../multi/GT_MetaTileEntity_TM_microwave.java | 21 +++++----- .../multi/base/GT_Container_MultiMachineEM.java | 12 +++--- .../multi/base/GT_GUIContainer_MultiMachineEM.java | 3 +- .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 20 ++++----- .../thing/metaTileEntity/multi/base/LedStatus.java | 33 +++++++++++++++ .../multi/em_machine/Behaviour_Centrifuge.java | 29 ++++++------- .../Behaviour_ElectromagneticSeparator.java | 49 +++++++++++----------- .../em_machine/GT_MetaTileEntity_EM_machine.java | 43 +++++++++---------- 13 files changed, 169 insertions(+), 130 deletions(-) create mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/LedStatus.java diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java index 471870b13b..69bebb4a78 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java @@ -37,6 +37,7 @@ import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; +import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*; /** * Created by danie_000 on 17.12.2016. diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java index c021f93260..77db52f4b1 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java @@ -34,6 +34,7 @@ import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; +import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*; /** * Created by danie_000 on 17.12.2016. @@ -208,55 +209,55 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB public void parametersOutAndStatusesWrite_EM(boolean machineBusy) { double ocRatio = getParameterIn(0, 0); if (ocRatio < 0) { - setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); + setStatusOfParameterIn(0, 0, STATUS_TOO_LOW); } else if (ocRatio < 1) { - setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_LOW); + setStatusOfParameterIn(0, 0, STATUS_LOW); } else if (ocRatio == 1) { - setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + setStatusOfParameterIn(0, 0, STATUS_OK); } else if (ocRatio <= 3) { - setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_HIGH); + setStatusOfParameterIn(0, 0, STATUS_HIGH); } else if (Double.isNaN(ocRatio)) { - setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); + setStatusOfParameterIn(0, 0, STATUS_WRONG); } else { - setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + setStatusOfParameterIn(0, 0, STATUS_TOO_HIGH); } double ovRatio = getParameterIn(0, 1); if (ovRatio < 0.7f) { - setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); + setStatusOfParameterIn(0, 1, STATUS_TOO_LOW); } else if (ovRatio < 0.8f) { - setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_LOW); + setStatusOfParameterIn(0, 1, STATUS_LOW); } else if (ovRatio <= 1.2f) { - setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + setStatusOfParameterIn(0, 1, STATUS_OK); } else if (ovRatio <= 2) { - setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_HIGH); + setStatusOfParameterIn(0, 1, STATUS_HIGH); } else if (Double.isNaN(ovRatio)) { - setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); + setStatusOfParameterIn(0, 1, STATUS_WRONG); } else { - setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + setStatusOfParameterIn(0, 1, STATUS_TOO_HIGH); } setParameterOut(0, 0, maxCurrentTemp); setParameterOut(0, 1, eAvailableData); if (maxCurrentTemp < -10000) { - setStatusOfParameterOut(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); + setStatusOfParameterOut(0, 0, STATUS_TOO_LOW); } else if (maxCurrentTemp < 0) { - setStatusOfParameterOut(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_LOW); + setStatusOfParameterOut(0, 0, STATUS_LOW); } else if (maxCurrentTemp == 0) { - setStatusOfParameterOut(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + setStatusOfParameterOut(0, 0, STATUS_OK); } else if (maxCurrentTemp <= 5000) { - setStatusOfParameterOut(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_HIGH); + setStatusOfParameterOut(0, 0, STATUS_HIGH); } else { - setStatusOfParameterOut(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + setStatusOfParameterOut(0, 0, STATUS_TOO_HIGH); } if (!machineBusy) { - setStatusOfParameterOut(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_NEUTRAL); + setStatusOfParameterOut(0, 1, STATUS_NEUTRAL); } else if (eAvailableData <= 0) { - setStatusOfParameterOut(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); + setStatusOfParameterOut(0, 1, STATUS_TOO_LOW); } else { - setStatusOfParameterOut(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + setStatusOfParameterOut(0, 1, STATUS_OK); } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java index da2e06c873..e79675f016 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java @@ -32,6 +32,7 @@ import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; +import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.STATUS_UNUSED; public class GT_MetaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { private final ArrayList eStacksDataOutputs = new ArrayList<>(); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java index bd8ed9c6bb..a295a5c7f1 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java @@ -15,6 +15,7 @@ import static com.github.technus.tectech.CommonValues.V; import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; +import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*; /** * Created by danie_000 on 17.12.2016. @@ -84,27 +85,27 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB for (int i = 0; i < 10; i++) { src = getParameterIn(i, 0); if (src <= 0) { - setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); - setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_NEUTRAL); + setStatusOfParameterIn(i, 0, STATUS_TOO_LOW); + setStatusOfParameterIn(i, 1, STATUS_NEUTRAL); } else if (src > eInputHatches.size()) { - setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); - setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_NEUTRAL); + setStatusOfParameterIn(i, 0, STATUS_TOO_HIGH); + setStatusOfParameterIn(i, 1, STATUS_NEUTRAL); } else if (Double.isNaN(src)) { - setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); - setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_NEUTRAL); + setStatusOfParameterIn(i, 0, STATUS_WRONG); + setStatusOfParameterIn(i, 1, STATUS_NEUTRAL); } else { - setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + setStatusOfParameterIn(i, 0, STATUS_OK); dest = getParameterIn(i, 1); if (dest < 0) { - setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); + setStatusOfParameterIn(i, 1, STATUS_TOO_LOW); } else if (dest == 0) { - setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_LOW); + setStatusOfParameterIn(i, 1, STATUS_LOW); } else if (dest > eOutputHatches.size()) { - setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + setStatusOfParameterIn(i, 1, STATUS_TOO_HIGH); } else if (Double.isNaN(dest)) { - setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); + setStatusOfParameterIn(i, 1, STATUS_WRONG); } else { - setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + setStatusOfParameterIn(i, 1, STATUS_OK); } } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java index 1ddb655105..767bd676d6 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java @@ -25,6 +25,7 @@ import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; +import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*; /** * Created by danie_000 on 17.12.2016. @@ -182,24 +183,24 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas for (int i = 0; i < 10; i++) { weight = getParameterIn(i, 0); if (weight < 0) { - setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); - setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_NEUTRAL); + setStatusOfParameterIn(i, 0, STATUS_TOO_LOW); + setStatusOfParameterIn(i, 1, STATUS_NEUTRAL); } else if (Double.isNaN(weight)) { - setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); - setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_NEUTRAL); + setStatusOfParameterIn(i, 0, STATUS_WRONG); + setStatusOfParameterIn(i, 1, STATUS_NEUTRAL); } else { - setStatusOfParameterIn(i, 0, weight==0?STATUS_LOW:GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + setStatusOfParameterIn(i, 0, weight==0?STATUS_LOW:STATUS_OK); dest = getParameterIn(i, 1); if (dest < 0) { - setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); + setStatusOfParameterIn(i, 1, STATUS_TOO_LOW); } else if (dest == 0) { - setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_LOW); + setStatusOfParameterIn(i, 1, STATUS_LOW); } else if (dest > eOutputData.size()) { - setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + setStatusOfParameterIn(i, 1, STATUS_TOO_HIGH); } else if (Double.isNaN(dest)) { - setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); + setStatusOfParameterIn(i, 1, STATUS_WRONG); } else { - setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + setStatusOfParameterIn(i, 1, STATUS_OK); } } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java index 67c390ab7c..1fdf8d6943 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java @@ -28,6 +28,7 @@ import java.util.HashSet; import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.loader.MainLoader.microwaving; +import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*; import static gregtech.api.GregTech_API.sBlockCasings4; /** @@ -218,28 +219,28 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock public void parametersOutAndStatusesWrite_EM(boolean machineBusy) { double powerParameter = getParameterIn(0, 0); if (powerParameter < 300) { - setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); + setStatusOfParameterIn(0, 0, STATUS_TOO_LOW); } else if (powerParameter < 1000) { - setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_LOW); + setStatusOfParameterIn(0, 0, STATUS_LOW); } else if (powerParameter == 1000) { - setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + setStatusOfParameterIn(0, 0, STATUS_OK); } else if (powerParameter == Double.POSITIVE_INFINITY) { - setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + setStatusOfParameterIn(0, 0, STATUS_TOO_HIGH); } else if (Double.isNaN(powerParameter)) { - setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); + setStatusOfParameterIn(0, 0, STATUS_WRONG); } else { - setStatusOfParameterOut(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_HIGH); + setStatusOfParameterOut(0, 0, STATUS_HIGH); } double timerParameter = getParameterIn(0, 1); if (timerParameter <= 1) { - setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); + setStatusOfParameterIn(0, 1, STATUS_TOO_LOW); } else if (timerParameter <= 3000) { - setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + setStatusOfParameterIn(0, 1, STATUS_OK); } else if (Double.isNaN(timerParameter)) { - setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); + setStatusOfParameterIn(0, 1, STATUS_WRONG); } else { - setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + setStatusOfParameterIn(0, 1, STATUS_TOO_HIGH); } setParameterOut(0, 0, timerValue); 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 91b2635001..4845117a99 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 @@ -11,8 +11,8 @@ import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { - public byte[] eParamsInStatus = new byte[20];//unused 0,G ok 1, B too low 2, R too high 3, Y blink dangerous 4,5 - public byte[] eParamsOutStatus = new byte[20]; + public LedStatus[] eParamsInStatus = new LedStatus[20];//unused 0,G ok 1, B too low 2, R too high 3, Y blink dangerous 4,5 + public LedStatus[] eParamsOutStatus = new LedStatus[20]; public byte eCertainMode = 5, eCertainStatus = 127; public boolean ePowerPass = false, eSafeVoid = false, allowedToWork = false; public final boolean ePowerPassButton, eSafeVoidButton, allowedToWorkButton; @@ -118,9 +118,9 @@ public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { ICrafting var1 = (ICrafting) crafter; int i = 100; for (int j = 0; j < eParamsInStatus.length; j++) { - var1.sendProgressBarUpdate(this, i++, eParamsInStatus[j] | eParamsOutStatus[j] << 8); + var1.sendProgressBarUpdate(this, i++, (eParamsInStatus[j].getOrdinalByte() | (eParamsOutStatus[j].getOrdinalByte() << 8))); } - var1.sendProgressBarUpdate(this, 120, eCertainMode | eCertainStatus << 8); + var1.sendProgressBarUpdate(this, 120, eCertainMode | (eCertainStatus << 8)); var1.sendProgressBarUpdate(this, 121, (ePowerPass ? 1 : 0) + (eSafeVoid ? 2 : 0) + (allowedToWork ? 4 : 0)); } } @@ -132,8 +132,8 @@ public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { return; } if (par1 >= 100 && par1 < 120) { - eParamsInStatus[par1 - 100] = (byte) (par2 & 0xff); - eParamsOutStatus[par1 - 100] = (byte) (par2 >>> 8); + eParamsInStatus[par1 - 100] = LedStatus.getStatus ((byte) (par2 & 0xff)); + eParamsOutStatus[par1 - 100] = LedStatus.getStatus ((byte) (par2 >>> 8)); } else if (par1 == 120) { eCertainMode = (byte) (par2 & 0xff); eCertainStatus = (byte) (par2 >>> 8); 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 40285cc5e7..90ad4e7388 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 @@ -13,6 +13,7 @@ import org.lwjgl.opengl.GL12; import java.util.List; import static com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM.*; +import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.STATUS_UNUSED; import static gregtech.api.enums.GT_Values.RES_PATH_GUI; /** @@ -200,7 +201,7 @@ public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Mach } } - private void LEDdrawP(int x, int y, int i, int j, byte status) { + private void LEDdrawP(int x, int y, int i, int j, LedStatus status) { int v = 192, su = 8, sv = 6, u = 11; switch (status) { case STATUS_WRONG: //fallthrough 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 ebcc0ef622..a6ec5b561a 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 @@ -105,12 +105,8 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt private final int[] iParamsOut = new int[20];//number O to parametrizers private final boolean[] bParamsAreFloats = new boolean[10]; - final byte[] eParamsInStatus = new byte[20];//LED status for I - final byte[] eParamsOutStatus = new byte[20];//LED status for O - public static final byte STATUS_UNUSED =7, STATUS_NEUTRAL = 0, - STATUS_TOO_LOW = 1, STATUS_LOW = 2, - STATUS_WRONG = 3, STATUS_OK = 4, - STATUS_TOO_HIGH = 5, STATUS_HIGH = 6; + final LedStatus[] eParamsInStatus = new LedStatus[20];//LED status for I + final LedStatus[] eParamsOutStatus = new LedStatus[20];//LED status for O // 0,2,4,6 - ok // 1,3,5 - nok @@ -699,11 +695,11 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt // return false; //} - public final void setStatusOfParameterIn(int hatchNo, int paramID, byte status){ + public final void setStatusOfParameterIn(int hatchNo, int paramID, LedStatus status){ eParamsInStatus[hatchNo+10*paramID]=status; } - public final void setStatusOfParameterOut(int hatchNo, int paramID, byte status){ + public final void setStatusOfParameterOut(int hatchNo, int paramID, LedStatus status){ eParamsOutStatus[hatchNo+10*paramID]=status; } @@ -965,13 +961,13 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt NBTTagCompound paramIs = new NBTTagCompound(); for (int i = 0; i < eParamsInStatus.length; i++) { - paramIs.setByte(Integer.toString(i), eParamsInStatus[i]); + paramIs.setByte(Integer.toString(i), eParamsInStatus[i].getOrdinalByte()); } aNBT.setTag("eParamsInS", paramIs); NBTTagCompound paramOs = new NBTTagCompound(); for (int i = 0; i < eParamsOutStatus.length; i++) { - paramOs.setByte(Integer.toString(i), eParamsOutStatus[i]); + paramOs.setByte(Integer.toString(i), eParamsOutStatus[i].getOrdinalByte()); } aNBT.setTag("eParamsOutS", paramOs); } @@ -1055,12 +1051,12 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt NBTTagCompound paramIs = aNBT.getCompoundTag("eParamsInS"); for (int i = 0; i < eParamsInStatus.length; i++) { - eParamsInStatus[i] = paramIs.getByte(Integer.toString(i)); + eParamsInStatus[i] = LedStatus.getStatus(paramIs.getByte(Integer.toString(i))); } NBTTagCompound paramOs = aNBT.getCompoundTag("eParamsOutS"); for (int i = 0; i < eParamsOutStatus.length; i++) { - eParamsOutStatus[i] = paramOs.getByte(Integer.toString(i)); + eParamsOutStatus[i] = LedStatus.getStatus(paramOs.getByte(Integer.toString(i))); } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/LedStatus.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/LedStatus.java new file mode 100644 index 0000000000..fba5910532 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/LedStatus.java @@ -0,0 +1,33 @@ +package com.github.technus.tectech.thing.metaTileEntity.multi.base; + +public enum LedStatus { + STATUS_UNUSED, + STATUS_TOO_LOW, + STATUS_LOW, + STATUS_WRONG, + STATUS_OK, + STATUS_TOO_HIGH, + STATUS_HIGH, + STATUS_UNDEFINED, + STATUS_NEUTRAL; + + public boolean isOk(){ + return (ordinal()&1)==0; + } + + public boolean isBad(){ + return (ordinal()&1)==1; + } + + public byte getOrdinalByte(){ + return (byte)ordinal(); + } + + public static LedStatus getStatus(byte value){ + try{ + return LedStatus.values()[value]; + }catch (IndexOutOfBoundsException e){ + return STATUS_UNDEFINED; + } + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java index 4b7d41494b..efbca82c8f 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java @@ -13,6 +13,7 @@ import java.util.Comparator; import static com.github.technus.tectech.CommonValues.V; import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; +import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*; /** * Created by danie_000 on 24.12.2017. @@ -69,33 +70,33 @@ public class Behaviour_Centrifuge extends GT_MetaTileEntity_EM_machine.Behaviour te.setParameterOut(2, 1, maxCapacity);// eV/c^2 for(int i=4;i<=9;i++) { - te.setStatusOfParameterOut(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); - te.setStatusOfParameterOut(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); + te.setStatusOfParameterOut(i, 0, STATUS_UNUSED); + te.setStatusOfParameterOut(i, 1, STATUS_UNUSED); } for(int i=1;i<=3;i++) { - te.setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); - te.setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); + te.setStatusOfParameterIn(i, 0, STATUS_UNUSED); + te.setStatusOfParameterIn(i, 1, STATUS_UNUSED); } double RPM = parametersToCheckAndFix[0]; if (RPM > maxRPM) { - te.setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + te.setStatusOfParameterIn(0, 0, STATUS_TOO_HIGH); te.setParameterOut(0, 0, maxRPM);//rpm te.setParameterOut(0, 1, maxRCF);//rcf check=false; } else if (RPM > maxRPM / 3f * 2f) { - te.setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_HIGH); + te.setStatusOfParameterIn(0, 0, STATUS_HIGH); } else if (RPM > maxRPM / 3f) { - te.setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + te.setStatusOfParameterIn(0, 0, STATUS_OK); } else if (RPM > 0) { - te.setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_LOW); + te.setStatusOfParameterIn(0, 0, STATUS_LOW); } else if (RPM <= 0) { - te.setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); + te.setStatusOfParameterIn(0, 0, STATUS_TOO_LOW); te.setParameterOut(0, 0, 0);//rpm te.setParameterOut(0, 1, 0);//rcf check=false; } else { - te.setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); + te.setStatusOfParameterIn(0, 0, STATUS_WRONG); te.setParameterOut(0, 0, 0);//rpm te.setParameterOut(0, 1, 0);//rcf check=false; @@ -109,16 +110,16 @@ public class Behaviour_Centrifuge extends GT_MetaTileEntity_EM_machine.Behaviour double fractionCount = parametersToCheckAndFix[1]; if (fractionCount > 6) { parametersToCheckAndFix[1] = 6; - te.setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + te.setStatusOfParameterIn(0, 1, STATUS_TOO_HIGH); check=false; } else if (fractionCount >= 2) { - te.setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + te.setStatusOfParameterIn(0, 1, STATUS_OK); } else if (fractionCount < 2) { parametersToCheckAndFix[1] = 2; - te.setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); + te.setStatusOfParameterIn(0, 1, STATUS_TOO_LOW); check=false; } else { - te.setStatusOfParameterIn(0, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); + te.setStatusOfParameterIn(0, 1, STATUS_WRONG); check=false; } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java index 8c912dd38d..94f00ece1b 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java @@ -10,6 +10,7 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockCont import java.util.ArrayList; import static com.github.technus.tectech.CommonValues.V; +import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*; /** * Created by danie_000 on 24.12.2017. @@ -95,79 +96,79 @@ public class Behaviour_ElectromagneticSeparator extends GT_MetaTileEntity_EM_mac te.setParameterOut(0,0,precisionFull); te.setParameterOut(0,1,precisionMinimal); te.setParameterOut(1,0,offsetMax); - te.setStatusOfParameterOut(1,1,GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); + te.setStatusOfParameterOut(1,1,STATUS_UNUSED); te.setParameterOut(2,0,maxCharge); te.setParameterOut(2,1,maxCapacity); te.setParameterOut(3,0,V[tier]); te.setParameterOut(3,1,ticks); for(int i=4;i<=9;i++) { - te.setStatusOfParameterOut(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); - te.setStatusOfParameterOut(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); + te.setStatusOfParameterOut(i, 0, STATUS_UNUSED); + te.setStatusOfParameterOut(i, 1, STATUS_UNUSED); } - te.setStatusOfParameterIn(1, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); + te.setStatusOfParameterIn(1, 1, STATUS_UNUSED); for(int i=2;i<=3;i++) { - te.setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); - te.setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_UNUSED); + te.setStatusOfParameterIn(i, 0, STATUS_UNUSED); + te.setStatusOfParameterIn(i, 1, STATUS_UNUSED); } double full=parametersToCheckAndFix[0]; if(Double.isInfinite(full) && full>0) { - te.setStatusOfParameterIn(0,0,GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + te.setStatusOfParameterIn(0,0,STATUS_TOO_HIGH); check=false; }else if(full>precisionFull){ - te.setStatusOfParameterIn(0,0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_HIGH); + te.setStatusOfParameterIn(0,0, STATUS_HIGH); }else if(full==precisionFull){ - te.setStatusOfParameterIn(0,0,GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + te.setStatusOfParameterIn(0,0,STATUS_OK); }else if(full0) { - te.setStatusOfParameterIn(0,1,GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + te.setStatusOfParameterIn(0,1,STATUS_TOO_HIGH); check=false; }else if(minimal>precisionMinimal){ if(minimal>full){ - te.setStatusOfParameterIn(0,1,GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + te.setStatusOfParameterIn(0,1,STATUS_TOO_HIGH); check=false; }else { - te.setStatusOfParameterIn(0,1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_HIGH); + te.setStatusOfParameterIn(0,1, STATUS_HIGH); } }else if(minimal==precisionMinimal){ if(minimal>full){ - te.setStatusOfParameterIn(0,1,GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + te.setStatusOfParameterIn(0,1,STATUS_TOO_HIGH); check=false; }else { - te.setStatusOfParameterIn(0,1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + te.setStatusOfParameterIn(0,1, STATUS_OK); } }else if(minimaloffsetMax){ - te.setStatusOfParameterIn(1,0,GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + te.setStatusOfParameterIn(1,0,STATUS_TOO_HIGH); check=false; }else if(offset>0){ - te.setStatusOfParameterIn(1,0,GT_MetaTileEntity_MultiblockBase_EM.STATUS_HIGH); + te.setStatusOfParameterIn(1,0,STATUS_HIGH); }else if(offset==0){ - te.setStatusOfParameterIn(1,0,GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + te.setStatusOfParameterIn(1,0,STATUS_OK); }else if(offset>=-offsetMax){ - te.setStatusOfParameterIn(1,0,GT_MetaTileEntity_MultiblockBase_EM.STATUS_LOW); + te.setStatusOfParameterIn(1,0,STATUS_LOW); }else if(offset<-offsetMax){ - te.setStatusOfParameterIn(1,0,GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); + te.setStatusOfParameterIn(1,0,STATUS_TOO_LOW); check=false; }else { - te.setStatusOfParameterIn(1,0,GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); + te.setStatusOfParameterIn(1,0,STATUS_WRONG); check=false; } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java index 46e4ede660..ad10d70cbf 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java @@ -25,6 +25,7 @@ import java.util.HashMap; import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; +import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*; /** * Created by danie_000 on 17.12.2016. @@ -286,37 +287,37 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa for (int i = 4; i <= 6; i++) { pointer = getParameterInInt(i, 0); if (Double.isNaN(pointer)) { - setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); + setStatusOfParameterIn(i, 0, STATUS_WRONG); } else if (pointer <= 0) { - setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); + setStatusOfParameterIn(i, 0, STATUS_TOO_LOW); }//else if(pointer==0) // setStatusOfParameterIn(i,0,STATUS_LOW); else if (pointer <= eInputHatches.size()) { if (checkArray.get(pointer)) { - setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); + setStatusOfParameterIn(i, 0, STATUS_WRONG); } else { - setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + setStatusOfParameterIn(i, 0, STATUS_OK); checkArray.set(pointer); } } else { - setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + setStatusOfParameterIn(i, 0, STATUS_TOO_HIGH); } pointer = getParameterInInt(i, 1); if (Double.isNaN(pointer)) { - setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); + setStatusOfParameterIn(i, 1, STATUS_WRONG); } else if (pointer < 0) { - setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); + setStatusOfParameterIn(i, 1, STATUS_TOO_LOW); } else if (pointer == 0) { - setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_LOW); + setStatusOfParameterIn(i, 1, STATUS_LOW); } else if (pointer <= eInputHatches.size()) { if (checkArray.get(pointer)) { - setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); + setStatusOfParameterIn(i, 1, STATUS_WRONG); } else { - setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + setStatusOfParameterIn(i, 1, STATUS_OK); checkArray.set(pointer); } } else { - setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + setStatusOfParameterIn(i, 1, STATUS_TOO_HIGH); } } } @@ -324,27 +325,27 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa for (int i = 7; i <= 9; i++) { pointer = getParameterInInt(i, 0); if (Double.isNaN(pointer)) { - setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); + setStatusOfParameterIn(i, 0, STATUS_WRONG); } else if (pointer < 0) { - setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); + setStatusOfParameterIn(i, 0, STATUS_TOO_LOW); } else if (pointer == 0) { - setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_LOW); + setStatusOfParameterIn(i, 0, STATUS_LOW); } else if (pointer <= eOutputHatches.size()) { - setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + setStatusOfParameterIn(i, 0, STATUS_OK); } else { - setStatusOfParameterIn(i, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + setStatusOfParameterIn(i, 0, STATUS_TOO_HIGH); } pointer = getParameterInInt(i, 1); if (Double.isNaN(pointer)) { - setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_WRONG); + setStatusOfParameterIn(i, 1, STATUS_WRONG); } else if (pointer < 0) { - setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_LOW); + setStatusOfParameterIn(i, 1, STATUS_TOO_LOW); } else if (pointer == 0) { - setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_LOW); + setStatusOfParameterIn(i, 1, STATUS_LOW); } else if (pointer <= eOutputHatches.size()) { - setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_OK); + setStatusOfParameterIn(i, 1, STATUS_OK); } else { - setStatusOfParameterIn(i, 1, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); + setStatusOfParameterIn(i, 1, STATUS_TOO_HIGH); } } } -- cgit From 74cb12a7ca9c8ba0cfd63e8ca743e1b8820fea21 Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 16 Feb 2019 14:36:34 +0100 Subject: Backup theese default methods --- .../dreamcraft/DreamCraftRecipeLoader.java | 2 +- .../GT_MetaTileEntity_EM_essentiaDequantizer.java | 2 +- .../GT_MetaTileEntity_EM_essentiaQuantizer.java | 2 +- .../tectech/loader/thing/MachineLoader.java | 148 ++++++------- .../thing/item/ConstructableTriggerItem.java | 2 +- .../tectech/thing/item/ParametrizerMemoryCard.java | 2 +- .../hatch/GT_MetaTileEntity_Hatch_Capacitor.java | 2 +- ...GT_MetaTileEntity_Hatch_ElementalContainer.java | 2 +- .../hatch/GT_MetaTileEntity_Hatch_Holder.java | 2 +- .../multi/GT_MetaTileEntity_EM_dequantizer.java | 2 +- .../multi/GT_MetaTileEntity_EM_quantizer.java | 2 +- .../multi/GT_MetaTileEntity_EM_research.java | 6 +- .../multi/GT_MetaTileEntity_TM_microwave.java | 2 +- .../multi/base/GT_Container_MultiMachineEM.java | 4 +- .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 203 ++++++----------- .../metaTileEntity/multi/base/Parameters.java | 240 +++++++++++++++++++++ .../em_machine/GT_MetaTileEntity_EM_machine.java | 4 + 17 files changed, 401 insertions(+), 226 deletions(-) create mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java index 1d1c80f0da..a70f85d62d 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java @@ -716,7 +716,7 @@ public class DreamCraftRecipeLoader implements Runnable { Materials.SolderingAlloy.getMolten(9216)}, ItemList.Field_Generator_UEV.get(1L), 4000, 800000); - //UHV Energy Hatch + //UHV Energy ParameterDefinition TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Hatch_Energy_UV.get(1L), 24000, 16, 50000, 2, new Object[]{ ItemList.Hull_MAX.get(1L), diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java index 84cd28b7c9..9e6f3f3c77 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java @@ -52,7 +52,7 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_ private static final String[] description = new String[]{ EnumChatFormatting.AQUA+"Hint Details:", "1 - Classic Hatches or High Power Casing", - "2 - Elemental Input Hatch", + "2 - Elemental Input ParameterDefinition", "3 - Elemental Overflow Hatches or Elemental Casing", "General - Some sort of Essentia Storage", }; diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java index d45060c758..d97c28a2be 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java @@ -52,7 +52,7 @@ public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_Mu private static final String[] description = new String[]{ EnumChatFormatting.AQUA+"Hint Details:", "1 - Classic Hatches or High Power Casing", - "2 - Elemental Output Hatch", + "2 - Elemental Output ParameterDefinition", "3 - Elemental Overflow Hatches or Elemental Casing", "General - Some sort of Essentia Storage", }; diff --git a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java index c1b78523c5..deca78bf6e 100644 --- a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java @@ -26,133 +26,133 @@ public class MachineLoader implements Runnable { // =================================================================================================== eM_in_UV.set(new GT_MetaTileEntity_Hatch_InputElemental( - 15000, "hatch.emin.tier.08", "UV Elemental Input Hatch", 8).getStackForm(1L)); + 15000, "hatch.emin.tier.08", "UV Elemental Input ParameterDefinition", 8).getStackForm(1L)); eM_in_UHV.set(new GT_MetaTileEntity_Hatch_InputElemental( - 15001, "hatch.emin.tier.09", "UHV Elemental Input Hatch", 9).getStackForm(1L)); + 15001, "hatch.emin.tier.09", "UHV Elemental Input ParameterDefinition", 9).getStackForm(1L)); eM_in_UEV.set(new GT_MetaTileEntity_Hatch_InputElemental( - 15002, "hatch.emin.tier.10", "UEV Elemental Input Hatch", 10).getStackForm(1L)); + 15002, "hatch.emin.tier.10", "UEV Elemental Input ParameterDefinition", 10).getStackForm(1L)); eM_in_UIV.set(new GT_MetaTileEntity_Hatch_InputElemental( - 15003, "hatch.emin.tier.11", "UIV Elemental Input Hatch", 11).getStackForm(1L)); + 15003, "hatch.emin.tier.11", "UIV Elemental Input ParameterDefinition", 11).getStackForm(1L)); eM_in_UMV.set(new GT_MetaTileEntity_Hatch_InputElemental( - 15004, "hatch.emin.tier.12", "UMV Elemental Input Hatch", 12).getStackForm(1L)); + 15004, "hatch.emin.tier.12", "UMV Elemental Input ParameterDefinition", 12).getStackForm(1L)); eM_in_UXV.set(new GT_MetaTileEntity_Hatch_InputElemental( - 15005, "hatch.emin.tier.13", "UXV Elemental Input Hatch", 13).getStackForm(1L)); + 15005, "hatch.emin.tier.13", "UXV Elemental Input ParameterDefinition", 13).getStackForm(1L)); // =================================================================================================== // eM OUT // =================================================================================================== eM_out_UV.set(new GT_MetaTileEntity_Hatch_OutputElemental( - 15010, "hatch.emout.tier.08", "UV Elemental Output Hatch", 8).getStackForm(1L)); + 15010, "hatch.emout.tier.08", "UV Elemental Output ParameterDefinition", 8).getStackForm(1L)); eM_out_UHV.set(new GT_MetaTileEntity_Hatch_OutputElemental( - 15011, "hatch.emout.tier.09", "UHV Elemental Output Hatch", 9).getStackForm(1L)); + 15011, "hatch.emout.tier.09", "UHV Elemental Output ParameterDefinition", 9).getStackForm(1L)); eM_out_UEV.set(new GT_MetaTileEntity_Hatch_OutputElemental( - 15012, "hatch.emout.tier.10", "UEV Elemental Output Hatch", 10).getStackForm(1L)); + 15012, "hatch.emout.tier.10", "UEV Elemental Output ParameterDefinition", 10).getStackForm(1L)); eM_out_UIV.set(new GT_MetaTileEntity_Hatch_OutputElemental( - 15013, "hatch.emout.tier.11", "UIV Elemental Output Hatch", 11).getStackForm(1L)); + 15013, "hatch.emout.tier.11", "UIV Elemental Output ParameterDefinition", 11).getStackForm(1L)); eM_out_UMV.set(new GT_MetaTileEntity_Hatch_OutputElemental( - 15014, "hatch.emout.tier.12", "UMV Elemental Output Hatch", 12).getStackForm(1L)); + 15014, "hatch.emout.tier.12", "UMV Elemental Output ParameterDefinition", 12).getStackForm(1L)); eM_out_UXV.set(new GT_MetaTileEntity_Hatch_OutputElemental( - 15015, "hatch.emout.tier.13", "UXV Elemental Output Hatch", 13).getStackForm(1L)); + 15015, "hatch.emout.tier.13", "UXV Elemental Output ParameterDefinition", 13).getStackForm(1L)); // =================================================================================================== // eM Waste OUT // =================================================================================================== eM_muffler_UV.set(new GT_MetaTileEntity_Hatch_OverflowElemental( - 15020, "hatch.emmuffler.tier.08", "UV Overflow Output Hatch", 8, 1e10f).getStackForm(1L)); + 15020, "hatch.emmuffler.tier.08", "UV Overflow Output ParameterDefinition", 8, 1e10f).getStackForm(1L)); eM_muffler_UHV.set(new GT_MetaTileEntity_Hatch_OverflowElemental( - 15021, "hatch.emmuffler.tier.09", "UHV Overflow Output Hatch", 9, 5e10f).getStackForm(1L)); + 15021, "hatch.emmuffler.tier.09", "UHV Overflow Output ParameterDefinition", 9, 5e10f).getStackForm(1L)); eM_muffler_UEV.set(new GT_MetaTileEntity_Hatch_OverflowElemental( - 15022, "hatch.emmuffler.tier.10", "UEV Overflow Output Hatch", 10, 25e10f).getStackForm(1L)); + 15022, "hatch.emmuffler.tier.10", "UEV Overflow Output ParameterDefinition", 10, 25e10f).getStackForm(1L)); eM_muffler_UIV.set(new GT_MetaTileEntity_Hatch_OverflowElemental( - 15023, "hatch.emmuffler.tier.11", "UIV Overflow Output Hatch", 11, 125e10f).getStackForm(1L)); + 15023, "hatch.emmuffler.tier.11", "UIV Overflow Output ParameterDefinition", 11, 125e10f).getStackForm(1L)); eM_muffler_UMV.set(new GT_MetaTileEntity_Hatch_OverflowElemental( - 15024, "hatch.emmuffler.tier.12", "UMV Overflow Output Hatch", 12, 125e11f).getStackForm(1L)); + 15024, "hatch.emmuffler.tier.12", "UMV Overflow Output ParameterDefinition", 12, 125e11f).getStackForm(1L)); eM_muffler_UXV.set(new GT_MetaTileEntity_Hatch_OverflowElemental( - 15025, "hatch.emmuffler.tier.13", "UXV Overflow Output Hatch", 13, 125e12f).getStackForm(1L)); + 15025, "hatch.emmuffler.tier.13", "UXV Overflow Output ParameterDefinition", 13, 125e12f).getStackForm(1L)); // =================================================================================================== // Multi AMP Power INPUTS // =================================================================================================== eM_energymulti4_IV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15100, "hatch.energymulti04.tier.05", "IV 4A Energy Hatch", 5, 4).getStackForm(1L)); + 15100, "hatch.energymulti04.tier.05", "IV 4A Energy ParameterDefinition", 5, 4).getStackForm(1L)); eM_energymulti16_IV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15110, "hatch.energymulti16.tier.05", "IV 16A Energy Hatch", 5, 16).getStackForm(1L)); + 15110, "hatch.energymulti16.tier.05", "IV 16A Energy ParameterDefinition", 5, 16).getStackForm(1L)); eM_energymulti64_IV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15120, "hatch.energymulti64.tier.05", "IV 64A Energy Hatch", 5, 64).getStackForm(1L)); + 15120, "hatch.energymulti64.tier.05", "IV 64A Energy ParameterDefinition", 5, 64).getStackForm(1L)); eM_energymulti4_LuV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15101, "hatch.energymulti04.tier.06", "LuV 4A Energy Hatch", 6, 4).getStackForm(1L)); + 15101, "hatch.energymulti04.tier.06", "LuV 4A Energy ParameterDefinition", 6, 4).getStackForm(1L)); eM_energymulti16_LuV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15111, "hatch.energymulti16.tier.06", "LuV 16A Energy Hatch", 6, 16).getStackForm(1L)); + 15111, "hatch.energymulti16.tier.06", "LuV 16A Energy ParameterDefinition", 6, 16).getStackForm(1L)); eM_energymulti64_LuV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15121, "hatch.energymulti64.tier.06", "LuV 64A Energy Hatch", 6, 64).getStackForm(1L)); + 15121, "hatch.energymulti64.tier.06", "LuV 64A Energy ParameterDefinition", 6, 64).getStackForm(1L)); eM_energymulti4_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15102, "hatch.energymulti04.tier.07", "ZPM 4A Energy Hatch", 7, 4).getStackForm(1L)); + 15102, "hatch.energymulti04.tier.07", "ZPM 4A Energy ParameterDefinition", 7, 4).getStackForm(1L)); eM_energymulti16_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15112, "hatch.energymulti16.tier.07", "ZPM 16A Energy Hatch", 7, 16).getStackForm(1L)); + 15112, "hatch.energymulti16.tier.07", "ZPM 16A Energy ParameterDefinition", 7, 16).getStackForm(1L)); eM_energymulti64_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15122, "hatch.energymulti64.tier.07", "ZPM 64A Energy Hatch", 7, 64).getStackForm(1L)); + 15122, "hatch.energymulti64.tier.07", "ZPM 64A Energy ParameterDefinition", 7, 64).getStackForm(1L)); eM_energymulti4_UV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15103, "hatch.energymulti04.tier.08", "UV 4A Energy Hatch", 8, 4).getStackForm(1L)); + 15103, "hatch.energymulti04.tier.08", "UV 4A Energy ParameterDefinition", 8, 4).getStackForm(1L)); eM_energymulti16_UV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15113, "hatch.energymulti16.tier.08", "UV 16A Energy Hatch", 8, 16).getStackForm(1L)); + 15113, "hatch.energymulti16.tier.08", "UV 16A Energy ParameterDefinition", 8, 16).getStackForm(1L)); eM_energymulti64_UV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15123, "hatch.energymulti64.tier.08", "UV 64A Energy Hatch", 8, 64).getStackForm(1L)); + 15123, "hatch.energymulti64.tier.08", "UV 64A Energy ParameterDefinition", 8, 64).getStackForm(1L)); eM_energymulti4_UHV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15104, "hatch.energymulti04.tier.09", "UHV 4A Energy Hatch", 9, 4).getStackForm(1L)); + 15104, "hatch.energymulti04.tier.09", "UHV 4A Energy ParameterDefinition", 9, 4).getStackForm(1L)); eM_energymulti16_UHV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15114, "hatch.energymulti16.tier.09", "UHV 16A Energy Hatch", 9, 16).getStackForm(1L)); + 15114, "hatch.energymulti16.tier.09", "UHV 16A Energy ParameterDefinition", 9, 16).getStackForm(1L)); eM_energymulti64_UHV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15124, "hatch.energymulti64.tier.09", "UHV 64A Energy Hatch", 9, 64).getStackForm(1L)); + 15124, "hatch.energymulti64.tier.09", "UHV 64A Energy ParameterDefinition", 9, 64).getStackForm(1L)); eM_energymulti4_UEV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15105, "hatch.energymulti04.tier.10", "UEV 4A Energy Hatch", 10, 4).getStackForm(1L)); + 15105, "hatch.energymulti04.tier.10", "UEV 4A Energy ParameterDefinition", 10, 4).getStackForm(1L)); eM_energymulti16_UEV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15115, "hatch.energymulti16.tier.10", "UEV 16A Energy Hatch", 10, 16).getStackForm(1L)); + 15115, "hatch.energymulti16.tier.10", "UEV 16A Energy ParameterDefinition", 10, 16).getStackForm(1L)); eM_energymulti64_UEV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15125, "hatch.energymulti64.tier.10", "UEV 64A Energy Hatch", 10, 64).getStackForm(1L)); + 15125, "hatch.energymulti64.tier.10", "UEV 64A Energy ParameterDefinition", 10, 64).getStackForm(1L)); eM_energymulti4_UIV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15106, "hatch.energymulti04.tier.11", "UIV 4A Energy Hatch", 11, 4).getStackForm(1L)); + 15106, "hatch.energymulti04.tier.11", "UIV 4A Energy ParameterDefinition", 11, 4).getStackForm(1L)); eM_energymulti16_UIV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15116, "hatch.energymulti16.tier.11", "UIV 16A Energy Hatch", 11, 16).getStackForm(1L)); + 15116, "hatch.energymulti16.tier.11", "UIV 16A Energy ParameterDefinition", 11, 16).getStackForm(1L)); eM_energymulti64_UIV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15126, "hatch.energymulti64.tier.11", "UIV 64A Energy Hatch", 11, 64).getStackForm(1L)); + 15126, "hatch.energymulti64.tier.11", "UIV 64A Energy ParameterDefinition", 11, 64).getStackForm(1L)); eM_energymulti4_UMV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15107, "hatch.energymulti04.tier.12", "UMV 4A Energy Hatch", 12, 4).getStackForm(1L)); + 15107, "hatch.energymulti04.tier.12", "UMV 4A Energy ParameterDefinition", 12, 4).getStackForm(1L)); eM_energymulti16_UMV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15117, "hatch.energymulti16.tier.12", "UMV 16A Energy Hatch", 12, 16).getStackForm(1L)); + 15117, "hatch.energymulti16.tier.12", "UMV 16A Energy ParameterDefinition", 12, 16).getStackForm(1L)); eM_energymulti64_UMV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15127, "hatch.energymulti64.tier.12", "UMV 64A Energy Hatch", 12, 64).getStackForm(1L)); + 15127, "hatch.energymulti64.tier.12", "UMV 64A Energy ParameterDefinition", 12, 64).getStackForm(1L)); eM_energymulti4_UXV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15108, "hatch.energymulti04.tier.13", "UXV 4A Energy Hatch", 13, 4).getStackForm(1L)); + 15108, "hatch.energymulti04.tier.13", "UXV 4A Energy ParameterDefinition", 13, 4).getStackForm(1L)); eM_energymulti16_UXV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15118, "hatch.energymulti16.tier.13", "UXV 16A Energy Hatch", 13, 16).getStackForm(1L)); + 15118, "hatch.energymulti16.tier.13", "UXV 16A Energy ParameterDefinition", 13, 16).getStackForm(1L)); eM_energymulti64_UXV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15128, "hatch.energymulti64.tier.13", "UXV 64A Energy Hatch", 13, 64).getStackForm(1L)); + 15128, "hatch.energymulti64.tier.13", "UXV 64A Energy ParameterDefinition", 13, 64).getStackForm(1L)); // =================================================================================================== // Multi AMP Power OUTPUTS @@ -160,67 +160,67 @@ public class MachineLoader implements Runnable { eM_dynamomulti4_IV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15200, "hatch.dynamomulti04.tier.05", "IV 4A Dynamo Hatch", 5, 4).getStackForm(1L)); + 15200, "hatch.dynamomulti04.tier.05", "IV 4A Dynamo ParameterDefinition", 5, 4).getStackForm(1L)); eM_dynamomulti16_IV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15210, "hatch.dynamomulti16.tier.05", "IV 16A Dynamo Hatch", 5, 16).getStackForm(1L)); + 15210, "hatch.dynamomulti16.tier.05", "IV 16A Dynamo ParameterDefinition", 5, 16).getStackForm(1L)); eM_dynamomulti64_IV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15220, "hatch.dynamomulti64.tier.05", "IV 64A Dynamo Hatch", 5, 64).getStackForm(1L)); + 15220, "hatch.dynamomulti64.tier.05", "IV 64A Dynamo ParameterDefinition", 5, 64).getStackForm(1L)); eM_dynamomulti4_LuV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15201, "hatch.dynamomulti04.tier.06", "LuV 4A Dynamo Hatch", 6, 4).getStackForm(1L)); + 15201, "hatch.dynamomulti04.tier.06", "LuV 4A Dynamo ParameterDefinition", 6, 4).getStackForm(1L)); eM_dynamomulti16_LuV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15211, "hatch.dynamomulti16.tier.06", "LuV 16A Dynamo Hatch", 6, 16).getStackForm(1L)); + 15211, "hatch.dynamomulti16.tier.06", "LuV 16A Dynamo ParameterDefinition", 6, 16).getStackForm(1L)); eM_dynamomulti64_LuV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15221, "hatch.dynamomulti64.tier.06", "LuV 64A Dynamo Hatch", 6, 64).getStackForm(1L)); + 15221, "hatch.dynamomulti64.tier.06", "LuV 64A Dynamo ParameterDefinition", 6, 64).getStackForm(1L)); eM_dynamomulti4_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15202, "hatch.dynamomulti04.tier.07", "ZPM 4A Dynamo Hatch", 7, 4).getStackForm(1L)); + 15202, "hatch.dynamomulti04.tier.07", "ZPM 4A Dynamo ParameterDefinition", 7, 4).getStackForm(1L)); eM_dynamomulti16_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15212, "hatch.dynamomulti16.tier.07", "ZPM 16A Dynamo Hatch", 7, 16).getStackForm(1L)); + 15212, "hatch.dynamomulti16.tier.07", "ZPM 16A Dynamo ParameterDefinition", 7, 16).getStackForm(1L)); eM_dynamomulti64_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15222, "hatch.dynamomulti64.tier.07", "ZPM 64A Dynamo Hatch", 7, 64).getStackForm(1L)); + 15222, "hatch.dynamomulti64.tier.07", "ZPM 64A Dynamo ParameterDefinition", 7, 64).getStackForm(1L)); eM_dynamomulti4_UV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15203, "hatch.dynamomulti04.tier.08", "UV 4A Dynamo Hatch", 8, 4).getStackForm(1L)); + 15203, "hatch.dynamomulti04.tier.08", "UV 4A Dynamo ParameterDefinition", 8, 4).getStackForm(1L)); eM_dynamomulti16_UV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15213, "hatch.dynamomulti16.tier.08", "UV 16A Dynamo Hatch", 8, 16).getStackForm(1L)); + 15213, "hatch.dynamomulti16.tier.08", "UV 16A Dynamo ParameterDefinition", 8, 16).getStackForm(1L)); eM_dynamomulti64_UV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15223, "hatch.dynamomulti64.tier.08", "UV 64A Dynamo Hatch", 8, 64).getStackForm(1L)); + 15223, "hatch.dynamomulti64.tier.08", "UV 64A Dynamo ParameterDefinition", 8, 64).getStackForm(1L)); eM_dynamomulti4_UHV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15204, "hatch.dynamomulti04.tier.09", "UHV 4A Dynamo Hatch", 9, 4).getStackForm(1L)); + 15204, "hatch.dynamomulti04.tier.09", "UHV 4A Dynamo ParameterDefinition", 9, 4).getStackForm(1L)); eM_dynamomulti16_UHV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15214, "hatch.dynamomulti16.tier.09", "UHV 16A Dynamo Hatch", 9, 16).getStackForm(1L)); + 15214, "hatch.dynamomulti16.tier.09", "UHV 16A Dynamo ParameterDefinition", 9, 16).getStackForm(1L)); eM_dynamomulti64_UHV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15224, "hatch.dynamomulti64.tier.09", "UHV 64A Dynamo Hatch", 9, 64).getStackForm(1L)); + 15224, "hatch.dynamomulti64.tier.09", "UHV 64A Dynamo ParameterDefinition", 9, 64).getStackForm(1L)); eM_dynamomulti4_UEV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15205, "hatch.dynamomulti04.tier.10", "UEV 4A Dynamo Hatch", 10, 4).getStackForm(1L)); + 15205, "hatch.dynamomulti04.tier.10", "UEV 4A Dynamo ParameterDefinition", 10, 4).getStackForm(1L)); eM_dynamomulti16_UEV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15215, "hatch.dynamomulti16.tier.10", "UEV 16A Dynamo Hatch", 10, 16).getStackForm(1L)); + 15215, "hatch.dynamomulti16.tier.10", "UEV 16A Dynamo ParameterDefinition", 10, 16).getStackForm(1L)); eM_dynamomulti64_UEV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15225, "hatch.dynamomulti64.tier.10", "UEV 64A Dynamo Hatch", 10, 64).getStackForm(1L)); + 15225, "hatch.dynamomulti64.tier.10", "UEV 64A Dynamo ParameterDefinition", 10, 64).getStackForm(1L)); eM_dynamomulti4_UIV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15206, "hatch.dynamomulti04.tier.11", "UIV 4A Dynamo Hatch", 11, 4).getStackForm(1L)); + 15206, "hatch.dynamomulti04.tier.11", "UIV 4A Dynamo ParameterDefinition", 11, 4).getStackForm(1L)); eM_dynamomulti16_UIV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15216, "hatch.dynamomulti16.tier.11", "UIV 16A Dynamo Hatch", 11, 16).getStackForm(1L)); + 15216, "hatch.dynamomulti16.tier.11", "UIV 16A Dynamo ParameterDefinition", 11, 16).getStackForm(1L)); eM_dynamomulti64_UIV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15226, "hatch.dynamomulti64.tier.11", "UIV 64A Dynamo Hatch", 11, 64).getStackForm(1L)); + 15226, "hatch.dynamomulti64.tier.11", "UIV 64A Dynamo ParameterDefinition", 11, 64).getStackForm(1L)); eM_dynamomulti4_UMV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15207, "hatch.dynamomulti04.tier.12", "UMV 4A Dynamo Hatch", 12, 4).getStackForm(1L)); + 15207, "hatch.dynamomulti04.tier.12", "UMV 4A Dynamo ParameterDefinition", 12, 4).getStackForm(1L)); eM_dynamomulti16_UMV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15217, "hatch.dynamomulti16.tier.12", "UMV 16A Dynamo Hatch", 12, 16).getStackForm(1L)); + 15217, "hatch.dynamomulti16.tier.12", "UMV 16A Dynamo ParameterDefinition", 12, 16).getStackForm(1L)); eM_dynamomulti64_UMV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15227, "hatch.dynamomulti64.tier.12", "UMV 64A Dynamo Hatch", 12, 64).getStackForm(1L)); + 15227, "hatch.dynamomulti64.tier.12", "UMV 64A Dynamo ParameterDefinition", 12, 64).getStackForm(1L)); eM_dynamomulti4_UXV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15208, "hatch.dynamomulti04.tier.13", "UXV 4A Dynamo Hatch", 13, 4).getStackForm(1L)); + 15208, "hatch.dynamomulti04.tier.13", "UXV 4A Dynamo ParameterDefinition", 13, 4).getStackForm(1L)); eM_dynamomulti16_UXV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15218, "hatch.dynamomulti16.tier.13", "UXV 16A Dynamo Hatch", 13, 16).getStackForm(1L)); + 15218, "hatch.dynamomulti16.tier.13", "UXV 16A Dynamo ParameterDefinition", 13, 16).getStackForm(1L)); eM_dynamomulti64_UXV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15228, "hatch.dynamomulti64.tier.13", "UXV 64A Dynamo Hatch", 13, 64).getStackForm(1L)); + 15228, "hatch.dynamomulti64.tier.13", "UXV 64A Dynamo ParameterDefinition", 13, 64).getStackForm(1L)); // =================================================================================================== // MULTIBLOCKS @@ -279,7 +279,7 @@ public class MachineLoader implements Runnable { rack_Hatch.set(new GT_MetaTileEntity_Hatch_Rack(15450, "hatch.rack.tier.08", "Computer Rack", 8, "4 Slot Rack").getStackForm(1L)); holder_Hatch.set(new GT_MetaTileEntity_Hatch_Holder(15451, "hatch.holder.tier.09", "Object Holder", 8, "For Research Station").getStackForm(1L)); - capacitor_Hatch.set(new GT_MetaTileEntity_Hatch_Capacitor(15452, "hatch.capacitor.tier.05", "Capacitor Hatch", 5, "For Tesla Coil").getStackForm(1L)); + capacitor_Hatch.set(new GT_MetaTileEntity_Hatch_Capacitor(15452, "hatch.capacitor.tier.05", "Capacitor ParameterDefinition", 5, "For Tesla Coil").getStackForm(1L)); // =================================================================================================== // Pipes @@ -309,7 +309,7 @@ public class MachineLoader implements Runnable { // =================================================================================================== // Debug Stuff // =================================================================================================== - hatch_CreativeMaitenance.set(new GT_MetaTileEntity_Hatch_CreativeMaintenance(15497, "debug.tt.maintenance", "Debug Maintenance Hatch", 15).getStackForm(1L)); + hatch_CreativeMaitenance.set(new GT_MetaTileEntity_Hatch_CreativeMaintenance(15497, "debug.tt.maintenance", "Debug Maintenance ParameterDefinition", 15).getStackForm(1L)); Machine_DebugGenny.set(new GT_MetaTileEntity_DebugPowerGenerator(15498, "debug.tt.genny", "Debug Power Generator", 15).getStackForm(1L)); Machine_DebugWriter.set(new GT_MetaTileEntity_DebugStructureWriter(15499, "debug.tt.writer", "Debug Structure Writer", 15).getStackForm(1L)); diff --git a/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java b/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java index efb9e6d644..667f1a45d5 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java @@ -133,7 +133,7 @@ public final class ConstructableTriggerItem extends Item { private final String[] desc=new String[]{ EnumChatFormatting.AQUA+"Hint Details:", "1 - Classic Hatches or Heat Proof Casing", - "2 - Muffler Hatch", + "2 - Muffler ParameterDefinition", "3 - Coil blocks" }; //endregion diff --git a/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java b/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java index 035b049a99..bc6d8cf3c6 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java @@ -127,7 +127,7 @@ public final class ParametrizerMemoryCard extends Item { int temp; if(tNBT!=null && tNBT.hasKey("param")) { - aList.add("Hatch ID: "+EnumChatFormatting.AQUA + tNBT.getInteger("param")); + aList.add("ParameterDefinition ID: "+EnumChatFormatting.AQUA + tNBT.getInteger("param")); temp=tNBT.getInteger("value0i"); aList.add("Value 0|I: "+EnumChatFormatting.AQUA + temp); aList.add("Value 0|F: "+EnumChatFormatting.AQUA + Float.intBitsToFloat(temp)); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Capacitor.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Capacitor.java index 2aae2b8c2b..ca8fb59f74 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Capacitor.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Capacitor.java @@ -94,7 +94,7 @@ public class GT_MetaTileEntity_Hatch_Capacitor extends GT_MetaTileEntity_Hatch { @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_Capacitor(aPlayerInventory, aBaseMetaTileEntity, "Capacitor Hatch"); + return new GT_GUIContainer_Capacitor(aPlayerInventory, aBaseMetaTileEntity, "Capacitor ParameterDefinition"); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java index c84057c121..e97ffaa670 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java @@ -259,7 +259,7 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta mDescription, "Max stacks amount: " + EnumChatFormatting.AQUA + getMaxStacksCount(), "Stack capacity: " + EnumChatFormatting.AQUA + getMaxStackSize(), - "Place Overflow Hatch behind,on top or below", + "Place Overflow ParameterDefinition behind,on top or below", "to provide overflow protection while this block", "is not attached to multi block.", "Transport range can be extended in straight", diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java index 409f8195e2..cd3ad8d573 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java @@ -94,7 +94,7 @@ public class GT_MetaTileEntity_Hatch_Holder extends GT_MetaTileEntity_Hatch { @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_Holder(aPlayerInventory, aBaseMetaTileEntity, "Holder Hatch"); + return new GT_GUIContainer_Holder(aPlayerInventory, aBaseMetaTileEntity, "Holder ParameterDefinition"); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java index 5f102c94ab..346e851345 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java @@ -53,7 +53,7 @@ public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_Multiblo private static final String[] description = new String[]{ EnumChatFormatting.AQUA + "Hint Details:", "1 - Classic Hatches or High Power Casing", - "2 - Elemental Input Hatch", + "2 - Elemental Input ParameterDefinition", "3 - Elemental Overflow Hatches or Molecular Casing", }; //endregion diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java index a5a3f451ea..5733bfb458 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java @@ -59,7 +59,7 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock private static final String[] description = new String[]{ EnumChatFormatting.AQUA+"Hint Details:", "1 - Classic Hatches or High Power Casing", - "2 - Elemental Output Hatch", + "2 - Elemental Output ParameterDefinition", "3 - Elemental Overflow Hatches or Molecular Casing", }; //endregion diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java index 377291f59a..edc9c11a56 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java @@ -73,7 +73,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB private static final String[] description = new String[]{ EnumChatFormatting.AQUA+"Hint Details:", "1 - Classic/Data Hatches or Computer casing", - "2 - Holder Hatch", + "2 - Holder ParameterDefinition", }; //endregion @@ -286,7 +286,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB } for (int i = 0; i < tRecipe.mFluidInputs.length; i++) { if (tRecipe.mFluidInputs[i] != null) { - tNBTList.appendTag(new NBTTagString("Input Hatch " + (i + 1) + ": " + tRecipe.mFluidInputs[i].amount + "L " + GT_LanguageManager.getTranslation(tRecipe.mFluidInputs[i].getLocalizedName()))); + tNBTList.appendTag(new NBTTagString("Input ParameterDefinition " + (i + 1) + ": " + tRecipe.mFluidInputs[i].amount + "L " + GT_LanguageManager.getTranslation(tRecipe.mFluidInputs[i].getLocalizedName()))); } } tNBT.setTag("pages", tNBTList); @@ -382,7 +382,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB s = tRecipe.mFluidInputs[i].getLocalizedName(); } } - tNBTList.appendTag(new NBTTagString("Input Hatch "+(i+1)+": "+tRecipe.mFluidInputs[i].amount+"L "+s)); + tNBTList.appendTag(new NBTTagString("Input ParameterDefinition "+(i+1)+": "+tRecipe.mFluidInputs[i].amount+"L "+s)); } } tNBT.setTag("pages", tNBTList); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java index 1fdf8d6943..541adfd953 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java @@ -210,7 +210,7 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock } @Override - protected void parametersInRead_EM() { + protected void parametersInReadWhileActive_EM() { powerSetting = (int) getParameterIn(0, 0); timerSetting = (int) getParameterIn(0, 1); } 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 4845117a99..b8c856f9f8 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 @@ -106,8 +106,8 @@ public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null || eParamsInStatus == null) { return; } - eParamsInStatus = ((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).eParamsInStatus; - eParamsOutStatus = ((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).eParamsOutStatus; + eParamsInStatus = ((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).parametrization.eParamsInStatus; + eParamsOutStatus = ((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).parametrization.eParamsOutStatus; eCertainMode = ((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).eCertainMode; eCertainStatus = ((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).eCertainStatus; ePowerPass = ((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).ePowerPass; 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 a6ec5b561a..07fde1050a 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 @@ -95,20 +95,8 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt protected ArrayList eInputData = new ArrayList<>(); protected ArrayList eOutputData = new ArrayList<>(); - //endregion - - //region PARAMETERS! GO AWAY and use proper get/set methods - // 0 and 10 are from first parametrizer - // 1 and 11 are from second etc... - - private final int[] iParamsIn = new int[20];//number I from parametrizers - private final int[] iParamsOut = new int[20];//number O to parametrizers - private final boolean[] bParamsAreFloats = new boolean[10]; - - final LedStatus[] eParamsInStatus = new LedStatus[20];//LED status for I - final LedStatus[] eParamsOutStatus = new LedStatus[20];//LED status for O - // 0,2,4,6 - ok - // 1,3,5 - nok + //region parameters + public final Parameters parametrization; //endregion @@ -164,12 +152,16 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt protected GT_MetaTileEntity_MultiblockBase_EM(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); - parametersLoadDefault_EM(); + parametrization=new Parameters(); + parametersInstantiation_EM(); + parametrization.setToDefaults(true,true,true); } protected GT_MetaTileEntity_MultiblockBase_EM(String aName) { super(aName); - parametersLoadDefault_EM(); + parametrization=new Parameters(); + parametersInstantiation_EM(); + parametrization.setToDefaults(true,true,true); } //region SUPER STRUCT @@ -631,80 +623,6 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt //endregion - //region PARAMETERS AND STATUSES - actually use it to work with parameters in other overrides - - public final boolean setParameterPairIn_ClearOut(int hatchNo, boolean usesFloats, double value0, double value1) { - if (mMaxProgresstime > 0) { - return false; - } - bParamsAreFloats[hatchNo] = usesFloats; - if (usesFloats) { - iParamsIn[hatchNo] = Float.floatToIntBits((float) value0); - iParamsIn[hatchNo + 10] = Float.floatToIntBits((float) value1); - } else { - iParamsIn[hatchNo] = (int) value0; - iParamsIn[hatchNo + 10] = (int) value1; - } - iParamsOut[hatchNo] = 0; - iParamsOut[hatchNo + 10] = 0; - return true; - } - - public final boolean isParametrizerUsingFloat(int hatchNo){ - return bParamsAreFloats[hatchNo]; - } - - public final double getParameterIn(int hatchNo, int paramID){ - return bParamsAreFloats[hatchNo]?Float.intBitsToFloat(iParamsIn[hatchNo+10*paramID]):iParamsIn[hatchNo+10*paramID]; - } - - public final int getParameterInInt(int hatchNo, int paramID){ - if(bParamsAreFloats[hatchNo]) { - return (int) Float.intBitsToFloat(iParamsIn[hatchNo + 10 * paramID]); - } - return iParamsIn[hatchNo+10*paramID]; - } - - //public final int getParameterInIntRaw(int hatchNo, int paramID){ - // return iParamsIn[hatchNo+10*paramID]; - //} - - //public final float getParameterInFloatRaw(int hatchNo, int paramID){ - // return Float.intBitsToFloat(iParamsIn[hatchNo+10*paramID]); - //} - - public final void setParameterOut(int hatchNo, int paramID, double value){ - if(bParamsAreFloats[hatchNo]) { - iParamsOut[hatchNo+10*paramID]=Float.floatToIntBits((float) value); - }else{ - iParamsOut[hatchNo+10*paramID]=(int)value; - } - } - - //public final boolean setParameterOutInt(int hatchNo, int paramID, int value){ - // if(bParamsAreFloats[hatchNo]) return false; - // iParamsOut[hatchNo+10*paramID]=value; - // return true; - //} - - //public final boolean setParameterOutFloat(int hatchNo, int paramID, float value){ - // if(bParamsAreFloats[hatchNo]) { - // iParamsOut[hatchNo + 10 * paramID] = Float.floatToIntBits(value); - // return true; - // } - // return false; - //} - - public final void setStatusOfParameterIn(int hatchNo, int paramID, LedStatus status){ - eParamsInStatus[hatchNo+10*paramID]=status; - } - - public final void setStatusOfParameterOut(int hatchNo, int paramID, LedStatus status){ - eParamsOutStatus[hatchNo+10*paramID]=status; - } - - //endregion - //region Methods to maybe override (if u implement certain stuff) /** @@ -787,30 +705,43 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } /** - * loads default parameters in CONSTRUCTOR! CALLED ONCE on creation, don't call it in your classes + * instantiate parameters in CONSTRUCTOR! CALLED ONCE on creation, don't call it in your classes */ - protected void parametersLoadDefault_EM(){ - //load default parameters with setParameterPairIn_ClearOut - } + protected void parametersInstantiation_EM(){} /** - * This is called automatically when there was parameters data update, copy it to your variables for safe storage - * although the base code only downloads the values from parametrizers when machines is NOT OPERATING + * This is called automatically when there was IN parameters data update and machine IS RUNNING + * although the base code only downloads the IN values from parametrizers when machine is NOT OPERATING + * + * this can be used to update the IN values on the fly when machine is running to affect the current process * - * good place to get Parameters */ - protected void parametersInRead_EM(){} + protected void parametersInReadWhileActive_EM() { + } /** * It is automatically called OFTEN * update status of parameters in guis (and "machine state" if u wish) - * Called before check recipe, before outputting, and every second the machine is active + * Called before check recipe, before outputting, and every second the machine is complete * - * good place for set Parameters + * good place to update parameter statuses, default implementation handles it well * * @param machineBusy is machine doing SHIT */ - public void parametersOutAndStatusesWrite_EM(boolean machineBusy){} + public void parametersOutAndStatusesWrite_EM(boolean machineBusy) { + if(!machineBusy){ + for (Parameters.ParameterDefinition.In in : parametrization.inArrayList) { + if (in != null) { + in.updateStatus(); + } + } + } + for (Parameters.ParameterDefinition.Out out : parametrization.outArrayList) { + if (out != null) { + out.updateStatus(); + } + } + } /** * For extra types of hatches initiation, LOOK HOW IT IS CALLED! in onPostTick @@ -942,32 +873,32 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } NBTTagCompound paramI = new NBTTagCompound(); - for (int i = 0; i < iParamsIn.length; i++) { - paramI.setInteger(Integer.toString(i), iParamsIn[i]); + for (int i = 0; i < parametrization.iParamsIn.length; i++) { + paramI.setInteger(Integer.toString(i), parametrization.iParamsIn[i]); } aNBT.setTag("eParamsIn", paramI); NBTTagCompound paramO = new NBTTagCompound(); - for (int i = 0; i < iParamsOut.length; i++) { - paramO.setInteger(Integer.toString(i), iParamsOut[i]); + for (int i = 0; i < parametrization.iParamsOut.length; i++) { + paramO.setInteger(Integer.toString(i), parametrization.iParamsOut[i]); } aNBT.setTag("eParamsOut", paramO); NBTTagCompound paramB = new NBTTagCompound(); - for (int i = 0; i < bParamsAreFloats.length; i++) { - paramB.setBoolean(Integer.toString(i), bParamsAreFloats[i]); + for (int i = 0; i < parametrization.bParamsAreFloats.length; i++) { + paramB.setBoolean(Integer.toString(i), parametrization.bParamsAreFloats[i]); } aNBT.setTag("eParamsB", paramB); NBTTagCompound paramIs = new NBTTagCompound(); - for (int i = 0; i < eParamsInStatus.length; i++) { - paramIs.setByte(Integer.toString(i), eParamsInStatus[i].getOrdinalByte()); + for (int i = 0; i < parametrization.eParamsInStatus.length; i++) { + paramIs.setByte(Integer.toString(i), parametrization.eParamsInStatus[i].getOrdinalByte()); } aNBT.setTag("eParamsInS", paramIs); NBTTagCompound paramOs = new NBTTagCompound(); - for (int i = 0; i < eParamsOutStatus.length; i++) { - paramOs.setByte(Integer.toString(i), eParamsOutStatus[i].getOrdinalByte()); + for (int i = 0; i < parametrization.eParamsOutStatus.length; i++) { + paramOs.setByte(Integer.toString(i), parametrization.eParamsOutStatus[i].getOrdinalByte()); } aNBT.setTag("eParamsOutS", paramOs); } @@ -1035,28 +966,28 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } NBTTagCompound paramI = aNBT.getCompoundTag("eParamsIn"); - for (int i = 0; i < iParamsIn.length; i++) { - iParamsIn[i] = paramI.getInteger(Integer.toString(i)); + for (int i = 0; i < parametrization.iParamsIn.length; i++) { + parametrization.iParamsIn[i] = paramI.getInteger(Integer.toString(i)); } NBTTagCompound paramO = aNBT.getCompoundTag("eParamsOut"); - for (int i = 0; i < iParamsOut.length; i++) { - iParamsOut[i] = paramO.getInteger(Integer.toString(i)); + for (int i = 0; i < parametrization.iParamsOut.length; i++) { + parametrization.iParamsOut[i] = paramO.getInteger(Integer.toString(i)); } NBTTagCompound paramB = aNBT.getCompoundTag("eParamsB"); - for (int i = 0; i < bParamsAreFloats.length; i++) { - bParamsAreFloats[i] = paramB.getBoolean(Integer.toString(i)); + for (int i = 0; i < parametrization.bParamsAreFloats.length; i++) { + parametrization.bParamsAreFloats[i] = paramB.getBoolean(Integer.toString(i)); } NBTTagCompound paramIs = aNBT.getCompoundTag("eParamsInS"); - for (int i = 0; i < eParamsInStatus.length; i++) { - eParamsInStatus[i] = LedStatus.getStatus(paramIs.getByte(Integer.toString(i))); + for (int i = 0; i < parametrization.eParamsInStatus.length; i++) { + parametrization.eParamsInStatus[i] = LedStatus.getStatus(paramIs.getByte(Integer.toString(i))); } NBTTagCompound paramOs = aNBT.getCompoundTag("eParamsOutS"); - for (int i = 0; i < eParamsOutStatus.length; i++) { - eParamsOutStatus[i] = LedStatus.getStatus(paramOs.getByte(Integer.toString(i))); + for (int i = 0; i < parametrization.eParamsOutStatus.length; i++) { + parametrization.eParamsOutStatus[i] = LedStatus.getStatus(paramOs.getByte(Integer.toString(i))); } } @@ -1235,7 +1166,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } /** - * callback for updating parameters, change this if u really need dynamic (inside recipe time) parameter updates + * callback for updating parameters and new hatches */ protected void hatchesStatusUpdate_EM() { boolean busy=mMaxProgresstime>0; @@ -1245,29 +1176,29 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt continue; } int paramID = hatch.param; - if(bParamsAreFloats[hatch.param] == hatch.isUsingFloats()){ - hatch.input0i = iParamsOut[paramID]; - hatch.input1i = iParamsOut[paramID + 10]; + if(parametrization.bParamsAreFloats[hatch.param] == hatch.isUsingFloats()){ + hatch.input0i = parametrization.iParamsOut[paramID]; + hatch.input1i = parametrization.iParamsOut[paramID + 10]; }else if(hatch.isUsingFloats()){ - hatch.input0i = Float.floatToIntBits((float)iParamsOut[paramID]); - hatch.input1i = Float.floatToIntBits((float)iParamsOut[paramID + 10]); + hatch.input0i = Float.floatToIntBits((float)parametrization.iParamsOut[paramID]); + hatch.input1i = Float.floatToIntBits((float)parametrization.iParamsOut[paramID + 10]); }else { - hatch.input0i = (int)Float.intBitsToFloat(iParamsOut[paramID]); - hatch.input1i = (int)Float.intBitsToFloat(iParamsOut[paramID + 10]); + hatch.input0i = (int)Float.intBitsToFloat(parametrization.iParamsOut[paramID]); + hatch.input1i = (int)Float.intBitsToFloat(parametrization.iParamsOut[paramID + 10]); } } - parametersInRead_EM(); + parametersInReadWhileActive_EM(); } else {//if has nothing to do update all for (GT_MetaTileEntity_Hatch_Param hatch : eParamHatches) { if (!GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch) || hatch.param < 0) { continue; } int paramID = hatch.param; - bParamsAreFloats[hatch.param] = hatch.isUsingFloats(); - iParamsIn[paramID] = hatch.value0i; - iParamsIn[paramID + 10] = hatch.value1i; - hatch.input0i = iParamsOut[paramID]; - hatch.input1i = iParamsOut[paramID + 10]; + parametrization.bParamsAreFloats[hatch.param] = hatch.isUsingFloats(); + parametrization.iParamsIn[paramID] = hatch.value0i; + parametrization.iParamsIn[paramID + 10] = hatch.value1i; + hatch.input0i = parametrization.iParamsOut[paramID]; + hatch.input1i = parametrization.iParamsOut[paramID + 10]; } } for (GT_MetaTileEntity_Hatch_Uncertainty uncertainty : eUncertainHatches) { @@ -1479,7 +1410,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) { hatch.getBaseMetaTileEntity().setActive(true); if(hatch.param>=0) { - bParamsAreFloats[hatch.param] = hatch.isUsingFloats(); + parametrization.bParamsAreFloats[hatch.param] = hatch.isUsingFloats(); } } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java new file mode 100644 index 0000000000..3bd769f14f --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java @@ -0,0 +1,240 @@ +package com.github.technus.tectech.thing.metaTileEntity.multi.base; + +import java.util.ArrayList; +import java.util.function.Supplier; + +/** + * Instantiate parameters as field in parametersInstantiation_EM(); + */ +public class Parameters { + private static final Supplier LED_STATUS_FUNCTION_DEFAULT = ()->LedStatus.STATUS_UNDEFINED; + private static final int ZERO_FLOAT=Float.floatToIntBits(0); + private final ParameterDefinition[] parameterDefinitions =new ParameterDefinition[10]; + + final int[] iParamsIn = new int[20];//number I from parametrizers + final int[] iParamsOut = new int[20];//number O to parametrizers + final ArrayList inArrayList=new ArrayList<>(); + final ArrayList outArrayList=new ArrayList<>(); + + final boolean[] bParamsAreFloats =new boolean[10]; + + //package private for use in gui + final LedStatus[] eParamsInStatus = new LedStatus[20];//LED status for I + final LedStatus[] eParamsOutStatus = new LedStatus[20];//LED status for O + + Parameters(){} + + void setToDefaults(boolean defaultIn, boolean defaultOut,boolean defaultAreFloats){ + for (int hatch=0;hatch<10;hatch++) { + ParameterDefinition p= parameterDefinitions[hatch]; + if (p!=null){ + p.setToDefaults(defaultIn,defaultOut,defaultAreFloats); + }else{ + if(defaultAreFloats){ + bParamsAreFloats[hatch]=false; + if(defaultIn){ + iParamsIn[hatch] = 0; + iParamsIn[hatch + 10] = 0; + } + if(defaultOut){ + iParamsOut[hatch] = 0; + iParamsOut[hatch + 10] = 0; + } + }else{ + if(bParamsAreFloats[hatch]){ + if(defaultIn){ + iParamsIn[hatch] = ZERO_FLOAT; + iParamsIn[hatch + 10] = ZERO_FLOAT; + } + if(defaultOut){ + iParamsOut[hatch] = ZERO_FLOAT; + iParamsOut[hatch + 10] = ZERO_FLOAT; + } + }else{ + if(defaultIn){ + iParamsIn[hatch] = 0; + iParamsIn[hatch + 10] = 0; + } + if(defaultOut){ + iParamsOut[hatch] = 0; + iParamsOut[hatch + 10] = 0; + } + } + } + } + } + } + + public void ClearDefinitions(){ + setToDefaults(true,true,false); + inArrayList.clear(); + outArrayList.clear(); + for(int i = 0; i< parameterDefinitions.length; i++){ + parameterDefinitions[i]=null; + } + } + + /** + * most likely used locally in parametersInstantiation_EM() + */ + public class ParameterDefinition { + private final boolean bParamsDefaultsAreStoredAsFloats; + private final int hatchNo; + private final In[] in=new In[2]; + private final Out[] out=new Out[2]; + + private ParameterDefinition(int hatchNo, boolean aParamsDefaultsAreFloats){ + if(hatchNo<0 || hatchNo>=10){ + throw new IllegalArgumentException("ParameterDefinition id must be in 0 to 9 range"); + } + this.hatchNo=hatchNo; + bParamsDefaultsAreStoredAsFloats =aParamsDefaultsAreFloats; + parameterDefinitions[hatchNo]=this; + } + + private void setToDefaults(boolean defaultIn, boolean defaultOut,boolean defaultAreFloats) { + if(defaultAreFloats){ + bParamsAreFloats[hatchNo] = bParamsDefaultsAreStoredAsFloats; + } + if(defaultIn){ + for(int in=0;in<2;in++){ + if(this.in[in]!=null){ + this.in[in].setDefault(); + }else { + if (bParamsAreFloats[hatchNo]) { + iParamsIn[hatchNo] = ZERO_FLOAT; + iParamsIn[hatchNo + 10] = ZERO_FLOAT; + } else { + iParamsIn[hatchNo] = 0; + iParamsIn[hatchNo + 10] = 0; + } + } + } + } + if(defaultOut){ + for(int out=0;out<2;out++){ + if(this.out[out]!=null){ + this.out[out].setDefault(); + }else { + if (bParamsAreFloats[hatchNo]) { + iParamsIn[hatchNo] = ZERO_FLOAT; + iParamsIn[hatchNo + 10] = ZERO_FLOAT; + } else { + iParamsIn[hatchNo] = 0; + iParamsIn[hatchNo + 10] = 0; + } + } + } + } + } + + /** + * Make a field out of this... + */ + public class Out { + public final int id; + public final double defaultValue; + private final Supplier status; + + public Out(int paramID, double defaultValue, Supplier< LedStatus> status){ + this.id=hatchNo+10*paramID; + if(paramID<0 || paramID>2){ + throw new IllegalArgumentException("Parameter id must be in 0 to 1 range"); + } + this.defaultValue=defaultValue; + if(out[paramID]!=null){ + throw new InstantiationError("This parameter already exists!"); + } + if(status ==null){ + this.status =LED_STATUS_FUNCTION_DEFAULT; + }else{ + this.status = status; + } + outArrayList.add(this); + out[paramID]=this; + } + + private void setDefault() { + set(defaultValue); + } + + public double get(){ + return bParamsAreFloats[hatchNo]?Float.intBitsToFloat(iParamsOut[id]):iParamsOut[id]; + } + + public void set(double value){ + if(bParamsAreFloats[hatchNo]) { + iParamsOut[id]=Float.floatToIntBits((float) value); + }else{ + iParamsOut[id]=(int)value; + } + } + + public LedStatus getStatus(){ + return eParamsOutStatus[id]; + } + + public void updateStatus(){ + eParamsOutStatus[id]=status.get(); + } + + public LedStatus getStaus(boolean update){ + if(update){ + updateStatus(); + } + return eParamsOutStatus[id]; + } + } + + /** + * Make a field out of this... + */ + public class In { + public final int id; + public final double defaultValue; + private final Supplier status; + + public In(int paramID, double defaultValue,Supplier status){ + this.id=hatchNo+10*paramID; + if(paramID<0 || paramID>2){ + throw new IllegalArgumentException("Parameter id must be in 0 to 1 range"); + } + this.defaultValue=defaultValue; + if(in[paramID]!=null){ + throw new InstantiationError("This parameter already exists!"); + } + if(status ==null){ + this.status =LED_STATUS_FUNCTION_DEFAULT; + }else{ + this.status = status; + } + inArrayList.add(this); + in[paramID]=this; + } + + private void setDefault() { + if(bParamsAreFloats[hatchNo]) { + iParamsIn[id]=Float.floatToIntBits((float) defaultValue); + }else{ + iParamsIn[id]=(int)defaultValue; + } + } + + public double get(){ + return bParamsAreFloats[hatchNo]?Float.intBitsToFloat(iParamsIn[id]):iParamsIn[id]; + } + + public void updateStatus(){ + eParamsInStatus[id]=status.get(); + } + + public LedStatus getStaus(boolean update){ + if(update){ + updateStatus(); + } + return eParamsInStatus[id]; + } + } + } +} + diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java index ad10d70cbf..93c8f69587 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java @@ -376,6 +376,10 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa public static abstract class Behaviour { public Behaviour(){} + public abstract void setOnMachine(){ + + } + /** * handle parameters pre recipe, and cyclically * this shouldn't write to input parameters! only to the provided array and/or output parameters -- cgit From d1b16ceea346e546ae7bec574230bdf03c2a4172 Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 16 Feb 2019 15:16:44 +0100 Subject: Collider uses new impl of parameters --- .../dreamcraft/DreamCraftRecipeLoader.java | 2 +- .../GT_MetaTileEntity_EM_essentiaDequantizer.java | 2 +- .../GT_MetaTileEntity_EM_essentiaQuantizer.java | 2 +- .../tectech/loader/thing/MachineLoader.java | 148 ++++++++++----------- .../thing/item/ConstructableTriggerItem.java | 2 +- .../tectech/thing/item/ParametrizerMemoryCard.java | 2 +- .../hatch/GT_MetaTileEntity_Hatch_Capacitor.java | 2 +- ...GT_MetaTileEntity_Hatch_ElementalContainer.java | 2 +- .../hatch/GT_MetaTileEntity_Hatch_Holder.java | 2 +- .../multi/GT_MetaTileEntity_EM_collider.java | 48 +++++-- .../multi/GT_MetaTileEntity_EM_dequantizer.java | 2 +- .../multi/GT_MetaTileEntity_EM_quantizer.java | 2 +- .../multi/GT_MetaTileEntity_EM_research.java | 6 +- .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 14 +- .../metaTileEntity/multi/base/Parameters.java | 49 ++++--- .../em_machine/GT_MetaTileEntity_EM_machine.java | 25 +--- 16 files changed, 173 insertions(+), 137 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java index a70f85d62d..a735213915 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java @@ -716,7 +716,7 @@ public class DreamCraftRecipeLoader implements Runnable { Materials.SolderingAlloy.getMolten(9216)}, ItemList.Field_Generator_UEV.get(1L), 4000, 800000); - //UHV Energy ParameterDefinition + //UHV Energy ParameterGroup TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Hatch_Energy_UV.get(1L), 24000, 16, 50000, 2, new Object[]{ ItemList.Hull_MAX.get(1L), diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java index 9e6f3f3c77..6a9ef392cd 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java @@ -52,7 +52,7 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_ private static final String[] description = new String[]{ EnumChatFormatting.AQUA+"Hint Details:", "1 - Classic Hatches or High Power Casing", - "2 - Elemental Input ParameterDefinition", + "2 - Elemental Input ParameterGroup", "3 - Elemental Overflow Hatches or Elemental Casing", "General - Some sort of Essentia Storage", }; diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java index d97c28a2be..0fbf3aaa13 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java @@ -52,7 +52,7 @@ public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_Mu private static final String[] description = new String[]{ EnumChatFormatting.AQUA+"Hint Details:", "1 - Classic Hatches or High Power Casing", - "2 - Elemental Output ParameterDefinition", + "2 - Elemental Output ParameterGroup", "3 - Elemental Overflow Hatches or Elemental Casing", "General - Some sort of Essentia Storage", }; diff --git a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java index deca78bf6e..0e65aa0b12 100644 --- a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java @@ -26,133 +26,133 @@ public class MachineLoader implements Runnable { // =================================================================================================== eM_in_UV.set(new GT_MetaTileEntity_Hatch_InputElemental( - 15000, "hatch.emin.tier.08", "UV Elemental Input ParameterDefinition", 8).getStackForm(1L)); + 15000, "hatch.emin.tier.08", "UV Elemental Input ParameterGroup", 8).getStackForm(1L)); eM_in_UHV.set(new GT_MetaTileEntity_Hatch_InputElemental( - 15001, "hatch.emin.tier.09", "UHV Elemental Input ParameterDefinition", 9).getStackForm(1L)); + 15001, "hatch.emin.tier.09", "UHV Elemental Input ParameterGroup", 9).getStackForm(1L)); eM_in_UEV.set(new GT_MetaTileEntity_Hatch_InputElemental( - 15002, "hatch.emin.tier.10", "UEV Elemental Input ParameterDefinition", 10).getStackForm(1L)); + 15002, "hatch.emin.tier.10", "UEV Elemental Input ParameterGroup", 10).getStackForm(1L)); eM_in_UIV.set(new GT_MetaTileEntity_Hatch_InputElemental( - 15003, "hatch.emin.tier.11", "UIV Elemental Input ParameterDefinition", 11).getStackForm(1L)); + 15003, "hatch.emin.tier.11", "UIV Elemental Input ParameterGroup", 11).getStackForm(1L)); eM_in_UMV.set(new GT_MetaTileEntity_Hatch_InputElemental( - 15004, "hatch.emin.tier.12", "UMV Elemental Input ParameterDefinition", 12).getStackForm(1L)); + 15004, "hatch.emin.tier.12", "UMV Elemental Input ParameterGroup", 12).getStackForm(1L)); eM_in_UXV.set(new GT_MetaTileEntity_Hatch_InputElemental( - 15005, "hatch.emin.tier.13", "UXV Elemental Input ParameterDefinition", 13).getStackForm(1L)); + 15005, "hatch.emin.tier.13", "UXV Elemental Input ParameterGroup", 13).getStackForm(1L)); // =================================================================================================== // eM OUT // =================================================================================================== eM_out_UV.set(new GT_MetaTileEntity_Hatch_OutputElemental( - 15010, "hatch.emout.tier.08", "UV Elemental Output ParameterDefinition", 8).getStackForm(1L)); + 15010, "hatch.emout.tier.08", "UV Elemental Output ParameterGroup", 8).getStackForm(1L)); eM_out_UHV.set(new GT_MetaTileEntity_Hatch_OutputElemental( - 15011, "hatch.emout.tier.09", "UHV Elemental Output ParameterDefinition", 9).getStackForm(1L)); + 15011, "hatch.emout.tier.09", "UHV Elemental Output ParameterGroup", 9).getStackForm(1L)); eM_out_UEV.set(new GT_MetaTileEntity_Hatch_OutputElemental( - 15012, "hatch.emout.tier.10", "UEV Elemental Output ParameterDefinition", 10).getStackForm(1L)); + 15012, "hatch.emout.tier.10", "UEV Elemental Output ParameterGroup", 10).getStackForm(1L)); eM_out_UIV.set(new GT_MetaTileEntity_Hatch_OutputElemental( - 15013, "hatch.emout.tier.11", "UIV Elemental Output ParameterDefinition", 11).getStackForm(1L)); + 15013, "hatch.emout.tier.11", "UIV Elemental Output ParameterGroup", 11).getStackForm(1L)); eM_out_UMV.set(new GT_MetaTileEntity_Hatch_OutputElemental( - 15014, "hatch.emout.tier.12", "UMV Elemental Output ParameterDefinition", 12).getStackForm(1L)); + 15014, "hatch.emout.tier.12", "UMV Elemental Output ParameterGroup", 12).getStackForm(1L)); eM_out_UXV.set(new GT_MetaTileEntity_Hatch_OutputElemental( - 15015, "hatch.emout.tier.13", "UXV Elemental Output ParameterDefinition", 13).getStackForm(1L)); + 15015, "hatch.emout.tier.13", "UXV Elemental Output ParameterGroup", 13).getStackForm(1L)); // =================================================================================================== // eM Waste OUT // =================================================================================================== eM_muffler_UV.set(new GT_MetaTileEntity_Hatch_OverflowElemental( - 15020, "hatch.emmuffler.tier.08", "UV Overflow Output ParameterDefinition", 8, 1e10f).getStackForm(1L)); + 15020, "hatch.emmuffler.tier.08", "UV Overflow Output ParameterGroup", 8, 1e10f).getStackForm(1L)); eM_muffler_UHV.set(new GT_MetaTileEntity_Hatch_OverflowElemental( - 15021, "hatch.emmuffler.tier.09", "UHV Overflow Output ParameterDefinition", 9, 5e10f).getStackForm(1L)); + 15021, "hatch.emmuffler.tier.09", "UHV Overflow Output ParameterGroup", 9, 5e10f).getStackForm(1L)); eM_muffler_UEV.set(new GT_MetaTileEntity_Hatch_OverflowElemental( - 15022, "hatch.emmuffler.tier.10", "UEV Overflow Output ParameterDefinition", 10, 25e10f).getStackForm(1L)); + 15022, "hatch.emmuffler.tier.10", "UEV Overflow Output ParameterGroup", 10, 25e10f).getStackForm(1L)); eM_muffler_UIV.set(new GT_MetaTileEntity_Hatch_OverflowElemental( - 15023, "hatch.emmuffler.tier.11", "UIV Overflow Output ParameterDefinition", 11, 125e10f).getStackForm(1L)); + 15023, "hatch.emmuffler.tier.11", "UIV Overflow Output ParameterGroup", 11, 125e10f).getStackForm(1L)); eM_muffler_UMV.set(new GT_MetaTileEntity_Hatch_OverflowElemental( - 15024, "hatch.emmuffler.tier.12", "UMV Overflow Output ParameterDefinition", 12, 125e11f).getStackForm(1L)); + 15024, "hatch.emmuffler.tier.12", "UMV Overflow Output ParameterGroup", 12, 125e11f).getStackForm(1L)); eM_muffler_UXV.set(new GT_MetaTileEntity_Hatch_OverflowElemental( - 15025, "hatch.emmuffler.tier.13", "UXV Overflow Output ParameterDefinition", 13, 125e12f).getStackForm(1L)); + 15025, "hatch.emmuffler.tier.13", "UXV Overflow Output ParameterGroup", 13, 125e12f).getStackForm(1L)); // =================================================================================================== // Multi AMP Power INPUTS // =================================================================================================== eM_energymulti4_IV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15100, "hatch.energymulti04.tier.05", "IV 4A Energy ParameterDefinition", 5, 4).getStackForm(1L)); + 15100, "hatch.energymulti04.tier.05", "IV 4A Energy ParameterGroup", 5, 4).getStackForm(1L)); eM_energymulti16_IV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15110, "hatch.energymulti16.tier.05", "IV 16A Energy ParameterDefinition", 5, 16).getStackForm(1L)); + 15110, "hatch.energymulti16.tier.05", "IV 16A Energy ParameterGroup", 5, 16).getStackForm(1L)); eM_energymulti64_IV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15120, "hatch.energymulti64.tier.05", "IV 64A Energy ParameterDefinition", 5, 64).getStackForm(1L)); + 15120, "hatch.energymulti64.tier.05", "IV 64A Energy ParameterGroup", 5, 64).getStackForm(1L)); eM_energymulti4_LuV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15101, "hatch.energymulti04.tier.06", "LuV 4A Energy ParameterDefinition", 6, 4).getStackForm(1L)); + 15101, "hatch.energymulti04.tier.06", "LuV 4A Energy ParameterGroup", 6, 4).getStackForm(1L)); eM_energymulti16_LuV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15111, "hatch.energymulti16.tier.06", "LuV 16A Energy ParameterDefinition", 6, 16).getStackForm(1L)); + 15111, "hatch.energymulti16.tier.06", "LuV 16A Energy ParameterGroup", 6, 16).getStackForm(1L)); eM_energymulti64_LuV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15121, "hatch.energymulti64.tier.06", "LuV 64A Energy ParameterDefinition", 6, 64).getStackForm(1L)); + 15121, "hatch.energymulti64.tier.06", "LuV 64A Energy ParameterGroup", 6, 64).getStackForm(1L)); eM_energymulti4_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15102, "hatch.energymulti04.tier.07", "ZPM 4A Energy ParameterDefinition", 7, 4).getStackForm(1L)); + 15102, "hatch.energymulti04.tier.07", "ZPM 4A Energy ParameterGroup", 7, 4).getStackForm(1L)); eM_energymulti16_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15112, "hatch.energymulti16.tier.07", "ZPM 16A Energy ParameterDefinition", 7, 16).getStackForm(1L)); + 15112, "hatch.energymulti16.tier.07", "ZPM 16A Energy ParameterGroup", 7, 16).getStackForm(1L)); eM_energymulti64_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15122, "hatch.energymulti64.tier.07", "ZPM 64A Energy ParameterDefinition", 7, 64).getStackForm(1L)); + 15122, "hatch.energymulti64.tier.07", "ZPM 64A Energy ParameterGroup", 7, 64).getStackForm(1L)); eM_energymulti4_UV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15103, "hatch.energymulti04.tier.08", "UV 4A Energy ParameterDefinition", 8, 4).getStackForm(1L)); + 15103, "hatch.energymulti04.tier.08", "UV 4A Energy ParameterGroup", 8, 4).getStackForm(1L)); eM_energymulti16_UV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15113, "hatch.energymulti16.tier.08", "UV 16A Energy ParameterDefinition", 8, 16).getStackForm(1L)); + 15113, "hatch.energymulti16.tier.08", "UV 16A Energy ParameterGroup", 8, 16).getStackForm(1L)); eM_energymulti64_UV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15123, "hatch.energymulti64.tier.08", "UV 64A Energy ParameterDefinition", 8, 64).getStackForm(1L)); + 15123, "hatch.energymulti64.tier.08", "UV 64A Energy ParameterGroup", 8, 64).getStackForm(1L)); eM_energymulti4_UHV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15104, "hatch.energymulti04.tier.09", "UHV 4A Energy ParameterDefinition", 9, 4).getStackForm(1L)); + 15104, "hatch.energymulti04.tier.09", "UHV 4A Energy ParameterGroup", 9, 4).getStackForm(1L)); eM_energymulti16_UHV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15114, "hatch.energymulti16.tier.09", "UHV 16A Energy ParameterDefinition", 9, 16).getStackForm(1L)); + 15114, "hatch.energymulti16.tier.09", "UHV 16A Energy ParameterGroup", 9, 16).getStackForm(1L)); eM_energymulti64_UHV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15124, "hatch.energymulti64.tier.09", "UHV 64A Energy ParameterDefinition", 9, 64).getStackForm(1L)); + 15124, "hatch.energymulti64.tier.09", "UHV 64A Energy ParameterGroup", 9, 64).getStackForm(1L)); eM_energymulti4_UEV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15105, "hatch.energymulti04.tier.10", "UEV 4A Energy ParameterDefinition", 10, 4).getStackForm(1L)); + 15105, "hatch.energymulti04.tier.10", "UEV 4A Energy ParameterGroup", 10, 4).getStackForm(1L)); eM_energymulti16_UEV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15115, "hatch.energymulti16.tier.10", "UEV 16A Energy ParameterDefinition", 10, 16).getStackForm(1L)); + 15115, "hatch.energymulti16.tier.10", "UEV 16A Energy ParameterGroup", 10, 16).getStackForm(1L)); eM_energymulti64_UEV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15125, "hatch.energymulti64.tier.10", "UEV 64A Energy ParameterDefinition", 10, 64).getStackForm(1L)); + 15125, "hatch.energymulti64.tier.10", "UEV 64A Energy ParameterGroup", 10, 64).getStackForm(1L)); eM_energymulti4_UIV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15106, "hatch.energymulti04.tier.11", "UIV 4A Energy ParameterDefinition", 11, 4).getStackForm(1L)); + 15106, "hatch.energymulti04.tier.11", "UIV 4A Energy ParameterGroup", 11, 4).getStackForm(1L)); eM_energymulti16_UIV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15116, "hatch.energymulti16.tier.11", "UIV 16A Energy ParameterDefinition", 11, 16).getStackForm(1L)); + 15116, "hatch.energymulti16.tier.11", "UIV 16A Energy ParameterGroup", 11, 16).getStackForm(1L)); eM_energymulti64_UIV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15126, "hatch.energymulti64.tier.11", "UIV 64A Energy ParameterDefinition", 11, 64).getStackForm(1L)); + 15126, "hatch.energymulti64.tier.11", "UIV 64A Energy ParameterGroup", 11, 64).getStackForm(1L)); eM_energymulti4_UMV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15107, "hatch.energymulti04.tier.12", "UMV 4A Energy ParameterDefinition", 12, 4).getStackForm(1L)); + 15107, "hatch.energymulti04.tier.12", "UMV 4A Energy ParameterGroup", 12, 4).getStackForm(1L)); eM_energymulti16_UMV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15117, "hatch.energymulti16.tier.12", "UMV 16A Energy ParameterDefinition", 12, 16).getStackForm(1L)); + 15117, "hatch.energymulti16.tier.12", "UMV 16A Energy ParameterGroup", 12, 16).getStackForm(1L)); eM_energymulti64_UMV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15127, "hatch.energymulti64.tier.12", "UMV 64A Energy ParameterDefinition", 12, 64).getStackForm(1L)); + 15127, "hatch.energymulti64.tier.12", "UMV 64A Energy ParameterGroup", 12, 64).getStackForm(1L)); eM_energymulti4_UXV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15108, "hatch.energymulti04.tier.13", "UXV 4A Energy ParameterDefinition", 13, 4).getStackForm(1L)); + 15108, "hatch.energymulti04.tier.13", "UXV 4A Energy ParameterGroup", 13, 4).getStackForm(1L)); eM_energymulti16_UXV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15118, "hatch.energymulti16.tier.13", "UXV 16A Energy ParameterDefinition", 13, 16).getStackForm(1L)); + 15118, "hatch.energymulti16.tier.13", "UXV 16A Energy ParameterGroup", 13, 16).getStackForm(1L)); eM_energymulti64_UXV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15128, "hatch.energymulti64.tier.13", "UXV 64A Energy ParameterDefinition", 13, 64).getStackForm(1L)); + 15128, "hatch.energymulti64.tier.13", "UXV 64A Energy ParameterGroup", 13, 64).getStackForm(1L)); // =================================================================================================== // Multi AMP Power OUTPUTS @@ -160,67 +160,67 @@ public class MachineLoader implements Runnable { eM_dynamomulti4_IV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15200, "hatch.dynamomulti04.tier.05", "IV 4A Dynamo ParameterDefinition", 5, 4).getStackForm(1L)); + 15200, "hatch.dynamomulti04.tier.05", "IV 4A Dynamo ParameterGroup", 5, 4).getStackForm(1L)); eM_dynamomulti16_IV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15210, "hatch.dynamomulti16.tier.05", "IV 16A Dynamo ParameterDefinition", 5, 16).getStackForm(1L)); + 15210, "hatch.dynamomulti16.tier.05", "IV 16A Dynamo ParameterGroup", 5, 16).getStackForm(1L)); eM_dynamomulti64_IV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15220, "hatch.dynamomulti64.tier.05", "IV 64A Dynamo ParameterDefinition", 5, 64).getStackForm(1L)); + 15220, "hatch.dynamomulti64.tier.05", "IV 64A Dynamo ParameterGroup", 5, 64).getStackForm(1L)); eM_dynamomulti4_LuV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15201, "hatch.dynamomulti04.tier.06", "LuV 4A Dynamo ParameterDefinition", 6, 4).getStackForm(1L)); + 15201, "hatch.dynamomulti04.tier.06", "LuV 4A Dynamo ParameterGroup", 6, 4).getStackForm(1L)); eM_dynamomulti16_LuV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15211, "hatch.dynamomulti16.tier.06", "LuV 16A Dynamo ParameterDefinition", 6, 16).getStackForm(1L)); + 15211, "hatch.dynamomulti16.tier.06", "LuV 16A Dynamo ParameterGroup", 6, 16).getStackForm(1L)); eM_dynamomulti64_LuV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15221, "hatch.dynamomulti64.tier.06", "LuV 64A Dynamo ParameterDefinition", 6, 64).getStackForm(1L)); + 15221, "hatch.dynamomulti64.tier.06", "LuV 64A Dynamo ParameterGroup", 6, 64).getStackForm(1L)); eM_dynamomulti4_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15202, "hatch.dynamomulti04.tier.07", "ZPM 4A Dynamo ParameterDefinition", 7, 4).getStackForm(1L)); + 15202, "hatch.dynamomulti04.tier.07", "ZPM 4A Dynamo ParameterGroup", 7, 4).getStackForm(1L)); eM_dynamomulti16_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15212, "hatch.dynamomulti16.tier.07", "ZPM 16A Dynamo ParameterDefinition", 7, 16).getStackForm(1L)); + 15212, "hatch.dynamomulti16.tier.07", "ZPM 16A Dynamo ParameterGroup", 7, 16).getStackForm(1L)); eM_dynamomulti64_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15222, "hatch.dynamomulti64.tier.07", "ZPM 64A Dynamo ParameterDefinition", 7, 64).getStackForm(1L)); + 15222, "hatch.dynamomulti64.tier.07", "ZPM 64A Dynamo ParameterGroup", 7, 64).getStackForm(1L)); eM_dynamomulti4_UV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15203, "hatch.dynamomulti04.tier.08", "UV 4A Dynamo ParameterDefinition", 8, 4).getStackForm(1L)); + 15203, "hatch.dynamomulti04.tier.08", "UV 4A Dynamo ParameterGroup", 8, 4).getStackForm(1L)); eM_dynamomulti16_UV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15213, "hatch.dynamomulti16.tier.08", "UV 16A Dynamo ParameterDefinition", 8, 16).getStackForm(1L)); + 15213, "hatch.dynamomulti16.tier.08", "UV 16A Dynamo ParameterGroup", 8, 16).getStackForm(1L)); eM_dynamomulti64_UV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15223, "hatch.dynamomulti64.tier.08", "UV 64A Dynamo ParameterDefinition", 8, 64).getStackForm(1L)); + 15223, "hatch.dynamomulti64.tier.08", "UV 64A Dynamo ParameterGroup", 8, 64).getStackForm(1L)); eM_dynamomulti4_UHV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15204, "hatch.dynamomulti04.tier.09", "UHV 4A Dynamo ParameterDefinition", 9, 4).getStackForm(1L)); + 15204, "hatch.dynamomulti04.tier.09", "UHV 4A Dynamo ParameterGroup", 9, 4).getStackForm(1L)); eM_dynamomulti16_UHV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15214, "hatch.dynamomulti16.tier.09", "UHV 16A Dynamo ParameterDefinition", 9, 16).getStackForm(1L)); + 15214, "hatch.dynamomulti16.tier.09", "UHV 16A Dynamo ParameterGroup", 9, 16).getStackForm(1L)); eM_dynamomulti64_UHV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15224, "hatch.dynamomulti64.tier.09", "UHV 64A Dynamo ParameterDefinition", 9, 64).getStackForm(1L)); + 15224, "hatch.dynamomulti64.tier.09", "UHV 64A Dynamo ParameterGroup", 9, 64).getStackForm(1L)); eM_dynamomulti4_UEV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15205, "hatch.dynamomulti04.tier.10", "UEV 4A Dynamo ParameterDefinition", 10, 4).getStackForm(1L)); + 15205, "hatch.dynamomulti04.tier.10", "UEV 4A Dynamo ParameterGroup", 10, 4).getStackForm(1L)); eM_dynamomulti16_UEV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15215, "hatch.dynamomulti16.tier.10", "UEV 16A Dynamo ParameterDefinition", 10, 16).getStackForm(1L)); + 15215, "hatch.dynamomulti16.tier.10", "UEV 16A Dynamo ParameterGroup", 10, 16).getStackForm(1L)); eM_dynamomulti64_UEV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15225, "hatch.dynamomulti64.tier.10", "UEV 64A Dynamo ParameterDefinition", 10, 64).getStackForm(1L)); + 15225, "hatch.dynamomulti64.tier.10", "UEV 64A Dynamo ParameterGroup", 10, 64).getStackForm(1L)); eM_dynamomulti4_UIV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15206, "hatch.dynamomulti04.tier.11", "UIV 4A Dynamo ParameterDefinition", 11, 4).getStackForm(1L)); + 15206, "hatch.dynamomulti04.tier.11", "UIV 4A Dynamo ParameterGroup", 11, 4).getStackForm(1L)); eM_dynamomulti16_UIV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15216, "hatch.dynamomulti16.tier.11", "UIV 16A Dynamo ParameterDefinition", 11, 16).getStackForm(1L)); + 15216, "hatch.dynamomulti16.tier.11", "UIV 16A Dynamo ParameterGroup", 11, 16).getStackForm(1L)); eM_dynamomulti64_UIV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15226, "hatch.dynamomulti64.tier.11", "UIV 64A Dynamo ParameterDefinition", 11, 64).getStackForm(1L)); + 15226, "hatch.dynamomulti64.tier.11", "UIV 64A Dynamo ParameterGroup", 11, 64).getStackForm(1L)); eM_dynamomulti4_UMV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15207, "hatch.dynamomulti04.tier.12", "UMV 4A Dynamo ParameterDefinition", 12, 4).getStackForm(1L)); + 15207, "hatch.dynamomulti04.tier.12", "UMV 4A Dynamo ParameterGroup", 12, 4).getStackForm(1L)); eM_dynamomulti16_UMV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15217, "hatch.dynamomulti16.tier.12", "UMV 16A Dynamo ParameterDefinition", 12, 16).getStackForm(1L)); + 15217, "hatch.dynamomulti16.tier.12", "UMV 16A Dynamo ParameterGroup", 12, 16).getStackForm(1L)); eM_dynamomulti64_UMV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15227, "hatch.dynamomulti64.tier.12", "UMV 64A Dynamo ParameterDefinition", 12, 64).getStackForm(1L)); + 15227, "hatch.dynamomulti64.tier.12", "UMV 64A Dynamo ParameterGroup", 12, 64).getStackForm(1L)); eM_dynamomulti4_UXV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15208, "hatch.dynamomulti04.tier.13", "UXV 4A Dynamo ParameterDefinition", 13, 4).getStackForm(1L)); + 15208, "hatch.dynamomulti04.tier.13", "UXV 4A Dynamo ParameterGroup", 13, 4).getStackForm(1L)); eM_dynamomulti16_UXV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15218, "hatch.dynamomulti16.tier.13", "UXV 16A Dynamo ParameterDefinition", 13, 16).getStackForm(1L)); + 15218, "hatch.dynamomulti16.tier.13", "UXV 16A Dynamo ParameterGroup", 13, 16).getStackForm(1L)); eM_dynamomulti64_UXV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15228, "hatch.dynamomulti64.tier.13", "UXV 64A Dynamo ParameterDefinition", 13, 64).getStackForm(1L)); + 15228, "hatch.dynamomulti64.tier.13", "UXV 64A Dynamo ParameterGroup", 13, 64).getStackForm(1L)); // =================================================================================================== // MULTIBLOCKS @@ -279,7 +279,7 @@ public class MachineLoader implements Runnable { rack_Hatch.set(new GT_MetaTileEntity_Hatch_Rack(15450, "hatch.rack.tier.08", "Computer Rack", 8, "4 Slot Rack").getStackForm(1L)); holder_Hatch.set(new GT_MetaTileEntity_Hatch_Holder(15451, "hatch.holder.tier.09", "Object Holder", 8, "For Research Station").getStackForm(1L)); - capacitor_Hatch.set(new GT_MetaTileEntity_Hatch_Capacitor(15452, "hatch.capacitor.tier.05", "Capacitor ParameterDefinition", 5, "For Tesla Coil").getStackForm(1L)); + capacitor_Hatch.set(new GT_MetaTileEntity_Hatch_Capacitor(15452, "hatch.capacitor.tier.05", "Capacitor ParameterGroup", 5, "For Tesla Coil").getStackForm(1L)); // =================================================================================================== // Pipes @@ -309,7 +309,7 @@ public class MachineLoader implements Runnable { // =================================================================================================== // Debug Stuff // =================================================================================================== - hatch_CreativeMaitenance.set(new GT_MetaTileEntity_Hatch_CreativeMaintenance(15497, "debug.tt.maintenance", "Debug Maintenance ParameterDefinition", 15).getStackForm(1L)); + hatch_CreativeMaitenance.set(new GT_MetaTileEntity_Hatch_CreativeMaintenance(15497, "debug.tt.maintenance", "Debug Maintenance ParameterGroup", 15).getStackForm(1L)); Machine_DebugGenny.set(new GT_MetaTileEntity_DebugPowerGenerator(15498, "debug.tt.genny", "Debug Power Generator", 15).getStackForm(1L)); Machine_DebugWriter.set(new GT_MetaTileEntity_DebugStructureWriter(15499, "debug.tt.writer", "Debug Structure Writer", 15).getStackForm(1L)); diff --git a/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java b/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java index 667f1a45d5..cf4b4d2978 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java @@ -133,7 +133,7 @@ public final class ConstructableTriggerItem extends Item { private final String[] desc=new String[]{ EnumChatFormatting.AQUA+"Hint Details:", "1 - Classic Hatches or Heat Proof Casing", - "2 - Muffler ParameterDefinition", + "2 - Muffler ParameterGroup", "3 - Coil blocks" }; //endregion diff --git a/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java b/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java index bc6d8cf3c6..25eb3ec939 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java @@ -127,7 +127,7 @@ public final class ParametrizerMemoryCard extends Item { int temp; if(tNBT!=null && tNBT.hasKey("param")) { - aList.add("ParameterDefinition ID: "+EnumChatFormatting.AQUA + tNBT.getInteger("param")); + aList.add("ParameterGroup ID: "+EnumChatFormatting.AQUA + tNBT.getInteger("param")); temp=tNBT.getInteger("value0i"); aList.add("Value 0|I: "+EnumChatFormatting.AQUA + temp); aList.add("Value 0|F: "+EnumChatFormatting.AQUA + Float.intBitsToFloat(temp)); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Capacitor.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Capacitor.java index ca8fb59f74..560a57cd54 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Capacitor.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Capacitor.java @@ -94,7 +94,7 @@ public class GT_MetaTileEntity_Hatch_Capacitor extends GT_MetaTileEntity_Hatch { @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_Capacitor(aPlayerInventory, aBaseMetaTileEntity, "Capacitor ParameterDefinition"); + return new GT_GUIContainer_Capacitor(aPlayerInventory, aBaseMetaTileEntity, "Capacitor ParameterGroup"); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java index e97ffaa670..63bd262a75 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java @@ -259,7 +259,7 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta mDescription, "Max stacks amount: " + EnumChatFormatting.AQUA + getMaxStacksCount(), "Stack capacity: " + EnumChatFormatting.AQUA + getMaxStackSize(), - "Place Overflow ParameterDefinition behind,on top or below", + "Place Overflow ParameterGroup behind,on top or below", "to provide overflow protection while this block", "is not attached to multi block.", "Transport range can be extended in straight", diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java index cd3ad8d573..0850bf859a 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java @@ -94,7 +94,7 @@ public class GT_MetaTileEntity_Hatch_Holder extends GT_MetaTileEntity_Hatch { @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_Holder(aPlayerInventory, aBaseMetaTileEntity, "Holder ParameterDefinition"); + return new GT_GUIContainer_Holder(aPlayerInventory, aBaseMetaTileEntity, "Holder ParameterGroup"); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java index 69bebb4a78..0ec2196a82 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java @@ -16,6 +16,8 @@ import com.github.technus.tectech.thing.casing.TT_Container_Casings; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -51,8 +53,6 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB private static double MASS_TO_EU_PARTIAL,MASS_TO_EU_INSTANT; private static int STARTUP_COST,KEEPUP_COST; - private long plasmaEnergy; - public static void setValues(int heliumPlasmaValue){ MASS_TO_EU_PARTIAL = heliumPlasmaValue / 1.75893000478707E07;//mass diff MASS_TO_EU_INSTANT = MASS_TO_EU_PARTIAL * 20; @@ -267,6 +267,8 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB protected byte eTier = 0; protected cElementalInstanceStack stack; + private long plasmaEnergy; + public Parameters.ParameterGroup.In mode; protected static final byte FUSE_MODE=0, COLLIDE_MODE =1; protected boolean started=false; @@ -328,6 +330,35 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB super(aName); } + @Override + protected void parametersInstantiation_EM() { + Parameters.ParameterGroup group=parametrization.makeGroup(0,false); + mode=group.makeInParameter(0,FUSE_MODE,()->{ + if(isMaster()){ + if(mode.get()==FUSE_MODE){ + return "Mode: Fuse"; + }else if(mode.get()==COLLIDE_MODE){ + return "Mode: Collide"; + } + return "Mode: Undefined"; + } + return "Currently Slaves..."; + },()->{ + if(isMaster()){ + if (mode.get() == FUSE_MODE || mode.get() == COLLIDE_MODE) { + return STATUS_OK; + } else if (mode.get() > 1) { + return STATUS_TOO_HIGH; + } else if (mode.get() < 0) { + return STATUS_TOO_LOW; + }else{ + return STATUS_WRONG; + } + } + return STATUS_UNUSED; + }); + } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_EM_collider(mName); @@ -441,16 +472,7 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB @Override public void parametersOutAndStatusesWrite_EM(boolean machineBusy) { if(isMaster()) { - double mode = getParameterIn(0, 0); - if (mode == FUSE_MODE || mode == COLLIDE_MODE) { - setStatusOfParameterIn(0, 0, STATUS_OK); - } else if (mode > 1) { - setStatusOfParameterIn(0, 0, STATUS_TOO_HIGH); - } else if (mode < 0) { - setStatusOfParameterIn(0, 0, STATUS_TOO_LOW); - }else{ - setStatusOfParameterIn(0,0,STATUS_WRONG); - } + super.parametersOutAndStatusesWrite_EM(machineBusy); } } @@ -600,7 +622,7 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB return; } if (isMaster()) { - switch (getParameterInInt(0,0)){ + switch ((int)mode.get()){ case FUSE_MODE: makeEU(fuse(partner)); break; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java index 346e851345..8c0a0f0708 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java @@ -53,7 +53,7 @@ public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_Multiblo private static final String[] description = new String[]{ EnumChatFormatting.AQUA + "Hint Details:", "1 - Classic Hatches or High Power Casing", - "2 - Elemental Input ParameterDefinition", + "2 - Elemental Input ParameterGroup", "3 - Elemental Overflow Hatches or Molecular Casing", }; //endregion diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java index 5733bfb458..1494d97e34 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java @@ -59,7 +59,7 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock private static final String[] description = new String[]{ EnumChatFormatting.AQUA+"Hint Details:", "1 - Classic Hatches or High Power Casing", - "2 - Elemental Output ParameterDefinition", + "2 - Elemental Output ParameterGroup", "3 - Elemental Overflow Hatches or Molecular Casing", }; //endregion diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java index edc9c11a56..b4b786dcdb 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java @@ -73,7 +73,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB private static final String[] description = new String[]{ EnumChatFormatting.AQUA+"Hint Details:", "1 - Classic/Data Hatches or Computer casing", - "2 - Holder ParameterDefinition", + "2 - Holder ParameterGroup", }; //endregion @@ -286,7 +286,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB } for (int i = 0; i < tRecipe.mFluidInputs.length; i++) { if (tRecipe.mFluidInputs[i] != null) { - tNBTList.appendTag(new NBTTagString("Input ParameterDefinition " + (i + 1) + ": " + tRecipe.mFluidInputs[i].amount + "L " + GT_LanguageManager.getTranslation(tRecipe.mFluidInputs[i].getLocalizedName()))); + tNBTList.appendTag(new NBTTagString("Input ParameterGroup " + (i + 1) + ": " + tRecipe.mFluidInputs[i].amount + "L " + GT_LanguageManager.getTranslation(tRecipe.mFluidInputs[i].getLocalizedName()))); } } tNBT.setTag("pages", tNBTList); @@ -382,7 +382,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB s = tRecipe.mFluidInputs[i].getLocalizedName(); } } - tNBTList.appendTag(new NBTTagString("Input ParameterDefinition "+(i+1)+": "+tRecipe.mFluidInputs[i].amount+"L "+s)); + tNBTList.appendTag(new NBTTagString("Input ParameterGroup "+(i+1)+": "+tRecipe.mFluidInputs[i].amount+"L "+s)); } } tNBT.setTag("pages", tNBTList); 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 07fde1050a..82da3a5ba2 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 @@ -453,6 +453,11 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt EnumChatFormatting.AQUA+paramID + EnumChatFormatting.YELLOW+ ":"+ EnumChatFormatting.AQUA+"I"); + try{ + list.add(parametrization.parameterGroups[hatchNo].in[paramID].name.get()); + }catch (NullPointerException e){ + list.add("Unused"); + } return list; } @@ -470,6 +475,11 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt EnumChatFormatting.AQUA+paramID + EnumChatFormatting.YELLOW+ ":"+ EnumChatFormatting.AQUA+"O"); + try{ + list.add(parametrization.parameterGroups[hatchNo].out[paramID].name.get()); + }catch (NullPointerException e){ + list.add("Unused"); + } return list; } @@ -730,13 +740,13 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt */ public void parametersOutAndStatusesWrite_EM(boolean machineBusy) { if(!machineBusy){ - for (Parameters.ParameterDefinition.In in : parametrization.inArrayList) { + for (Parameters.ParameterGroup.In in : parametrization.inArrayList) { if (in != null) { in.updateStatus(); } } } - for (Parameters.ParameterDefinition.Out out : parametrization.outArrayList) { + for (Parameters.ParameterGroup.Out out : parametrization.outArrayList) { if (out != null) { out.updateStatus(); } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java index 3bd769f14f..824588ab25 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java @@ -9,12 +9,13 @@ import java.util.function.Supplier; public class Parameters { private static final Supplier LED_STATUS_FUNCTION_DEFAULT = ()->LedStatus.STATUS_UNDEFINED; private static final int ZERO_FLOAT=Float.floatToIntBits(0); - private final ParameterDefinition[] parameterDefinitions =new ParameterDefinition[10]; + + final ParameterGroup[] parameterGroups =new ParameterGroup[10]; final int[] iParamsIn = new int[20];//number I from parametrizers final int[] iParamsOut = new int[20];//number O to parametrizers - final ArrayList inArrayList=new ArrayList<>(); - final ArrayList outArrayList=new ArrayList<>(); + final ArrayList inArrayList=new ArrayList<>(); + final ArrayList outArrayList=new ArrayList<>(); final boolean[] bParamsAreFloats =new boolean[10]; @@ -24,9 +25,9 @@ public class Parameters { Parameters(){} - void setToDefaults(boolean defaultIn, boolean defaultOut,boolean defaultAreFloats){ + public void setToDefaults(boolean defaultIn, boolean defaultOut,boolean defaultAreFloats){ for (int hatch=0;hatch<10;hatch++) { - ParameterDefinition p= parameterDefinitions[hatch]; + ParameterGroup p= parameterGroups[hatch]; if (p!=null){ p.setToDefaults(defaultIn,defaultOut,defaultAreFloats); }else{ @@ -69,30 +70,42 @@ public class Parameters { setToDefaults(true,true,false); inArrayList.clear(); outArrayList.clear(); - for(int i = 0; i< parameterDefinitions.length; i++){ - parameterDefinitions[i]=null; + for(int i = 0; i< parameterGroups.length; i++){ + parameterGroups[i]=null; } } + public ParameterGroup makeGroup(int hatchNo, boolean aParamsDefaultsAreFloats){ + return new ParameterGroup( hatchNo, aParamsDefaultsAreFloats); + } + /** * most likely used locally in parametersInstantiation_EM() */ - public class ParameterDefinition { + public class ParameterGroup { private final boolean bParamsDefaultsAreStoredAsFloats; private final int hatchNo; - private final In[] in=new In[2]; - private final Out[] out=new Out[2]; + final In[] in=new In[2]; + final Out[] out=new Out[2]; - private ParameterDefinition(int hatchNo, boolean aParamsDefaultsAreFloats){ + private ParameterGroup(int hatchNo, boolean aParamsDefaultsAreFloats){ if(hatchNo<0 || hatchNo>=10){ - throw new IllegalArgumentException("ParameterDefinition id must be in 0 to 9 range"); + throw new IllegalArgumentException("ParameterGroup id must be in 0 to 9 range"); } this.hatchNo=hatchNo; bParamsDefaultsAreStoredAsFloats =aParamsDefaultsAreFloats; - parameterDefinitions[hatchNo]=this; + parameterGroups[hatchNo]=this; + } + + public In makeInParameter(int paramID, double defaultValue,Supplier name, Supplier status){ + return new In(paramID, defaultValue,name, status); + } + + public Out makeOutParameter(int paramID, double defaultValue,Supplier name, Supplier status){ + return new Out(paramID, defaultValue, name, status); } - private void setToDefaults(boolean defaultIn, boolean defaultOut,boolean defaultAreFloats) { + public void setToDefaults(boolean defaultIn, boolean defaultOut,boolean defaultAreFloats) { if(defaultAreFloats){ bParamsAreFloats[hatchNo] = bParamsDefaultsAreStoredAsFloats; } @@ -135,8 +148,10 @@ public class Parameters { public final int id; public final double defaultValue; private final Supplier status; + public Supplier name; - public Out(int paramID, double defaultValue, Supplier< LedStatus> status){ + private Out(int paramID, double defaultValue,Supplier name, Supplier status){ + this.name=name; this.id=hatchNo+10*paramID; if(paramID<0 || paramID>2){ throw new IllegalArgumentException("Parameter id must be in 0 to 1 range"); @@ -193,8 +208,10 @@ public class Parameters { public final int id; public final double defaultValue; private final Supplier status; + public Supplier name; - public In(int paramID, double defaultValue,Supplier status){ + private In(int paramID, double defaultValue,Supplier name,Supplier status){ + this.name=name; this.id=hatchNo+10*paramID; if(paramID<0 || paramID>2){ throw new IllegalArgumentException("Parameter id must be in 0 to 1 range"); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java index 93c8f69587..d22b1d4d2c 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java @@ -9,6 +9,7 @@ import com.github.technus.tectech.thing.block.QuantumStuffBlock; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockControl; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; @@ -31,7 +32,6 @@ import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStat * Created by danie_000 on 17.12.2016. */ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { - public static final String machine = "EM Machinery"; private Behaviour currentBehaviour; @@ -376,10 +376,13 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa public static abstract class Behaviour { public Behaviour(){} - public abstract void setOnMachine(){ - + public final void setOnMachine(GT_MetaTileEntity_EM_machine te){ + te.parametrization.ClearDefinitions(); + parametersInstantiation(te.parametrization); } + public abstract void parametersInstantiation(Parameters parameters); + /** * handle parameters pre recipe, and cyclically * this shouldn't write to input parameters! only to the provided array and/or output parameters @@ -397,22 +400,6 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa * @return null if recipe should not start, control object to set machine state and start recipe */ public abstract MultiblockControl process(cElementalInstanceStackMap[] inputs, double[] checkedAndFixedParameters); - - /** - * get input param description, only for 4 first hatches - * @param baseDescr - * @param hatchNo - * @param paramID - */ - protected void getFullLedDescriptionIn(ArrayList baseDescr, int hatchNo, int paramID){} - - /** - * get output param description - * @param baseDescr - * @param hatchNo - * @param paramID - */ - protected void getFullLedDescriptionOut(ArrayList baseDescr, int hatchNo, int paramID){} } @Override -- cgit From 664d264be74c12b2a7471548b16d49870d98cada Mon Sep 17 00:00:00 2001 From: Tec Date: Mon, 18 Feb 2019 19:24:14 +0100 Subject: Storing work --- .../multi/GT_MetaTileEntity_EM_collider.java | 64 +++++----- .../multi/GT_MetaTileEntity_EM_computer.java | 11 ++ .../multi/base/GT_Container_MultiMachineEM.java | 4 +- .../multi/base/GT_GUIContainer_MultiMachineEM.java | 2 +- .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 21 ++-- .../thing/metaTileEntity/multi/base/LedStatus.java | 67 ++++++++++- .../metaTileEntity/multi/base/Parameters.java | 129 +++++++++++---------- .../em_machine/GT_MetaTileEntity_EM_machine.java | 2 +- 8 files changed, 190 insertions(+), 110 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java index 0ec2196a82..e805b02fa9 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java @@ -34,6 +34,7 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.common.util.ForgeDirection; import java.util.HashMap; +import java.util.function.Function; import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; @@ -50,11 +51,12 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB private static Textures.BlockIcons.CustomIcon ScreenON_Slave; private static Textures.BlockIcons.CustomIcon ScreenOFF_Slave; - private static double MASS_TO_EU_PARTIAL,MASS_TO_EU_INSTANT; + protected static final byte FUSE_MODE=0, COLLIDE_MODE =1; + private static double MASS_TO_EU_INSTANT; private static int STARTUP_COST,KEEPUP_COST; public static void setValues(int heliumPlasmaValue){ - MASS_TO_EU_PARTIAL = heliumPlasmaValue / 1.75893000478707E07;//mass diff + double MASS_TO_EU_PARTIAL = heliumPlasmaValue / 1.75893000478707E07;//mass diff MASS_TO_EU_INSTANT = MASS_TO_EU_PARTIAL * 20; STARTUP_COST=-heliumPlasmaValue*10000; KEEPUP_COST=-heliumPlasmaValue; @@ -268,9 +270,36 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB protected byte eTier = 0; protected cElementalInstanceStack stack; private long plasmaEnergy; - public Parameters.ParameterGroup.In mode; - protected static final byte FUSE_MODE=0, COLLIDE_MODE =1; + //region parameters + protected Parameters.Group.ParameterIn mode; + private static final Function MODE_STATUS = base_EM->{ + if(base_EM.isMaster()){ + if (base_EM.mode.get() == FUSE_MODE || base_EM.mode.get() == COLLIDE_MODE) { + return STATUS_OK; + } else if (base_EM.mode.get() > 1) { + return STATUS_TOO_HIGH; + } else if (base_EM.mode.get() < 0) { + return STATUS_TOO_LOW; + }else{ + return STATUS_WRONG; + } + } + return STATUS_UNUSED; + }; + private static final Function MODE_NAME = base_EM->{ + if(base_EM.isMaster()){ + if(base_EM.mode.get()==FUSE_MODE){ + return "Mode: Fuse"; + }else if(base_EM.mode.get()==COLLIDE_MODE){ + return "Mode: Collide"; + } + return "Mode: Undefined"; + } + return "Currently Slaves..."; + }; + //endregion + protected boolean started=false; //region Structure @@ -332,31 +361,8 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB @Override protected void parametersInstantiation_EM() { - Parameters.ParameterGroup group=parametrization.makeGroup(0,false); - mode=group.makeInParameter(0,FUSE_MODE,()->{ - if(isMaster()){ - if(mode.get()==FUSE_MODE){ - return "Mode: Fuse"; - }else if(mode.get()==COLLIDE_MODE){ - return "Mode: Collide"; - } - return "Mode: Undefined"; - } - return "Currently Slaves..."; - },()->{ - if(isMaster()){ - if (mode.get() == FUSE_MODE || mode.get() == COLLIDE_MODE) { - return STATUS_OK; - } else if (mode.get() > 1) { - return STATUS_TOO_HIGH; - } else if (mode.get() < 0) { - return STATUS_TOO_LOW; - }else{ - return STATUS_WRONG; - } - } - return STATUS_UNUSED; - }); + Parameters.Group group=parametrization.makeGroup(0,false); + mode=group.makeInParameter(0,FUSE_MODE, MODE_NAME, MODE_STATUS); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java index 77db52f4b1..305acb23e3 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java @@ -10,6 +10,7 @@ import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_H import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OutputData; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Rack; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -43,6 +44,11 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB private static Textures.BlockIcons.CustomIcon ScreenOFF; private static Textures.BlockIcons.CustomIcon ScreenON; + //region parameters + protected Parameters.Group.ParameterIn overclock,overvolt; + + //endregion + private final ArrayList eRacks = new ArrayList<>(); private int maxCurrentTemp = 0; @@ -76,6 +82,11 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB eCertainStatus = -128;//no-brain value } + @Override + protected void parametersInstantiation_EM() { + + } + @Override @SideOnly(Side.CLIENT) protected ResourceLocation getActivitySound(){ 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 b8c856f9f8..78b020979e 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 @@ -11,8 +11,8 @@ import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { - public LedStatus[] eParamsInStatus = new LedStatus[20];//unused 0,G ok 1, B too low 2, R too high 3, Y blink dangerous 4,5 - public LedStatus[] eParamsOutStatus = new LedStatus[20]; + public LedStatus[] eParamsInStatus = LedStatus.makeArray(20,LedStatus.STATUS_UNDEFINED); + public LedStatus[] eParamsOutStatus = LedStatus.makeArray(20,LedStatus.STATUS_UNDEFINED); public byte eCertainMode = 5, eCertainStatus = 127; public boolean ePowerPass = false, eSafeVoid = false, allowedToWork = false; public final boolean ePowerPassButton, eSafeVoidButton, allowedToWorkButton; 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 90ad4e7388..71ab4c0af8 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 @@ -231,7 +231,7 @@ public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Mach case STATUS_HIGH:// too high drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * (6 + j), su, sv); break; - case STATUS_UNUSED: + default: if (GregTech_API.sColoredGUI && this.mContainer.mTileEntity != null) { int tColor = this.mContainer.mTileEntity.getColorization() & 15; if (tColor < ItemDye.field_150922_c.length) { 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 82da3a5ba2..f99eb510d3 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 @@ -97,7 +97,6 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt //region parameters public final Parameters parametrization; - //endregion //region Control variables @@ -152,14 +151,14 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt protected GT_MetaTileEntity_MultiblockBase_EM(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); - parametrization=new Parameters(); + parametrization=new Parameters(this); parametersInstantiation_EM(); parametrization.setToDefaults(true,true,true); } protected GT_MetaTileEntity_MultiblockBase_EM(String aName) { super(aName); - parametrization=new Parameters(); + parametrization=new Parameters(this); parametersInstantiation_EM(); parametrization.setToDefaults(true,true,true); } @@ -454,7 +453,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt EnumChatFormatting.YELLOW+ ":"+ EnumChatFormatting.AQUA+"I"); try{ - list.add(parametrization.parameterGroups[hatchNo].in[paramID].name.get()); + list.add(parametrization.groups[hatchNo].parameterIn[paramID].getBrief()); }catch (NullPointerException e){ list.add("Unused"); } @@ -476,7 +475,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt EnumChatFormatting.YELLOW+ ":"+ EnumChatFormatting.AQUA+"O"); try{ - list.add(parametrization.parameterGroups[hatchNo].out[paramID].name.get()); + list.add(parametrization.groups[hatchNo].parameterOut[paramID].getBrief()); }catch (NullPointerException e){ list.add("Unused"); } @@ -740,15 +739,15 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt */ public void parametersOutAndStatusesWrite_EM(boolean machineBusy) { if(!machineBusy){ - for (Parameters.ParameterGroup.In in : parametrization.inArrayList) { - if (in != null) { - in.updateStatus(); + for (Parameters.Group.ParameterIn parameterIn : parametrization.parameterInArrayList) { + if (parameterIn != null) { + parameterIn.updateStatus(); } } } - for (Parameters.ParameterGroup.Out out : parametrization.outArrayList) { - if (out != null) { - out.updateStatus(); + for (Parameters.Group.ParameterOut parameterOut : parametrization.parameterOutArrayList) { + if (parameterOut != null) { + parameterOut.updateStatus(); } } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/LedStatus.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/LedStatus.java index fba5910532..f346fe7e64 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/LedStatus.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/LedStatus.java @@ -8,8 +8,7 @@ public enum LedStatus { STATUS_OK, STATUS_TOO_HIGH, STATUS_HIGH, - STATUS_UNDEFINED, - STATUS_NEUTRAL; + STATUS_UNDEFINED; public boolean isOk(){ return (ordinal()&1)==0; @@ -26,8 +25,70 @@ public enum LedStatus { public static LedStatus getStatus(byte value){ try{ return LedStatus.values()[value]; - }catch (IndexOutOfBoundsException e){ + }catch (Exception e){ return STATUS_UNDEFINED; } } + + public static LedStatus[] makeArray(int count,LedStatus defaultValue){ + LedStatus[] statuses=new LedStatus[count]; + for (int i = 0; i < count; i++) { + statuses[i]=defaultValue; + } + return statuses; + } + + public static LedStatus fromLimitsInclusiveOuterBoundary(double value, double min,double low, double high, double max, double... excludedNumbers + ){ + if(Double.isNaN(value)) return STATUS_WRONG; + if(valuemax) return STATUS_TOO_HIGH; + + if(valuehigh) return STATUS_HIGH; + for (double val : excludedNumbers) { + if(val==value) return STATUS_WRONG; + } + return STATUS_UNDEFINED; + } + + public static LedStatus fromLimitsExclusiveOuterBoundary(double value, double min,double low, double high,double max, double... excludedNumbers + ){ + if(Double.isNaN(value)) return STATUS_WRONG; + if(value<=min) return STATUS_TOO_LOW; + if(value>=max) return STATUS_TOO_HIGH; + + if(valuehigh) return STATUS_HIGH; + for (double val : excludedNumbers) { + if(val==value) return STATUS_WRONG; + } + return STATUS_OK; + } + + public static LedStatus fromLimitsInclusiveOuterBoundary(double value, double min, double max, double... excludedNumbers + ){ + if(Double.isNaN(value)) return STATUS_WRONG; + if(value<=min) return STATUS_TOO_LOW; + else if(value==min) + if(value>=max) return STATUS_TOO_HIGH; + + for (double val : excludedNumbers) { + if(val==value) return STATUS_WRONG; + } + return STATUS_OK; + } + + public static LedStatus fromLimitsExclusiveOuterBoundary(double value, double min, double max, double... excludedNumbers + ){ + if(Double.isNaN(value)) return STATUS_WRONG; + if(value<=min) return STATUS_TOO_LOW; + else if(value==min) + if(value>=max) return STATUS_TOO_HIGH; + + for (double val : excludedNumbers) { + if(val==value) return STATUS_WRONG; + } + return STATUS_OK; + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java index 824588ab25..e67072309f 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java @@ -1,33 +1,38 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.base; import java.util.ArrayList; -import java.util.function.Supplier; +import java.util.function.Function; /** * Instantiate parameters as field in parametersInstantiation_EM(); */ public class Parameters { - private static final Supplier LED_STATUS_FUNCTION_DEFAULT = ()->LedStatus.STATUS_UNDEFINED; - private static final int ZERO_FLOAT=Float.floatToIntBits(0); + public static final Function LED_STATUS_FUNCTION_DEFAULT = o->LedStatus.STATUS_UNDEFINED; + public static final Function NAME_FUNCTION_DEFAULT=o->"Undefined"; + public static final int ZERO_FLOAT=Float.floatToIntBits(0); - final ParameterGroup[] parameterGroups =new ParameterGroup[10]; + final Group[] groups = new Group[10]; final int[] iParamsIn = new int[20];//number I from parametrizers final int[] iParamsOut = new int[20];//number O to parametrizers - final ArrayList inArrayList=new ArrayList<>(); - final ArrayList outArrayList=new ArrayList<>(); + final ArrayList parameterInArrayList =new ArrayList<>(); + final ArrayList parameterOutArrayList =new ArrayList<>(); final boolean[] bParamsAreFloats =new boolean[10]; //package private for use in gui - final LedStatus[] eParamsInStatus = new LedStatus[20];//LED status for I - final LedStatus[] eParamsOutStatus = new LedStatus[20];//LED status for O + final LedStatus[] eParamsInStatus = LedStatus.makeArray(20,LedStatus.STATUS_UNUSED);//LED status for I + final LedStatus[] eParamsOutStatus = LedStatus.makeArray(20,LedStatus.STATUS_UNUSED);//LED status for O - Parameters(){} + private final GT_MetaTileEntity_MultiblockBase_EM parent; + + Parameters(GT_MetaTileEntity_MultiblockBase_EM parent){ + this.parent=parent; + } public void setToDefaults(boolean defaultIn, boolean defaultOut,boolean defaultAreFloats){ for (int hatch=0;hatch<10;hatch++) { - ParameterGroup p= parameterGroups[hatch]; + Group p= groups[hatch]; if (p!=null){ p.setToDefaults(defaultIn,defaultOut,defaultAreFloats); }else{ @@ -68,41 +73,41 @@ public class Parameters { public void ClearDefinitions(){ setToDefaults(true,true,false); - inArrayList.clear(); - outArrayList.clear(); - for(int i = 0; i< parameterGroups.length; i++){ - parameterGroups[i]=null; + parameterInArrayList.clear(); + parameterOutArrayList.clear(); + for(int i = 0; i< groups.length; i++){ + groups[i]=null; } } - public ParameterGroup makeGroup(int hatchNo, boolean aParamsDefaultsAreFloats){ - return new ParameterGroup( hatchNo, aParamsDefaultsAreFloats); + public Group makeGroup(int hatchNo, boolean aParamsDefaultsAreFloats){ + return new Group( hatchNo, aParamsDefaultsAreFloats); } /** * most likely used locally in parametersInstantiation_EM() */ - public class ParameterGroup { + public class Group { private final boolean bParamsDefaultsAreStoredAsFloats; private final int hatchNo; - final In[] in=new In[2]; - final Out[] out=new Out[2]; + final ParameterIn[] parameterIn =new ParameterIn[2]; + final ParameterOut[] parameterOut =new ParameterOut[2]; - private ParameterGroup(int hatchNo, boolean aParamsDefaultsAreFloats){ + private Group(int hatchNo, boolean aParamsDefaultsAreFloats){ if(hatchNo<0 || hatchNo>=10){ throw new IllegalArgumentException("ParameterGroup id must be in 0 to 9 range"); } this.hatchNo=hatchNo; bParamsDefaultsAreStoredAsFloats =aParamsDefaultsAreFloats; - parameterGroups[hatchNo]=this; + groups[hatchNo]=this; } - public In makeInParameter(int paramID, double defaultValue,Supplier name, Supplier status){ - return new In(paramID, defaultValue,name, status); + public ParameterIn makeInParameter(int paramID, double defaultValue, Function name, Function status){ + return new ParameterIn(paramID, defaultValue,name, status); } - public Out makeOutParameter(int paramID, double defaultValue,Supplier name, Supplier status){ - return new Out(paramID, defaultValue, name, status); + public ParameterOut makeOutParameter(int paramID, double defaultValue, Function name, Function status){ + return new ParameterOut(paramID, defaultValue, name, status); } public void setToDefaults(boolean defaultIn, boolean defaultOut,boolean defaultAreFloats) { @@ -111,8 +116,8 @@ public class Parameters { } if(defaultIn){ for(int in=0;in<2;in++){ - if(this.in[in]!=null){ - this.in[in].setDefault(); + if(this.parameterIn[in]!=null){ + this.parameterIn[in].setDefault(); }else { if (bParamsAreFloats[hatchNo]) { iParamsIn[hatchNo] = ZERO_FLOAT; @@ -126,8 +131,8 @@ public class Parameters { } if(defaultOut){ for(int out=0;out<2;out++){ - if(this.out[out]!=null){ - this.out[out].setDefault(); + if(this.parameterOut[out]!=null){ + this.parameterOut[out].setDefault(); }else { if (bParamsAreFloats[hatchNo]) { iParamsIn[hatchNo] = ZERO_FLOAT; @@ -144,29 +149,26 @@ public class Parameters { /** * Make a field out of this... */ - public class Out { + public class ParameterOut { public final int id; public final double defaultValue; - private final Supplier status; - public Supplier name; + Function status; + Function name; - private Out(int paramID, double defaultValue,Supplier name, Supplier status){ - this.name=name; + @SuppressWarnings("unchecked") + private ParameterOut(int paramID, double defaultValue, Function name, Function status){ + this.name= name; this.id=hatchNo+10*paramID; if(paramID<0 || paramID>2){ throw new IllegalArgumentException("Parameter id must be in 0 to 1 range"); } this.defaultValue=defaultValue; - if(out[paramID]!=null){ + if(parameterOut[paramID]!=null){ throw new InstantiationError("This parameter already exists!"); } - if(status ==null){ - this.status =LED_STATUS_FUNCTION_DEFAULT; - }else{ - this.status = status; - } - outArrayList.add(this); - out[paramID]=this; + this.status = status; + parameterOutArrayList.add(this); + parameterOut[paramID]=this; } private void setDefault() { @@ -185,48 +187,45 @@ public class Parameters { } } - public LedStatus getStatus(){ - return eParamsOutStatus[id]; - } - public void updateStatus(){ - eParamsOutStatus[id]=status.get(); + eParamsOutStatus[id]=status.apply(parent); } - public LedStatus getStaus(boolean update){ + public LedStatus getStatus(boolean update){ if(update){ updateStatus(); } return eParamsOutStatus[id]; } + + public String getBrief(){ + return name.apply(parent); + } } /** * Make a field out of this... */ - public class In { + public class ParameterIn { public final int id; public final double defaultValue; - private final Supplier status; - public Supplier name; + Function status; + Function name; - private In(int paramID, double defaultValue,Supplier name,Supplier status){ - this.name=name; + @SuppressWarnings("unchecked") + private ParameterIn(int paramID, double defaultValue, Function name, Function status){ + this.name= name; this.id=hatchNo+10*paramID; if(paramID<0 || paramID>2){ throw new IllegalArgumentException("Parameter id must be in 0 to 1 range"); } this.defaultValue=defaultValue; - if(in[paramID]!=null){ + if(parameterIn[paramID]!=null){ throw new InstantiationError("This parameter already exists!"); } - if(status ==null){ - this.status =LED_STATUS_FUNCTION_DEFAULT; - }else{ - this.status = status; - } - inArrayList.add(this); - in[paramID]=this; + this.status = status; + parameterInArrayList.add(this); + parameterIn[paramID]=this; } private void setDefault() { @@ -242,15 +241,19 @@ public class Parameters { } public void updateStatus(){ - eParamsInStatus[id]=status.get(); + eParamsInStatus[id]=status.apply(parent); } - public LedStatus getStaus(boolean update){ + public LedStatus getStatus(boolean update){ if(update){ updateStatus(); } return eParamsInStatus[id]; } + + public String getBrief(){ + return name.apply(parent); + } } } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java index d22b1d4d2c..9c45b5df67 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java @@ -377,7 +377,7 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa public Behaviour(){} public final void setOnMachine(GT_MetaTileEntity_EM_machine te){ - te.parametrization.ClearDefinitions(); + te.parametrization.clearGroups(); parametersInstantiation(te.parametrization); } -- cgit From 16ace78716ae898fe0d57abde51448fde68c2d58 Mon Sep 17 00:00:00 2001 From: Tec Date: Tue, 19 Feb 2019 20:28:13 +0100 Subject: Most likely the param api will look like this. --- .../multi/GT_MetaTileEntity_EM_collider.java | 4 +- .../multi/GT_MetaTileEntity_EM_computer.java | 109 +++++++-------------- .../multi/GT_MetaTileEntity_EM_dataBank.java | 10 -- .../multi/GT_MetaTileEntity_EM_decay.java | 33 +++++-- .../multi/base/GT_Container_MultiMachineEM.java | 36 +++++++ .../multi/base/GT_GUIContainer_MultiMachineEM.java | 78 ++++++++++----- .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 41 +++++--- .../thing/metaTileEntity/multi/base/LedStatus.java | 46 +++++---- .../metaTileEntity/multi/base/Parameters.java | 49 ++++++--- 9 files changed, 247 insertions(+), 159 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java index e805b02fa9..03404cf652 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java @@ -361,8 +361,8 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB @Override protected void parametersInstantiation_EM() { - Parameters.Group group=parametrization.makeGroup(0,false); - mode=group.makeInParameter(0,FUSE_MODE, MODE_NAME, MODE_STATUS); + Parameters.Group hatch_0=parametrization.makeGroup(0,false); + mode=hatch_0.makeInParameter(0,FUSE_MODE, MODE_NAME, MODE_STATUS); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java index 305acb23e3..d12ec0ca64 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java @@ -10,6 +10,7 @@ import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_H import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OutputData; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Rack; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus; import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; @@ -28,6 +29,7 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; import java.util.ArrayList; +import java.util.function.Function; import static com.github.technus.tectech.CommonValues.V; import static com.github.technus.tectech.Util.StructureBuilderExtreme; @@ -46,11 +48,29 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB //region parameters protected Parameters.Group.ParameterIn overclock,overvolt; - + protected Parameters.Group.ParameterOut maxCurrentTemp,availableData; + private static final Function OC_NAME = base-> "Overclock ratio"; + private static final Function OV_NAME = base-> "Overvoltage ratio"; + private static final Function MAX_TEMP_NAME = base-> "Current max. heat"; + private static final Function COMPUTE_NAME = base-> "Produced computation"; + private static final Function OC_STATUS= + base->LedStatus.fromLimitsInclusiveOuterBoundary(base.overclock.get(),0,1,1,3); + private static final Function OV_STATUS= + base->LedStatus.fromLimitsInclusiveOuterBoundary(base.overvolt.get(),.7,.8,1.2,2); + private static final Function MAX_TEMP_STATUS= + base->LedStatus.fromLimitsInclusiveOuterBoundary(base.maxCurrentTemp.get(),-10000,0,0,5000); + private static final Function COMPUTE_STATUS=base->{ + if(base.eAvailableData<0){ + return STATUS_TOO_LOW; + } + if(base.eAvailableData==0){ + return STATUS_NEUTRAL; + } + return STATUS_OK; + }; //endregion private final ArrayList eRacks = new ArrayList<>(); - private int maxCurrentTemp = 0; //region Structure private static final String[][] front = new String[][]{{"A ", "A ", "A. ", "A ",},}; @@ -84,7 +104,11 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB @Override protected void parametersInstantiation_EM() { - + Parameters.Group hatch_0=parametrization.makeGroup(0,true); + overclock=hatch_0.makeInParameter(0,1,OC_NAME,OC_STATUS); + overvolt=hatch_0.makeInParameter(1,1,OV_NAME,OV_STATUS); + maxCurrentTemp=hatch_0.makeOutParameter(0,0,MAX_TEMP_NAME,MAX_TEMP_STATUS); + availableData=hatch_0.makeOutParameter(1,0,COMPUTE_NAME,COMPUTE_STATUS); } @Override @@ -116,14 +140,15 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB @Override public boolean checkRecipe_EM(ItemStack itemStack) { + parametrization.setToDefaults(false,true,false); eAvailableData = 0; - maxCurrentTemp = 0; - double overClockRatio= getParameterIn(0,0); - double overVoltageRatio= getParameterIn(0,1); + double maxTemp=0; + double overClockRatio= overclock.get(); + double overVoltageRatio= overvolt.get(); if(Double.isNaN(overClockRatio) || Double.isNaN(overVoltageRatio)) { return false; } - if(overClockRatio>0 && overVoltageRatio>=0.7f && overClockRatio<=3 && overVoltageRatio<=2){ + if(overclock.getStatus(true).isOk() && overvolt.getStatus(true).isOk()){ float eut=V[8] * (float)overVoltageRatio * (float)overClockRatio; if(eut maxCurrentTemp) { - maxCurrentTemp = rack.heat; + if (rack.heat > maxTemp) { + maxTemp=rack.heat; } rackComputation = rack.tickComponents((float) overClockRatio, (float) overVoltageRatio); if (rackComputation > 0) { @@ -161,6 +186,8 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB eAmpereFlow = 1 + (thingsActive >> 2); mMaxProgresstime = 20; mEfficiencyIncrease = 10000; + maxCurrentTemp.set(maxTemp); + availableData.set(eAvailableData); return true; } else { eAvailableData=0; @@ -168,6 +195,8 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB eAmpereFlow = 1; mMaxProgresstime = 20; mEfficiencyIncrease = 10000; + maxCurrentTemp.set(maxTemp); + availableData.set(eAvailableData); return true; } } @@ -211,68 +240,6 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB } } - @Override - protected void parametersLoadDefault_EM() { - setParameterPairIn_ClearOut(0, false, 1, 1); - } - - @Override - public void parametersOutAndStatusesWrite_EM(boolean machineBusy) { - double ocRatio = getParameterIn(0, 0); - if (ocRatio < 0) { - setStatusOfParameterIn(0, 0, STATUS_TOO_LOW); - } else if (ocRatio < 1) { - setStatusOfParameterIn(0, 0, STATUS_LOW); - } else if (ocRatio == 1) { - setStatusOfParameterIn(0, 0, STATUS_OK); - } else if (ocRatio <= 3) { - setStatusOfParameterIn(0, 0, STATUS_HIGH); - } else if (Double.isNaN(ocRatio)) { - setStatusOfParameterIn(0, 0, STATUS_WRONG); - } else { - setStatusOfParameterIn(0, 0, STATUS_TOO_HIGH); - } - - double ovRatio = getParameterIn(0, 1); - if (ovRatio < 0.7f) { - setStatusOfParameterIn(0, 1, STATUS_TOO_LOW); - } else if (ovRatio < 0.8f) { - setStatusOfParameterIn(0, 1, STATUS_LOW); - } else if (ovRatio <= 1.2f) { - setStatusOfParameterIn(0, 1, STATUS_OK); - } else if (ovRatio <= 2) { - setStatusOfParameterIn(0, 1, STATUS_HIGH); - } else if (Double.isNaN(ovRatio)) { - setStatusOfParameterIn(0, 1, STATUS_WRONG); - } else { - setStatusOfParameterIn(0, 1, STATUS_TOO_HIGH); - } - - setParameterOut(0, 0, maxCurrentTemp); - setParameterOut(0, 1, eAvailableData); - - if (maxCurrentTemp < -10000) { - setStatusOfParameterOut(0, 0, STATUS_TOO_LOW); - } else if (maxCurrentTemp < 0) { - setStatusOfParameterOut(0, 0, STATUS_LOW); - } else if (maxCurrentTemp == 0) { - setStatusOfParameterOut(0, 0, STATUS_OK); - } else if (maxCurrentTemp <= 5000) { - setStatusOfParameterOut(0, 0, STATUS_HIGH); - } else { - setStatusOfParameterOut(0, 0, STATUS_TOO_HIGH); - } - - if (!machineBusy) { - setStatusOfParameterOut(0, 1, STATUS_NEUTRAL); - } else if (eAvailableData <= 0) { - setStatusOfParameterOut(0, 1, STATUS_TOO_LOW); - } else { - setStatusOfParameterOut(0, 1, STATUS_OK); - } - } - - @Override public void onRemoval() { super.onRemoval(); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java index e79675f016..3a4e82cb52 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java @@ -113,16 +113,6 @@ public class GT_MetaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockB return description; } - @Override - protected void parametersLoadDefault_EM() { - for(int i=0;i<10;i++){ - setStatusOfParameterIn(i,0,STATUS_UNUSED); - setStatusOfParameterIn(i,1,STATUS_UNUSED); - setStatusOfParameterOut(i,0,STATUS_UNUSED); - setStatusOfParameterOut(i,1,STATUS_UNUSED); - } - } - @Override public boolean checkRecipe_EM(ItemStack itemStack) { if (eDataAccessHatches.size() > 0 && eStacksDataOutputs.size() > 0) { diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java index 71a6b70dfb..36b7505a65 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java @@ -7,6 +7,8 @@ import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -23,11 +25,14 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; +import java.util.function.Function; + import static com.github.technus.tectech.CommonValues.VN; import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; +import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*; /** * Created by danie_000 on 17.12.2016. @@ -40,6 +45,17 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase private static final double MASS_TO_EU_PARTIAL = ConfigUtil.getFloat(MainConfig.get(), "balance/energy/generator/nuclear") * 3_000_000.0 / URANIUM_INGOT_MASS_DIFF; private static final double MASS_TO_EU_INSTANT= MASS_TO_EU_PARTIAL *20; + //region parameters + protected Parameters.Group.ParameterIn ampereFlow; + private final Function FLOW_NAME=base->"Ampere divider"; + private final Function FLOW_STATUS=base->{ + if(eAmpereFlow<=0){ + return STATUS_TOO_LOW; + } + return STATUS_OK; + }; + //endregion + //region structure private static final String[][] shape = new String[][]{ {"0C0","A ","A . ","A ","0C0",}, @@ -73,6 +89,12 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase super(aName); } + @Override + protected void parametersInstantiation_EM() { + Parameters.Group hatch_0=parametrization.makeGroup(0,false); + ampereFlow=hatch_0.makeInParameter(0,1,FLOW_NAME,FLOW_STATUS); + } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_EM_decay(mName); @@ -157,8 +179,7 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase float preMass=outputEM[0].getMass(); outputEM[0].tickContent(1,0,1); double energyDose=((preMass-outputEM[0].getMass())* MASS_TO_EU_PARTIAL); - mEUt=(int)(energyDose/getParameterInInt(0,0)); - eAmpereFlow=getParameterInInt(0,0); + mEUt=(int)(energyDose/(eAmpereFlow=(long) ampereFlow.get())); return outputEM[0].hasStacks(); } @@ -191,17 +212,17 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase return new String[]{ "Progress:", EnumChatFormatting.GREEN + Integer.toString(mProgresstime / 20) + EnumChatFormatting.RESET + " s / " + - EnumChatFormatting.YELLOW + Integer.toString(mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s", + EnumChatFormatting.YELLOW + mMaxProgresstime / 20 + EnumChatFormatting.RESET + " s", "Energy Hatches:", EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET + " EU / " + - EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET + " EU", + EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU", (mEUt <= 0 ? "Probably uses: " : "Probably makes: ") + - EnumChatFormatting.RED + Integer.toString(Math.abs(mEUt)) + EnumChatFormatting.RESET + " EU/t at " + + EnumChatFormatting.RED + Math.abs(mEUt) + EnumChatFormatting.RESET + " EU/t at " + EnumChatFormatting.RED + eAmpereFlow + EnumChatFormatting.RESET + " A", "Tier Rating: " + EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier_EM()] + EnumChatFormatting.RESET + " / " + EnumChatFormatting.GREEN + VN[getMinEnergyInputTier_EM()] + EnumChatFormatting.RESET + " Amp Rating: " + EnumChatFormatting.GREEN + eMaxAmpereFlow + EnumChatFormatting.RESET + " A", "Problems: " + EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + - " Efficiency: " + EnumChatFormatting.YELLOW + Float.toString(mEfficiency / 100.0F) + EnumChatFormatting.RESET + " %", + " Efficiency: " + EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", "PowerPass: " + EnumChatFormatting.BLUE + ePowerPass + EnumChatFormatting.RESET + " SafeVoid: " + EnumChatFormatting.BLUE + eSafeVoid, "Computation: " + EnumChatFormatting.GREEN + eAvailableData + EnumChatFormatting.RESET + " / " + EnumChatFormatting.YELLOW + eRequiredData + EnumChatFormatting.RESET, 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 78b020979e..bd2c20b2bc 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 @@ -10,10 +10,15 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; +import java.util.BitSet; + public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { public LedStatus[] eParamsInStatus = LedStatus.makeArray(20,LedStatus.STATUS_UNDEFINED); public LedStatus[] eParamsOutStatus = LedStatus.makeArray(20,LedStatus.STATUS_UNDEFINED); + public int[] eParamsIn = new int[20];//number I from parametrizers + public int[] eParamsOut = new int[20];//number O to parametrizers public byte eCertainMode = 5, eCertainStatus = 127; + public short eParamsAreFloats; public boolean ePowerPass = false, eSafeVoid = false, allowedToWork = false; public final boolean ePowerPassButton, eSafeVoidButton, allowedToWorkButton; @@ -108,6 +113,9 @@ public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { } eParamsInStatus = ((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).parametrization.eParamsInStatus; eParamsOutStatus = ((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).parametrization.eParamsOutStatus; + int[] iParamsIn= ((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).parametrization.iParamsIn; + int[] iParamsOut= ((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).parametrization.iParamsOut; + eParamsAreFloats=((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).parametrization.bParamsAreFloats; eCertainMode = ((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).eCertainMode; eCertainStatus = ((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).eCertainStatus; ePowerPass = ((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).ePowerPass; @@ -122,6 +130,26 @@ public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { } var1.sendProgressBarUpdate(this, 120, eCertainMode | (eCertainStatus << 8)); var1.sendProgressBarUpdate(this, 121, (ePowerPass ? 1 : 0) + (eSafeVoid ? 2 : 0) + (allowedToWork ? 4 : 0)); + var1.sendProgressBarUpdate(this,122,eParamsAreFloats); + i=130; + for(int j=0;j>>16); + } + for(int j=0;j>>16); + } } } @@ -141,6 +169,14 @@ public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { ePowerPass = (par2 & 1) == 1; eSafeVoid = (par2 & 2) == 2; allowedToWork = (par2 & 4) == 4; + } else if (par1 == 122) { + eParamsAreFloats=(short) par2; + }else if(par1>=130 && par1<170){ + int pointer=(par1-130)>>1; + eParamsOut[pointer]=(par1&1)==0?eParamsOut[pointer]&0xFFFF0000|par2:eParamsOut[pointer]&0xFFFF|(par2<<16); + }else if(par1>=170 && par1<210){ + int pointer=(par1-170)>>1; + eParamsIn[pointer]=(par1&1)==0?eParamsIn[pointer]&0xFFFF0000|par2:eParamsIn[pointer]&0xFFFF|(par2<<16); } } 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 71ab4c0af8..47a3d60a0a 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 @@ -24,9 +24,11 @@ public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Mach private String mName; private static byte counter = 0; private final boolean ePowerPassButton, eSafeVoidButton, allowedToWorkButton; + private final GT_Container_MultiMachineEM mContainer; 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; @@ -37,6 +39,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; ePowerPassButton=eSafeVoidButton=allowedToWorkButton=true; ySize= 192; @@ -58,36 +61,36 @@ public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Mach fontRendererObj.drawString(mName, 7, 8, 16448255); if (mContainer != null) { - if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 1) != 0) { + if ((mContainer.mDisplayErrorCode & 1) != 0) { fontRendererObj.drawString("Pipe is loose.", 7, 16, 16448255); } - if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 2) != 0) { + if ((mContainer.mDisplayErrorCode & 2) != 0) { fontRendererObj.drawString("Screws are loose.", 7, 24, 16448255); } - if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 4) != 0) { + if ((mContainer.mDisplayErrorCode & 4) != 0) { fontRendererObj.drawString("Something is stuck.", 7, 32, 16448255); } - if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 8) != 0) { + if ((mContainer.mDisplayErrorCode & 8) != 0) { fontRendererObj.drawString("Plating is dented.", 7, 40, 16448255); } - if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 16) != 0) { + if ((mContainer.mDisplayErrorCode & 16) != 0) { fontRendererObj.drawString("Circuitry burned out.", 7, 48, 16448255); } - if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 32) != 0) { + if ((mContainer.mDisplayErrorCode & 32) != 0) { fontRendererObj.drawString("That doesn't belong there.", 7, 56, 16448255); } - if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 64) != 0) { + if ((mContainer.mDisplayErrorCode & 64) != 0) { fontRendererObj.drawString("Incomplete Structure.", 7, 64, 16448255); } - if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 128) != 0) { + if ((mContainer.mDisplayErrorCode & 128) != 0) { fontRendererObj.drawString("Too Uncertain.", 7, 72, 16448255); } - if ((((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode & 256) != 0) { + if ((mContainer.mDisplayErrorCode & 256) != 0) { fontRendererObj.drawString("Invalid Parameters.", 7, 80, 16448255); } - if (((GT_Container_MultiMachineEM) mContainer).mDisplayErrorCode == 0) { - if (((GT_Container_MultiMachineEM) mContainer).mActive == 0) { + if (mContainer.mDisplayErrorCode == 0) { + if (mContainer.mActive == 0) { fontRendererObj.drawString("Soft Hammer or press Button", 7, 16, 16448255); fontRendererObj.drawString("to (re-)start the Machine", 7, 24, 16448255); fontRendererObj.drawString("if it doesn't start.", 7, 32, 16448255); @@ -104,41 +107,41 @@ public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Mach int x = (width - xSize) / 2; int y = (height - ySize) / 2; drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - if (mContainer != null && ((GT_Container_MultiMachineEM) mContainer).eParamsInStatus != null) { + if (mContainer != null && mContainer.eParamsInStatus != null) { counter = (byte) ((1 + counter) % 6); GL11.glColor4f(1f, 1f, 1f, 1f); x+= 173; if(!ePowerPassButton) { drawTexturedModalRect(x, y + 115, 231, 23, 18, 18); - } else if (((GT_Container_MultiMachineEM) mContainer).ePowerPass) { + } else if (mContainer.ePowerPass) { drawTexturedModalRect(x, y + 115, 207, 23, 18, 18); } if(!eSafeVoidButton) { drawTexturedModalRect(x, y + 132, 231, 41, 18, 18); - } else if (((GT_Container_MultiMachineEM) mContainer).eSafeVoid) { + } else if (mContainer.eSafeVoid) { drawTexturedModalRect(x, y + 132, 207, 41, 18, 18); } if(!allowedToWorkButton) { drawTexturedModalRect(x, y + 147, 231, 57, 18, 18); - } else if (((GT_Container_MultiMachineEM) mContainer).allowedToWork) { + } else if (mContainer.allowedToWork) { drawTexturedModalRect(x, y + 147, 207, 57, 18, 18); } x -= 162; y += 96; for (int i = 0; i < 20; ) { byte hatch = (byte) (i >>> 1); - LEDdrawP(x, y, i, 0, ((GT_Container_MultiMachineEM) mContainer).eParamsInStatus[hatch]); - LEDdrawP(x, y, i++, 1, ((GT_Container_MultiMachineEM) mContainer).eParamsOutStatus[hatch]); - LEDdrawP(x, y, i, 0, ((GT_Container_MultiMachineEM) mContainer).eParamsInStatus[hatch + 10]); - LEDdrawP(x, y, i++, 1, ((GT_Container_MultiMachineEM) mContainer).eParamsOutStatus[hatch + 10]); + LEDdrawP(x, y, i, 0, mContainer.eParamsInStatus[hatch]); + LEDdrawP(x, y, i++, 1, mContainer.eParamsOutStatus[hatch]); + LEDdrawP(x, y, i, 0, mContainer.eParamsInStatus[hatch + 10]); + LEDdrawP(x, y, i++, 1, mContainer.eParamsOutStatus[hatch + 10]); } short rU = 207, Vs = 77; x += 162; - byte state = ((GT_Container_MultiMachineEM) mContainer).eCertainStatus; - switch (((GT_Container_MultiMachineEM) mContainer).eCertainMode) { + byte state = mContainer.eCertainStatus; + switch (mContainer.eCertainMode) { case 1://ooo oxo ooo drawTexturedModalRect(x + 6, y + 6, rU + (state == 0 ? 30 : 6), @@ -231,6 +234,29 @@ public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Mach case STATUS_HIGH:// too high drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * (6 + j), su, sv); break; + case STATUS_NEUTRAL: + if(counter<3){ + GL11.glColor4f(.85f, .9f, .95f, 1.0F); + drawTexturedModalRect(x + su * i, y + sv * j, 212, 96, su+2, sv+2); + GL11.glColor4f(1f, 1f, 1f, 1f); + }else { + GL11.glColor4f(.8f, .9f, 1f, 1.0F); + drawTexturedModalRect(x + su * i, y + sv * j, 212, 96, su+2, sv+2); + GL11.glColor4f(1f, 1f, 1f, 1f); + } + break; + case STATUS_UNDEFINED: + if(counter<3) { + GL11.glColor4f(.5f, .1f, .15f, 1.0F); + drawTexturedModalRect(x + su * i, y + sv * j, 212, 96, su + 2, sv + 2); + GL11.glColor4f(1f, 1f, 1f, 1f); + }else { + GL11.glColor4f(0f, .1f, .2f, 1.0F); + drawTexturedModalRect(x + su * i, y + sv * j, 212, 96, su + 2, sv + 2); + GL11.glColor4f(1f, 1f, 1f, 1f); + } + break; + case STATUS_UNUSED: default: if (GregTech_API.sColoredGUI && this.mContainer.mTileEntity != null) { int tColor = this.mContainer.mTileEntity.getColorization() & 15; @@ -254,6 +280,12 @@ public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Mach if(mContainer.mTileEntity!=null){ IMetaTileEntity mte=mContainer.mTileEntity.getMetaTileEntity(); if(mte instanceof GT_MetaTileEntity_MultiblockBase_EM){ + Parameters parametrization=((GT_MetaTileEntity_MultiblockBase_EM)mte).parametrization; + parametrization.bParamsAreFloats=mContainer.eParamsAreFloats; + parametrization.eParamsInStatus=mContainer.eParamsInStatus; + parametrization.eParamsOutStatus=mContainer.eParamsOutStatus; + parametrization.iParamsIn=mContainer.eParamsIn; + parametrization.iParamsOut=mContainer.eParamsOut; int su = 8, sv = 6, u=11,v=96; if(x=v && y=0) { - parametrization.bParamsAreFloats[hatch.param] = hatch.isUsingFloats(); + if(hatch.isUsingFloats()){ + parametrization.bParamsAreFloats |= B[hatch.param]; + }else { + parametrization.bParamsAreFloats &=~B[hatch.param]; + } } } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/LedStatus.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/LedStatus.java index f346fe7e64..52d4f30c12 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/LedStatus.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/LedStatus.java @@ -1,21 +1,30 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.base; public enum LedStatus { - STATUS_UNUSED, - STATUS_TOO_LOW, - STATUS_LOW, - STATUS_WRONG, - STATUS_OK, - STATUS_TOO_HIGH, - STATUS_HIGH, - STATUS_UNDEFINED; + STATUS_UNUSED("Unused",true), + STATUS_TOO_LOW("Too Low",false), + STATUS_LOW("Low",true), + STATUS_WRONG("Wrong",false), + STATUS_OK("Valid",true), + STATUS_TOO_HIGH("Too High",false), + STATUS_HIGH("High",true), + STATUS_UNDEFINED("Unknown",false), + STATUS_NEUTRAL("Neutral",true); + + public final String name; + public final boolean isOk; + + LedStatus(String name,boolean ok){ + this.name=name; + this.isOk=ok; + } public boolean isOk(){ - return (ordinal()&1)==0; + return isOk; } public boolean isBad(){ - return (ordinal()&1)==1; + return !isOk; } public byte getOrdinalByte(){ @@ -38,9 +47,7 @@ public enum LedStatus { return statuses; } - public static LedStatus fromLimitsInclusiveOuterBoundary(double value, double min,double low, double high, double max, double... excludedNumbers - ){ - if(Double.isNaN(value)) return STATUS_WRONG; + public static LedStatus fromLimitsInclusiveOuterBoundary(double value, double min,double low, double high, double max, double... excludedNumbers){ if(valuemax) return STATUS_TOO_HIGH; @@ -49,11 +56,11 @@ public enum LedStatus { for (double val : excludedNumbers) { if(val==value) return STATUS_WRONG; } + if(Double.isNaN(value)) return STATUS_WRONG; return STATUS_UNDEFINED; } - public static LedStatus fromLimitsExclusiveOuterBoundary(double value, double min,double low, double high,double max, double... excludedNumbers - ){ + public static LedStatus fromLimitsExclusiveOuterBoundary(double value, double min,double low, double high,double max, double... excludedNumbers){ if(Double.isNaN(value)) return STATUS_WRONG; if(value<=min) return STATUS_TOO_LOW; if(value>=max) return STATUS_TOO_HIGH; @@ -63,11 +70,11 @@ public enum LedStatus { for (double val : excludedNumbers) { if(val==value) return STATUS_WRONG; } + if(Double.isNaN(value)) return STATUS_WRONG; return STATUS_OK; } - public static LedStatus fromLimitsInclusiveOuterBoundary(double value, double min, double max, double... excludedNumbers - ){ + public static LedStatus fromLimitsInclusiveBoundary(double value, double min, double max, double... excludedNumbers){ if(Double.isNaN(value)) return STATUS_WRONG; if(value<=min) return STATUS_TOO_LOW; else if(value==min) @@ -76,11 +83,11 @@ public enum LedStatus { for (double val : excludedNumbers) { if(val==value) return STATUS_WRONG; } + if(Double.isNaN(value)) return STATUS_WRONG; return STATUS_OK; } - public static LedStatus fromLimitsExclusiveOuterBoundary(double value, double min, double max, double... excludedNumbers - ){ + public static LedStatus fromLimitsExclusiveBoundary(double value, double min, double max, double... excludedNumbers){ if(Double.isNaN(value)) return STATUS_WRONG; if(value<=min) return STATUS_TOO_LOW; else if(value==min) @@ -89,6 +96,7 @@ public enum LedStatus { for (double val : excludedNumbers) { if(val==value) return STATUS_WRONG; } + if(Double.isNaN(value)) return STATUS_WRONG; return STATUS_OK; } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java index e67072309f..3ab2947085 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java @@ -1,8 +1,13 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.base; +import gregtech.api.enums.GT_Values; + import java.util.ArrayList; +import java.util.BitSet; import java.util.function.Function; +import static gregtech.api.enums.GT_Values.B; + /** * Instantiate parameters as field in parametersInstantiation_EM(); */ @@ -13,16 +18,24 @@ public class Parameters { final Group[] groups = new Group[10]; - final int[] iParamsIn = new int[20];//number I from parametrizers - final int[] iParamsOut = new int[20];//number O to parametrizers + int[] iParamsIn = new int[20];//number I from parametrizers + int[] iParamsOut = new int[20];//number O to parametrizers final ArrayList parameterInArrayList =new ArrayList<>(); final ArrayList parameterOutArrayList =new ArrayList<>(); - final boolean[] bParamsAreFloats =new boolean[10]; + short bParamsAreFloats=0; //package private for use in gui - final LedStatus[] eParamsInStatus = LedStatus.makeArray(20,LedStatus.STATUS_UNUSED);//LED status for I - final LedStatus[] eParamsOutStatus = LedStatus.makeArray(20,LedStatus.STATUS_UNUSED);//LED status for O + LedStatus[] eParamsInStatus = LedStatus.makeArray(20,LedStatus.STATUS_UNUSED);//LED status for I + LedStatus[] eParamsOutStatus = LedStatus.makeArray(20,LedStatus.STATUS_UNUSED);//LED status for O + + public double getIn(int hatchNo,int parameterId){ + return (bParamsAreFloats& B[hatchNo])!=0?Float.intBitsToFloat(iParamsIn[hatchNo+10*parameterId]):iParamsIn[hatchNo+10*parameterId]; + } + + public double getOut(int hatchNo,int parameterId){ + return (bParamsAreFloats& B[hatchNo])!=0?Float.intBitsToFloat(iParamsOut[hatchNo+10*parameterId]):iParamsOut[hatchNo+10*parameterId]; + } private final GT_MetaTileEntity_MultiblockBase_EM parent; @@ -37,7 +50,7 @@ public class Parameters { p.setToDefaults(defaultIn,defaultOut,defaultAreFloats); }else{ if(defaultAreFloats){ - bParamsAreFloats[hatch]=false; + bParamsAreFloats&=~B[hatch]; if(defaultIn){ iParamsIn[hatch] = 0; iParamsIn[hatch + 10] = 0; @@ -47,7 +60,7 @@ public class Parameters { iParamsOut[hatch + 10] = 0; } }else{ - if(bParamsAreFloats[hatch]){ + if((bParamsAreFloats& B[hatch])!=0){ if(defaultIn){ iParamsIn[hatch] = ZERO_FLOAT; iParamsIn[hatch + 10] = ZERO_FLOAT; @@ -110,16 +123,20 @@ public class Parameters { return new ParameterOut(paramID, defaultValue, name, status); } - public void setToDefaults(boolean defaultIn, boolean defaultOut,boolean defaultAreFloats) { - if(defaultAreFloats){ - bParamsAreFloats[hatchNo] = bParamsDefaultsAreStoredAsFloats; + public void setToDefaults(boolean defaultIn, boolean defaultOut,boolean defaultConfigureAreFloats) { + if(defaultConfigureAreFloats){ + if(bParamsDefaultsAreStoredAsFloats){ + bParamsAreFloats|= B[hatchNo]; + }else { + bParamsAreFloats&=~B[hatchNo]; + } } if(defaultIn){ for(int in=0;in<2;in++){ if(this.parameterIn[in]!=null){ this.parameterIn[in].setDefault(); }else { - if (bParamsAreFloats[hatchNo]) { + if ((bParamsAreFloats& B[hatchNo])!=0) { iParamsIn[hatchNo] = ZERO_FLOAT; iParamsIn[hatchNo + 10] = ZERO_FLOAT; } else { @@ -134,7 +151,7 @@ public class Parameters { if(this.parameterOut[out]!=null){ this.parameterOut[out].setDefault(); }else { - if (bParamsAreFloats[hatchNo]) { + if ((bParamsAreFloats& B[hatchNo])!=0) { iParamsIn[hatchNo] = ZERO_FLOAT; iParamsIn[hatchNo + 10] = ZERO_FLOAT; } else { @@ -176,11 +193,11 @@ public class Parameters { } public double get(){ - return bParamsAreFloats[hatchNo]?Float.intBitsToFloat(iParamsOut[id]):iParamsOut[id]; + return (bParamsAreFloats& B[hatchNo])!=0?Float.intBitsToFloat(iParamsOut[id]):iParamsOut[id]; } public void set(double value){ - if(bParamsAreFloats[hatchNo]) { + if((bParamsAreFloats& B[hatchNo])!=0) { iParamsOut[id]=Float.floatToIntBits((float) value); }else{ iParamsOut[id]=(int)value; @@ -229,7 +246,7 @@ public class Parameters { } private void setDefault() { - if(bParamsAreFloats[hatchNo]) { + if((bParamsAreFloats& B[hatchNo])!=0) { iParamsIn[id]=Float.floatToIntBits((float) defaultValue); }else{ iParamsIn[id]=(int)defaultValue; @@ -237,7 +254,7 @@ public class Parameters { } public double get(){ - return bParamsAreFloats[hatchNo]?Float.intBitsToFloat(iParamsIn[id]):iParamsIn[id]; + return (bParamsAreFloats& B[hatchNo])!=0?Float.intBitsToFloat(iParamsIn[id]):iParamsIn[id]; } public void updateStatus(){ -- cgit From 187984ddedb32973ec4fc09e86749a3806b2072a Mon Sep 17 00:00:00 2001 From: Dream-Master Date: Sat, 23 Feb 2019 11:54:26 +0100 Subject: fix gradle --- build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.properties b/build.properties index 460c548681..ebb04958db 100644 --- a/build.properties +++ b/build.properties @@ -1,5 +1,5 @@ minecraft.version=1.7.10 -forge.version=1.7.10-10.13.4.1614-1.7.10 +forge.version=1.7.10-10.13.4.1614 tectech.version=3.6.8 ic2.version=2.2.790-experimental -- cgit From 3a7797d2734688caba1a71a24279cceba8a67421 Mon Sep 17 00:00:00 2001 From: Dream-Master Date: Sat, 23 Feb 2019 11:55:58 +0100 Subject: update gt version --- build.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.properties b/build.properties index ebb04958db..410117c4a8 100644 --- a/build.properties +++ b/build.properties @@ -6,8 +6,8 @@ ic2.version=2.2.790-experimental codechickenlib.version=1.1.3.140 codechickencore.version=1.0.7.47 nei.version=1.0.5.120 -gregtech.jenkinsbuild=227 -gregtech.version=5.09.33.07 +gregtech.jenkinsbuild=241 +gregtech.version=5.09.33.10 cofhcore.version=[1.7.10]3.1.4-329-dev cofhlib.version=[1.7.10]1.0.3-175-dev -- cgit From 49bbc0df0fed717b95c3e5232e7cee1b6406d90a Mon Sep 17 00:00:00 2001 From: Dream-Master Date: Sat, 23 Feb 2019 12:06:34 +0100 Subject: fix gradle again --- build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.properties b/build.properties index 410117c4a8..6a9a79e5d7 100644 --- a/build.properties +++ b/build.properties @@ -1,5 +1,5 @@ minecraft.version=1.7.10 -forge.version=1.7.10-10.13.4.1614 +forge.version=1.7.10-10.13.4.1614-1.7.10 tectech.version=3.6.8 ic2.version=2.2.790-experimental -- cgit From 615fc4e2495ca8bae3fcd45c54e5fe8cfc2e3681 Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 10 Mar 2019 14:25:39 +0100 Subject: storing work --- src/main/java/com/github/technus/tectech/Util.java | 139 +++++++-- .../GT_MetaTileEntity_EM_essentiaDequantizer.java | 6 +- .../GT_MetaTileEntity_EM_essentiaQuantizer.java | 6 +- .../tectech/loader/recipe/BloodyRecipeLoader.java | 52 ++-- .../hatch/GT_MetaTileEntity_Hatch_Param.java | 62 ++-- .../hatch/gui/GT_Container_Param.java | 74 ++--- .../hatch/gui/GT_Container_ParamAdv.java | 108 +++---- .../hatch/gui/GT_GUIContainer_Param.java | 15 +- .../hatch/gui/GT_GUIContainer_ParamAdv.java | 26 +- .../multi/GT_MetaTileEntity_EM_annihilation.java | 3 +- .../multi/GT_MetaTileEntity_EM_bhg.java | 3 +- .../multi/GT_MetaTileEntity_EM_collider.java | 36 ++- .../multi/GT_MetaTileEntity_EM_computer.java | 45 ++- .../multi/GT_MetaTileEntity_EM_crafting.java | 3 +- .../multi/GT_MetaTileEntity_EM_dataBank.java | 15 +- .../multi/GT_MetaTileEntity_EM_decay.java | 27 +- .../multi/GT_MetaTileEntity_EM_dequantizer.java | 6 +- .../multi/GT_MetaTileEntity_EM_infuser.java | 3 +- .../multi/GT_MetaTileEntity_EM_junction.java | 108 ++++--- .../multi/GT_MetaTileEntity_EM_quantizer.java | 6 +- .../multi/GT_MetaTileEntity_EM_research.java | 14 +- .../multi/GT_MetaTileEntity_EM_scanner.java | 57 +++- .../multi/GT_MetaTileEntity_EM_stabilizer.java | 3 +- .../multi/GT_MetaTileEntity_EM_switch.java | 83 ++--- .../multi/GT_MetaTileEntity_EM_transformer.java | 3 +- .../multi/GT_MetaTileEntity_EM_wormhole.java | 3 +- .../multi/GT_MetaTileEntity_TM_microwave.java | 125 +++----- .../multi/GT_MetaTileEntity_TM_teslaCoil.java | 15 +- .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 183 ++++------- .../metaTileEntity/multi/base/HatchAdder.java | 8 + .../thing/metaTileEntity/multi/base/LedStatus.java | 19 +- .../metaTileEntity/multi/base/NameFunction.java | 8 + .../metaTileEntity/multi/base/Parameters.java | 303 ++++++++++-------- .../metaTileEntity/multi/base/StatusFunction.java | 8 + .../multi/em_machine/Behaviour_Centrifuge.java | 112 ++++--- .../multi/em_machine/Behaviour_Electrolyzer.java | 12 +- .../Behaviour_ElectromagneticSeparator.java | 12 +- .../multi/em_machine/Behaviour_PrecisionLaser.java | 12 +- .../multi/em_machine/Behaviour_Recycler.java | 12 +- .../multi/em_machine/Behaviour_Scanner.java | 12 +- .../em_machine/GT_MetaTileEntity_EM_machine.java | 342 ++++++++------------- .../single/GT_MetaTileEntity_DataReader.java | 10 +- .../single/gui/GT_GUIContainer_DataReader.java | 6 +- 43 files changed, 1052 insertions(+), 1053 deletions(-) create mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/HatchAdder.java create mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/NameFunction.java create mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/StatusFunction.java diff --git a/src/main/java/com/github/technus/tectech/Util.java b/src/main/java/com/github/technus/tectech/Util.java index 1fd479939c..05e7fd6336 100644 --- a/src/main/java/com/github/technus/tectech/Util.java +++ b/src/main/java/com/github/technus/tectech/Util.java @@ -2,6 +2,7 @@ package com.github.technus.tectech; import com.github.technus.tectech.thing.casing.TT_Container_Casings; import com.github.technus.tectech.thing.metaTileEntity.IFrontRotation; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -13,6 +14,8 @@ import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; import net.minecraft.init.Items; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -22,8 +25,6 @@ import net.minecraftforge.fluids.FluidStack; import org.apache.commons.lang3.StringUtils; import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; @@ -71,6 +72,22 @@ public final class Util { return result.toString(); } + public static String longBitsToShortString(long number) { + StringBuilder result = new StringBuilder(16); + + for (int i = 63; i >= 0; i--) { + int mask = 1 << i; + result.append((number & mask) != 0 ? ":" : "."); + + if (i % 8 == 0) { + result.append('|'); + } + } + result.replace(result.length() - 1, result.length(), ""); + + return result.toString(); + } + //region junk /* //Check Machine Structure based on string[][] (effectively char[][][]), ond offset of the controller @@ -360,14 +377,14 @@ public final class Util { */ //endregion + //Check Machine Structure based on string[][] (effectively char[][][]), ond offset of the controller //This only checks for REGULAR BLOCKS! public static boolean StructureCheckerExtreme( String[][] structure,//0-9 casing, +- air no air, A... ignore 'A'-CHAR-1 blocks Block[] blockType,//use numbers 0-9 for casing types byte[] blockMeta,//use numbers 0-9 for casing types - Method adder, - String[] addingMethods, + HatchAdder[] addingMethods, short[] casingTextures, Block[] blockTypeFallback,//use numbers 0-9 for casing types byte[] blockMetaFallback,//use numbers 0-9 for casing types @@ -578,28 +595,22 @@ public final class Util { } return false; } - } else if ((pointer = block - ' ') >= 0) { + } else //noinspection ConstantConditions + if ((pointer = block - ' ') >= 0) { igt = aBaseMetaTileEntity.getIGregTechTileEntity(x, y, z); - try { - if (igt == null || !(boolean) adder.invoke(imt, addingMethods[pointer], igt, casingTextures[pointer])) { - if (world.getBlock(x, y, z) != blockTypeFallback[pointer]) { - if (DEBUG_MODE) { - TecTech.LOGGER.info("Fallback-struct-block-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlock(x, y, z).getUnlocalizedName() + ' ' + (blockTypeFallback[pointer] == null ? "null" : blockTypeFallback[pointer].getUnlocalizedName())); - } - return false; - } - if (world.getBlockMetadata(x, y, z) != blockMetaFallback[pointer]) { - if (DEBUG_MODE) { - TecTech.LOGGER.info("Fallback-Struct-meta-id-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlockMetadata(x, y, z) + ' ' + blockMetaFallback[pointer]); - } - return false; + if (igt == null || !addingMethods[pointer].apply(igt, casingTextures[pointer])) { + if (world.getBlock(x, y, z) != blockTypeFallback[pointer]) { + if (DEBUG_MODE) { + TecTech.LOGGER.info("Fallback-struct-block-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlock(x, y, z).getUnlocalizedName() + ' ' + (blockTypeFallback[pointer] == null ? "null" : blockTypeFallback[pointer].getUnlocalizedName())); } + return false; } - } catch (InvocationTargetException | IllegalAccessException e) { - if (DEBUG_MODE) { - e.printStackTrace(); + if (world.getBlockMetadata(x, y, z) != blockMetaFallback[pointer]) { + if (DEBUG_MODE) { + TecTech.LOGGER.info("Fallback-Struct-meta-id-error " + x + ' ' + y + ' ' + z + " / " + a + ' ' + b + ' ' + c + " / " + world.getBlockMetadata(x, y, z) + ' ' + blockMetaFallback[pointer]); + } + return false; } - return false; } } } @@ -1291,18 +1302,18 @@ public final class Util { return (testedValue & setBits) == setBits; } - public static class TT_ItemStack implements Comparable { + public static class ItemStack_NoNBT implements Comparable { public final Item mItem; public final int mStackSize; public final int mMetaData; - public TT_ItemStack(Item aItem, long aStackSize, long aMetaData) { + public ItemStack_NoNBT(Item aItem, long aStackSize, long aMetaData) { this.mItem = aItem; this.mStackSize = (byte) ((int) aStackSize); this.mMetaData = (short) ((int) aMetaData); } - public TT_ItemStack(ItemStack aStack) { + public ItemStack_NoNBT(ItemStack aStack) { if (aStack == null) { mItem = null; mStackSize = mMetaData = 0; @@ -1314,7 +1325,7 @@ public final class Util { } @Override - public int compareTo(TT_ItemStack o) { + public int compareTo(ItemStack_NoNBT o) { if (mMetaData > o.mMetaData) return 1; if (mMetaData < o.mMetaData) return -1; if (mStackSize > o.mStackSize) return 1; @@ -1329,10 +1340,10 @@ public final class Util { @Override public boolean equals(Object aStack) { return aStack == this || - (aStack instanceof TT_ItemStack && - ((mItem == ((TT_ItemStack) aStack).mItem) || ((TT_ItemStack) aStack).mItem.getUnlocalizedName().equals(this.mItem.getUnlocalizedName())) && - ((TT_ItemStack) aStack).mStackSize == this.mStackSize && - ((TT_ItemStack) aStack).mMetaData == this.mMetaData); + (aStack instanceof ItemStack_NoNBT && + ((mItem == ((ItemStack_NoNBT) aStack).mItem) || ((ItemStack_NoNBT) aStack).mItem.getUnlocalizedName().equals(this.mItem.getUnlocalizedName())) && + ((ItemStack_NoNBT) aStack).mStackSize == this.mStackSize && + ((ItemStack_NoNBT) aStack).mMetaData == this.mMetaData); } @Override @@ -1346,7 +1357,7 @@ public final class Util { } } - public static void setTier(int tier,Object me){ + public static void setTier(int tier,GT_MetaTileEntity_TieredMachineBlock me){ try{ Field field=GT_MetaTileEntity_TieredMachineBlock.class.getField("mTier"); field.setAccessible(true); @@ -1355,4 +1366,70 @@ public final class Util { e.printStackTrace(); } } + + public static double receiveDouble(double previousValue, int startIndex, int index, int value){ + return Double.longBitsToDouble(receiveLong(Double.doubleToLongBits(previousValue),startIndex,index,value)); + } + + public static long receiveLong(long previousValue, int startIndex, int index, int value){ + value &=0xFFFF; + switch (index-startIndex){ + case 0: + previousValue&= 0xFFFF_FFFF_FFFF_0000L; + previousValue|=value; + break; + case 1: + previousValue&=0xFFFF_FFFF_0000_FFFFL; + previousValue|=value<<16; + break; + case 2: + previousValue&=0xFFFF_0000_FFFF_FFFFL; + previousValue|=(long)value<<32; + break; + case 3: + previousValue&=0x0000_FFFF_FFFF_FFFFL; + previousValue|=(long)value<<48; + break; + } + return previousValue; + } + + public static void sendDouble(double value,Container container, ICrafting crafter,int startIndex){ + sendLong(Double.doubleToLongBits(value),container,crafter,startIndex); + } + + public static void sendLong(long value,Container container, ICrafting crafter,int startIndex){ + crafter.sendProgressBarUpdate(container, startIndex++, (int)(value & 0xFFFFL)); + crafter.sendProgressBarUpdate(container, startIndex++, (int)((value & 0xFFFF0000L)>>>16)); + crafter.sendProgressBarUpdate(container, startIndex++, (int)((value & 0xFFFF00000000L)>>>32)); + crafter.sendProgressBarUpdate(container, startIndex, (int)((value & 0xFFFF000000000000L)>>>48)); + } + + public static float receiveFloat(float previousValue, int startIndex, int index, int value){ + return Float.intBitsToFloat(receiveInteger(Float.floatToIntBits(previousValue),startIndex,index,value)); + } + + public static int receiveInteger(int previousValue, int startIndex, int index, int value){ + value &=0xFFFF; + switch (index-startIndex){ + case 0: + previousValue&= 0xFFFF_0000; + previousValue|=value; + break; + case 1: + previousValue&=0x0000_FFFF; + previousValue|=value<<16; + break; + } + return previousValue; + } + + public static void sendFloat(float value,Container container, ICrafting crafter,int startIndex){ + sendInteger(Float.floatToIntBits(value),container,crafter,startIndex); + } + + public static void sendInteger(int value,Container container, ICrafting crafter,int startIndex){ + crafter.sendProgressBarUpdate(container, startIndex++, (int)(value & 0xFFFFL)); + crafter.sendProgressBarUpdate(container, startIndex, (value & 0xFFFF0000)>>>16); + } } diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java index 6a9ef392cd..96230201ba 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java @@ -10,6 +10,7 @@ import com.github.technus.tectech.thing.casing.TT_Container_Casings; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_quantizer; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -45,7 +46,10 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_ }; private static final Block[] blockType = new Block[]{QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{0,0,4,8}; - private static final String[] addingMethods = new String[]{"addClassicToMachineList", "addElementalInputToMachineList", "addElementalMufflerToMachineList"}; + private final HatchAdder[] addingMethods = new HatchAdder[]{ + this::addClassicToMachineList, + this::addElementalInputToMachineList, + this::addElementalMufflerToMachineList}; private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4, 4}; diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java index 0fbf3aaa13..ba97367cd7 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java @@ -10,6 +10,7 @@ import com.github.technus.tectech.thing.casing.TT_Container_Casings; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_quantizer; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -45,7 +46,10 @@ public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_Mu }; private static final Block[] blockType = new Block[]{QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{0,4,0,8}; - private static final String[] addingMethods = new String[]{"addClassicToMachineList", "addElementalOutputToMachineList", "addElementalMufflerToMachineList"}; + private final HatchAdder[] addingMethods = new HatchAdder[]{ + this::addClassicToMachineList, + this::addElementalOutputToMachineList, + this::addElementalMufflerToMachineList}; private static final short[] casingTextures = new short[]{textureOffset, textureOffset+4, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4, 4}; diff --git a/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java b/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java index 6e3a95aaad..fc2cc455de 100644 --- a/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java @@ -570,38 +570,38 @@ public class BloodyRecipeLoader implements Runnable { } private void register_machine_EM_behaviours(){ - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(6),ItemList.Machine_IV_Centrifuge.get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(6),ItemList.Machine_IV_Centrifuge.get(1)); try { - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(7),ItemList.valueOf("Machine_LuV_Centrifuge").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(8),ItemList.valueOf("Machine_ZPM_Centrifuge").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(9),ItemList.valueOf("Machine_UV_Centrifuge").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(10),ItemList.valueOf("Machine_UV_Centrifuge").get(4)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(11),ItemList.valueOf("Machine_UV_Centrifuge").get(16)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(12),ItemList.valueOf("Machine_UV_Centrifuge").get(64)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(7),ItemList.valueOf("Machine_LuV_Centrifuge").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(8),ItemList.valueOf("Machine_ZPM_Centrifuge").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(9),ItemList.valueOf("Machine_UV_Centrifuge").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(10),ItemList.valueOf("Machine_UV_Centrifuge").get(4)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(11),ItemList.valueOf("Machine_UV_Centrifuge").get(16)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(12),ItemList.valueOf("Machine_UV_Centrifuge").get(64)); }catch (IllegalArgumentException|NullPointerException e){ - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(7),ItemList.Machine_IV_Centrifuge.get(2)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(8),ItemList.Machine_IV_Centrifuge.get(4)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(9),ItemList.Machine_IV_Centrifuge.get(8)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(10),ItemList.Machine_IV_Centrifuge.get(16)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(11),ItemList.Machine_IV_Centrifuge.get(32)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(12),ItemList.Machine_IV_Centrifuge.get(64)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(7),ItemList.Machine_IV_Centrifuge.get(2)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(8),ItemList.Machine_IV_Centrifuge.get(4)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(9),ItemList.Machine_IV_Centrifuge.get(8)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(10),ItemList.Machine_IV_Centrifuge.get(16)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(11),ItemList.Machine_IV_Centrifuge.get(32)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(12),ItemList.Machine_IV_Centrifuge.get(64)); } - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(6),ItemList.Machine_IV_ElectromagneticSeparator.get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(6),ItemList.Machine_IV_ElectromagneticSeparator.get(1)); try { - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(7),ItemList.valueOf("Machine_LuV_ElectromagneticSeparator").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(8),ItemList.valueOf("Machine_ZPM_ElectromagneticSeparator").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(9),ItemList.valueOf("Machine_UV_ElectromagneticSeparator").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(10),ItemList.valueOf("Machine_UV_ElectromagneticSeparator").get(4)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(11),ItemList.valueOf("Machine_UV_ElectromagneticSeparator").get(16)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(12),ItemList.valueOf("Machine_UV_ElectromagneticSeparator").get(64)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(7),ItemList.valueOf("Machine_LuV_ElectromagneticSeparator").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(8),ItemList.valueOf("Machine_ZPM_ElectromagneticSeparator").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(9),ItemList.valueOf("Machine_UV_ElectromagneticSeparator").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(10),ItemList.valueOf("Machine_UV_ElectromagneticSeparator").get(4)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(11),ItemList.valueOf("Machine_UV_ElectromagneticSeparator").get(16)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(12),ItemList.valueOf("Machine_UV_ElectromagneticSeparator").get(64)); }catch (IllegalArgumentException|NullPointerException e){ - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(7),ItemList.Machine_IV_ElectromagneticSeparator.get(2)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(8),ItemList.Machine_IV_ElectromagneticSeparator.get(4)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(9),ItemList.Machine_IV_ElectromagneticSeparator.get(8)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(10),ItemList.Machine_IV_ElectromagneticSeparator.get(16)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(11),ItemList.Machine_IV_ElectromagneticSeparator.get(32)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(12),ItemList.Machine_IV_ElectromagneticSeparator.get(64)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(7),ItemList.Machine_IV_ElectromagneticSeparator.get(2)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(8),ItemList.Machine_IV_ElectromagneticSeparator.get(4)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(9),ItemList.Machine_IV_ElectromagneticSeparator.get(8)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(10),ItemList.Machine_IV_ElectromagneticSeparator.get(16)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(11),ItemList.Machine_IV_ElectromagneticSeparator.get(32)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(12),ItemList.Machine_IV_ElectromagneticSeparator.get(64)); } } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java index 2a2812368b..aa92eb777e 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java @@ -26,13 +26,12 @@ import net.minecraftforge.fluids.FluidStack; * Created by danie_000 on 15.12.2016. */ public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch { - private boolean usesFloat = false; public int pointer = 0; public int param = -1; - public int value0i = 0; - public int value1i = 0; - public int input0i = 0; - public int input1i = 0; + public double value0i = 0; + public double value1i = 0; + public double input0i = 0; + public double input1i = 0; private static Textures.BlockIcons.CustomIcon ScreenON; private static Textures.BlockIcons.CustomIcon ScreenOFF; @@ -105,9 +104,6 @@ public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch { @Override public String[] getInfoData() { - if(mTier>7) { - return new String[]{"Parametrizer ID: " + EnumChatFormatting.GREEN + param, "Value 0I: " + EnumChatFormatting.AQUA + value0i, "Value 0FB: " + EnumChatFormatting.AQUA + Float.intBitsToFloat(value0i) + ' ' + Util.intBitsToShortString(value0i), "Value 1I: " + EnumChatFormatting.BLUE + value1i, "Value 1FB: " + EnumChatFormatting.BLUE + Float.intBitsToFloat(value1i) + ' ' + Util.intBitsToShortString(value1i), "Input 0I: " + EnumChatFormatting.GOLD + input0i, "Input 0FB: " + EnumChatFormatting.GOLD + Float.intBitsToFloat(input0i) + ' ' + Util.intBitsToShortString(input0i), "Input 1I: " + EnumChatFormatting.YELLOW + input1i, "Input 1FB: " + EnumChatFormatting.YELLOW + Float.intBitsToFloat(input1i) + ' ' + Util.intBitsToShortString(input1i),}; - } return new String[]{ "Parametrizer ID: " + EnumChatFormatting.GREEN + param, "Value 0I: " + EnumChatFormatting.AQUA + value0i, @@ -135,24 +131,41 @@ public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch { @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); - aNBT.setBoolean("eFloats", usesFloat); aNBT.setInteger("ePointer", pointer); - aNBT.setInteger("eValue0i", value0i); - aNBT.setInteger("eValue1i", value1i); - aNBT.setInteger("eInput0i", value0i); - aNBT.setInteger("eInput1i", value1i); + aNBT.setDouble("eDValue0i", value0i); + aNBT.setDouble("eDValue1i", value1i); + aNBT.setDouble("eDInput0i", input0i); + aNBT.setDouble("eDInput1i", input1i); aNBT.setInteger("eParam", param); } @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); - usesFloat = aNBT.getBoolean("eFloats"); pointer = aNBT.getInteger("ePointer"); - value0i=aNBT.getInteger("eValue0i"); - value1i=aNBT.getInteger("eValue1i"); - value0i=aNBT.getInteger("eInput0i"); - value1i=aNBT.getInteger("eInput1i"); + if(aNBT.hasKey("eFloats") || + aNBT.hasKey("eValue0i") || + aNBT.hasKey("eValue1i") || + aNBT.hasKey("eInput0i") || + aNBT.hasKey("eInput1i")){ + boolean usesFloat = aNBT.getBoolean("eFloats"); + if(usesFloat){ + value0i=Float.intBitsToFloat(aNBT.getInteger("eValue0i")); + value1i=Float.intBitsToFloat(aNBT.getInteger("eValue1i")); + input0i=Float.intBitsToFloat(aNBT.getInteger("eInput0i")); + input1i=Float.intBitsToFloat(aNBT.getInteger("eInput1i")); + }else { + value0i=aNBT.getInteger("eValue0i"); + value1i=aNBT.getInteger("eValue1i"); + input0i=aNBT.getInteger("eInput0i"); + input1i=aNBT.getInteger("eInput1i"); + } + }else{ + value0i=aNBT.getDouble("eDValue0i"); + value1i=aNBT.getDouble("eDValue1i"); + input0i=aNBT.getDouble("eDInput0i"); + input1i=aNBT.getDouble("eDInput1i"); + } param = aNBT.getInteger("eParam"); } @@ -198,17 +211,4 @@ public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch { EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "E=mine*craft\u00b2" }; } - - public boolean isUsingFloats() { - return mTier > 7 && usesFloat; - } - - //returns - succeded - public boolean setUsingFloats(boolean value){ - if(mTier>7){ - usesFloat=value; - return true; - } - return !value; - } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Param.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Param.java index fec3be6e20..db0c2d501f 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Param.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Param.java @@ -1,6 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch.gui; import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.Util; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Param; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -15,10 +16,10 @@ import net.minecraft.item.ItemStack; public class GT_Container_Param extends GT_ContainerMetaTile_Machine { public int param = 0; - public int value0f = 0; - public int value1f = 0; - public int input0f = 0; - public int input1f = 0; + public double value0f = 0; + public double value1f = 0; + public double input0f = 0; + public double input1f = 0; public GT_Container_Param(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(aInventoryPlayer, aTileEntity); @@ -67,8 +68,8 @@ public class GT_Container_Param extends GT_ContainerMetaTile_Machine { paramH.value1i -= aShifthold == 1 ? 4096 : 256; break; case 3: - paramH.value0i >>= aShifthold == 1 ? 16 : 4; - paramH.value1i >>= aShifthold == 1 ? 16 : 4; + paramH.value0i /= aShifthold == 1 ? 4096 : 256; + paramH.value1i /= aShifthold == 1 ? 4096 : 256; break; case 4: paramH.param -= aShifthold == 1 ? 2 : 1; @@ -80,8 +81,8 @@ public class GT_Container_Param extends GT_ContainerMetaTile_Machine { paramH.value1i -= aShifthold == 1 ? 16 : 1; break; case 7: - paramH.value0i >>= aShifthold == 1 ? 2 : 1; - paramH.value1i >>= aShifthold == 1 ? 2 : 1; + paramH.value0i /= aShifthold == 1 ? 16 : 2; + paramH.value1i /= aShifthold == 1 ? 16 : 2; break; case 8: paramH.param += aShifthold == 1 ? 16 : 4; @@ -93,8 +94,8 @@ public class GT_Container_Param extends GT_ContainerMetaTile_Machine { paramH.value1i += aShifthold == 1 ? 4096 : 256; break; case 11: - paramH.value0i <<= aShifthold == 1 ? 16 : 4; - paramH.value1i <<= aShifthold == 1 ? 16 : 4; + paramH.value0i *= aShifthold == 1 ? 4096 : 256; + paramH.value1i *= aShifthold == 1 ? 4096 : 256; break; case 12: paramH.param += aShifthold == 1 ? 2 : 1; @@ -106,8 +107,8 @@ public class GT_Container_Param extends GT_ContainerMetaTile_Machine { paramH.value1i += aShifthold == 1 ? 16 : 1; break; case 15: - paramH.value0i <<= aShifthold == 1 ? 2 : 1; - paramH.value1i <<= aShifthold == 1 ? 2 : 1; + paramH.value0i *= aShifthold == 1 ? 16 : 2; + paramH.value1i *= aShifthold == 1 ? 16 : 2; break; default: doStuff = false; @@ -139,16 +140,11 @@ public class GT_Container_Param extends GT_ContainerMetaTile_Machine { for (Object crafter : crafters) { ICrafting var1 = (ICrafting) crafter; - var1.sendProgressBarUpdate(this, 100, param & 0xFFFF); - var1.sendProgressBarUpdate(this, 101, param >>> 16); - var1.sendProgressBarUpdate(this, 102, value0f & 0xFFFF); - var1.sendProgressBarUpdate(this, 103, value0f >>> 16); - var1.sendProgressBarUpdate(this, 104, value1f & 0xFFFF); - var1.sendProgressBarUpdate(this, 105, value1f >>> 16); - var1.sendProgressBarUpdate(this, 106, input0f & 0xFFFF); - var1.sendProgressBarUpdate(this, 107, input0f >>> 16); - var1.sendProgressBarUpdate(this, 108, input1f & 0xFFFF); - var1.sendProgressBarUpdate(this, 109, input1f >>> 16); + Util.sendInteger(param,this,var1,100); + Util.sendDouble(value0f,this,var1,102); + Util.sendDouble(value1f,this,var1, 106); + Util.sendDouble(input0f,this,var1, 110); + Util.sendDouble(input1f,this,var1, 114); } } @@ -158,34 +154,32 @@ public class GT_Container_Param extends GT_ContainerMetaTile_Machine { super.updateProgressBar(par1, par2); switch (par1) { case 100: - param = param & 0xFFFF0000 | par2; - return; case 101: - param = param & 0xFFFF | par2 << 16; + param=Util.receiveInteger(param,100,par1,par2); return; case 102: - value0f = value0f & 0xFFFF0000 | par2; - break; case 103: - value0f = value0f & 0xFFFF | par2 << 16; - break; case 104: - value1f = value1f & 0xFFFF0000 | par2; - break; case 105: - value1f = value1f & 0xFFFF | par2 << 16; - break; + value0f=Util.receiveDouble(value0f,102,par1,par2); + return; case 106: - input0f = input0f & 0xFFFF0000 | par2; - break; case 107: - input0f = input0f & 0xFFFF | par2 << 16; - break; case 108: - input1f = input1f & 0xFFFF0000 | par2; - return; case 109: - input1f = input1f & 0xFFFF | par2 << 16; + value1f=Util.receiveDouble(value1f,106,par1,par2); + return; + case 110: + case 111: + case 112: + case 113: + input0f=Util.receiveDouble(input0f,110,par1,par2); + return; + case 114: + case 115: + case 116: + case 117: + input1f=Util.receiveDouble(input1f,114,par1,par2); return; default: } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java index 90d8a26d1c..6b1e4f68cd 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java @@ -1,6 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch.gui; import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.Util; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Param; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -14,13 +15,12 @@ import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; public class GT_Container_ParamAdv extends GT_ContainerMetaTile_Machine { - public boolean usesFloats = false; public int pointer=0; public int param = 0; - public int value1f = 0; - public int value0f = 0; - public int input0f = 0; - public int input1f = 0; + public double value1f = 0; + public double value0f = 0; + public double input0f = 0; + public double input1f = 0; public GT_Container_ParamAdv(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(aInventoryPlayer, aTileEntity); @@ -60,7 +60,6 @@ public class GT_Container_ParamAdv extends GT_ContainerMetaTile_Machine { GT_MetaTileEntity_Hatch_Param paramH = (GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity(); int columnPointer=paramH.pointer &0xff; boolean secondRow=(paramH.pointer &0x0100)!=0; - boolean showInts=!paramH.isUsingFloats(); switch (aSlotIndex) { case 0: paramH.param -= aShifthold == 1 ? 16 : 4; @@ -82,15 +81,19 @@ public class GT_Container_ParamAdv extends GT_ContainerMetaTile_Machine { case 3: if (aShifthold == 1) { if (secondRow) { - paramH.value1i = 0xFFFFFFFF; + paramH.value1i = Double.longBitsToDouble(0xFFFF_FFFF_FFFF_FFFFL); } else { - paramH.value0i = 0xFFFFFFFF; + paramH.value0i = Double.longBitsToDouble(0xFFFF_FFFF_FFFF_FFFFL); } } else { if (secondRow) { - paramH.value1i |= 1 << columnPointer; + long temp=Double.doubleToLongBits(paramH.value1i); + temp |= 1 << columnPointer; + paramH.value1i=Double.longBitsToDouble(temp); } else { - paramH.value0i |= 1 << columnPointer; + long temp=Double.doubleToLongBits(paramH.value0i); + temp |= 1 << columnPointer; + paramH.value0i=Double.longBitsToDouble(temp); } } break; @@ -114,15 +117,19 @@ public class GT_Container_ParamAdv extends GT_ContainerMetaTile_Machine { case 7: if (aShifthold == 1) { if (secondRow) { - paramH.value1i = 0; + paramH.value1i = Double.longBitsToDouble(0); } else { - paramH.value0i = 0; + paramH.value0i = Double.longBitsToDouble(0); } } else { if (secondRow) { - paramH.value1i &= ~(1 << columnPointer); + long temp=Double.doubleToLongBits(paramH.value1i); + temp &= ~(1 << columnPointer); + paramH.value1i=Double.longBitsToDouble(temp); } else { - paramH.value0i &= ~(1 << columnPointer); + long temp=Double.doubleToLongBits(paramH.value0i); + temp &= ~(1 << columnPointer); + paramH.value0i=Double.longBitsToDouble(temp); } } break; @@ -144,7 +151,8 @@ public class GT_Container_ParamAdv extends GT_ContainerMetaTile_Machine { } break; case 11: - showInts ^= true; + paramH.value0i=paramH.input0i; + paramH.value1i=paramH.input1i; break; case 12: paramH.param += aShifthold == 1 ? 2 : 1; @@ -166,15 +174,19 @@ public class GT_Container_ParamAdv extends GT_ContainerMetaTile_Machine { case 15: if (aShifthold == 1) { if (secondRow) { - paramH.value1i ^= 0xFFFFFFFF; + paramH.value1i = Double.longBitsToDouble(~Double.doubleToLongBits(paramH.value1i)); } else { - paramH.value0i ^= 0xFFFFFFFF; + paramH.value0i = Double.longBitsToDouble(~Double.doubleToLongBits(paramH.value1i)); } } else { if (secondRow) { - paramH.value1i ^= 1 << columnPointer; + long temp=Double.doubleToLongBits(paramH.value1i); + temp ^= 1 << columnPointer; + paramH.value1i=Double.longBitsToDouble(temp); } else { - paramH.value0i ^= 1 << columnPointer; + long temp=Double.doubleToLongBits(paramH.value0i); + temp ^= 1 << columnPointer; + paramH.value0i=Double.longBitsToDouble(temp); } } break; @@ -190,7 +202,6 @@ public class GT_Container_ParamAdv extends GT_ContainerMetaTile_Machine { columnPointer = 0; } paramH.pointer=secondRow?columnPointer+0x100:columnPointer; - paramH.setUsingFloats(!showInts); if (paramH.param > 9) { paramH.param = 9; } else if (paramH.param < -1) { @@ -213,22 +224,15 @@ public class GT_Container_ParamAdv extends GT_ContainerMetaTile_Machine { input0f = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).input0i; input1f = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).input1i; pointer = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).pointer; - usesFloats =((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).isUsingFloats(); for (Object crafter : crafters) { ICrafting var1 = (ICrafting) crafter; - var1.sendProgressBarUpdate(this, 100, param & 0xFFFF); - var1.sendProgressBarUpdate(this, 101, param >>> 16); - var1.sendProgressBarUpdate(this, 102, value0f & 0xFFFF); - var1.sendProgressBarUpdate(this, 103, value0f >>> 16); - var1.sendProgressBarUpdate(this, 104, value1f & 0xFFFF); - var1.sendProgressBarUpdate(this, 105, value1f >>> 16); - var1.sendProgressBarUpdate(this, 106, input0f & 0xFFFF); - var1.sendProgressBarUpdate(this, 107, input0f >>> 16); - var1.sendProgressBarUpdate(this, 108, input1f & 0xFFFF); - var1.sendProgressBarUpdate(this, 109, input1f >>> 16); - var1.sendProgressBarUpdate(this, 110, pointer); - var1.sendProgressBarUpdate(this, 111, usesFloats ? 1 : 0); + Util.sendInteger(param,this,var1,100); + Util.sendDouble(value0f,this,var1,102); + Util.sendDouble(value1f,this,var1, 106); + Util.sendDouble(input0f,this,var1, 110); + Util.sendDouble(input1f,this,var1, 114); + Util.sendInteger(pointer,this,var1,118); } } @@ -238,39 +242,37 @@ public class GT_Container_ParamAdv extends GT_ContainerMetaTile_Machine { super.updateProgressBar(par1, par2); switch (par1) { case 100: - param = param & 0xFFFF0000 | par2; - return; case 101: - param = param & 0xFFFF | par2 << 16; + param=Util.receiveInteger(param,100,par1,par2); return; case 102: - value0f = value0f & 0xFFFF0000 | par2; - break; case 103: - value0f = value0f & 0xFFFF | par2 << 16; - break; case 104: - value1f = value1f & 0xFFFF0000 | par2; - break; case 105: - value1f = value1f & 0xFFFF | par2 << 16; - break; + value0f=Util.receiveDouble(value0f,102,par1,par2); + return; case 106: - input0f = input0f & 0xFFFF0000 | par2; - break; case 107: - input0f = input0f & 0xFFFF | par2 << 16; - break; case 108: - input1f = input1f & 0xFFFF0000 | par2; - return; case 109: - input1f = input1f & 0xFFFF | par2 << 16; + value1f=Util.receiveDouble(value1f,106,par1,par2); return; case 110: - pointer = par2 & 0xFFFF; case 111: - usesFloats = par2 != 0; + case 112: + case 113: + input0f=Util.receiveDouble(input0f,110,par1,par2); + return; + case 114: + case 115: + case 116: + case 117: + input1f=Util.receiveDouble(input1f,114,par1,par2); + return; + case 118: + case 119: + pointer=Util.receiveInteger(pointer,118,par1,par2); + return; default: } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java index d9502333d8..9b8f818da8 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java @@ -4,6 +4,7 @@ import com.github.technus.tectech.Util; import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.InventoryPlayer; +import org.lwjgl.opengl.GL11; import java.util.Locale; @@ -20,12 +21,14 @@ public class GT_GUIContainer_Param extends GT_GUIContainerMetaTile_Machine { if (mContainer != null) { proxy.renderUnicodeString("Parameters: " + ((GT_Container_Param) mContainer).param, 46, 7, 167, 0xffffff); Locale locale= Locale.getDefault(); - proxy.renderUnicodeString("\u24EA\u2b07" + String.format(locale, "%+d", ((GT_Container_Param) mContainer).input0f), 46, 16, 167, 0x22ddff); - proxy.renderUnicodeString("\u2460\u2b07" + String.format(locale, "%+d", ((GT_Container_Param) mContainer).input1f), 46, 24, 167, 0x00ffff); - proxy.renderUnicodeString("\u24EA\u2b06" + String.format(locale, "%+d", ((GT_Container_Param) mContainer).value0f), 46, 33, 167, 0x00bbff); - proxy.renderUnicodeString("\u2460\u2b06" + String.format(locale, "%+d", ((GT_Container_Param) mContainer).value1f), 46, 41, 167, 0x0077ff); - proxy.renderUnicodeString("\u24EA\u2b06" + Util.intBitsToShortString(((GT_Container_Param) mContainer).value0f), 46, 50, 167, 0x00bbff); - proxy.renderUnicodeString("\u2460\u2b06" + Util.intBitsToShortString(((GT_Container_Param) mContainer).value1f), 46, 58, 167, 0x0077ff); + proxy.renderUnicodeString("\u24EA\u2b07" + String.format(locale, "%+.5E", ((GT_Container_Param) mContainer).input0f), 46, 16, 167, 0x22ddff); + proxy.renderUnicodeString("\u2460\u2b07" + String.format(locale, "%+.5E", ((GT_Container_Param) mContainer).input1f), 46, 24, 167, 0x00ffff); + proxy.renderUnicodeString("\u24EA\u2b06" + String.format(locale, "%+.5E", ((GT_Container_Param) mContainer).value0f), 46, 33, 167, 0x00bbff); + proxy.renderUnicodeString("\u2460\u2b06" + String.format(locale, "%+.5E", ((GT_Container_Param) mContainer).value1f), 46, 41, 167, 0x0077ff); + GL11.glScalef(.5f,.5f,.5f); + proxy.renderUnicodeString("\u24EA\u2b06" + Util.longBitsToShortString(Double.doubleToLongBits(((GT_Container_Param) mContainer).value0f)), 46*2, 50*2, 167*2, 0x00bbff); + proxy.renderUnicodeString("\u2460\u2b06" + Util.longBitsToShortString(Double.doubleToLongBits(((GT_Container_Param) mContainer).value1f)), 46*2, 58*2, 167*2, 0x0077ff); + GL11.glScalef(1,1,1); } else { proxy.renderUnicodeString("Parameters", 46, 7, 167, 0xffffff); } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java index 245ec91b20..541c8323b1 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java @@ -4,6 +4,7 @@ import com.github.technus.tectech.Util; import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.InventoryPlayer; +import org.lwjgl.opengl.GL11; import java.util.Locale; @@ -12,27 +13,22 @@ import static gregtech.api.enums.GT_Values.RES_PATH_GUI; public class GT_GUIContainer_ParamAdv extends GT_GUIContainerMetaTile_Machine { public GT_GUIContainer_ParamAdv(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(new GT_Container_ParamAdv(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "ParametrizerAdv.png"); + super(new GT_Container_Param(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "ParametrizerAdv.png"); } @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { if (mContainer != null) { proxy.renderUnicodeString("Parameters X: " + ((GT_Container_ParamAdv) mContainer).param, 46, 7, 167, 0xffffff); - Locale locale= Locale.getDefault(); - if (((GT_Container_ParamAdv) mContainer).usesFloats) { - proxy.renderUnicodeString("\u24EA\u2b07" + String.format(locale, "%+.5E", Float.intBitsToFloat(((GT_Container_ParamAdv) mContainer).input0f)), 46, 16, 167, 0x22ddff); - proxy.renderUnicodeString("\u2460\u2b07" + String.format(locale, "%+.5E", Float.intBitsToFloat(((GT_Container_ParamAdv) mContainer).input1f)), 46, 24, 167, 0x00ffff); - proxy.renderUnicodeString("\u24EA\u2b06" + String.format(locale, "%+.5E", Float.intBitsToFloat(((GT_Container_ParamAdv) mContainer).value0f)), 46, 33, 167, 0x00bbff); - proxy.renderUnicodeString("\u2460\u2b06" + String.format(locale, "%+.5E", Float.intBitsToFloat(((GT_Container_ParamAdv) mContainer).value1f)), 46, 41, 167, 0x0077ff); - } else { - proxy.renderUnicodeString("\u24EA\u2b07" + String.format(locale, "%+d", ((GT_Container_ParamAdv) mContainer).input0f), 46, 16, 167, 0x22ddff); - proxy.renderUnicodeString("\u2460\u2b07" + String.format(locale, "%+d", ((GT_Container_ParamAdv) mContainer).input1f), 46, 24, 167, 0x00ffff); - proxy.renderUnicodeString("\u24EA\u2b06" + String.format(locale, "%+d", ((GT_Container_ParamAdv) mContainer).value0f), 46, 33, 167, 0x00bbff); - proxy.renderUnicodeString("\u2460\u2b06" + String.format(locale, "%+d", ((GT_Container_ParamAdv) mContainer).value1f), 46, 41, 167, 0x0077ff); - } - proxy.renderUnicodeString("\u24EA\u2b06" + Util.intBitsToShortString(((GT_Container_ParamAdv) mContainer).value0f), 46, 50, 167, 0x00bbff); - proxy.renderUnicodeString("\u2460\u2b06" + Util.intBitsToShortString(((GT_Container_ParamAdv) mContainer).value1f), 46, 58, 167, 0x0077ff); + Locale locale = Locale.getDefault(); + proxy.renderUnicodeString("\u24EA\u2b07" + String.format(locale, "%+.5E", (((GT_Container_ParamAdv) mContainer).input0f)), 46, 16, 167, 0x22ddff); + proxy.renderUnicodeString("\u2460\u2b07" + String.format(locale, "%+.5E", (((GT_Container_ParamAdv) mContainer).input1f)), 46, 24, 167, 0x00ffff); + proxy.renderUnicodeString("\u24EA\u2b06" + String.format(locale, "%+.5E", (((GT_Container_ParamAdv) mContainer).value0f)), 46, 33, 167, 0x00bbff); + proxy.renderUnicodeString("\u2460\u2b06" + String.format(locale, "%+.5E", (((GT_Container_ParamAdv) mContainer).value1f)), 46, 41, 167, 0x0077ff); + GL11.glScalef(.5f,.5f,.5f); + proxy.renderUnicodeString("\u24EA\u2b06" + Util.longBitsToShortString(Double.doubleToLongBits(((GT_Container_ParamAdv) mContainer).value0f)), 46*2, 50*2, 167*2, 0x00bbff); + proxy.renderUnicodeString("\u2460\u2b06" + Util.longBitsToShortString(Double.doubleToLongBits(((GT_Container_ParamAdv) mContainer).value1f)), 46*2, 58*2, 167*2, 0x0077ff); + GL11.glScalef(1,1,1); proxy.renderUnicodeString("Pointer " + Integer.toHexString(((GT_Container_ParamAdv) mContainer).pointer | 0x10000).substring(1), 46, 66, 167, 0x0033ff); } else { proxy.renderUnicodeString("Parameters X", 46, 7, 167, 0xffffff); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java index be9ff21e58..2ee110be4c 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java @@ -4,6 +4,7 @@ import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -44,7 +45,7 @@ public class GT_MetaTileEntity_EM_annihilation extends GT_MetaTileEntity_Multibl }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT ,sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{4, 5, 12, 6, 0, 10}; - private static final String[] addingMethods = new String[]{"addClassicToMachineList", "addElementalToMachineList"}; + private final HatchAdder[] addingMethods = new HatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java index 15e9628b7a..7b662814a6 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java @@ -4,6 +4,7 @@ import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -73,7 +74,7 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E }; private static final Block[] blockType = new Block[]{sBlockCasingsTT,sBlockCasingsTT,sBlockCasingsTT,sBlockCasingsTT,sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{12, 13, 14, 10, 11}; - private static final String[] addingMethods = new String[]{"addClassicToMachineList", "addElementalToMachineList"}; + private final HatchAdder[] addingMethods = new HatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java index 03404cf652..06f1866826 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java @@ -16,8 +16,10 @@ import com.github.technus.tectech.thing.casing.TT_Container_Casings; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.NameFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.StatusFunction; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -34,7 +36,6 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.common.util.ForgeDirection; import java.util.HashMap; -import java.util.function.Function; import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; @@ -273,25 +274,26 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB //region parameters protected Parameters.Group.ParameterIn mode; - private static final Function MODE_STATUS = base_EM->{ + private static final StatusFunction MODE_STATUS = (base_EM, p)->{ if(base_EM.isMaster()){ - if (base_EM.mode.get() == FUSE_MODE || base_EM.mode.get() == COLLIDE_MODE) { + double mode=p.get(); + if (mode == FUSE_MODE || mode == COLLIDE_MODE) { return STATUS_OK; - } else if (base_EM.mode.get() > 1) { + } else if (mode > 1) { return STATUS_TOO_HIGH; - } else if (base_EM.mode.get() < 0) { + } else if (mode < 0) { return STATUS_TOO_LOW; - }else{ - return STATUS_WRONG; } + return STATUS_WRONG; } return STATUS_UNUSED; }; - private static final Function MODE_NAME = base_EM->{ + private static final NameFunction MODE_NAME = (base_EM, p)->{ if(base_EM.isMaster()){ - if(base_EM.mode.get()==FUSE_MODE){ + double mode=p.get(); + if(mode==FUSE_MODE){ return "Mode: Fuse"; - }else if(base_EM.mode.get()==COLLIDE_MODE){ + }else if(mode==COLLIDE_MODE){ return "Mode: Collide"; } return "Mode: Undefined"; @@ -337,7 +339,11 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB }; private static final byte[] blockMeta1 = new byte[]{4, 7, 4, 0, 4, 8}; private static final byte[] blockMeta2 = new byte[]{4, 7, 5, 0, 6, 9}; - private static final String[] addingMethods = new String[]{"addClassicToMachineList", "addElementalInputToMachineList", "addElementalOutputToMachineList", "addElementalMufflerToMachineList"}; + private final HatchAdder[] addingMethods = new HatchAdder[]{ + this::addClassicToMachineList, + this::addElementalInputToMachineList, + this::addElementalOutputToMachineList, + this::addElementalMufflerToMachineList}; private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4, textureOffset + 4, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4, 4, 4}; @@ -361,7 +367,7 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB @Override protected void parametersInstantiation_EM() { - Parameters.Group hatch_0=parametrization.makeGroup(0,false); + Parameters.Group hatch_0=parametrization.getGroup(0); mode=hatch_0.makeInParameter(0,FUSE_MODE, MODE_NAME, MODE_STATUS); } @@ -476,9 +482,9 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB } @Override - public void parametersOutAndStatusesWrite_EM(boolean machineBusy) { + public void parametersStatusesWrite_EM(boolean machineBusy) { if(isMaster()) { - super.parametersOutAndStatusesWrite_EM(machineBusy); + super.parametersStatusesWrite_EM(machineBusy); } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java index d12ec0ca64..c2b6589901 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java @@ -10,8 +10,11 @@ import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_H import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OutputData; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Rack; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus; import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.NameFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.StatusFunction; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -29,11 +32,9 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; import java.util.ArrayList; -import java.util.function.Function; import static com.github.technus.tectech.CommonValues.V; import static com.github.technus.tectech.Util.StructureBuilderExtreme; -import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; @@ -49,17 +50,17 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB //region parameters protected Parameters.Group.ParameterIn overclock,overvolt; protected Parameters.Group.ParameterOut maxCurrentTemp,availableData; - private static final Function OC_NAME = base-> "Overclock ratio"; - private static final Function OV_NAME = base-> "Overvoltage ratio"; - private static final Function MAX_TEMP_NAME = base-> "Current max. heat"; - private static final Function COMPUTE_NAME = base-> "Produced computation"; - private static final Function OC_STATUS= - base->LedStatus.fromLimitsInclusiveOuterBoundary(base.overclock.get(),0,1,1,3); - private static final Function OV_STATUS= - base->LedStatus.fromLimitsInclusiveOuterBoundary(base.overvolt.get(),.7,.8,1.2,2); - private static final Function MAX_TEMP_STATUS= - base->LedStatus.fromLimitsInclusiveOuterBoundary(base.maxCurrentTemp.get(),-10000,0,0,5000); - private static final Function COMPUTE_STATUS=base->{ + private static final NameFunction OC_NAME = (base, p)-> "Overclock ratio"; + private static final NameFunction OV_NAME = (base,p)-> "Overvoltage ratio"; + private static final NameFunction MAX_TEMP_NAME = (base,p)-> "Current max. heat"; + private static final NameFunction COMPUTE_NAME = (base,p)-> "Produced computation"; + private static final StatusFunction OC_STATUS= + (base,p)->LedStatus.fromLimitsInclusiveOuterBoundary(p.get(),0,1,1,3); + private static final StatusFunction OV_STATUS= + (base,p)->LedStatus.fromLimitsInclusiveOuterBoundary(p.get(),.7,.8,1.2,2); + private static final StatusFunction MAX_TEMP_STATUS= + (base,p)->LedStatus.fromLimitsInclusiveOuterBoundary(p.get(),-10000,0,0,5000); + private static final StatusFunction COMPUTE_STATUS=(base,p)->{ if(base.eAvailableData<0){ return STATUS_TOO_LOW; } @@ -79,7 +80,7 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB private static final String[][] slice = new String[][]{{"-01", "A!2", "A!2", "-01",},}; private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{2, 1, 3}; - private static final String[] addingMethods = new String[]{"addToMachineList", "addRackToMachineList"}; + private final HatchAdder[] addingMethods = new HatchAdder[]{this::addToMachineList, this::addRackToMachineList}; private static final short[] casingTextures = new short[]{textureOffset + 1, textureOffset + 3}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{1, 3}; @@ -104,7 +105,7 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB @Override protected void parametersInstantiation_EM() { - Parameters.Group hatch_0=parametrization.makeGroup(0,true); + Parameters.Group hatch_0=parametrization.getGroup(0); overclock=hatch_0.makeInParameter(0,1,OC_NAME,OC_STATUS); overvolt=hatch_0.makeInParameter(1,1,OV_NAME,OV_STATUS); maxCurrentTemp=hatch_0.makeOutParameter(0,0,MAX_TEMP_NAME,MAX_TEMP_STATUS); @@ -140,7 +141,7 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB @Override public boolean checkRecipe_EM(ItemStack itemStack) { - parametrization.setToDefaults(false,true,false); + parametrization.setToDefaults(false,true); eAvailableData = 0; double maxTemp=0; double overClockRatio= overclock.get(); @@ -148,7 +149,7 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB if(Double.isNaN(overClockRatio) || Double.isNaN(overVoltageRatio)) { return false; } - if(overclock.getStatus(true).isOk() && overvolt.getStatus(true).isOk()){ + if(overclock.getStatus(true).isOk && overvolt.getStatus(true).isOk){ float eut=V[8] * (float)overVoltageRatio * (float)overClockRatio; if(eut eStacksDataOutputs = new ArrayList<>(); @@ -46,7 +45,7 @@ public class GT_MetaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockB }; private static final Block[] blockType = new Block[]{sBlockCasingsTT,sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{2,1}; - private static final String[] addingMethods = new String[]{"addClassicToMachineList","addDataBankHatchToMachineList"}; + private final HatchAdder[] addingMethods = new HatchAdder[]{this::addClassicToMachineList,this::addDataBankHatchToMachineList}; private static final short[] casingTextures = new short[]{textureOffset,textureOffset+1}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT,sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0,1}; @@ -176,14 +175,4 @@ public class GT_MetaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockB } return false; } - - public static void run(){ - try { - adderMethodMap.put("addDataBankHatchToMachineList", GT_MetaTileEntity_EM_dataBank.class.getMethod("addDataBankHatchToMachineList", IGregTechTileEntity.class, int.class)); - } catch (NoSuchMethodException e) { - if (TecTechConfig.DEBUG_MODE) { - e.printStackTrace(); - } - } - } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java index 36b7505a65..b52637d220 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java @@ -7,8 +7,10 @@ import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.NameFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.StatusFunction; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -25,14 +27,13 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import java.util.function.Function; - import static com.github.technus.tectech.CommonValues.VN; import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; -import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*; +import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.STATUS_OK; +import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.STATUS_TOO_LOW; /** * Created by danie_000 on 17.12.2016. @@ -47,9 +48,9 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase //region parameters protected Parameters.Group.ParameterIn ampereFlow; - private final Function FLOW_NAME=base->"Ampere divider"; - private final Function FLOW_STATUS=base->{ - if(eAmpereFlow<=0){ + private static final NameFunction FLOW_NAME= (base, p)->"Ampere divider"; + private static final StatusFunction FLOW_STATUS= (base, p)->{ + if(base.eAmpereFlow<=0){ return STATUS_TOO_LOW; } return STATUS_OK; @@ -70,7 +71,7 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT ,sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{4, 5, 8, 6}; - private static final String[] addingMethods = new String[]{"addClassicToMachineList", "addElementalToMachineList"}; + private final HatchAdder[] addingMethods = new HatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; @@ -91,7 +92,7 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase @Override protected void parametersInstantiation_EM() { - Parameters.Group hatch_0=parametrization.makeGroup(0,false); + Parameters.Group hatch_0=parametrization.getGroup(0, true); ampereFlow=hatch_0.makeInParameter(0,1,FLOW_NAME,FLOW_STATUS); } @@ -179,8 +180,12 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase float preMass=outputEM[0].getMass(); outputEM[0].tickContent(1,0,1); double energyDose=((preMass-outputEM[0].getMass())* MASS_TO_EU_PARTIAL); - mEUt=(int)(energyDose/(eAmpereFlow=(long) ampereFlow.get())); - + eAmpereFlow=(long) ampereFlow.get(); + if (eAmpereFlow <= 0) { + mEUt=0; + return false; + } + mEUt=(int)(energyDose/eAmpereFlow); return outputEM[0].hasStacks(); } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java index 8c0a0f0708..5f5febb383 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java @@ -10,6 +10,7 @@ import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -46,7 +47,10 @@ public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_Multiblo }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, QuantumGlassBlock.INSTANCE}; private static final byte[] blockMeta = new byte[]{0, 4, 0}; - private static final String[] addingMethods = new String[]{"addClassicToMachineList", "addElementalInputToMachineList", "addElementalMufflerToMachineList"}; + private final HatchAdder[] addingMethods = new HatchAdder[]{ + this::addClassicToMachineList, + this::addElementalInputToMachineList, + this::addElementalMufflerToMachineList}; private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4, 4}; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java index c6eb10c94a..54d14ded92 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java @@ -8,6 +8,7 @@ import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -39,7 +40,7 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{7, 4}; - private static final String[] addingMethods = new String[]{"addClassicToMachineList"}; + private final HatchAdder[] addingMethods = new HatchAdder[]{this::addClassicToMachineList}; private static final short[] casingTextures = new short[]{textureOffset}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0}; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java index a295a5c7f1..d78ed3cbc4 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java @@ -5,8 +5,13 @@ import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OutputElemental; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.NameFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.StatusFunction; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; @@ -16,6 +21,7 @@ import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*; +import static gregtech.api.enums.GT_Values.E; /** * Created by danie_000 on 17.12.2016. @@ -29,9 +35,16 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB {"!!!", "!0!", "!!!",}, {"!!!", "!!!", "!!!",}, }; - private static final Block[] blockType = new Block[]{sBlockCasingsTT}; - private static final byte[] blockMeta = new byte[]{4}; - private static final String[] addingMethods = new String[]{"addClassicToMachineList", "addElementalToMachineList"}; + private static final String[][] shapeBig = new String[][]{ + {E, "A ", "A . ", "A ",}, + {"A!!!", "!000!", "!010!", "!000!", "A!!!",}, + {"!!!!!", "!000!", "!000!", "!000!", "!!!!!",}, + {"A!!!", "!000!", "!000!", "!000!", "A!!!",}, + {"A!!!", "!!!!!", "!!!!!", "!!!!!", "A!!!",}, + }; + private static final Block[] blockType = new Block[]{sBlockCasingsTT,sBlockCasingsTT}; + private static final byte[] blockMeta = new byte[]{4,5}; + private final HatchAdder[] addingMethods = new HatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; @@ -42,6 +55,36 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB }; //endregion + //region parameters + private static final NameFunction ROUTE_NAME= + (base,p)->(p.parameterId()==0?"Source ":"Destination ")+p.hatchId(); + private static final StatusFunction SRC_STATUS = + (base,p)-> { + double v = p.get(); + if (Double.isNaN(v)) return STATUS_WRONG; + v=(int)v; + if (v < 0) return STATUS_TOO_LOW; + if (v == 0) return STATUS_NEUTRAL; + if (v >= base.eInputHatches.size()) return STATUS_TOO_HIGH; + return STATUS_OK; + }; + private static final StatusFunction DST_STATUS = + (base,p)->{ + if(base.src[p.hatchId()].getStatus(false)== STATUS_OK){ + double v = p.get(); + if (Double.isNaN(v)) return STATUS_WRONG; + v=(int)v; + if (v < 0) return STATUS_TOO_LOW; + if (v == 0) return STATUS_LOW; + if (v >= base.eInputHatches.size()) return STATUS_TOO_HIGH; + return STATUS_OK; + } + return STATUS_NEUTRAL; + }; + protected Parameters.Group.ParameterIn[] src=new Parameters.Group.ParameterIn[10]; + protected Parameters.Group.ParameterIn[] dst=new Parameters.Group.ParameterIn[10]; + //endregion + public GT_MetaTileEntity_EM_junction(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } @@ -50,6 +93,15 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB super(aName); } + @Override + protected void parametersInstantiation_EM() { + for (int i = 0; i < 10; i++) { + Parameters.Group hatch = parametrization.getGroup(i); + src[i] = hatch.makeInParameter(0, i, ROUTE_NAME, SRC_STATUS); + dst[i] = hatch.makeInParameter(1, i, ROUTE_NAME, DST_STATUS); + } + } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_EM_junction(mName); @@ -57,7 +109,13 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB @Override public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 1, 0); + int meta=iGregTechTileEntity.getMetaIDAtSide(GT_Utility.getOppositeSide(iGregTechTileEntity.getFrontFacing())); + if(meta==4){ + return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 1, 0); + }else if(meta==5){ + return structureCheck_EM(shapeBig, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0); + } + return false; } @Override @@ -79,38 +137,6 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB }; } - @Override - public void parametersOutAndStatusesWrite_EM(boolean machineBusy) { - double src, dest; - for (int i = 0; i < 10; i++) { - src = getParameterIn(i, 0); - if (src <= 0) { - setStatusOfParameterIn(i, 0, STATUS_TOO_LOW); - setStatusOfParameterIn(i, 1, STATUS_NEUTRAL); - } else if (src > eInputHatches.size()) { - setStatusOfParameterIn(i, 0, STATUS_TOO_HIGH); - setStatusOfParameterIn(i, 1, STATUS_NEUTRAL); - } else if (Double.isNaN(src)) { - setStatusOfParameterIn(i, 0, STATUS_WRONG); - setStatusOfParameterIn(i, 1, STATUS_NEUTRAL); - } else { - setStatusOfParameterIn(i, 0, STATUS_OK); - dest = getParameterIn(i, 1); - if (dest < 0) { - setStatusOfParameterIn(i, 1, STATUS_TOO_LOW); - } else if (dest == 0) { - setStatusOfParameterIn(i, 1, STATUS_LOW); - } else if (dest > eOutputHatches.size()) { - setStatusOfParameterIn(i, 1, STATUS_TOO_HIGH); - } else if (Double.isNaN(dest)) { - setStatusOfParameterIn(i, 1, STATUS_WRONG); - } else { - setStatusOfParameterIn(i, 1, STATUS_OK); - } - } - } - } - @Override public boolean checkRecipe_EM(ItemStack itemStack) { for (GT_MetaTileEntity_Hatch_InputElemental in : eInputHatches) { @@ -127,18 +153,18 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB @Override public void outputAfterRecipe_EM() { - double src,dest; + double src,dst; for (int i = 0; i < 10; i++) { - src= getParameterIn(i,0); - dest= getParameterIn(i,1); - if(Double.isNaN(src) || Double.isNaN(dest)) { + src= this.src[i].get(); + dst= this.dst[i].get(); + if(Double.isNaN(src) || Double.isNaN(dst)) { continue; } int inIndex = (int)src - 1; if (inIndex < 0 || inIndex >= eInputHatches.size()) { continue; } - int outIndex = (int)dest - 1; + int outIndex = (int)dst - 1; GT_MetaTileEntity_Hatch_InputElemental in = eInputHatches.get(inIndex); if (outIndex == -1) {//param==0 -> null the content cleanHatchContentEM_EM(in); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java index 1494d97e34..e7a42fa941 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java @@ -13,6 +13,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.transformations import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; @@ -52,7 +53,10 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, QuantumGlassBlock.INSTANCE}; private static final byte[] blockMeta = new byte[]{4, 0, 0}; - private static final String[] addingMethods = new String[]{"addClassicToMachineList", "addElementalOutputToMachineList", "addElementalMufflerToMachineList"}; + private final HatchAdder[] addingMethods = new HatchAdder[]{ + this::addClassicToMachineList, + this::addElementalOutputToMachineList, + this::addElementalMufflerToMachineList}; private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4, 4}; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java index b4b786dcdb..6b3cab021e 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java @@ -1,12 +1,12 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; -import com.github.technus.tectech.loader.TecTechConfig; import com.github.technus.tectech.recipe.TT_recipe; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Holder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.ItemList; @@ -66,7 +66,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{1, 3, 2}; - private static final String[] addingMethods = new String[]{"addClassicToMachineList", "addHolderToMachineList"}; + private final HatchAdder[] addingMethods = new HatchAdder[]{this::addClassicToMachineList, this::addHolderToMachineList}; private static final short[] casingTextures = new short[]{textureOffset + 1, textureOffset + 3}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, Blocks.air}; private static final byte[] blockMetaFallback = new byte[]{1, 0}; @@ -490,16 +490,6 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB return false; } - public static void run() { - try { - adderMethodMap.put("addHolderToMachineList", GT_MetaTileEntity_EM_research.class.getMethod("addHolderToMachineList", IGregTechTileEntity.class, int.class)); - } catch (NoSuchMethodException e) { - if (TecTechConfig.DEBUG_MODE) { - e.printStackTrace(); - } - } - } - @Override public int getInventoryStackLimit() { return 1; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java index b2711530ed..d7cf3303f3 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java @@ -14,6 +14,11 @@ import com.github.technus.tectech.thing.item.ElementalDefinitionScanStorage_EM; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.NameFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.StatusFunction; import gregtech.api.enums.ItemList; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -57,6 +62,24 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa private long totalComputationRemaining, totalComputationRequired; private int[] scanComplexity; + //region parameters + private static final NameFunction CONFIG_NAME= + (base,p)->"Config at Depth: "+(p.hatchId()*2+p.parameterId()); + private static final StatusFunction CONFIG_STATUS= + (base,p)->{ + double v=p.get(); + if(Double.isNaN(v)){ + return LedStatus.STATUS_WRONG; + } + v=(int)v; + if(v==0) return LedStatus.STATUS_NEUTRAL; + if(v>=SCAN_GET_CLASS_TYPE) return LedStatus.STATUS_TOO_HIGH; + if(v<0) return LedStatus.STATUS_TOO_LOW; + return LedStatus.STATUS_OK; + }; + protected Parameters.Group.ParameterIn[] scanConfiguration=new Parameters.Group.ParameterIn[20]; + //endregion + //region structure private static final String[][] shape = new String[][]{ {" ", " 222 ", " 2.2 ", " 222 ", " ",}, @@ -70,11 +93,11 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{4, 0, 0}; - private static final String[] addingMethods = new String[]{ - "addClassicToMachineList", - "addElementalInputToMachineList", - "addElementalOutputToMachineList", - "addElementalMufflerToMachineList"}; + private final HatchAdder[] addingMethods = new HatchAdder[]{ + this::addClassicToMachineList, + this::addElementalInputToMachineList, + this::addElementalOutputToMachineList, + this::addElementalMufflerToMachineList}; private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4, textureOffset + 4, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4, 4, 4}; @@ -97,6 +120,15 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa eDismantleBoom=true; } + @Override + protected void parametersInstantiation_EM() { + for (int i = 0; i < 10; i++) { + Parameters.Group hatch = parametrization.getGroup(i); + scanConfiguration[i*2] = hatch.makeInParameter(0, 0, CONFIG_NAME, CONFIG_STATUS); + scanConfiguration[i*2+1] = hatch.makeInParameter(0, 0, CONFIG_NAME, CONFIG_STATUS); + } + } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_EM_scanner(mName); @@ -248,7 +280,7 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa cleanStackEM_EM(stackEM); researchEM.remove(stackEM.definition); } - if(eRecipe!=null && scannerRecipe!=null){//make sure it werks + if(eRecipe!=null && scannerRecipe!=null){//todo make sure it werks totalComputationRequired = totalComputationRemaining = scannerRecipe.mDuration * 20L; mMaxProgresstime = 20;//const mEfficiencyIncrease = 10000; @@ -272,9 +304,8 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa //get depth scan complexity array { int[] scanComplexityTemp = new int[20]; - for (int i = 0; i < 10; i++) { - scanComplexityTemp[i] = getParameterInInt(i, 0); - scanComplexityTemp[i + 10] = getParameterInInt(i, 1); + for (int i = 0; i < 20; i++) { + scanComplexityTemp[i]=(int)scanConfiguration[i].get(); } int maxDepth = 0; for (int i = 0; i < 20; i++) { @@ -418,20 +449,20 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa return new String[]{ "Energy Hatches:", EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET + " EU / " + - EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET + " EU", + EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU", (mEUt <= 0 ? "Probably uses: " : "Probably makes: ") + - EnumChatFormatting.RED + Integer.toString(Math.abs(mEUt)) + EnumChatFormatting.RESET + " EU/t at " + + EnumChatFormatting.RED + Math.abs(mEUt) + EnumChatFormatting.RESET + " EU/t at " + EnumChatFormatting.RED + eAmpereFlow + EnumChatFormatting.RESET + " A", "Tier Rating: " + EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier_EM()] + EnumChatFormatting.RESET + " / " + EnumChatFormatting.GREEN + VN[getMinEnergyInputTier_EM()] + EnumChatFormatting.RESET + " Amp Rating: " + EnumChatFormatting.GREEN + eMaxAmpereFlow + EnumChatFormatting.RESET + " A", "Problems: " + EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + - " Efficiency: " + EnumChatFormatting.YELLOW + Float.toString(mEfficiency / 100.0F) + EnumChatFormatting.RESET + " %", + " Efficiency: " + EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", "PowerPass: " + EnumChatFormatting.BLUE + ePowerPass + EnumChatFormatting.RESET + " SafeVoid: " + EnumChatFormatting.BLUE + eSafeVoid, "Computation Available: " + EnumChatFormatting.GREEN + eAvailableData +EnumChatFormatting.RESET+" / "+EnumChatFormatting.YELLOW + eRequiredData + EnumChatFormatting.RESET, "Computation Remaining:", EnumChatFormatting.GREEN + Long.toString(totalComputationRemaining / 20L) + EnumChatFormatting.RESET + " / " + - EnumChatFormatting.YELLOW + Long.toString(totalComputationRequired / 20L) + EnumChatFormatting.YELLOW + totalComputationRequired / 20L }; } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java index ce16d939cd..2386619e7e 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java @@ -4,6 +4,7 @@ import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; @@ -28,7 +29,7 @@ public class GT_MetaTileEntity_EM_stabilizer extends GT_MetaTileEntity_Multibloc }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT ,sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{4, 0, 5, 6, 9}; - private static final String[] addingMethods = new String[]{"addClassicToMachineList", "addElementalToMachineList"}; + private final HatchAdder[] addingMethods = new HatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java index 767bd676d6..e5bcb3f75d 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java @@ -8,6 +8,10 @@ import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputData; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OutputData; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.NameFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.StatusFunction; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -39,7 +43,7 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas }; private static final Block[] blockType = new Block[]{sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{3}; - private static final String[] addingMethods = new String[]{"addClassicToMachineList"}; + private final HatchAdder[] addingMethods = new HatchAdder[]{this::addClassicToMachineList}; private static final short[] casingTextures = new short[]{textureOffset+1}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{1}; @@ -49,6 +53,34 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas }; //endregion + //region parameters + private static final NameFunction ROUTE_NAME= + (base,p)->(p.parameterId()==0?"Destination ":"Weight ")+p.hatchId(); + private static final StatusFunction WEI_STATUS = + (base,p)-> { + double v=p.get(); + if (Double.isNaN(v)) return STATUS_WRONG; + if(v<0) return STATUS_TOO_LOW; + if(v==0) return STATUS_LOW; + if(Double.isInfinite(v)) return STATUS_HIGH; + return STATUS_OK; + }; + private static final StatusFunction DST_STATUS = + (base,p)->{ + if(base.weight[p.hatchId()].getStatus(false).isOk) { + double v = p.get(); + if (Double.isNaN(v)) return STATUS_WRONG; + v = (int) v; + if (v <= 0) return STATUS_TOO_LOW; + if (v >= base.eOutputHatches.size()) return STATUS_TOO_HIGH; + return STATUS_OK; + } + return STATUS_NEUTRAL; + }; + protected Parameters.Group.ParameterIn[] dst=new Parameters.Group.ParameterIn[10]; + protected Parameters.Group.ParameterIn[] weight =new Parameters.Group.ParameterIn[10]; + //endregion + public GT_MetaTileEntity_EM_switch(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } @@ -57,6 +89,15 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas super(aName); } + @Override + protected void parametersInstantiation_EM() { + for (int i = 0; i < 10; i++) { + Parameters.Group hatch = parametrization.getGroup(i); + dst[i] = hatch.makeInParameter(0, i, ROUTE_NAME, DST_STATUS); + weight[i] = hatch.makeInParameter(1,0, ROUTE_NAME, WEI_STATUS); + } + } + public final static ResourceLocation activitySound=new ResourceLocation(Reference.MODID+":fx_hi_freq"); @Override @@ -117,12 +158,10 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas public void outputAfterRecipe_EM() { if (!eOutputData.isEmpty()) { double total = 0; - double dest; double weight; for (int i = 0; i < 10; i++) {//each param pair - dest= getParameterIn(i,1); - weight= getParameterIn(i,0); - if (weight > 0 && dest >= 0) { + weight= this.weight[i].get(); + if (weight > 0 && dst[i].get() >= 0) { total += weight;//Total weighted div } } @@ -144,9 +183,10 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas long remaining = pack.getContent(); + double dest; for (int i = 0; i < 10; i++) { - dest= getParameterIn(i,1); - weight= getParameterIn(i,0); + dest= dst[i].get(); + weight= this.weight[i].get(); if (weight > 0 && dest >= 0) { int outIndex = (int)dest - 1; if (outIndex < 0 || outIndex >= eOutputData.size()) { @@ -177,35 +217,6 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas } } - @Override - public void parametersOutAndStatusesWrite_EM(boolean machineBusy) { - double weight, dest; - for (int i = 0; i < 10; i++) { - weight = getParameterIn(i, 0); - if (weight < 0) { - setStatusOfParameterIn(i, 0, STATUS_TOO_LOW); - setStatusOfParameterIn(i, 1, STATUS_NEUTRAL); - } else if (Double.isNaN(weight)) { - setStatusOfParameterIn(i, 0, STATUS_WRONG); - setStatusOfParameterIn(i, 1, STATUS_NEUTRAL); - } else { - setStatusOfParameterIn(i, 0, weight==0?STATUS_LOW:STATUS_OK); - dest = getParameterIn(i, 1); - if (dest < 0) { - setStatusOfParameterIn(i, 1, STATUS_TOO_LOW); - } else if (dest == 0) { - setStatusOfParameterIn(i, 1, STATUS_LOW); - } else if (dest > eOutputData.size()) { - setStatusOfParameterIn(i, 1, STATUS_TOO_HIGH); - } else if (Double.isNaN(dest)) { - setStatusOfParameterIn(i, 1, STATUS_WRONG); - } else { - setStatusOfParameterIn(i, 1, STATUS_OK); - } - } - } - } - @Override public String[] getDescription() { return new String[]{ diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java index 4584e86122..65f2301e41 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java @@ -6,6 +6,7 @@ import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -37,7 +38,7 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo }; private static final Block[] blockType = new Block[]{sBlockCasings1}; private static final byte[] blockMeta = new byte[]{15}; - private static final String[] addingMethods = new String[]{"addEnergyIOToMachineList"}; + private final HatchAdder[] addingMethods = new HatchAdder[]{this::addEnergyIOToMachineList}; private static final short[] casingTextures = new short[]{textureOffset}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0}; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java index 5e60f59807..50070972ca 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java @@ -4,6 +4,7 @@ import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -45,7 +46,7 @@ public class GT_MetaTileEntity_EM_wormhole extends GT_MetaTileEntity_MultiblockB }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, QuantumGlassBlock.INSTANCE ,sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{12, 10, 0, 5, 11}; - private static final String[] addingMethods = new String[]{"addClassicToMachineList", "addElementalToMachineList"}; + private final HatchAdder[] addingMethods = new HatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java index 541adfd953..4456f97130 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java @@ -3,9 +3,9 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.Reference; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.*; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.NameFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.StatusFunction; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -19,7 +19,6 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.EnumChatFormatting; @@ -35,8 +34,6 @@ import static gregtech.api.GregTech_API.sBlockCasings4; * Created by danie_000 on 17.12.2016. */ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { - public static final int POWER_SETTING_DEFAULT=1000, TIMER_SETTING_DEFAULT=360; - private int powerSetting,timerSetting,timerValue; private boolean hasBeenPausedThisCycle=false; //region Structure @@ -51,7 +48,7 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock private static final Block[] blockType = new Block[]{sBlockCasings4}; private static final byte[] blockMeta = new byte[]{1}; - private static final String[] addingMethods = new String[]{"addClassicToMachineList"}; + private final HatchAdder[] addingMethods = new HatchAdder[]{this::addClassicToMachineList}; private static final short[] casingTextures = new short[]{49}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasings4}; private static final byte[] blockMetaFallback = new byte[]{1}; @@ -62,6 +59,25 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock }; //endregion + //region parameters + protected Parameters.Group.ParameterIn powerSetting,timerSetting; + protected Parameters.Group.ParameterOut timerValue,remainingTime; + private static final NameFunction POWER_NAME = (base, p)-> "Power setting"; + private static final NameFunction TIMER_SETTING_NAME = (base, p)-> "Timer setting"; + private static final NameFunction TIMER_REMAINING_NAME = (base, p)-> "Timer remaining"; + private static final NameFunction TIMER_VALUE_NAME = (base,p)-> "Timer value"; + private static final StatusFunction POWER_STATUS= + (base,p)-> LedStatus.fromLimitsInclusiveOuterBoundary(p.get(),300,1000,1000,Double.POSITIVE_INFINITY); + private static final StatusFunction TIMER_STATUS=(base,p)->{ + double value=p.get(); + if(Double.isNaN(value)) return STATUS_WRONG; + value=(int)value; + if(value<=0) return STATUS_TOO_LOW; + if(value>3000) return STATUS_TOO_HIGH; + return STATUS_OK; + }; + //endregion + public GT_MetaTileEntity_TM_microwave(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } @@ -70,6 +86,15 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock super(aName); } + @Override + protected void parametersInstantiation_EM() { + Parameters.Group hatch_0=parametrization.getGroup(0, true); + powerSetting=hatch_0.makeInParameter(0,1000, POWER_NAME,POWER_STATUS); + timerSetting=hatch_0.makeInParameter(1,360, TIMER_SETTING_NAME,TIMER_STATUS); + timerValue=hatch_0.makeOutParameter(0,0,TIMER_VALUE_NAME,TIMER_STATUS); + remainingTime=hatch_0.makeOutParameter(0,360,TIMER_REMAINING_NAME,TIMER_STATUS); + } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_TM_microwave(mName); @@ -123,13 +148,14 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock @Override public boolean checkRecipe_EM(ItemStack itemStack) { hasBeenPausedThisCycle =false; - if(powerSetting<300 || timerSetting<=0 || timerSetting>3000) { + if((int)powerSetting.get()<300 || timerSetting.get()<=0 || timerSetting.get()>3000) { return false; } - if (timerValue <= 0) { - timerValue=timerSetting; + if (remainingTime.get() <= 0) { + remainingTime.set(timerSetting.get()); + timerValue.set(0); } - mEUt = -(powerSetting >> 1); + mEUt = -((int)powerSetting.get() >> 1); eAmpereFlow = 1; mMaxProgresstime = 20; mEfficiencyIncrease = 10000; @@ -141,7 +167,8 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock if(hasBeenPausedThisCycle) { return;//skip timer and actions if paused } - timerValue--; + timerValue.set(timerValue.get()+1); + remainingTime.set(timerSetting.get()-timerValue.get()); IGregTechTileEntity mte=getBaseMetaTileEntity(); double[] xyzOffsets= getTranslatedOffsets(0,-1,2); double xPos=mte.getXCoord()+0.5f+xyzOffsets[0]; @@ -153,12 +180,12 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock for(int i=0;i<3;i++){//gets ABS from translated to get expansion values if(xyzExpansion[i]<0)xyzExpansion[i]=-xyzExpansion[i]; } - + int power=(int)powerSetting.get(); int damagingFactor = - Math.min(powerSetting >> 6,8)+ - Math.min(powerSetting >> 8,24)+ - Math.min(powerSetting >> 12,48)+ - (powerSetting >> 18); + Math.min(power >> 6,8)+ + Math.min(power >> 8,24)+ + Math.min(power >> 12,48)+ + (power >> 18); ArrayList itemsToOutput=new ArrayList<>(); HashSet tickedStuff=new HashSet<>(); @@ -194,59 +221,14 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock damagingFactor>>=1; } while(damagingFactor>0); - mOutputItems= itemsToOutput.toArray(new ItemStack[itemsToOutput.size()]); + mOutputItems= itemsToOutput.toArray(new ItemStack[0]); - if(timerValue<=0) { + if(remainingTime.get() <=0) { mte.getWorld().playSoundEffect(xPos,yPos,zPos, Reference.MODID+":microwave_ding", 1, 1); stopMachine(); } } - @Override - protected void parametersLoadDefault_EM() { - powerSetting = POWER_SETTING_DEFAULT; - timerSetting = TIMER_SETTING_DEFAULT; - setParameterPairIn_ClearOut(0,false, POWER_SETTING_DEFAULT, TIMER_SETTING_DEFAULT); - } - - @Override - protected void parametersInReadWhileActive_EM() { - powerSetting = (int) getParameterIn(0, 0); - timerSetting = (int) getParameterIn(0, 1); - } - - @Override - public void parametersOutAndStatusesWrite_EM(boolean machineBusy) { - double powerParameter = getParameterIn(0, 0); - if (powerParameter < 300) { - setStatusOfParameterIn(0, 0, STATUS_TOO_LOW); - } else if (powerParameter < 1000) { - setStatusOfParameterIn(0, 0, STATUS_LOW); - } else if (powerParameter == 1000) { - setStatusOfParameterIn(0, 0, STATUS_OK); - } else if (powerParameter == Double.POSITIVE_INFINITY) { - setStatusOfParameterIn(0, 0, STATUS_TOO_HIGH); - } else if (Double.isNaN(powerParameter)) { - setStatusOfParameterIn(0, 0, STATUS_WRONG); - } else { - setStatusOfParameterOut(0, 0, STATUS_HIGH); - } - - double timerParameter = getParameterIn(0, 1); - if (timerParameter <= 1) { - setStatusOfParameterIn(0, 1, STATUS_TOO_LOW); - } else if (timerParameter <= 3000) { - setStatusOfParameterIn(0, 1, STATUS_OK); - } else if (Double.isNaN(timerParameter)) { - setStatusOfParameterIn(0, 1, STATUS_WRONG); - } else { - setStatusOfParameterIn(0, 1, STATUS_TOO_HIGH); - } - - setParameterOut(0, 0, timerValue); - setParameterOut(0, 1, timerSetting - timerValue); - } - @Override public boolean onRunningTick(ItemStack aStack) { if(eSafeVoid) { @@ -258,19 +240,8 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock @Override public void stopMachine() { super.stopMachine(); - timerValue=0; - } - - @Override - public void saveNBTData(NBTTagCompound aNBT) { - super.saveNBTData(aNBT); - aNBT.setInteger("eTimerVal", timerValue); - } - - @Override - public void loadNBTData(NBTTagCompound aNBT) { - super.loadNBTData(aNBT); - timerValue = aNBT.getInteger("eTimerVal"); + remainingTime.set(timerSetting.get()); + timerValue.set(0); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java index 82722e76f9..2c58006360 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java @@ -6,6 +6,7 @@ import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_H import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -23,7 +24,6 @@ import java.util.ArrayList; import static com.github.technus.tectech.CommonValues.V; import static com.github.technus.tectech.Util.StructureBuilder; -import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static gregtech.api.GregTech_API.*; import static gregtech.api.enums.GT_Values.E; @@ -88,7 +88,7 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock private static final byte[] blockMetaT1 = new byte[]{15, 1, 13, 0}; private static final byte[] blockMetaT2 = new byte[]{15, 2, 13, 0}; private static final byte[][] blockMetas = new byte[][]{blockMetaT0,blockMetaT1,blockMetaT2}; - private static final String[] addingMethods = new String[]{"addCapacitorToMachineList", "addFrameToMachineList"}; + private final HatchAdder[] addingMethods = new HatchAdder[]{this::addCapacitorToMachineList, this::addFrameToMachineList}; private static final short[] casingTextures = new short[]{29, 0}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasings2, null}; private static final byte[] blockMetaFallback = new byte[]{13, 0}; @@ -348,15 +348,4 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock } return false; } - - public static void run() { - try { - adderMethodMap.put("addFrameToMachineList", GT_MetaTileEntity_TM_teslaCoil.class.getMethod("addFrameToMachineList", IGregTechTileEntity.class, int.class)); - adderMethodMap.put("addCapacitorToMachineList", GT_MetaTileEntity_TM_teslaCoil.class.getMethod("addCapacitorToMachineList", IGregTechTileEntity.class, int.class)); - } catch (NoSuchMethodException e) { - if (DEBUG_MODE) { - e.printStackTrace(); - } - } - } } 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 f3147d890c..3c9102d072 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 @@ -14,7 +14,6 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.network.Rotati import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.enums.GT_Values; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -36,18 +35,13 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fluids.FluidStack; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; import static com.github.technus.tectech.CommonValues.*; import static com.github.technus.tectech.Util.StructureCheckerExtreme; import static com.github.technus.tectech.Util.getTier; import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; -import static gregtech.api.enums.GT_Values.B; /** * Created by danie_000 on 27.10.2016. @@ -59,12 +53,6 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt public static final FluidStack[] nothingF = new FluidStack[0]; //endregion - //region Reflection based hatch adding... - //Example how to add custom method is in computer and research station - protected static final Map adderMethodMap = new HashMap<>(); - private static Method adderMethod; - //endregion - //region Client side variables (static - one per class) //Front icon holders - static so it is default one for my blocks @@ -155,14 +143,14 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt super(aID, aName, aNameRegional); parametrization=new Parameters(this); parametersInstantiation_EM(); - parametrization.setToDefaults(true,true,true); + parametrization.setToDefaults(true,true); } protected GT_MetaTileEntity_MultiblockBase_EM(String aName) { super(aName); parametrization=new Parameters(this); parametersInstantiation_EM(); - parametrization.setToDefaults(true,true,true); + parametrization.setToDefaults(true,true); } //region SUPER STRUCT @@ -375,12 +363,12 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt String[][] structure,//0-9 casing, +- air no air, a-z ignore Block[] blockType,//use numbers 0-9 for casing types byte[] blockMeta,//use numbers 0-9 for casing types - String[] addingMethods, + HatchAdder[] addingMethods, short[] casingTextures, Block[] blockTypeFallback,//use numbers 0-9 for casing types byte[] blockMetaFallback,//use numbers 0-9 for casing types int horizontalOffset, int verticalOffset, int depthOffset) { - return StructureCheckerExtreme(structure, blockType, blockMeta, adderMethod, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, + return StructureCheckerExtreme(structure, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, horizontalOffset, verticalOffset, depthOffset, getBaseMetaTileEntity(), this, !mMachine); } @@ -435,7 +423,6 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } } } - //endregion //region tooltip and scanner result @@ -455,11 +442,10 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt EnumChatFormatting.YELLOW+ ":"+ EnumChatFormatting.AQUA+"I"); list.add(EnumChatFormatting.WHITE+"Value: "+ - EnumChatFormatting.AQUA+parametrization.getIn(hatchNo,paramID)+ - EnumChatFormatting.GOLD+(((parametrization.bParamsAreFloats& B[hatchNo])!=0)?" float":" int")); + EnumChatFormatting.AQUA+parametrization.getIn(hatchNo,paramID)); try{ list.add(parametrization.groups[hatchNo].parameterIn[paramID].getBrief()); - }catch (NullPointerException e){ + }catch (NullPointerException|IndexOutOfBoundsException e){ list.add("Unused"); } return list; @@ -480,11 +466,10 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt EnumChatFormatting.YELLOW+ ":"+ EnumChatFormatting.AQUA+"O"); list.add(EnumChatFormatting.WHITE+"Value: "+ - EnumChatFormatting.AQUA+parametrization.getOut(hatchNo,paramID)+ - EnumChatFormatting.GOLD+(((parametrization.bParamsAreFloats& B[hatchNo])!=0)?" float":" int")); + EnumChatFormatting.AQUA+parametrization.getOut(hatchNo,paramID)); try{ list.add(parametrization.groups[hatchNo].parameterOut[paramID].getBrief()); - }catch (NullPointerException e){ + }catch (NullPointerException|IndexOutOfBoundsException e){ list.add("Unused"); } return list; @@ -726,16 +711,6 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt */ protected void parametersInstantiation_EM(){} - /** - * This is called automatically when there was IN parameters data update and machine IS RUNNING - * although the base code only downloads the IN values from parametrizers when machine is NOT OPERATING - * - * this can be used to update the IN values on the fly when machine is running to affect the current process - * - */ - protected void parametersInReadWhileActive_EM() { - } - /** * It is automatically called OFTEN * update status of parameters in guis (and "machine state" if u wish) @@ -745,13 +720,23 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt * * @param machineBusy is machine doing SHIT */ - protected void parametersOutAndStatusesWrite_EM(boolean machineBusy) {//todo unimplement + protected void parametersStatusesWrite_EM(boolean machineBusy) {//todo unimplement? if(!machineBusy){ for (Parameters.Group.ParameterIn parameterIn : parametrization.parameterInArrayList) { if (parameterIn != null) { parameterIn.updateStatus(); } } + }else{ + for (Parameters.Group hatch:parametrization.groups){ + if(hatch!=null && hatch.updateWhileRunning){ + for (Parameters.Group.ParameterIn in:hatch.parameterIn) { + if(in!=null){ + in.updateStatus(); + } + } + } + } } for (Parameters.Group.ParameterOut parameterOut : parametrization.parameterOutArrayList) { if (parameterOut != null) { @@ -891,17 +876,15 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt NBTTagCompound paramI = new NBTTagCompound(); for (int i = 0; i < parametrization.iParamsIn.length; i++) { - paramI.setInteger(Integer.toString(i), parametrization.iParamsIn[i]); + paramI.setDouble(Integer.toString(i), parametrization.iParamsIn[i]); } - aNBT.setTag("eParamsIn", paramI); + aNBT.setTag("eParamsInD", paramI); NBTTagCompound paramO = new NBTTagCompound(); for (int i = 0; i < parametrization.iParamsOut.length; i++) { - paramO.setInteger(Integer.toString(i), parametrization.iParamsOut[i]); + paramO.setDouble(Integer.toString(i), parametrization.iParamsOut[i]); } - aNBT.setTag("eParamsOut", paramO); - - aNBT.setShort("eParamsS",parametrization.bParamsAreFloats); + aNBT.setTag("eParamsOutD", paramO); NBTTagCompound paramIs = new NBTTagCompound(); for (int i = 0; i < parametrization.eParamsInStatus.length; i++) { @@ -978,24 +961,28 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt outputEM = null; } - NBTTagCompound paramI = aNBT.getCompoundTag("eParamsIn"); - for (int i = 0; i < parametrization.iParamsIn.length; i++) { - parametrization.iParamsIn[i] = paramI.getInteger(Integer.toString(i)); - } - - NBTTagCompound paramO = aNBT.getCompoundTag("eParamsOut"); - for (int i = 0; i < parametrization.iParamsOut.length; i++) { - parametrization.iParamsOut[i] = paramO.getInteger(Integer.toString(i)); - } - - if(aNBT.hasKey("eParamsB")) { + if(aNBT.hasKey("eParamsIn") && aNBT.hasKey("eParamsOut") && aNBT.hasKey("eParamsB")){ + NBTTagCompound paramI = aNBT.getCompoundTag("eParamsIn"); + NBTTagCompound paramO = aNBT.getCompoundTag("eParamsOut"); NBTTagCompound paramB = aNBT.getCompoundTag("eParamsB"); - parametrization.bParamsAreFloats=0; for (int i = 0; i < 10; i++) { - parametrization.bParamsAreFloats|=paramB.getBoolean(Integer.toString(i))? B[i]:0; + if(paramB.getBoolean(Integer.toString(i))){ + parametrization.iParamsIn[i] = Float.intBitsToFloat(paramI.getInteger(Integer.toString(i))); + parametrization.iParamsOut[i] =Float.intBitsToFloat(paramO.getInteger(Integer.toString(i))); + }else { + parametrization.iParamsIn[i] = paramI.getInteger(Integer.toString(i)); + parametrization.iParamsOut[i] = paramO.getInteger(Integer.toString(i)); + } } }else{ - parametrization.bParamsAreFloats=aNBT.getShort("eParamsS"); + NBTTagCompound paramI = aNBT.getCompoundTag("eParamsInD"); + for (int i = 0; i < parametrization.iParamsIn.length; i++) { + parametrization.iParamsIn[i] = paramI.getDouble(Integer.toString(i)); + } + NBTTagCompound paramO = aNBT.getCompoundTag("eParamsOutD"); + for (int i = 0; i < parametrization.iParamsOut.length; i++) { + parametrization.iParamsOut[i] = paramO.getDouble(Integer.toString(i)); + } } NBTTagCompound paramIs = aNBT.getCompoundTag("eParamsInS"); @@ -1187,47 +1174,40 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt * callback for updating parameters and new hatches */ protected void hatchesStatusUpdate_EM() { + if(getBaseMetaTileEntity().isClientSide()){ + return; + } boolean busy=mMaxProgresstime>0; if (busy) {//write from buffer to hatches only for (GT_MetaTileEntity_Hatch_Param hatch : eParamHatches) { if (!GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch) || hatch.param < 0) { continue; } - int paramID = hatch.param; - if((parametrization.bParamsAreFloats&B[hatch.param])!=0){ - hatch.input0i = parametrization.iParamsOut[paramID]; - hatch.input1i = parametrization.iParamsOut[paramID + 10]; - }else if(hatch.isUsingFloats()){ - hatch.input0i = Float.floatToIntBits((float)parametrization.iParamsOut[paramID]); - hatch.input1i = Float.floatToIntBits((float)parametrization.iParamsOut[paramID + 10]); - }else { - hatch.input0i = (int)Float.intBitsToFloat(parametrization.iParamsOut[paramID]); - hatch.input1i = (int)Float.intBitsToFloat(parametrization.iParamsOut[paramID + 10]); + int hatchId = hatch.param; + if(parametrization.groups[hatchId]!=null && parametrization.groups[hatchId].updateWhileRunning){ + parametrization.iParamsIn[hatchId] = hatch.value0i; + parametrization.iParamsIn[hatchId + 10] = hatch.value1i; } + hatch.input0i = parametrization.iParamsOut[hatchId]; + hatch.input1i = parametrization.iParamsOut[hatchId + 10]; } - parametersInReadWhileActive_EM(); } else {//if has nothing to do update all for (GT_MetaTileEntity_Hatch_Param hatch : eParamHatches) { if (!GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch) || hatch.param < 0) { continue; } - int paramID = hatch.param; - if(hatch.isUsingFloats()){ - parametrization.bParamsAreFloats |= B[hatch.param]; - }else { - parametrization.bParamsAreFloats &=~B[hatch.param]; - } - parametrization.iParamsIn[paramID] = hatch.value0i; - parametrization.iParamsIn[paramID + 10] = hatch.value1i; - hatch.input0i = parametrization.iParamsOut[paramID]; - hatch.input1i = parametrization.iParamsOut[paramID + 10]; + int hatchId = hatch.param; + parametrization.iParamsIn[hatchId] = hatch.value0i; + parametrization.iParamsIn[hatchId + 10] = hatch.value1i; + hatch.input0i = parametrization.iParamsOut[hatchId]; + hatch.input1i = parametrization.iParamsOut[hatchId + 10]; } } for (GT_MetaTileEntity_Hatch_Uncertainty uncertainty : eUncertainHatches) { eCertainStatus = uncertainty.update(eCertainMode); } eAvailableData = getAvailableData_EM(); - parametersOutAndStatusesWrite_EM(busy); + parametersStatusesWrite_EM(busy); } @Deprecated @@ -1431,13 +1411,6 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt for (GT_MetaTileEntity_Hatch_Param hatch : eParamHatches){ if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) { hatch.getBaseMetaTileEntity().setActive(true); - if(hatch.param>=0) { - if(hatch.isUsingFloats()){ - parametrization.bParamsAreFloats |= B[hatch.param]; - }else { - parametrization.bParamsAreFloats &=~B[hatch.param]; - } - } } } } else { @@ -2621,48 +2594,4 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } return false; } - - public static void run() { - try { - adderMethodMap.put("addToMachineList", GT_MetaTileEntity_MultiblockBase_EM.class.getMethod("addToMachineList", IGregTechTileEntity.class, int.class)); - adderMethodMap.put("addClassicToMachineList", GT_MetaTileEntity_MultiblockBase_EM.class.getMethod("addClassicToMachineList", IGregTechTileEntity.class, int.class)); - adderMethodMap.put("addElementalToMachineList", GT_MetaTileEntity_MultiblockBase_EM.class.getMethod("addElementalToMachineList", IGregTechTileEntity.class, int.class)); - adderMethodMap.put("addMufflerToMachineList", GT_MetaTileEntity_MultiblockBase_EM.class.getMethod("addMufflerToMachineList", IGregTechTileEntity.class, int.class)); - adderMethodMap.put("addClassicMufflerToMachineList", GT_MetaTileEntity_MultiblockBase_EM.class.getMethod("addClassicMufflerToMachineList", IGregTechTileEntity.class, int.class)); - adderMethodMap.put("addElementalMufflerToMachineList", GT_MetaTileEntity_MultiblockBase_EM.class.getMethod("addElementalMufflerToMachineList", IGregTechTileEntity.class, int.class)); - adderMethodMap.put("addInputToMachineList", GT_MetaTileEntity_MultiblockBase_EM.class.getMethod("addInputToMachineList", IGregTechTileEntity.class, int.class)); - adderMethodMap.put("addOutputToMachineList", GT_MetaTileEntity_MultiblockBase_EM.class.getMethod("addOutputToMachineList", IGregTechTileEntity.class, int.class)); - adderMethodMap.put("addEnergyInputToMachineList", GT_MetaTileEntity_MultiblockBase_EM.class.getMethod("addEnergyInputToMachineList", IGregTechTileEntity.class, int.class)); - adderMethodMap.put("addDynamoToMachineList", GT_MetaTileEntity_MultiblockBase_EM.class.getMethod("addDynamoToMachineList", IGregTechTileEntity.class, int.class)); - adderMethodMap.put("addEnergyIOToMachineList", GT_MetaTileEntity_MultiblockBase_EM.class.getMethod("addEnergyIOToMachineList", IGregTechTileEntity.class, int.class)); - adderMethodMap.put("addElementalInputToMachineList", GT_MetaTileEntity_MultiblockBase_EM.class.getMethod("addElementalInputToMachineList", IGregTechTileEntity.class, int.class)); - adderMethodMap.put("addElementalOutputToMachineList", GT_MetaTileEntity_MultiblockBase_EM.class.getMethod("addElementalOutputToMachineList", IGregTechTileEntity.class, int.class)); - adderMethodMap.put("addClassicInputToMachineList", GT_MetaTileEntity_MultiblockBase_EM.class.getMethod("addClassicInputToMachineList", IGregTechTileEntity.class, int.class)); - adderMethodMap.put("addClassicOutputToMachineList", GT_MetaTileEntity_MultiblockBase_EM.class.getMethod("addClassicOutputToMachineList", IGregTechTileEntity.class, int.class)); - adderMethodMap.put("addParametrizerToMachineList", GT_MetaTileEntity_MultiblockBase_EM.class.getMethod("addParametrizerToMachineList", IGregTechTileEntity.class, int.class)); - adderMethodMap.put("addUncertainToMachineList", GT_MetaTileEntity_MultiblockBase_EM.class.getMethod("addUncertainToMachineList", IGregTechTileEntity.class, int.class)); - adderMethodMap.put("addMaintenanceToMachineList", GT_MetaTileEntity_MultiblockBase_EM.class.getMethod("addMaintenanceToMachineList", IGregTechTileEntity.class, int.class)); - adderMethodMap.put("addClassicMaintenanceToMachineList", GT_MetaTileEntity_MultiblockBase_EM.class.getMethod("addClassicMaintenanceToMachineList", IGregTechTileEntity.class, int.class)); - adderMethodMap.put("addDataConnectorToMachineList", GT_MetaTileEntity_MultiblockBase_EM.class.getMethod("addDataConnectorToMachineList", IGregTechTileEntity.class, int.class)); - adderMethod = GT_MetaTileEntity_MultiblockBase_EM.class.getMethod("addThing", String.class, IGregTechTileEntity.class, int.class); - } catch (NoSuchMethodException e) { - if (DEBUG_MODE) { - e.printStackTrace(); - } - } - } - - //CALLBACK from hatches adders - public boolean addThing(String methodName, IGregTechTileEntity igt, int casing) { - try { - return (boolean) adderMethodMap.get(methodName).invoke(this, igt, casing); - } catch (InvocationTargetException | IllegalAccessException e) { - if (DEBUG_MODE) { - e.printStackTrace(); - } - } - return false; - } - - //endregion } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/HatchAdder.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/HatchAdder.java new file mode 100644 index 0000000000..a8633c4837 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/HatchAdder.java @@ -0,0 +1,8 @@ +package com.github.technus.tectech.thing.metaTileEntity.multi.base; + + +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; + +import java.util.function.BiFunction; + +public interface HatchAdder extends BiFunction {} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/LedStatus.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/LedStatus.java index 52d4f30c12..e32df43ae4 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/LedStatus.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/LedStatus.java @@ -19,14 +19,6 @@ public enum LedStatus { this.isOk=ok; } - public boolean isOk(){ - return isOk; - } - - public boolean isBad(){ - return !isOk; - } - public byte getOrdinalByte(){ return (byte)ordinal(); } @@ -61,7 +53,6 @@ public enum LedStatus { } public static LedStatus fromLimitsExclusiveOuterBoundary(double value, double min,double low, double high,double max, double... excludedNumbers){ - if(Double.isNaN(value)) return STATUS_WRONG; if(value<=min) return STATUS_TOO_LOW; if(value>=max) return STATUS_TOO_HIGH; @@ -75,10 +66,8 @@ public enum LedStatus { } public static LedStatus fromLimitsInclusiveBoundary(double value, double min, double max, double... excludedNumbers){ - if(Double.isNaN(value)) return STATUS_WRONG; - if(value<=min) return STATUS_TOO_LOW; - else if(value==min) - if(value>=max) return STATUS_TOO_HIGH; + if(valuemax) return STATUS_TOO_HIGH; for (double val : excludedNumbers) { if(val==value) return STATUS_WRONG; @@ -88,10 +77,8 @@ public enum LedStatus { } public static LedStatus fromLimitsExclusiveBoundary(double value, double min, double max, double... excludedNumbers){ - if(Double.isNaN(value)) return STATUS_WRONG; if(value<=min) return STATUS_TOO_LOW; - else if(value==min) - if(value>=max) return STATUS_TOO_HIGH; + if(value>=max) return STATUS_TOO_HIGH; for (double val : excludedNumbers) { if(val==value) return STATUS_WRONG; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/NameFunction.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/NameFunction.java new file mode 100644 index 0000000000..8ced431576 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/NameFunction.java @@ -0,0 +1,8 @@ +package com.github.technus.tectech.thing.metaTileEntity.multi.base; + +import java.util.function.BiFunction; + +public interface NameFunction extends BiFunction { + @Override + String apply(T t, Parameters.IParameter iParameter); +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java index 3ab2947085..2e8959c00f 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java @@ -1,40 +1,31 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.base; -import gregtech.api.enums.GT_Values; - import java.util.ArrayList; -import java.util.BitSet; -import java.util.function.Function; - -import static gregtech.api.enums.GT_Values.B; /** * Instantiate parameters as field in parametersInstantiation_EM(); */ public class Parameters { - public static final Function LED_STATUS_FUNCTION_DEFAULT = o->LedStatus.STATUS_UNDEFINED; - public static final Function NAME_FUNCTION_DEFAULT=o->"Undefined"; - public static final int ZERO_FLOAT=Float.floatToIntBits(0); + private static final StatusFunction LED_STATUS_FUNCTION_DEFAULT = (b,p)->LedStatus.STATUS_UNDEFINED; + private static final NameFunction NAME_FUNCTION_DEFAULT= (b,p)->"Undefined"; final Group[] groups = new Group[10]; - int[] iParamsIn = new int[20];//number I from parametrizers - int[] iParamsOut = new int[20];//number O to parametrizers + double[] iParamsIn = new double[20];//number I from parametrizers + double[] iParamsOut = new double[20];//number O to parametrizers final ArrayList parameterInArrayList =new ArrayList<>(); final ArrayList parameterOutArrayList =new ArrayList<>(); - short bParamsAreFloats=0; - //package private for use in gui LedStatus[] eParamsInStatus = LedStatus.makeArray(20,LedStatus.STATUS_UNUSED);//LED status for I LedStatus[] eParamsOutStatus = LedStatus.makeArray(20,LedStatus.STATUS_UNUSED);//LED status for O - public double getIn(int hatchNo,int parameterId){ - return (bParamsAreFloats& B[hatchNo])!=0?Float.intBitsToFloat(iParamsIn[hatchNo+10*parameterId]):iParamsIn[hatchNo+10*parameterId]; + double getIn(int hatchNo,int parameterId){ + return iParamsIn[hatchNo+10*parameterId]; } - public double getOut(int hatchNo,int parameterId){ - return (bParamsAreFloats& B[hatchNo])!=0?Float.intBitsToFloat(iParamsOut[hatchNo+10*parameterId]):iParamsOut[hatchNo+10*parameterId]; + double getOut(int hatchNo,int parameterId){ + return iParamsOut[hatchNo+10*parameterId]; } private final GT_MetaTileEntity_MultiblockBase_EM parent; @@ -43,49 +34,29 @@ public class Parameters { this.parent=parent; } - public void setToDefaults(boolean defaultIn, boolean defaultOut,boolean defaultAreFloats){ - for (int hatch=0;hatch<10;hatch++) { - Group p= groups[hatch]; - if (p!=null){ - p.setToDefaults(defaultIn,defaultOut,defaultAreFloats); - }else{ - if(defaultAreFloats){ - bParamsAreFloats&=~B[hatch]; - if(defaultIn){ - iParamsIn[hatch] = 0; - iParamsIn[hatch + 10] = 0; - } - if(defaultOut){ - iParamsOut[hatch] = 0; - iParamsOut[hatch + 10] = 0; - } - }else{ - if((bParamsAreFloats& B[hatch])!=0){ - if(defaultIn){ - iParamsIn[hatch] = ZERO_FLOAT; - iParamsIn[hatch + 10] = ZERO_FLOAT; - } - if(defaultOut){ - iParamsOut[hatch] = ZERO_FLOAT; - iParamsOut[hatch + 10] = ZERO_FLOAT; - } - }else{ - if(defaultIn){ - iParamsIn[hatch] = 0; - iParamsIn[hatch + 10] = 0; - } - if(defaultOut){ - iParamsOut[hatch] = 0; - iParamsOut[hatch + 10] = 0; - } - } - } + public void setToDefaults(int hatch,boolean defaultIn, boolean defaultOut) { + Group p= groups[hatch]; + if (p == null) { + if (defaultIn) { + iParamsIn[hatch] = 0; + iParamsIn[hatch + 10] = 0; + } + if (defaultOut) { + iParamsOut[hatch] = 0; + iParamsOut[hatch + 10] = 0; } + } else { + p.setToDefaults(defaultIn,defaultOut); + } + } + + public void setToDefaults(boolean defaultIn, boolean defaultOut){ + for (int hatch=0;hatch<10;hatch++) { + setToDefaults(hatch,defaultIn,defaultOut); } } public void ClearDefinitions(){ - setToDefaults(true,true,false); parameterInArrayList.clear(); parameterOutArrayList.clear(); for(int i = 0; i< groups.length; i++){ @@ -93,72 +64,95 @@ public class Parameters { } } - public Group makeGroup(int hatchNo, boolean aParamsDefaultsAreFloats){ - return new Group( hatchNo, aParamsDefaultsAreFloats); + public void removeGroup(Group group){ + if(group==groups[group.hatchNo]){ + removeGroup(group.hatchNo); + }else{ + throw new IllegalArgumentException("Group does not exists in this parametrization!"); + } + } + + public void removeGroup(int hatchNo){ + Group hatch=groups[hatchNo]; + if(hatch!=null){ + for (Group.ParameterOut p:hatch.parameterOut) { + parameterOutArrayList.remove(p); + } + for (Group.ParameterIn p:hatch.parameterIn) { + parameterInArrayList.remove(p); + } + groups[hatchNo]=null; + } + } + + public Group getGroup(int hatchNo, boolean updateWhileRunning){ + return groups[hatchNo]!=null?groups[hatchNo]:new Group( hatchNo, updateWhileRunning); + } + + public Group getGroup(int hatchNo){ + return groups[hatchNo]!=null?groups[hatchNo]:new Group( hatchNo, false); + } + + public interface IParameter{ + double get(); + double getDefault(); + void updateStatus(); + LedStatus getStatus(boolean update); + int id(); + int hatchId(); + int parameterId(); + String getBrief(); } /** * most likely used locally in parametersInstantiation_EM() */ public class Group { - private final boolean bParamsDefaultsAreStoredAsFloats; private final int hatchNo; final ParameterIn[] parameterIn =new ParameterIn[2]; final ParameterOut[] parameterOut =new ParameterOut[2]; + public boolean updateWhileRunning; - private Group(int hatchNo, boolean aParamsDefaultsAreFloats){ + private Group(int hatchNo, boolean updateWhileRunning){ if(hatchNo<0 || hatchNo>=10){ throw new IllegalArgumentException("ParameterGroup id must be in 0 to 9 range"); } this.hatchNo=hatchNo; - bParamsDefaultsAreStoredAsFloats =aParamsDefaultsAreFloats; + this.updateWhileRunning=updateWhileRunning; groups[hatchNo]=this; } - public ParameterIn makeInParameter(int paramID, double defaultValue, Function name, Function status){ + public ParameterIn makeInParameter(int paramID, double defaultValue, NameFunction name, StatusFunction status){ return new ParameterIn(paramID, defaultValue,name, status); } - public ParameterOut makeOutParameter(int paramID, double defaultValue, Function name, Function status){ + public ParameterOut makeOutParameter(int paramID, double defaultValue, NameFunction name, StatusFunction status){ return new ParameterOut(paramID, defaultValue, name, status); } - public void setToDefaults(boolean defaultIn, boolean defaultOut,boolean defaultConfigureAreFloats) { - if(defaultConfigureAreFloats){ - if(bParamsDefaultsAreStoredAsFloats){ - bParamsAreFloats|= B[hatchNo]; - }else { - bParamsAreFloats&=~B[hatchNo]; - } - } + public void setToDefaults(boolean defaultIn, boolean defaultOut) { if(defaultIn){ - for(int in=0;in<2;in++){ - if(this.parameterIn[in]!=null){ - this.parameterIn[in].setDefault(); - }else { - if ((bParamsAreFloats& B[hatchNo])!=0) { - iParamsIn[hatchNo] = ZERO_FLOAT; - iParamsIn[hatchNo + 10] = ZERO_FLOAT; - } else { - iParamsIn[hatchNo] = 0; - iParamsIn[hatchNo + 10] = 0; - } - } + if (this.parameterIn[0] != null) { + this.parameterIn[0].setDefault(); + } else { + iParamsIn[hatchNo] = 0; + } + if (this.parameterIn[1] != null) { + this.parameterIn[1].setDefault(); + } else { + iParamsIn[hatchNo + 10] = 0; } } if(defaultOut){ - for(int out=0;out<2;out++){ - if(this.parameterOut[out]!=null){ - this.parameterOut[out].setDefault(); - }else { - if ((bParamsAreFloats& B[hatchNo])!=0) { - iParamsIn[hatchNo] = ZERO_FLOAT; - iParamsIn[hatchNo + 10] = ZERO_FLOAT; - } else { - iParamsIn[hatchNo] = 0; - iParamsIn[hatchNo + 10] = 0; - } - } + if (this.parameterOut[0] != null) { + this.parameterOut[0].setDefault(); + } else { + iParamsIn[hatchNo] = 0; + } + if (this.parameterOut[1] != null) { + this.parameterOut[1].setDefault(); + } else { + iParamsIn[hatchNo + 10] = 0; } } } @@ -166,48 +160,52 @@ public class Parameters { /** * Make a field out of this... */ - public class ParameterOut { + public class ParameterOut implements IParameter { public final int id; public final double defaultValue; - Function status; - Function name; + StatusFunction status; + NameFunction name; - @SuppressWarnings("unchecked") - private ParameterOut(int paramID, double defaultValue, Function name, Function status){ - this.name= name; - this.id=hatchNo+10*paramID; + private ParameterOut(int paramID, double defaultValue, NameFunction name, StatusFunction status){ + this.name= name==null?NAME_FUNCTION_DEFAULT:name; if(paramID<0 || paramID>2){ throw new IllegalArgumentException("Parameter id must be in 0 to 1 range"); } - this.defaultValue=defaultValue; if(parameterOut[paramID]!=null){ - throw new InstantiationError("This parameter already exists!"); + throw new IllegalArgumentException("Parameter id already occupied"); } - this.status = status; + this.id=hatchNo+10*paramID; + this.defaultValue=defaultValue; + this.status = status==null?LED_STATUS_FUNCTION_DEFAULT:status; parameterOutArrayList.add(this); parameterOut[paramID]=this; } - private void setDefault() { + void setDefault() { set(defaultValue); } + @Override public double get(){ - return (bParamsAreFloats& B[hatchNo])!=0?Float.intBitsToFloat(iParamsOut[id]):iParamsOut[id]; + return iParamsOut[id]; + } + + @Override + public double getDefault() { + return defaultValue; } public void set(double value){ - if((bParamsAreFloats& B[hatchNo])!=0) { - iParamsOut[id]=Float.floatToIntBits((float) value); - }else{ - iParamsOut[id]=(int)value; - } + iParamsOut[id]=value; } + @SuppressWarnings("unchecked") + @Override public void updateStatus(){ - eParamsOutStatus[id]=status.apply(parent); + eParamsOutStatus[id]=status.apply(parent,this); } + @Override public LedStatus getStatus(boolean update){ if(update){ updateStatus(); @@ -215,52 +213,76 @@ public class Parameters { return eParamsOutStatus[id]; } + @Override public String getBrief(){ - return name.apply(parent); + return name.apply(parent,this); + } + + @Override + public int id() { + return id; + } + + @Override + public int hatchId() { + return id%10; + } + + @Override + public int parameterId() { + return id/10; } } /** * Make a field out of this... */ - public class ParameterIn { + public class ParameterIn implements IParameter { public final int id; public final double defaultValue; - Function status; - Function name; + StatusFunction status; + NameFunction name; - @SuppressWarnings("unchecked") - private ParameterIn(int paramID, double defaultValue, Function name, Function status){ - this.name= name; + private ParameterIn(int paramID, double defaultValue, NameFunction name, StatusFunction status){ + this.name= name==null?NAME_FUNCTION_DEFAULT:name; this.id=hatchNo+10*paramID; if(paramID<0 || paramID>2){ throw new IllegalArgumentException("Parameter id must be in 0 to 1 range"); } - this.defaultValue=defaultValue; - if(parameterIn[paramID]!=null){ - throw new InstantiationError("This parameter already exists!"); + if(parameterOut[paramID]!=null){ + throw new IllegalArgumentException("Parameter id already occupied"); } - this.status = status; + this.defaultValue=defaultValue; + this.status = status==null?LED_STATUS_FUNCTION_DEFAULT:status; parameterInArrayList.add(this); parameterIn[paramID]=this; } - private void setDefault() { - if((bParamsAreFloats& B[hatchNo])!=0) { - iParamsIn[id]=Float.floatToIntBits((float) defaultValue); - }else{ - iParamsIn[id]=(int)defaultValue; - } + void setDefault() { + set(defaultValue); } + @Override public double get(){ - return (bParamsAreFloats& B[hatchNo])!=0?Float.intBitsToFloat(iParamsIn[id]):iParamsIn[id]; + return iParamsIn[id]; + } + + void set(double value){ + iParamsIn[id]=value; } + @Override + public double getDefault() { + return defaultValue; + } + + @SuppressWarnings("unchecked") + @Override public void updateStatus(){ - eParamsInStatus[id]=status.apply(parent); + eParamsInStatus[id]=status.apply(parent,this); } + @Override public LedStatus getStatus(boolean update){ if(update){ updateStatus(); @@ -268,8 +290,25 @@ public class Parameters { return eParamsInStatus[id]; } + @Override public String getBrief(){ - return name.apply(parent); + return name.apply(parent,this); + } + + + @Override + public int id() { + return id; + } + + @Override + public int hatchId() { + return id%10; + } + + @Override + public int parameterId() { + return id/10; } } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/StatusFunction.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/StatusFunction.java new file mode 100644 index 0000000000..224f0fc47c --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/StatusFunction.java @@ -0,0 +1,8 @@ +package com.github.technus.tectech.thing.metaTileEntity.multi.base; + +import java.util.function.BiFunction; + +public interface StatusFunction extends BiFunction { + @Override + LedStatus apply(T t, Parameters.IParameter iParameter); +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java index efbca82c8f..4551ef3b17 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java @@ -4,12 +4,11 @@ import com.github.technus.tectech.TecTech; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.dAtomDefinition; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockControl; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.*; import java.util.ArrayList; import java.util.Arrays; -import java.util.Comparator; +import java.util.function.BiFunction; import static com.github.technus.tectech.CommonValues.V; import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; @@ -18,10 +17,22 @@ import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStat /** * Created by danie_000 on 24.12.2017. */ -public class Behaviour_Centrifuge extends GT_MetaTileEntity_EM_machine.Behaviour { - private final float radius, maxRPM, maxRCF, maxForce, maxCapacity; +public class Behaviour_Centrifuge implements GT_MetaTileEntity_EM_machine.Behaviour { private final byte tier; - private final static String[] DESCRIPTION_I =new String[]{"RPM Input","Fraction Count Input"}; + private float radius, maxRPM, maxRCF, maxForce, maxCapacity; + private Parameters.Group.ParameterIn settingRPM, settingFraction; + private final static NameFunction rpmName= (gt_metaTileEntity_em_machine, iParameter) -> "RPM Setting"; + private static final StatusFunction rpmStatus= (gt_metaTileEntity_em_machine, iParameter) -> { + double v=iParameter.get(); + if(Double.isNaN(v)){ + return STATUS_WRONG; + } + + }; + private final static NameFunction fractionName= (gt_metaTileEntity_em_machine, iParameter) -> "Fraction Count"; + private static final StatusFunction fractionStatus= (gt_metaTileEntity_em_machine, iParameter) -> { + + }; private final static String[] DESCRIPTION_O =new String[]{"RPM Setting","RCF Setting","Radius [mm]","Max RPM","Max Force [eV/c^2 * m/s]","Max Capacity [eV/c^2]","Max Power Usage[EU/t]","Max Recipe Rime [tick]"}; private static final double[/*tier+5*/][/*outputHatches+2*/] MIXING_FACTORS =new double[][]{ @@ -46,13 +57,6 @@ public class Behaviour_Centrifuge extends GT_MetaTileEntity_EM_machine.Behaviour maxCapacity = maxSafeMass * 4f * radius;// eV/c^2 } - @Override - protected void getFullLedDescriptionIn(ArrayList baseDescr, int hatchNo, int paramID) { - if(hatchNo==0) { - baseDescr.add(DESCRIPTION_I[(hatchNo << 1) + paramID]); - } - } - @Override protected void getFullLedDescriptionOut(ArrayList baseDescr, int hatchNo, int paramID) { if(hatchNo<=2) { @@ -60,25 +64,38 @@ public class Behaviour_Centrifuge extends GT_MetaTileEntity_EM_machine.Behaviour } } - @Override - public boolean setAndCheckParametersOutAndStatuses(GT_MetaTileEntity_EM_machine te, double[] parametersToCheckAndFix) { - boolean check=true; - - te.setParameterOut(1, 0, radius * 1000);//in mm - te.setParameterOut(1, 1, maxRPM); - te.setParameterOut(2, 0, maxForce * 9.80665);// (eV/c^2 * m/s) - te.setParameterOut(2, 1, maxCapacity);// eV/c^2 + private double getRCF(double RPM) { + return RPM * RPM * radius * 0.001118; + } - for(int i=4;i<=9;i++) { - te.setStatusOfParameterOut(i, 0, STATUS_UNUSED); - te.setStatusOfParameterOut(i, 1, STATUS_UNUSED); + private void addRandomly(cElementalInstanceStack me, cElementalInstanceStackMap[] toThis, int fractionCount) { + long amountPerFraction = me.amount / fractionCount; + cElementalInstanceStack[] stacks = new cElementalInstanceStack[fractionCount]; + for (int i = 0; i < fractionCount; i++) { + stacks[i] = me.clone(); + stacks[i].amount = amountPerFraction; + toThis[i].putReplace(stacks[i]); } - for(int i=1;i<=3;i++) { - te.setStatusOfParameterIn(i, 0, STATUS_UNUSED); - te.setStatusOfParameterIn(i, 1, STATUS_UNUSED); + int remainingAmount = (int) (me.amount % fractionCount); + while (remainingAmount > 0) { + int amountToAdd = TecTech.RANDOM.nextInt(remainingAmount) + 1; + stacks[TecTech.RANDOM.nextInt(fractionCount)].amount += amountToAdd; + remainingAmount -= amountToAdd; } + } - double RPM = parametersToCheckAndFix[0]; + @Override + public void parametersInstantiation(GT_MetaTileEntity_EM_machine te, Parameters parameters) { + Parameters.Group hatch1=parameters.getGroup(7); + settingRPM=hatch1.makeInParameter(0,0,,); + settingFraction=hatch1.makeInParameter(1,2,,); + } + + @Override + public boolean checkParametersInAndSetStatuses(GT_MetaTileEntity_EM_machine te, Parameters parameters) { + boolean check=true; + + double RPM = settingRPM.get(); if (RPM > maxRPM) { te.setStatusOfParameterIn(0, 0, STATUS_TOO_HIGH); te.setParameterOut(0, 0, maxRPM);//rpm @@ -107,7 +124,7 @@ public class Behaviour_Centrifuge extends GT_MetaTileEntity_EM_machine.Behaviour te.setParameterOut(0, 1, getRCF(RPM)); } - double fractionCount = parametersToCheckAndFix[1]; + double fractionCount = settingFraction.get(); if (fractionCount > 6) { parametersToCheckAndFix[1] = 6; te.setStatusOfParameterIn(0, 1, STATUS_TOO_HIGH); @@ -130,7 +147,7 @@ public class Behaviour_Centrifuge extends GT_MetaTileEntity_EM_machine.Behaviour } @Override - public MultiblockControl process(cElementalInstanceStackMap[] inputs, double[] checkedAndFixedParameters) { + public MultiblockControl process(cElementalInstanceStackMap[] inputs, GT_MetaTileEntity_EM_machine te, Parameters parameters) { cElementalInstanceStackMap input = inputs[0]; if (input == null || input.isEmpty()) return null;//nothing in only valid input @@ -181,15 +198,12 @@ public class Behaviour_Centrifuge extends GT_MetaTileEntity_EM_machine.Behaviour //take all from hatch handler and put into new map - this takes from hatch to inner data storage stacks = input.takeAllToNewMap().values();//cleanup stacks if (stacks.length > 1) { - Arrays.sort(stacks, new Comparator() { - @Override - public int compare(cElementalInstanceStack o1, cElementalInstanceStack o2) { - float m1 = o1.definition.getMass(); - float m2 = o2.definition.getMass(); - if (m1 < m2) return -1; - if (m1 > m2) return 1; - return o1.compareTo(o2); - } + Arrays.sort(stacks, (o1, o2) -> { + float m1 = o1.definition.getMass(); + float m2 = o2.definition.getMass(); + if (m1 < m2) return -1; + if (m1 > m2) return 1; + return o1.compareTo(o2); }); double absMassPerOutput = 0;//"volume" @@ -258,24 +272,4 @@ public class Behaviour_Centrifuge extends GT_MetaTileEntity_EM_machine.Behaviour } return new MultiblockControl<>(outputs, mEut, 1, 0, 10000, mTicks, 0, excessMass); } - - private double getRCF(double RPM) { - return RPM * RPM * radius * 0.001118; - } - - private void addRandomly(cElementalInstanceStack me, cElementalInstanceStackMap[] toThis, int fractionCount) { - long amountPerFraction = me.amount / fractionCount; - cElementalInstanceStack[] stacks = new cElementalInstanceStack[fractionCount]; - for (int i = 0; i < fractionCount; i++) { - stacks[i] = me.clone(); - stacks[i].amount = amountPerFraction; - toThis[i].putReplace(stacks[i]); - } - int remainingAmount = (int) (me.amount % fractionCount); - while (remainingAmount > 0) { - int amountToAdd = TecTech.RANDOM.nextInt(remainingAmount) + 1; - stacks[TecTech.RANDOM.nextInt(fractionCount)].amount += amountToAdd; - remainingAmount -= amountToAdd; - } - } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Electrolyzer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Electrolyzer.java index 9fe54588bc..42b41a5ae3 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Electrolyzer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Electrolyzer.java @@ -2,23 +2,29 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.em_machine; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockControl; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; /** * Created by danie_000 on 24.12.2017. */ -public class Behaviour_Electrolyzer extends GT_MetaTileEntity_EM_machine.Behaviour { +public class Behaviour_Electrolyzer implements GT_MetaTileEntity_EM_machine.Behaviour { final int tier; public Behaviour_Electrolyzer(int tier){ this.tier=tier; } @Override - public boolean setAndCheckParametersOutAndStatuses(GT_MetaTileEntity_EM_machine te, double[] parametersToCheckAndFix) { + public void parametersInstantiation(GT_MetaTileEntity_EM_machine te, Parameters parameters) { + + } + + @Override + public boolean checkParametersInAndSetStatuses(GT_MetaTileEntity_EM_machine te, Parameters parameters) { return false; } @Override - public MultiblockControl process(cElementalInstanceStackMap[] inputs, double[] checkedAndFixedParameters) { + public MultiblockControl process(cElementalInstanceStackMap[] inputs, GT_MetaTileEntity_EM_machine te, Parameters parameters) { return null; } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java index 94f00ece1b..e8b0ac7401 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java @@ -15,7 +15,7 @@ import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStat /** * Created by danie_000 on 24.12.2017. */ -public class Behaviour_ElectromagneticSeparator extends GT_MetaTileEntity_EM_machine.Behaviour { +public class Behaviour_ElectromagneticSeparator implements GT_MetaTileEntity_EM_machine.Behaviour { private final byte tier; private final int ticks; private final byte precisionFull; @@ -102,16 +102,6 @@ public class Behaviour_ElectromagneticSeparator extends GT_MetaTileEntity_EM_mac te.setParameterOut(3,0,V[tier]); te.setParameterOut(3,1,ticks); - for(int i=4;i<=9;i++) { - te.setStatusOfParameterOut(i, 0, STATUS_UNUSED); - te.setStatusOfParameterOut(i, 1, STATUS_UNUSED); - } - te.setStatusOfParameterIn(1, 1, STATUS_UNUSED); - for(int i=2;i<=3;i++) { - te.setStatusOfParameterIn(i, 0, STATUS_UNUSED); - te.setStatusOfParameterIn(i, 1, STATUS_UNUSED); - } - double full=parametersToCheckAndFix[0]; if(Double.isInfinite(full) && full>0) { te.setStatusOfParameterIn(0,0,STATUS_TOO_HIGH); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_PrecisionLaser.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_PrecisionLaser.java index bae032cd9e..02ddecbdc6 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_PrecisionLaser.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_PrecisionLaser.java @@ -2,23 +2,29 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.em_machine; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockControl; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; /** * Created by danie_000 on 24.12.2017. */ -public class Behaviour_PrecisionLaser extends GT_MetaTileEntity_EM_machine.Behaviour { +public class Behaviour_PrecisionLaser implements GT_MetaTileEntity_EM_machine.Behaviour { final int tier; public Behaviour_PrecisionLaser(int tier){ this.tier=tier; } @Override - public boolean setAndCheckParametersOutAndStatuses(GT_MetaTileEntity_EM_machine te, double[] parametersToCheckAndFix) { + public void parametersInstantiation(GT_MetaTileEntity_EM_machine te, Parameters parameters) { + + } + + @Override + public boolean checkParametersInAndSetStatuses(GT_MetaTileEntity_EM_machine te, Parameters parameters) { return false; } @Override - public MultiblockControl process(cElementalInstanceStackMap[] inputs, double[] checkedAndFixedParameters) { + public MultiblockControl process(cElementalInstanceStackMap[] inputs, GT_MetaTileEntity_EM_machine te, Parameters parameters) { return null; } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Recycler.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Recycler.java index 4f6d555fdc..e30fdf111b 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Recycler.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Recycler.java @@ -2,23 +2,29 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.em_machine; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockControl; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; /** * Created by danie_000 on 24.12.2017. */ -public class Behaviour_Recycler extends GT_MetaTileEntity_EM_machine.Behaviour { +public class Behaviour_Recycler implements GT_MetaTileEntity_EM_machine.Behaviour { final int tier; public Behaviour_Recycler(int tier){ this.tier=tier; } @Override - public boolean setAndCheckParametersOutAndStatuses(GT_MetaTileEntity_EM_machine te, double[] parametersToCheckAndFix) { + public void parametersInstantiation(GT_MetaTileEntity_EM_machine te, Parameters parameters) { + + } + + @Override + public boolean checkParametersInAndSetStatuses(GT_MetaTileEntity_EM_machine te, Parameters parameters) { return false; } @Override - public MultiblockControl process(cElementalInstanceStackMap[] inputs, double[] checkedAndFixedParameters) { + public MultiblockControl process(cElementalInstanceStackMap[] inputs, GT_MetaTileEntity_EM_machine te, Parameters parameters) { return null; } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Scanner.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Scanner.java index 32d8b81fdd..627f713a22 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Scanner.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Scanner.java @@ -2,23 +2,29 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.em_machine; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockControl; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; /** * Created by danie_000 on 24.12.2017. */ -public class Behaviour_Scanner extends GT_MetaTileEntity_EM_machine.Behaviour { +public class Behaviour_Scanner implements GT_MetaTileEntity_EM_machine.Behaviour { final int tier; public Behaviour_Scanner(int tier){ this.tier=tier; } @Override - public boolean setAndCheckParametersOutAndStatuses(GT_MetaTileEntity_EM_machine te, double[] parametersToCheckAndFix) { + public void parametersInstantiation(GT_MetaTileEntity_EM_machine te, Parameters parameters) { + + } + + @Override + public boolean checkParametersInAndSetStatuses(GT_MetaTileEntity_EM_machine te, Parameters parameters) { return false; } @Override - public MultiblockControl process(cElementalInstanceStackMap[] inputs, double[] checkedAndFixedParameters) { + public MultiblockControl process(cElementalInstanceStackMap[] inputs, GT_MetaTileEntity_EM_machine te, Parameters parameters) { return null; } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java index 9c45b5df67..1ef3705b50 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java @@ -7,21 +7,25 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInsta import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.block.QuantumStuffBlock; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; +import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_junction; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockControl; import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.NameFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.StatusFunction; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.common.util.ForgeDirection; -import java.util.ArrayList; -import java.util.BitSet; import java.util.HashMap; +import java.util.function.Supplier; import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; @@ -34,6 +38,7 @@ import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStat public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { public static final String machine = "EM Machinery"; + private ItemStack loadedMachine; private Behaviour currentBehaviour; //region structure @@ -47,7 +52,7 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa {"B0", "A!!!", "0!!!0", "A!!!", "B0",},}; private static final Block[] blockType = new Block[]{sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{4, 0, 5, 6}; - private static final String[] addingMethods = new String[]{"addClassicToMachineList", "addElementalToMachineList"}; + private final HatchAdder[] addingMethods = new HatchAdder[]{this::addClassicToMachineList,this::addElementalToMachineList}; private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; @@ -57,6 +62,36 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa "2 - Elemental Hatches or Molecular Casing",}; //endregion + //region parameters + protected Parameters.Group.ParameterIn[] inputMux=new Parameters.Group.ParameterIn[6]; + protected Parameters.Group.ParameterIn[] outputMux=new Parameters.Group.ParameterIn[6]; + private static final StatusFunction SRC_STATUS = + (base,p)-> { + double v = p.get(); + if (Double.isNaN(v)) return STATUS_WRONG; + v=(int)v; + if (v < 0) return STATUS_TOO_LOW; + if (v == 0) return STATUS_NEUTRAL; + if (v >= base.eInputHatches.size()) return STATUS_TOO_HIGH; + return STATUS_OK; + }; + private static final StatusFunction DST_STATUS = + (base,p)->{ + if(base.inputMux[p.hatchId()].getStatus(false)== STATUS_OK){ + double v = p.get(); + if (Double.isNaN(v)) return STATUS_WRONG; + v=(int)v; + if (v < 0) return STATUS_TOO_LOW; + if (v == 0) return STATUS_LOW; + if (v >= base.eInputHatches.size()) return STATUS_TOO_HIGH; + return STATUS_OK; + } + return STATUS_NEUTRAL; + }; + private static final NameFunction ROUTE_NAME= + (base,p)->(p.parameterId()==0?"Source ":"Destination ")+p.hatchId(); + //endregion + public GT_MetaTileEntity_EM_machine(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } @@ -65,6 +100,31 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa super(aName); } + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + if(aNBT.hasKey("eLoadedMachine")){ + loadedMachine = ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("eLoadedMachine")); + } + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + if(loadedMachine !=null) { + aNBT.setTag("eLoadedMachine", loadedMachine.writeToNBT(new NBTTagCompound())); + } + } + + @Override + protected void parametersInstantiation_EM() { + for (int i=0;i<6;i++){ + Parameters.Group hatch=parametrization.getGroup(i); + inputMux[i]=hatch.makeInParameter(0,i,ROUTE_NAME,SRC_STATUS); + outputMux[i]=hatch.makeInParameter(1,i,ROUTE_NAME,DST_STATUS); + } + } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_EM_machine(mName); @@ -92,6 +152,7 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa @Override public void onFirstTick_EM(IGregTechTileEntity aBaseMetaTileEntity) { + setCurrentBehaviour(); if(aBaseMetaTileEntity.isServerSide()) { quantumStuff(aBaseMetaTileEntity.isActive()); } @@ -100,7 +161,9 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa @Override public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if(aBaseMetaTileEntity.isClientSide() && (aTick & 0x2)==0){ - currentBehaviour=GT_MetaTileEntity_EM_machine.map.get(new Util.TT_ItemStack(mInventory[1])); + if((aTick&0x10)==0) { + setCurrentBehaviour(); + } if(aBaseMetaTileEntity.isActive()){ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX*2+aBaseMetaTileEntity.getXCoord(); int yDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetY*2+aBaseMetaTileEntity.getYCoord(); @@ -110,28 +173,6 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa } } - private boolean setCurrentBehaviour(Behaviour newBehaviour){ - boolean changed=currentBehaviour!=newBehaviour; - if(changed){ - setDefaultParametersAndStatuses(); - } - currentBehaviour=newBehaviour; - return changed; - } - - private void setDefaultParametersAndStatuses() { - for (int i = 0; i <= 3; i++) { - setStatusOfParameterIn(i, 0, STATUS_NEUTRAL); - setStatusOfParameterIn(i, 1, STATUS_NEUTRAL); - } - for (int i = 0; i <= 9; i++) { - setStatusOfParameterOut(i, 0, STATUS_NEUTRAL); - setStatusOfParameterOut(i, 1, STATUS_NEUTRAL); - setParameterOut(i, 0, 0); - setParameterOut(i, 1, 0); - } - } - @Override public void onRemoval() { quantumStuff(false); @@ -140,48 +181,21 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa @Override public boolean checkRecipe_EM(ItemStack itemStack) { - setCurrentBehaviour(GT_MetaTileEntity_EM_machine.map.get(new Util.TT_ItemStack(itemStack))); + setCurrentBehaviour(); if(currentBehaviour==null){ return false; } - //mux input - double[] parameters = new double[]{ - getParameterIn(0, 0), - getParameterIn(0, 1), - getParameterIn(1, 0), - getParameterIn(1, 1), - getParameterIn(2, 0), - getParameterIn(2, 1), - getParameterIn(3, 0), - getParameterIn(3, 1)}; - if (!currentBehaviour.setAndCheckParametersOutAndStatuses(this, parameters)) { + + if (!currentBehaviour.checkParametersInAndSetStatuses(this, parametrization)) { return false; } cElementalInstanceStackMap[] handles = new cElementalInstanceStackMap[6]; - int pointer = getParameterInInt(4, 0) - 1; - if (pointer >= 0 && pointer < eInputHatches.size()) { - handles[0] = eInputHatches.get(pointer).getContainerHandler(); - } - pointer = getParameterInInt(4, 1) - 1; - if (pointer >= 0 && pointer < eInputHatches.size()) { - handles[1] = eInputHatches.get(pointer).getContainerHandler(); - } - pointer = getParameterInInt(5, 0) - 1; - if (pointer >= 0 && pointer < eInputHatches.size()) { - handles[2] = eInputHatches.get(pointer).getContainerHandler(); - } - pointer = getParameterInInt(5, 1) - 1; - if (pointer >= 0 && pointer < eInputHatches.size()) { - handles[3] = eInputHatches.get(pointer).getContainerHandler(); - } - pointer = getParameterInInt(6, 0) - 1; - if (pointer >= 0 && pointer < eInputHatches.size()) { - handles[4] = eInputHatches.get(pointer).getContainerHandler(); - } - pointer = getParameterInInt(6, 1) - 1; - if (pointer >= 0 && pointer < eInputHatches.size()) { - handles[5] = eInputHatches.get(pointer).getContainerHandler(); + for (int i = 0; i < 6; i++) { + int pointer = (int)inputMux[i].get(); + if (pointer >= 0 && pointer < eInputHatches.size()) { + handles[i] = eInputHatches.get(pointer).getContainerHandler(); + } } for (int i = 1; i < 6; i++) { @@ -194,7 +208,7 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa } } - MultiblockControl control = currentBehaviour.process(handles, parameters); + MultiblockControl control = currentBehaviour.process(handles,this, parametrization); if (control == null) { return false; } @@ -223,33 +237,16 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa @Override public void outputAfterRecipe_EM() { - if (setCurrentBehaviour(GT_MetaTileEntity_EM_machine.map.get(new Util.TT_ItemStack(mInventory[1])))) { + if (setCurrentBehaviour()) { return; } + cElementalInstanceStackMap[] handles = new cElementalInstanceStackMap[6]; - int pointer = getParameterInInt(7, 0) - 1; - if (pointer >= 0 && pointer < eOutputHatches.size()) { - handles[0] = eOutputHatches.get(pointer).getContainerHandler(); - } - pointer = getParameterInInt(7, 1) - 1; - if (pointer >= 0 && pointer < eOutputHatches.size()) { - handles[1] = eOutputHatches.get(pointer).getContainerHandler(); - } - pointer = getParameterInInt(8, 0) - 1; - if (pointer >= 0 && pointer < eOutputHatches.size()) { - handles[2] = eOutputHatches.get(pointer).getContainerHandler(); - } - pointer = getParameterInInt(8, 1) - 1; - if (pointer >= 0 && pointer < eOutputHatches.size()) { - handles[3] = eOutputHatches.get(pointer).getContainerHandler(); - } - pointer = getParameterInInt(9, 0) - 1; - if (pointer >= 0 && pointer < eOutputHatches.size()) { - handles[4] = eOutputHatches.get(pointer).getContainerHandler(); - } - pointer = getParameterInInt(9, 1) - 1; - if (pointer >= 0 && pointer < eOutputHatches.size()) { - handles[5] = eOutputHatches.get(pointer).getContainerHandler(); + for (int i = 0; i < 6; i++) { + int pointer = (int)outputMux[i].get(); + if (pointer >= 0 && pointer < eOutputHatches.size()) { + handles[i] = eOutputHatches.get(pointer).getContainerHandler(); + } } //output for (int i = 0; i < 6 && i < outputEM.length; i++) { @@ -269,159 +266,70 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa } @Override - protected void parametersLoadDefault_EM() {//default routing table - setParameterPairIn_ClearOut(4, false, 1, 2);//I - setParameterPairIn_ClearOut(5, false, 3, 4);//I - setParameterPairIn_ClearOut(6, false, 5, 6);//I - - setParameterPairIn_ClearOut(7, false, 1, 2);//O - setParameterPairIn_ClearOut(8, false, 3, 4);//O - setParameterPairIn_ClearOut(9, false, 5, 6);//O + public void parametersStatusesWrite_EM(boolean machineBusy) { + if (!machineBusy) { + setCurrentBehaviour(); + } + super.parametersStatusesWrite_EM(machineBusy); } - @Override - public void parametersOutAndStatusesWrite_EM(boolean machineBusy) { - int pointer; - { - BitSet checkArray = new BitSet(); - for (int i = 4; i <= 6; i++) { - pointer = getParameterInInt(i, 0); - if (Double.isNaN(pointer)) { - setStatusOfParameterIn(i, 0, STATUS_WRONG); - } else if (pointer <= 0) { - setStatusOfParameterIn(i, 0, STATUS_TOO_LOW); - }//else if(pointer==0) - // setStatusOfParameterIn(i,0,STATUS_LOW); - else if (pointer <= eInputHatches.size()) { - if (checkArray.get(pointer)) { - setStatusOfParameterIn(i, 0, STATUS_WRONG); - } else { - setStatusOfParameterIn(i, 0, STATUS_OK); - checkArray.set(pointer); - } - } else { - setStatusOfParameterIn(i, 0, STATUS_TOO_HIGH); - } - pointer = getParameterInInt(i, 1); - if (Double.isNaN(pointer)) { - setStatusOfParameterIn(i, 1, STATUS_WRONG); - } else if (pointer < 0) { - setStatusOfParameterIn(i, 1, STATUS_TOO_LOW); - } else if (pointer == 0) { - setStatusOfParameterIn(i, 1, STATUS_LOW); - } else if (pointer <= eInputHatches.size()) { - if (checkArray.get(pointer)) { - setStatusOfParameterIn(i, 1, STATUS_WRONG); - } else { - setStatusOfParameterIn(i, 1, STATUS_OK); - checkArray.set(pointer); - } - } else { - setStatusOfParameterIn(i, 1, STATUS_TOO_HIGH); - } - } + private boolean setCurrentBehaviour(){ + ItemStack newMachine=mInventory[1]; + if(ItemStack.areItemStacksEqual(newMachine, loadedMachine)){ + return false; } - { - for (int i = 7; i <= 9; i++) { - pointer = getParameterInInt(i, 0); - if (Double.isNaN(pointer)) { - setStatusOfParameterIn(i, 0, STATUS_WRONG); - } else if (pointer < 0) { - setStatusOfParameterIn(i, 0, STATUS_TOO_LOW); - } else if (pointer == 0) { - setStatusOfParameterIn(i, 0, STATUS_LOW); - } else if (pointer <= eOutputHatches.size()) { - setStatusOfParameterIn(i, 0, STATUS_OK); - } else { - setStatusOfParameterIn(i, 0, STATUS_TOO_HIGH); - } - pointer = getParameterInInt(i, 1); - if (Double.isNaN(pointer)) { - setStatusOfParameterIn(i, 1, STATUS_WRONG); - } else if (pointer < 0) { - setStatusOfParameterIn(i, 1, STATUS_TOO_LOW); - } else if (pointer == 0) { - setStatusOfParameterIn(i, 1, STATUS_LOW); - } else if (pointer <= eOutputHatches.size()) { - setStatusOfParameterIn(i, 1, STATUS_OK); - } else { - setStatusOfParameterIn(i, 1, STATUS_TOO_HIGH); - } + loadedMachine=newMachine; + Supplier behaviourSupplier=GT_MetaTileEntity_EM_machine.BEHAVIOUR_MAP.get(new Util.ItemStack_NoNBT(newMachine)); + if(currentBehaviour==null && behaviourSupplier==null) { + return false; + } + if(currentBehaviour!=null){ + for(int i=6;i<10;i++){ + parametrization.removeGroup(i); } } - setCurrentBehaviour(GT_MetaTileEntity_EM_machine.map.get(new Util.TT_ItemStack(mInventory[1]))); - if (currentBehaviour == null) { - setDefaultParametersAndStatuses(); + if(behaviourSupplier!=null){ + currentBehaviour=behaviourSupplier.get(); + currentBehaviour.parametersInstantiation(this, parametrization); + for(int i=6;i<10;i++){ + parametrization.setToDefaults(i,true,true); + } } else { - double[] parameters = new double[]{ - getParameterIn(0, 0), - getParameterIn(0, 1), - getParameterIn(1, 0), - getParameterIn(1, 1), - getParameterIn(2, 0), - getParameterIn(2, 1), - getParameterIn(3, 0), - getParameterIn(3, 1)}; - currentBehaviour.setAndCheckParametersOutAndStatuses(this,parameters); + currentBehaviour=null; } + return true; } - private static final HashMap map = new HashMap<>(); + private static final HashMap> BEHAVIOUR_MAP = new HashMap<>(); - public static void registerBehaviour(Behaviour behaviour, ItemStack is) { - map.put(new Util.TT_ItemStack(is), behaviour); - TecTech.LOGGER.info("Registered EM machine behaviour "+behaviour.getClass().getSimpleName()+' '+new Util.TT_ItemStack(is).toString()); + public static void registerBehaviour(Supplier behaviour, ItemStack is) { + BEHAVIOUR_MAP.put(new Util.ItemStack_NoNBT(is), behaviour); + TecTech.LOGGER.info("Registered EM machine behaviour "+behaviour.get().getClass().getSimpleName()+' '+new Util.ItemStack_NoNBT(is).toString()); } - public static abstract class Behaviour { - public Behaviour(){} - - public final void setOnMachine(GT_MetaTileEntity_EM_machine te){ - te.parametrization.clearGroups(); - parametersInstantiation(te.parametrization); - } - - public abstract void parametersInstantiation(Parameters parameters); + public interface Behaviour { + /** + * instantiate parameters, u can also check machine tier here + * @param te + * @param parameters + */ + void parametersInstantiation(GT_MetaTileEntity_EM_machine te, Parameters parameters); /** - * handle parameters pre recipe, and cyclically - * this shouldn't write to input parameters! only to the provided array and/or output parameters - * @param te this - * @param parametersToCheckAndFix array of 6 parameters to pass to the process method (can be modified) - * this allows to pass different numbers if u want to employ automatic parameter correction here + * handle parameters per recipe + * @param te this te instance + * @param parameters of this te * @return return true if machine can start with current parameters, false if not */ - public abstract boolean setAndCheckParametersOutAndStatuses(GT_MetaTileEntity_EM_machine te, double[] parametersToCheckAndFix); + boolean checkParametersInAndSetStatuses(GT_MetaTileEntity_EM_machine te, Parameters parameters); /** * do recipe handling * @param inputs from muxed inputs - * @param checkedAndFixedParameters array passed from previous method! + * @param parameters array passed from previous method! * @return null if recipe should not start, control object to set machine state and start recipe */ - public abstract MultiblockControl process(cElementalInstanceStackMap[] inputs, double[] checkedAndFixedParameters); - } - - @Override - public ArrayList getFullLedDescriptionIn(int hatchNo, int paramID) { - ArrayList base=super.getFullLedDescriptionIn(hatchNo, paramID); - if(hatchNo>=7){ - base.add("Output mux "+((hatchNo-7)*2+paramID+1)); - }else if(hatchNo>=4){ - base.add("Input mux "+((hatchNo-4)*2+paramID+1)); - }else if(currentBehaviour!=null){ - currentBehaviour.getFullLedDescriptionIn(base,hatchNo,paramID); - } - return base; - } - - @Override - public ArrayList getFullLedDescriptionOut(int hatchNo, int paramID) { - ArrayList base=super.getFullLedDescriptionOut(hatchNo, paramID); - if(currentBehaviour!=null){ - currentBehaviour.getFullLedDescriptionOut(base,hatchNo,paramID); - } - return base; + MultiblockControl process(cElementalInstanceStackMap[] inputs, GT_MetaTileEntity_EM_machine te, Parameters parameters); } private void quantumStuff(boolean shouldExist){ diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java index 6612167e5f..758afa69b9 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java @@ -37,7 +37,7 @@ import static com.github.technus.tectech.Reference.MODID; * Created by Tec on 23.03.2017. */ public class GT_MetaTileEntity_DataReader extends GT_MetaTileEntity_BasicMachine { - private static final HashMap> RENDER_REGISTRY =new HashMap<>(); + private static final HashMap> RENDER_REGISTRY =new HashMap<>(); private static GT_RenderedTexture READER_ONLINE, READER_OFFLINE; public GT_MetaTileEntity_DataReader(int aID, String aName, String aNameRegional, int aTier) { @@ -89,7 +89,7 @@ public class GT_MetaTileEntity_DataReader extends GT_MetaTileEntity_BasicMachine return DID_NOT_FIND_RECIPE; } ItemStack input=getInputAt(0); - ArrayList renders=getRenders(new Util.TT_ItemStack(input)); + ArrayList renders=getRenders(new Util.ItemStack_NoNBT(input)); for(DataRender render:renders){ if(render.canRender(input,mTier)){ mOutputItems[0]=input.copy(); @@ -173,7 +173,7 @@ public class GT_MetaTileEntity_DataReader extends GT_MetaTileEntity_BasicMachine return maxEUInput()*4L; } - public static void addDataRender(Util.TT_ItemStack stack,DataRender render){ + public static void addDataRender(Util.ItemStack_NoNBT stack, DataRender render){ ArrayList renders=RENDER_REGISTRY.get(stack); if(renders==null){ RENDER_REGISTRY.put(stack,renders=new ArrayList<>()); @@ -184,7 +184,7 @@ public class GT_MetaTileEntity_DataReader extends GT_MetaTileEntity_BasicMachine renders.add(render); } - public static ArrayList getRenders(Util.TT_ItemStack stack){ + public static ArrayList getRenders(Util.ItemStack_NoNBT stack){ return RENDER_REGISTRY.get(stack); } @@ -205,7 +205,7 @@ public class GT_MetaTileEntity_DataReader extends GT_MetaTileEntity_BasicMachine } public static void run(){ - addDataRender(new Util.TT_ItemStack(ItemList.Tool_DataStick.get(1)),new DataRender() { + addDataRender(new Util.ItemStack_NoNBT(ItemList.Tool_DataStick.get(1)),new DataRender() { @SideOnly(Side.CLIENT) private ResourceLocation bg; @SideOnly(Side.CLIENT) diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DataReader.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DataReader.java index 97e7601b67..022247b541 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DataReader.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DataReader.java @@ -115,7 +115,7 @@ public class GT_GUIContainer_DataReader extends GT_GUIContainerMetaTile_Machine private void renderDataBG(ItemStack thing, int mouseX, int mouseY, int x, int y, byte mTier) { if (thing != null) { - ArrayList renders = GT_MetaTileEntity_DataReader.getRenders(new Util.TT_ItemStack(thing)); + ArrayList renders = GT_MetaTileEntity_DataReader.getRenders(new Util.ItemStack_NoNBT(thing)); for (GT_MetaTileEntity_DataReader.DataRender render : renders) { if (render.canRender(thing, mTier)) { if (!GT_Utility.areStacksEqual(stack, thing, false)) { @@ -133,7 +133,7 @@ public class GT_GUIContainer_DataReader extends GT_GUIContainerMetaTile_Machine if(stack==null){ return false; } - ArrayList renders = GT_MetaTileEntity_DataReader.getRenders(new Util.TT_ItemStack(stack)); + ArrayList renders = GT_MetaTileEntity_DataReader.getRenders(new Util.ItemStack_NoNBT(stack)); for (GT_MetaTileEntity_DataReader.DataRender render : renders) { if (render.canRender(stack, mTier)) { render.renderForeground(stack, mouseX, mouseY, this, fontRendererObj); @@ -147,7 +147,7 @@ public class GT_GUIContainer_DataReader extends GT_GUIContainerMetaTile_Machine if(stack==null){ return false; } - ArrayList renders = GT_MetaTileEntity_DataReader.getRenders(new Util.TT_ItemStack(stack)); + ArrayList renders = GT_MetaTileEntity_DataReader.getRenders(new Util.ItemStack_NoNBT(stack)); for (GT_MetaTileEntity_DataReader.DataRender render : renders) { if (render.canRender(stack, mTier)) { render.renderTooltips(stack, mouseX, mouseY, this); -- cgit From 77299aca53c2a96760fe76c078e1ddad4df1aa0a Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 10 Mar 2019 17:55:54 +0100 Subject: done --- .../multi/em_machine/Behaviour_Centrifuge.java | 99 ++++------- .../Behaviour_ElectromagneticSeparator.java | 184 +++++++++------------ 2 files changed, 108 insertions(+), 175 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java index 4551ef3b17..5f072b3196 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java @@ -4,11 +4,12 @@ import com.github.technus.tectech.TecTech; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.dAtomDefinition; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.*; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockControl; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.NameFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.StatusFunction; -import java.util.ArrayList; import java.util.Arrays; -import java.util.function.BiFunction; import static com.github.technus.tectech.CommonValues.V; import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; @@ -22,18 +23,33 @@ public class Behaviour_Centrifuge implements GT_MetaTileEntity_EM_machine.Behavi private float radius, maxRPM, maxRCF, maxForce, maxCapacity; private Parameters.Group.ParameterIn settingRPM, settingFraction; private final static NameFunction rpmName= (gt_metaTileEntity_em_machine, iParameter) -> "RPM Setting"; - private static final StatusFunction rpmStatus= (gt_metaTileEntity_em_machine, iParameter) -> { + private final StatusFunction rpmStatus= (gt_metaTileEntity_em_machine, iParameter) -> { double v=iParameter.get(); if(Double.isNaN(v)){ return STATUS_WRONG; } - + if (v <=0) { + return STATUS_TOO_LOW; + }else if (v>maxRPM){ + return STATUS_TOO_HIGH; + } + return STATUS_OK; }; private final static NameFunction fractionName= (gt_metaTileEntity_em_machine, iParameter) -> "Fraction Count"; private static final StatusFunction fractionStatus= (gt_metaTileEntity_em_machine, iParameter) -> { - + double v=iParameter.get(); + if(Double.isNaN(v)){ + return STATUS_WRONG; + } + v=(int)v; + if (v <= 1) { + return STATUS_TOO_LOW; + }else if (v>6){ + return STATUS_TOO_HIGH; + } + return STATUS_OK; }; - private final static String[] DESCRIPTION_O =new String[]{"RPM Setting","RCF Setting","Radius [mm]","Max RPM","Max Force [eV/c^2 * m/s]","Max Capacity [eV/c^2]","Max Power Usage[EU/t]","Max Recipe Rime [tick]"}; + //private final static String[] DESCRIPTION_O =new String[]{"RPM Setting","RCF Setting","Radius [mm]","Max RPM","Max Force [eV/c^2 * m/s]","Max Capacity [eV/c^2]","Max Power Usage[EU/t]","Max Recipe Rime [tick]"}; private static final double[/*tier+5*/][/*outputHatches+2*/] MIXING_FACTORS =new double[][]{ {.45,.85,.95,1,1,}, @@ -57,13 +73,6 @@ public class Behaviour_Centrifuge implements GT_MetaTileEntity_EM_machine.Behavi maxCapacity = maxSafeMass * 4f * radius;// eV/c^2 } - @Override - protected void getFullLedDescriptionOut(ArrayList baseDescr, int hatchNo, int paramID) { - if(hatchNo<=2) { - baseDescr.add(DESCRIPTION_O[(hatchNo<<1)+paramID]); - } - } - private double getRCF(double RPM) { return RPM * RPM * radius * 0.001118; } @@ -87,63 +96,13 @@ public class Behaviour_Centrifuge implements GT_MetaTileEntity_EM_machine.Behavi @Override public void parametersInstantiation(GT_MetaTileEntity_EM_machine te, Parameters parameters) { Parameters.Group hatch1=parameters.getGroup(7); - settingRPM=hatch1.makeInParameter(0,0,,); - settingFraction=hatch1.makeInParameter(1,2,,); + settingRPM=hatch1.makeInParameter(0,0,rpmName,rpmStatus); + settingFraction=hatch1.makeInParameter(1,2,fractionName,fractionStatus); } @Override public boolean checkParametersInAndSetStatuses(GT_MetaTileEntity_EM_machine te, Parameters parameters) { - boolean check=true; - - double RPM = settingRPM.get(); - if (RPM > maxRPM) { - te.setStatusOfParameterIn(0, 0, STATUS_TOO_HIGH); - te.setParameterOut(0, 0, maxRPM);//rpm - te.setParameterOut(0, 1, maxRCF);//rcf - check=false; - } else if (RPM > maxRPM / 3f * 2f) { - te.setStatusOfParameterIn(0, 0, STATUS_HIGH); - } else if (RPM > maxRPM / 3f) { - te.setStatusOfParameterIn(0, 0, STATUS_OK); - } else if (RPM > 0) { - te.setStatusOfParameterIn(0, 0, STATUS_LOW); - } else if (RPM <= 0) { - te.setStatusOfParameterIn(0, 0, STATUS_TOO_LOW); - te.setParameterOut(0, 0, 0);//rpm - te.setParameterOut(0, 1, 0);//rcf - check=false; - } else { - te.setStatusOfParameterIn(0, 0, STATUS_WRONG); - te.setParameterOut(0, 0, 0);//rpm - te.setParameterOut(0, 1, 0);//rcf - check=false; - } - - if(check) { - te.setParameterOut(0, 0, RPM); - te.setParameterOut(0, 1, getRCF(RPM)); - } - - double fractionCount = settingFraction.get(); - if (fractionCount > 6) { - parametersToCheckAndFix[1] = 6; - te.setStatusOfParameterIn(0, 1, STATUS_TOO_HIGH); - check=false; - } else if (fractionCount >= 2) { - te.setStatusOfParameterIn(0, 1, STATUS_OK); - } else if (fractionCount < 2) { - parametersToCheckAndFix[1] = 2; - te.setStatusOfParameterIn(0, 1, STATUS_TOO_LOW); - check=false; - } else { - te.setStatusOfParameterIn(0, 1, STATUS_WRONG); - check=false; - } - - te.setParameterOut(3,0,(int) (Math.pow(parametersToCheckAndFix[0] / maxRPM, 3f) * V[tier]));//max eut - te.setParameterOut(3,1,(int) (20 * (fractionCount - 1)));//max time - - return check; + return settingRPM.getStatus(true).isOk && settingFraction.getStatus(true).isOk; } @Override @@ -172,11 +131,11 @@ public class Behaviour_Centrifuge implements GT_MetaTileEntity_EM_machine.Behavi inputMass = Math.abs(input.getMass()); - double RCF = getRCF(checkedAndFixedParameters[0]); + double RCF = getRCF(settingRPM.get()); if (inputMass * RCF > maxForce) return new MultiblockControl<>(excessMass);//AND THEN IT EXPLODES // how many output hatches to use - int fractionCount = (int) checkedAndFixedParameters[1]; + int fractionCount = (int) settingFraction.get(); cElementalInstanceStackMap[] outputs = new cElementalInstanceStackMap[fractionCount]; for (int i = 0; i < fractionCount; i++) { outputs[i] = new cElementalInstanceStackMap(); @@ -188,7 +147,7 @@ public class Behaviour_Centrifuge implements GT_MetaTileEntity_EM_machine.Behavi TecTech.LOGGER.info("mixingFactor "+mixingFactor); } - int mEut = (int) (Math.pow(checkedAndFixedParameters[0] / maxRPM, 3f) * V[tier]); + int mEut = (int) (Math.pow(settingRPM.get() / maxRPM, 3f) * V[tier]); mEut = Math.max(mEut, 512); mEut = -mEut; int mTicks = (int) (20 * (inputMass / maxCapacity) * (fractionCount - 1)); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java index e8b0ac7401..d2b08f0960 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java @@ -4,10 +4,10 @@ import com.github.technus.tectech.TecTech; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.dAtomDefinition; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockControl; - -import java.util.ArrayList; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.NameFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.StatusFunction; import static com.github.technus.tectech.CommonValues.V; import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*; @@ -17,14 +17,70 @@ import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStat */ public class Behaviour_ElectromagneticSeparator implements GT_MetaTileEntity_EM_machine.Behaviour { private final byte tier; - private final int ticks; - private final byte precisionFull; - private final byte precisionMinimal; - private final float maxCapacity; - private final long maxCharge; - private final int offsetMax; - private final static String[] DESCRIPTION_I =new String[]{"Full Precision Input [e/3]","Minimal Precision Input [e/3]","Offset Input [e/3]",null}; - private final static String[] DESCRIPTION_O =new String[]{"Full Precision Limit [e/3]","Minimal Precision Limit [e/3]","Offset Limit [e/3]",null,"Max Charge [e/3]","Max Capacity [eV/c^2]","Max Power Usage[EU/t]","Max Recipe Rime [tick]"}; + private int ticks; + private byte precisionFull,precisionMinimal; + private float maxCapacity; + private long maxCharge; + private int offsetMax; + private Parameters.Group.ParameterIn fullSetting,minimalSetting,offsetSetting; + private final static NameFunction fullName= (gt_metaTileEntity_em_machine, iParameter) -> "Full Precision Input [e/3]"; + private final StatusFunction fullStatus= (gt_metaTileEntity_em_machine, iParameter) -> { + double v=iParameter.get(); + if(Double.isNaN(v)){ + return STATUS_WRONG; + } + v=(int)v; + if(Double.isInfinite(v) && v>0) { + return STATUS_TOO_HIGH; + }else if(v>precisionFull){ + return STATUS_HIGH; + }else if(v minimalName= (gt_metaTileEntity_em_machine, iParameter) -> "Minimal Precision Input [e/3]"; + private final StatusFunction minimalStatus= (gt_metaTileEntity_em_machine, iParameter) -> { + double minimal=iParameter.get(); + double full=fullSetting.get(); + if(Double.isInfinite(minimal) && minimal>0) { + return STATUS_TOO_HIGH; + }else if(minimal>precisionMinimal){ + if(minimal>full){ + return STATUS_TOO_HIGH; + }else { + return STATUS_HIGH; + } + }else if(minimal==precisionMinimal){ + if(minimal>full){ + return STATUS_TOO_HIGH; + }else { + return STATUS_OK; + } + }else if(minimal offsetName= (gt_metaTileEntity_em_machine, iParameter) -> "Offset Input [e/3]"; + private final StatusFunction offsetStatus= (gt_metaTileEntity_em_machine, iParameter) -> { + double offset=iParameter.get(); + if(offset>offsetMax){ + return STATUS_TOO_HIGH; + }else if(offset>0){ + return STATUS_HIGH; + }else if(offset==0){ + return STATUS_OK; + }else if(offset>=-offsetMax){ + return STATUS_LOW; + }else if(offset<-offsetMax){ + return STATUS_TOO_LOW; + }else { + return STATUS_WRONG; + } + }; + //private final static String[] DESCRIPTION_O =new String[]{"Full Precision Limit [e/3]","Minimal Precision Limit [e/3]","Offset Limit [e/3]",null,"Max Charge [e/3]","Max Capacity [eV/c^2]","Max Power Usage[EU/t]","Max Recipe Rime [tick]"}; public Behaviour_ElectromagneticSeparator(int desiredTier){ tier=(byte) desiredTier; @@ -70,103 +126,21 @@ public class Behaviour_ElectromagneticSeparator implements GT_MetaTileEntity_EM_ } @Override - protected void getFullLedDescriptionIn(ArrayList baseDescr, int hatchNo, int paramID) { - if(hatchNo<=1) { - String desc=DESCRIPTION_I[(hatchNo << 1) + paramID]; - if(desc!=null){ - baseDescr.add(desc); - } - } + public void parametersInstantiation(GT_MetaTileEntity_EM_machine te, Parameters parameters) { + Parameters.Group hatch1=parameters.getGroup(7); + fullSetting=hatch1.makeInParameter(0,0,fullName,fullStatus); + minimalSetting=hatch1.makeInParameter(1,2,minimalName,minimalStatus); + Parameters.Group hatch2=parameters.getGroup(8); + offsetSetting=hatch2.makeInParameter(0,0,offsetName,offsetStatus); } @Override - protected void getFullLedDescriptionOut(ArrayList baseDescr, int hatchNo, int paramID) { - if(hatchNo<=3){ - String desc=DESCRIPTION_O[(hatchNo<<1)+paramID]; - if(desc!=null){ - baseDescr.add(desc); - } - } - } - - @Override - public boolean setAndCheckParametersOutAndStatuses(GT_MetaTileEntity_EM_machine te, double[] parametersToCheckAndFix) { - boolean check=true; - - te.setParameterOut(0,0,precisionFull); - te.setParameterOut(0,1,precisionMinimal); - te.setParameterOut(1,0,offsetMax); - te.setStatusOfParameterOut(1,1,STATUS_UNUSED); - te.setParameterOut(2,0,maxCharge); - te.setParameterOut(2,1,maxCapacity); - te.setParameterOut(3,0,V[tier]); - te.setParameterOut(3,1,ticks); - - double full=parametersToCheckAndFix[0]; - if(Double.isInfinite(full) && full>0) { - te.setStatusOfParameterIn(0,0,STATUS_TOO_HIGH); - check=false; - }else if(full>precisionFull){ - te.setStatusOfParameterIn(0,0, STATUS_HIGH); - }else if(full==precisionFull){ - te.setStatusOfParameterIn(0,0,STATUS_OK); - }else if(full0) { - te.setStatusOfParameterIn(0,1,STATUS_TOO_HIGH); - check=false; - }else if(minimal>precisionMinimal){ - if(minimal>full){ - te.setStatusOfParameterIn(0,1,STATUS_TOO_HIGH); - check=false; - }else { - te.setStatusOfParameterIn(0,1, STATUS_HIGH); - } - }else if(minimal==precisionMinimal){ - if(minimal>full){ - te.setStatusOfParameterIn(0,1,STATUS_TOO_HIGH); - check=false; - }else { - te.setStatusOfParameterIn(0,1, STATUS_OK); - } - }else if(minimaloffsetMax){ - te.setStatusOfParameterIn(1,0,STATUS_TOO_HIGH); - check=false; - }else if(offset>0){ - te.setStatusOfParameterIn(1,0,STATUS_HIGH); - }else if(offset==0){ - te.setStatusOfParameterIn(1,0,STATUS_OK); - }else if(offset>=-offsetMax){ - te.setStatusOfParameterIn(1,0,STATUS_LOW); - }else if(offset<-offsetMax){ - te.setStatusOfParameterIn(1,0,STATUS_TOO_LOW); - check=false; - }else { - te.setStatusOfParameterIn(1,0,STATUS_WRONG); - check=false; - } - - return check; + public boolean checkParametersInAndSetStatuses(GT_MetaTileEntity_EM_machine te, Parameters parameters) { + return fullSetting.getStatus(true).isOk && minimalSetting.getStatus(true).isOk && offsetSetting.getStatus(true).isOk; } @Override - public MultiblockControl process(cElementalInstanceStackMap[] inputs, double[] checkedAndFixedParameters) { + public MultiblockControl process(cElementalInstanceStackMap[] inputs, GT_MetaTileEntity_EM_machine te, Parameters parameters) { cElementalInstanceStackMap input = inputs[0]; if (input == null || input.isEmpty()) return null;//nothing in only valid input @@ -202,9 +176,9 @@ public class Behaviour_ElectromagneticSeparator implements GT_MetaTileEntity_EM_ outputs[i] = new cElementalInstanceStackMap(); } - double offsetIn=checkedAndFixedParameters[2]; - double precisionFullIn=checkedAndFixedParameters[0]; - double precisionMinimalIn=checkedAndFixedParameters[1]; + double offsetIn=offsetSetting.get(); + double precisionFullIn=fullSetting.get(); + double precisionMinimalIn=minimalSetting.get(); double levelsCountPlus1=precisionFullIn-precisionMinimalIn+1; //take all from hatch handler and put into new map - this takes from hatch to inner data storage -- cgit From 92ce99cef18bc7f32c6a0219ab12f93ff4bf55bf Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 10 Mar 2019 21:01:58 +0100 Subject: hmm sake --- src/main/java/com/github/technus/tectech/Util.java | 4 +-- .../dreamcraft/DreamCraftRecipeLoader.java | 34 +++++++++++----------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/Util.java b/src/main/java/com/github/technus/tectech/Util.java index 05e7fd6336..09aeae6a6b 100644 --- a/src/main/java/com/github/technus/tectech/Util.java +++ b/src/main/java/com/github/technus/tectech/Util.java @@ -1357,13 +1357,13 @@ public final class Util { } } - public static void setTier(int tier,GT_MetaTileEntity_TieredMachineBlock me){ + public static void setTier(int tier,Object me){ try{ Field field=GT_MetaTileEntity_TieredMachineBlock.class.getField("mTier"); field.setAccessible(true); field.set(me,(byte)tier); }catch (Exception e){ - e.printStackTrace(); + //e.printStackTrace(); } } diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java index a735213915..78f96a6901 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java @@ -980,22 +980,22 @@ public class DreamCraftRecipeLoader implements Runnable { } private void register_machine_EM_behaviours(){ - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(5),ItemList.Machine_IV_Centrifuge.get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(6),getItemContainer("CentrifugeLuV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(7),getItemContainer("CentrifugeZPM").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(8),getItemContainer("CentrifugeUV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(9),getItemContainer("CentrifugeUHV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(10),getItemContainer("CentrifugeUEV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(11),getItemContainer("CentrifugeUIV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(12),getItemContainer("CentrifugeUMV").get(1)); - - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(5),ItemList.Machine_IV_ElectromagneticSeparator.get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(6),getItemContainer("ElectromagneticSeparatorLuV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(7),getItemContainer("ElectromagneticSeparatorZPM").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(8),getItemContainer("ElectromagneticSeparatorUV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(9),getItemContainer("ElectromagneticSeparatorUHV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(10),getItemContainer("ElectromagneticSeparatorUEV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(11),getItemContainer("ElectromagneticSeparatorUIV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(12),getItemContainer("ElectromagneticSeparatorUMV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(5),ItemList.Machine_IV_Centrifuge.get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(6),getItemContainer("CentrifugeLuV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(7),getItemContainer("CentrifugeZPM").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(8),getItemContainer("CentrifugeUV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(9),getItemContainer("CentrifugeUHV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(10),getItemContainer("CentrifugeUEV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(11),getItemContainer("CentrifugeUIV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(12),getItemContainer("CentrifugeUMV").get(1)); + + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(5),ItemList.Machine_IV_ElectromagneticSeparator.get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(6),getItemContainer("ElectromagneticSeparatorLuV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(7),getItemContainer("ElectromagneticSeparatorZPM").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(8),getItemContainer("ElectromagneticSeparatorUV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(9),getItemContainer("ElectromagneticSeparatorUHV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(10),getItemContainer("ElectromagneticSeparatorUEV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(11),getItemContainer("ElectromagneticSeparatorUIV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(12),getItemContainer("ElectromagneticSeparatorUMV").get(1)); } } -- cgit From a3630d5d45ef3198f2548150bbb8d500865e438c Mon Sep 17 00:00:00 2001 From: Tec Date: Mon, 11 Mar 2019 06:53:41 +0100 Subject: tweak gui --- build.gradle | 8 ++-- .../tectech/loader/thing/MachineLoader.java | 7 --- .../tectech/thing/item/ParametrizerMemoryCard.java | 44 +++++++----------- .../hatch/GT_MetaTileEntity_Hatch_Param.java | 48 ++++++++++---------- .../hatch/gui/GT_Container_Param.java | 40 ++++++++--------- .../hatch/gui/GT_Container_ParamAdv.java | 48 ++++++++++---------- .../hatch/gui/GT_GUIContainer_Param.java | 3 +- .../hatch/gui/GT_GUIContainer_ParamAdv.java | 3 +- .../multi/GT_MetaTileEntity_EM_junction.java | 6 ++- .../multi/GT_MetaTileEntity_EM_scanner.java | 3 +- .../multi/GT_MetaTileEntity_EM_switch.java | 6 ++- .../multi/GT_MetaTileEntity_TM_microwave.java | 2 +- .../multi/base/GT_Container_MultiMachineEM.java | 52 +++++++--------------- .../multi/base/GT_GUIContainer_MultiMachineEM.java | 15 +++---- .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 26 +++++------ .../metaTileEntity/multi/base/HatchAdder.java | 6 +-- .../metaTileEntity/multi/base/NameFunction.java | 5 +-- .../metaTileEntity/multi/base/Parameters.java | 10 +++++ .../metaTileEntity/multi/base/StatusFunction.java | 5 +-- .../em_machine/GT_MetaTileEntity_EM_machine.java | 6 ++- 20 files changed, 155 insertions(+), 188 deletions(-) diff --git a/build.gradle b/build.gradle index 6fccbe64e8..3933a94c35 100644 --- a/build.gradle +++ b/build.gradle @@ -91,10 +91,10 @@ task getGregTech(type: Download) { mustRunAfter "repackMinecraft" } -tasks.setupCIWorkspace.dependsOn getGregTech -tasks.setupDevWorkspace.dependsOn getGregTech -tasks.setupDecompWorkspace.dependsOn getGregTech -tasks.compileJava.dependsOn getGregTech +//tasks.setupCIWorkspace.dependsOn getGregTech +//tasks.setupDevWorkspace.dependsOn getGregTech +//tasks.setupDecompWorkspace.dependsOn getGregTech +//tasks.compileJava.dependsOn getGregTech processResources { diff --git a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java index 0e65aa0b12..9ecb1b6526 100644 --- a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java @@ -6,7 +6,6 @@ import com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity. import com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_essentiaQuantizer; import com.github.technus.tectech.thing.metaTileEntity.hatch.*; import com.github.technus.tectech.thing.metaTileEntity.multi.*; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.GT_MetaTileEntity_EM_machine; import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_Data; import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_EM; @@ -317,13 +316,7 @@ public class MachineLoader implements Runnable { // MetaTE init // =================================================================================================== - GT_MetaTileEntity_MultiblockBase_EM.run(); GT_MetaTileEntity_Hatch_Rack.run(); - GT_MetaTileEntity_EM_computer.run(); - GT_MetaTileEntity_EM_research.run(); - GT_MetaTileEntity_EM_dataBank.run(); - GT_MetaTileEntity_TM_teslaCoil.run(); - GT_MetaTileEntity_DataReader.run(); if (!Loader.isModLoaded(Reference.DREAMCRAFT)) { diff --git a/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java b/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java index 25eb3ec939..4d7b451dd2 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java @@ -57,19 +57,13 @@ public final class ParametrizerMemoryCard extends Item { if (aStack.getItemDamage() == 1) { //write to parametrizer parametrizer.param = tNBT.getInteger("param"); - if (parametrizer.setUsingFloats(tNBT.getBoolean("usesFloats"))) { - parametrizer.value0i = (int) Float.intBitsToFloat(tNBT.getInteger("value0i")); - parametrizer.value1i = (int) Float.intBitsToFloat(tNBT.getInteger("value1i")); - } else { - parametrizer.value0i = tNBT.getInteger("value0i"); - parametrizer.value1i = tNBT.getInteger("value1i"); - } + parametrizer.value0D = tNBT.getDouble("value0D"); + parametrizer.value1D = tNBT.getDouble("value1D"); } else { //read from parametrizer tNBT.setInteger("param", parametrizer.param); - tNBT.setBoolean("usesFloats", parametrizer.isUsingFloats()); - tNBT.setInteger("value0i", parametrizer.value0i); - tNBT.setInteger("value1i", parametrizer.value1i); + tNBT.setDouble("value0D", parametrizer.value0D); + tNBT.setDouble("value1D", parametrizer.value1D); } return true; }else if(metaTE instanceof GT_MetaTileEntity_MultiblockBase_EM){ @@ -79,16 +73,10 @@ public final class ParametrizerMemoryCard extends Item { } NBTTagCompound tNBT = aStack.getTagCompound(); if(aStack.getItemDamage()== 1){ - //write to base - if(tNBT.getBoolean("usesFloats")){ - base.setParameterPairIn_ClearOut(tNBT.getInteger("param"),true - ,Float.intBitsToFloat(tNBT.getInteger("value0i")) - ,Float.intBitsToFloat(tNBT.getInteger("value1i"))); - }else{ - base.setParameterPairIn_ClearOut(tNBT.getInteger("param"),false - ,tNBT.getInteger("value0i") - ,tNBT.getInteger("value1i")); - } + base.parametrization.trySetParameters( + tNBT.getInteger("param"), + tNBT.getDouble("value0D"), + tNBT.getDouble("value1D")); return true; } } @@ -125,17 +113,15 @@ public final class ParametrizerMemoryCard extends Item { } aList.add(EnumChatFormatting.BLUE + "Sneak right click to lock/unlock"); - int temp; + long temp; if(tNBT!=null && tNBT.hasKey("param")) { aList.add("ParameterGroup ID: "+EnumChatFormatting.AQUA + tNBT.getInteger("param")); - temp=tNBT.getInteger("value0i"); - aList.add("Value 0|I: "+EnumChatFormatting.AQUA + temp); - aList.add("Value 0|F: "+EnumChatFormatting.AQUA + Float.intBitsToFloat(temp)); - aList.add("Value 0|B: "+EnumChatFormatting.AQUA + Util.intBitsToShortString(temp)); - temp=tNBT.getInteger("value1i"); - aList.add("Value 1|I: "+EnumChatFormatting.AQUA + temp); - aList.add("Value 1|F: "+EnumChatFormatting.AQUA + Float.intBitsToFloat(temp)); - aList.add("Value 1|B: "+EnumChatFormatting.AQUA + Util.intBitsToShortString(temp)); + temp=tNBT.getInteger("value0D"); + aList.add("Value 0D: "+EnumChatFormatting.AQUA + temp); + aList.add("Value 0B: "+EnumChatFormatting.AQUA + Util.longBitsToShortString(Double.doubleToLongBits(temp))); + temp=tNBT.getInteger("value1D"); + aList.add("Value 1D: "+EnumChatFormatting.AQUA + temp); + aList.add("Value 1B: "+EnumChatFormatting.AQUA + Util.longBitsToShortString(Double.doubleToLongBits(temp))); aList.add("Uses Floats: "+(tNBT.getBoolean("usesFloats")?EnumChatFormatting.GREEN+"TRUE":EnumChatFormatting.RED+"FALSE")); } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java index aa92eb777e..a4a713626c 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Param.java @@ -28,10 +28,10 @@ import net.minecraftforge.fluids.FluidStack; public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch { public int pointer = 0; public int param = -1; - public double value0i = 0; - public double value1i = 0; - public double input0i = 0; - public double input1i = 0; + public double value0D = 0; + public double value1D = 0; + public double input0D = 0; + public double input1D = 0; private static Textures.BlockIcons.CustomIcon ScreenON; private static Textures.BlockIcons.CustomIcon ScreenOFF; @@ -106,10 +106,10 @@ public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch { public String[] getInfoData() { return new String[]{ "Parametrizer ID: " + EnumChatFormatting.GREEN + param, - "Value 0I: " + EnumChatFormatting.AQUA + value0i, - "Value 1I: " + EnumChatFormatting.BLUE + value1i, - "Input 0I: " + EnumChatFormatting.GOLD + input0i, - "Input 1I: " + EnumChatFormatting.YELLOW + input1i, + "Value 0D: " + EnumChatFormatting.AQUA + value0D, + "Value 1D: " + EnumChatFormatting.BLUE + value1D, + "Input 0D: " + EnumChatFormatting.GOLD + input0D, + "Input 1D: " + EnumChatFormatting.YELLOW + input1D, }; } @@ -132,10 +132,10 @@ public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch { public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); aNBT.setInteger("ePointer", pointer); - aNBT.setDouble("eDValue0i", value0i); - aNBT.setDouble("eDValue1i", value1i); - aNBT.setDouble("eDInput0i", input0i); - aNBT.setDouble("eDInput1i", input1i); + aNBT.setDouble("eValue0D", value0D); + aNBT.setDouble("eValue1D", value1D); + aNBT.setDouble("eInput0D", input0D); + aNBT.setDouble("eInput1D", input1D); aNBT.setInteger("eParam", param); } @@ -150,21 +150,21 @@ public class GT_MetaTileEntity_Hatch_Param extends GT_MetaTileEntity_Hatch { aNBT.hasKey("eInput1i")){ boolean usesFloat = aNBT.getBoolean("eFloats"); if(usesFloat){ - value0i=Float.intBitsToFloat(aNBT.getInteger("eValue0i")); - value1i=Float.intBitsToFloat(aNBT.getInteger("eValue1i")); - input0i=Float.intBitsToFloat(aNBT.getInteger("eInput0i")); - input1i=Float.intBitsToFloat(aNBT.getInteger("eInput1i")); + value0D=Float.intBitsToFloat(aNBT.getInteger("eValue0i")); + value1D=Float.intBitsToFloat(aNBT.getInteger("eValue1i")); + input0D=Float.intBitsToFloat(aNBT.getInteger("eInput0i")); + input1D=Float.intBitsToFloat(aNBT.getInteger("eInput1i")); }else { - value0i=aNBT.getInteger("eValue0i"); - value1i=aNBT.getInteger("eValue1i"); - input0i=aNBT.getInteger("eInput0i"); - input1i=aNBT.getInteger("eInput1i"); + value0D=aNBT.getInteger("eValue0i"); + value1D=aNBT.getInteger("eValue1i"); + input0D=aNBT.getInteger("eInput0i"); + input1D=aNBT.getInteger("eInput1i"); } }else{ - value0i=aNBT.getDouble("eDValue0i"); - value1i=aNBT.getDouble("eDValue1i"); - input0i=aNBT.getDouble("eDInput0i"); - input1i=aNBT.getDouble("eDInput1i"); + value0D=aNBT.getDouble("eValue0D"); + value1D=aNBT.getDouble("eValue1D"); + input0D=aNBT.getDouble("eInput0D"); + input1D=aNBT.getDouble("eInput1D"); } param = aNBT.getInteger("eParam"); } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Param.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Param.java index db0c2d501f..f9c53090ff 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Param.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Param.java @@ -62,53 +62,53 @@ public class GT_Container_Param extends GT_ContainerMetaTile_Machine { paramH.param -= aShifthold == 1 ? 16 : 4; break; case 1: - paramH.value0i -= aShifthold == 1 ? 4096 : 256; + paramH.value0D -= aShifthold == 1 ? 4096 : 256; break; case 2: - paramH.value1i -= aShifthold == 1 ? 4096 : 256; + paramH.value1D -= aShifthold == 1 ? 4096 : 256; break; case 3: - paramH.value0i /= aShifthold == 1 ? 4096 : 256; - paramH.value1i /= aShifthold == 1 ? 4096 : 256; + paramH.value0D /= aShifthold == 1 ? 4096 : 256; + paramH.value1D /= aShifthold == 1 ? 4096 : 256; break; case 4: paramH.param -= aShifthold == 1 ? 2 : 1; break; case 5: - paramH.value0i -= aShifthold == 1 ? 16 : 1; + paramH.value0D -= aShifthold == 1 ? 16 : 1; break; case 6: - paramH.value1i -= aShifthold == 1 ? 16 : 1; + paramH.value1D -= aShifthold == 1 ? 16 : 1; break; case 7: - paramH.value0i /= aShifthold == 1 ? 16 : 2; - paramH.value1i /= aShifthold == 1 ? 16 : 2; + paramH.value0D /= aShifthold == 1 ? 16 : 2; + paramH.value1D /= aShifthold == 1 ? 16 : 2; break; case 8: paramH.param += aShifthold == 1 ? 16 : 4; break; case 9: - paramH.value0i += aShifthold == 1 ? 4096 : 256; + paramH.value0D += aShifthold == 1 ? 4096 : 256; break; case 10: - paramH.value1i += aShifthold == 1 ? 4096 : 256; + paramH.value1D += aShifthold == 1 ? 4096 : 256; break; case 11: - paramH.value0i *= aShifthold == 1 ? 4096 : 256; - paramH.value1i *= aShifthold == 1 ? 4096 : 256; + paramH.value0D *= aShifthold == 1 ? 4096 : 256; + paramH.value1D *= aShifthold == 1 ? 4096 : 256; break; case 12: paramH.param += aShifthold == 1 ? 2 : 1; break; case 13: - paramH.value0i += aShifthold == 1 ? 16 : 1; + paramH.value0D += aShifthold == 1 ? 16 : 1; break; case 14: - paramH.value1i += aShifthold == 1 ? 16 : 1; + paramH.value1D += aShifthold == 1 ? 16 : 1; break; case 15: - paramH.value0i *= aShifthold == 1 ? 16 : 2; - paramH.value1i *= aShifthold == 1 ? 16 : 2; + paramH.value0D *= aShifthold == 1 ? 16 : 2; + paramH.value1D *= aShifthold == 1 ? 16 : 2; break; default: doStuff = false; @@ -133,10 +133,10 @@ public class GT_Container_Param extends GT_ContainerMetaTile_Machine { return; } param = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).param; - value0f = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).value0i; - value1f = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).value1i; - input0f = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).input0i; - input1f = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).input1i; + value0f = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).value0D; + value1f = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).value1D; + input0f = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).input0D; + input1f = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).input1D; for (Object crafter : crafters) { ICrafting var1 = (ICrafting) crafter; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java index 6b1e4f68cd..3ce8b59fd0 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java @@ -81,19 +81,19 @@ public class GT_Container_ParamAdv extends GT_ContainerMetaTile_Machine { case 3: if (aShifthold == 1) { if (secondRow) { - paramH.value1i = Double.longBitsToDouble(0xFFFF_FFFF_FFFF_FFFFL); + paramH.value1D = Double.longBitsToDouble(0xFFFF_FFFF_FFFF_FFFFL); } else { - paramH.value0i = Double.longBitsToDouble(0xFFFF_FFFF_FFFF_FFFFL); + paramH.value0D = Double.longBitsToDouble(0xFFFF_FFFF_FFFF_FFFFL); } } else { if (secondRow) { - long temp=Double.doubleToLongBits(paramH.value1i); + long temp=Double.doubleToLongBits(paramH.value1D); temp |= 1 << columnPointer; - paramH.value1i=Double.longBitsToDouble(temp); + paramH.value1D=Double.longBitsToDouble(temp); } else { - long temp=Double.doubleToLongBits(paramH.value0i); + long temp=Double.doubleToLongBits(paramH.value0D); temp |= 1 << columnPointer; - paramH.value0i=Double.longBitsToDouble(temp); + paramH.value0D=Double.longBitsToDouble(temp); } } break; @@ -117,19 +117,19 @@ public class GT_Container_ParamAdv extends GT_ContainerMetaTile_Machine { case 7: if (aShifthold == 1) { if (secondRow) { - paramH.value1i = Double.longBitsToDouble(0); + paramH.value1D = Double.longBitsToDouble(0); } else { - paramH.value0i = Double.longBitsToDouble(0); + paramH.value0D = Double.longBitsToDouble(0); } } else { if (secondRow) { - long temp=Double.doubleToLongBits(paramH.value1i); + long temp=Double.doubleToLongBits(paramH.value1D); temp &= ~(1 << columnPointer); - paramH.value1i=Double.longBitsToDouble(temp); + paramH.value1D=Double.longBitsToDouble(temp); } else { - long temp=Double.doubleToLongBits(paramH.value0i); + long temp=Double.doubleToLongBits(paramH.value0D); temp &= ~(1 << columnPointer); - paramH.value0i=Double.longBitsToDouble(temp); + paramH.value0D=Double.longBitsToDouble(temp); } } break; @@ -151,8 +151,8 @@ public class GT_Container_ParamAdv extends GT_ContainerMetaTile_Machine { } break; case 11: - paramH.value0i=paramH.input0i; - paramH.value1i=paramH.input1i; + paramH.value0D=paramH.input0D; + paramH.value1D=paramH.input1D; break; case 12: paramH.param += aShifthold == 1 ? 2 : 1; @@ -174,19 +174,19 @@ public class GT_Container_ParamAdv extends GT_ContainerMetaTile_Machine { case 15: if (aShifthold == 1) { if (secondRow) { - paramH.value1i = Double.longBitsToDouble(~Double.doubleToLongBits(paramH.value1i)); + paramH.value1D = Double.longBitsToDouble(~Double.doubleToLongBits(paramH.value1D)); } else { - paramH.value0i = Double.longBitsToDouble(~Double.doubleToLongBits(paramH.value1i)); + paramH.value0D = Double.longBitsToDouble(~Double.doubleToLongBits(paramH.value1D)); } } else { if (secondRow) { - long temp=Double.doubleToLongBits(paramH.value1i); + long temp=Double.doubleToLongBits(paramH.value1D); temp ^= 1 << columnPointer; - paramH.value1i=Double.longBitsToDouble(temp); + paramH.value1D=Double.longBitsToDouble(temp); } else { - long temp=Double.doubleToLongBits(paramH.value0i); + long temp=Double.doubleToLongBits(paramH.value0D); temp ^= 1 << columnPointer; - paramH.value0i=Double.longBitsToDouble(temp); + paramH.value0D=Double.longBitsToDouble(temp); } } break; @@ -219,10 +219,10 @@ public class GT_Container_ParamAdv extends GT_ContainerMetaTile_Machine { return; } param = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).param; - value0f = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).value0i; - value1f = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).value1i; - input0f = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).input0i; - input1f = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).input1i; + value0f = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).value0D; + value1f = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).value1D; + input0f = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).input0D; + input1f = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).input1D; pointer = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).pointer; for (Object crafter : crafters) { diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java index 9b8f818da8..6547097257 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java @@ -25,10 +25,11 @@ public class GT_GUIContainer_Param extends GT_GUIContainerMetaTile_Machine { proxy.renderUnicodeString("\u2460\u2b07" + String.format(locale, "%+.5E", ((GT_Container_Param) mContainer).input1f), 46, 24, 167, 0x00ffff); proxy.renderUnicodeString("\u24EA\u2b06" + String.format(locale, "%+.5E", ((GT_Container_Param) mContainer).value0f), 46, 33, 167, 0x00bbff); proxy.renderUnicodeString("\u2460\u2b06" + String.format(locale, "%+.5E", ((GT_Container_Param) mContainer).value1f), 46, 41, 167, 0x0077ff); + GL11.glPushMatrix(); GL11.glScalef(.5f,.5f,.5f); proxy.renderUnicodeString("\u24EA\u2b06" + Util.longBitsToShortString(Double.doubleToLongBits(((GT_Container_Param) mContainer).value0f)), 46*2, 50*2, 167*2, 0x00bbff); proxy.renderUnicodeString("\u2460\u2b06" + Util.longBitsToShortString(Double.doubleToLongBits(((GT_Container_Param) mContainer).value1f)), 46*2, 58*2, 167*2, 0x0077ff); - GL11.glScalef(1,1,1); + GL11.glPopMatrix(); } else { proxy.renderUnicodeString("Parameters", 46, 7, 167, 0xffffff); } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java index 541c8323b1..7482d0a38c 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java @@ -25,10 +25,11 @@ public class GT_GUIContainer_ParamAdv extends GT_GUIContainerMetaTile_Machine { proxy.renderUnicodeString("\u2460\u2b07" + String.format(locale, "%+.5E", (((GT_Container_ParamAdv) mContainer).input1f)), 46, 24, 167, 0x00ffff); proxy.renderUnicodeString("\u24EA\u2b06" + String.format(locale, "%+.5E", (((GT_Container_ParamAdv) mContainer).value0f)), 46, 33, 167, 0x00bbff); proxy.renderUnicodeString("\u2460\u2b06" + String.format(locale, "%+.5E", (((GT_Container_ParamAdv) mContainer).value1f)), 46, 41, 167, 0x0077ff); + GL11.glPushMatrix(); GL11.glScalef(.5f,.5f,.5f); proxy.renderUnicodeString("\u24EA\u2b06" + Util.longBitsToShortString(Double.doubleToLongBits(((GT_Container_ParamAdv) mContainer).value0f)), 46*2, 50*2, 167*2, 0x00bbff); proxy.renderUnicodeString("\u2460\u2b06" + Util.longBitsToShortString(Double.doubleToLongBits(((GT_Container_ParamAdv) mContainer).value1f)), 46*2, 58*2, 167*2, 0x0077ff); - GL11.glScalef(1,1,1); + GL11.glPopMatrix(); proxy.renderUnicodeString("Pointer " + Integer.toHexString(((GT_Container_ParamAdv) mContainer).pointer | 0x10000).substring(1), 46, 66, 167, 0x0033ff); } else { proxy.renderUnicodeString("Parameters X", 46, 7, 167, 0xffffff); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java index d78ed3cbc4..c1248820b3 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java @@ -81,8 +81,8 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB } return STATUS_NEUTRAL; }; - protected Parameters.Group.ParameterIn[] src=new Parameters.Group.ParameterIn[10]; - protected Parameters.Group.ParameterIn[] dst=new Parameters.Group.ParameterIn[10]; + protected Parameters.Group.ParameterIn[] src; + protected Parameters.Group.ParameterIn[] dst; //endregion public GT_MetaTileEntity_EM_junction(int aID, String aName, String aNameRegional) { @@ -95,6 +95,8 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB @Override protected void parametersInstantiation_EM() { + src=new Parameters.Group.ParameterIn[10]; + dst=new Parameters.Group.ParameterIn[10]; for (int i = 0; i < 10; i++) { Parameters.Group hatch = parametrization.getGroup(i); src[i] = hatch.makeInParameter(0, i, ROUTE_NAME, SRC_STATUS); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java index d7cf3303f3..2461fc5534 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java @@ -77,7 +77,7 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa if(v<0) return LedStatus.STATUS_TOO_LOW; return LedStatus.STATUS_OK; }; - protected Parameters.Group.ParameterIn[] scanConfiguration=new Parameters.Group.ParameterIn[20]; + protected Parameters.Group.ParameterIn[] scanConfiguration; //endregion //region structure @@ -122,6 +122,7 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa @Override protected void parametersInstantiation_EM() { + scanConfiguration=new Parameters.Group.ParameterIn[20]; for (int i = 0; i < 10; i++) { Parameters.Group hatch = parametrization.getGroup(i); scanConfiguration[i*2] = hatch.makeInParameter(0, 0, CONFIG_NAME, CONFIG_STATUS); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java index e5bcb3f75d..276d0f2f74 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java @@ -77,8 +77,8 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas } return STATUS_NEUTRAL; }; - protected Parameters.Group.ParameterIn[] dst=new Parameters.Group.ParameterIn[10]; - protected Parameters.Group.ParameterIn[] weight =new Parameters.Group.ParameterIn[10]; + protected Parameters.Group.ParameterIn[] dst; + protected Parameters.Group.ParameterIn[] weight; //endregion public GT_MetaTileEntity_EM_switch(int aID, String aName, String aNameRegional) { @@ -91,6 +91,8 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas @Override protected void parametersInstantiation_EM() { + dst=new Parameters.Group.ParameterIn[10]; + weight =new Parameters.Group.ParameterIn[10]; for (int i = 0; i < 10; i++) { Parameters.Group hatch = parametrization.getGroup(i); dst[i] = hatch.makeInParameter(0, i, ROUTE_NAME, DST_STATUS); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java index 4456f97130..7894a7fa37 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java @@ -92,7 +92,7 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock powerSetting=hatch_0.makeInParameter(0,1000, POWER_NAME,POWER_STATUS); timerSetting=hatch_0.makeInParameter(1,360, TIMER_SETTING_NAME,TIMER_STATUS); timerValue=hatch_0.makeOutParameter(0,0,TIMER_VALUE_NAME,TIMER_STATUS); - remainingTime=hatch_0.makeOutParameter(0,360,TIMER_REMAINING_NAME,TIMER_STATUS); + remainingTime=hatch_0.makeOutParameter(1,360,TIMER_REMAINING_NAME,TIMER_STATUS); } @Override 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 bd2c20b2bc..ea22e3c23c 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 @@ -1,6 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.base; import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.Util; import gregtech.api.gui.GT_ContainerMetaTile_Machine; import gregtech.api.gui.GT_Slot_Holo; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -10,15 +11,12 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import java.util.BitSet; - public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { public LedStatus[] eParamsInStatus = LedStatus.makeArray(20,LedStatus.STATUS_UNDEFINED); public LedStatus[] eParamsOutStatus = LedStatus.makeArray(20,LedStatus.STATUS_UNDEFINED); - public int[] eParamsIn = new int[20];//number I from parametrizers - public int[] eParamsOut = new int[20];//number O to parametrizers + public double[] eParamsIn = new double[20];//number I from parametrizers + public double[] eParamsOut = new double[20];//number O to parametrizers public byte eCertainMode = 5, eCertainStatus = 127; - public short eParamsAreFloats; public boolean ePowerPass = false, eSafeVoid = false, allowedToWork = false; public final boolean ePowerPassButton, eSafeVoidButton, allowedToWorkButton; @@ -113,9 +111,8 @@ public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { } eParamsInStatus = ((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).parametrization.eParamsInStatus; eParamsOutStatus = ((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).parametrization.eParamsOutStatus; - int[] iParamsIn= ((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).parametrization.iParamsIn; - int[] iParamsOut= ((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).parametrization.iParamsOut; - eParamsAreFloats=((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).parametrization.bParamsAreFloats; + eParamsIn= ((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).parametrization.iParamsIn; + eParamsOut= ((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).parametrization.iParamsOut; eCertainMode = ((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).eCertainMode; eCertainStatus = ((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).eCertainStatus; ePowerPass = ((GT_MetaTileEntity_MultiblockBase_EM) mTileEntity.getMetaTileEntity()).ePowerPass; @@ -124,31 +121,14 @@ public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { for (Object crafter : crafters) { ICrafting var1 = (ICrafting) crafter; - int i = 100; - for (int j = 0; j < eParamsInStatus.length; j++) { + for (int i=100, j = 0; j < eParamsInStatus.length; j++) { var1.sendProgressBarUpdate(this, i++, (eParamsInStatus[j].getOrdinalByte() | (eParamsOutStatus[j].getOrdinalByte() << 8))); } var1.sendProgressBarUpdate(this, 120, eCertainMode | (eCertainStatus << 8)); var1.sendProgressBarUpdate(this, 121, (ePowerPass ? 1 : 0) + (eSafeVoid ? 2 : 0) + (allowedToWork ? 4 : 0)); - var1.sendProgressBarUpdate(this,122,eParamsAreFloats); - i=130; - for(int j=0;j>>16); - } - for(int j=0;j>>16); + for(int i=124,k=204,j=0;j<20;j++,i+=4,k+=4) { + Util.sendDouble(eParamsOut[j], this, var1, i); + Util.sendDouble(eParamsIn[j], this, var1, k); } } } @@ -169,14 +149,12 @@ public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { ePowerPass = (par2 & 1) == 1; eSafeVoid = (par2 & 2) == 2; allowedToWork = (par2 & 4) == 4; - } else if (par1 == 122) { - eParamsAreFloats=(short) par2; - }else if(par1>=130 && par1<170){ - int pointer=(par1-130)>>1; - eParamsOut[pointer]=(par1&1)==0?eParamsOut[pointer]&0xFFFF0000|par2:eParamsOut[pointer]&0xFFFF|(par2<<16); - }else if(par1>=170 && par1<210){ - int pointer=(par1-170)>>1; - eParamsIn[pointer]=(par1&1)==0?eParamsIn[pointer]&0xFFFF0000|par2:eParamsIn[pointer]&0xFFFF|(par2<<16); + } else if(par1>=130 && par1<210){ + int pos=(par1-130)>>2; + eParamsIn[pos]=Util.receiveDouble(eParamsIn[pos],par1&0xFFFFFFFC,par1,par2); + }else if(par1>=210 && par1<290){ + int pos=(par1-210)>>2; + eParamsIn[pos]=Util.receiveDouble(eParamsIn[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 47a3d60a0a..94e2d0af8d 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 @@ -12,8 +12,6 @@ import org.lwjgl.opengl.GL12; import java.util.List; -import static com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM.*; -import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.STATUS_UNUSED; import static gregtech.api.enums.GT_Values.RES_PATH_GUI; /** @@ -281,7 +279,6 @@ public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Mach IMetaTileEntity mte=mContainer.mTileEntity.getMetaTileEntity(); if(mte instanceof GT_MetaTileEntity_MultiblockBase_EM){ Parameters parametrization=((GT_MetaTileEntity_MultiblockBase_EM)mte).parametrization; - parametrization.bParamsAreFloats=mContainer.eParamsAreFloats; parametrization.eParamsInStatus=mContainer.eParamsInStatus; parametrization.eParamsOutStatus=mContainer.eParamsOutStatus; parametrization.iParamsIn=mContainer.eParamsIn; @@ -293,15 +290,15 @@ public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Mach for(int param=0;param<2;param++){ if(x<(u+=su)){ if(y=v && y {} +public interface HatchAdder{ + Boolean apply(IGregTechTileEntity iGregTechTileEntity, Short aShort); +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/NameFunction.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/NameFunction.java index 8ced431576..a296600abf 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/NameFunction.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/NameFunction.java @@ -1,8 +1,5 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.base; -import java.util.function.BiFunction; - -public interface NameFunction extends BiFunction { - @Override +public interface NameFunction{ String apply(T t, Parameters.IParameter iParameter); } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java index 2e8959c00f..8a0fca3d09 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java @@ -34,6 +34,16 @@ public class Parameters { this.parent=parent; } + public boolean trySetParameters(int hatch,double parameter0,double parameter1){ + Group p=groups[hatch]; + if(parent.mMaxProgresstime<=0 || (p!=null && p.updateWhileRunning)){ + iParamsIn[hatch]=parameter0; + iParamsIn[hatch+10]=parameter1; + return true; + } + return false; + } + public void setToDefaults(int hatch,boolean defaultIn, boolean defaultOut) { Group p= groups[hatch]; if (p == null) { diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/StatusFunction.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/StatusFunction.java index 224f0fc47c..e285c75344 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/StatusFunction.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/StatusFunction.java @@ -1,8 +1,5 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.base; -import java.util.function.BiFunction; - -public interface StatusFunction extends BiFunction { - @Override +public interface StatusFunction{ LedStatus apply(T t, Parameters.IParameter iParameter); } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java index 1ef3705b50..c29da7208a 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java @@ -63,8 +63,8 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa //endregion //region parameters - protected Parameters.Group.ParameterIn[] inputMux=new Parameters.Group.ParameterIn[6]; - protected Parameters.Group.ParameterIn[] outputMux=new Parameters.Group.ParameterIn[6]; + protected Parameters.Group.ParameterIn[] inputMux; + protected Parameters.Group.ParameterIn[] outputMux; private static final StatusFunction SRC_STATUS = (base,p)-> { double v = p.get(); @@ -118,6 +118,8 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa @Override protected void parametersInstantiation_EM() { + inputMux=new Parameters.Group.ParameterIn[6]; + outputMux=new Parameters.Group.ParameterIn[6]; for (int i=0;i<6;i++){ Parameters.Group hatch=parametrization.getGroup(i); inputMux[i]=hatch.makeInParameter(0,i,ROUTE_NAME,SRC_STATUS); -- cgit From 586ff231000d80b44382b40abfef53eaece76d24 Mon Sep 17 00:00:00 2001 From: Tec Date: Mon, 11 Mar 2019 06:53:52 +0100 Subject: tweak gui --- .../tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java | 4 ++-- .../thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java index 6547097257..015c3742cd 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java @@ -27,8 +27,8 @@ public class GT_GUIContainer_Param extends GT_GUIContainerMetaTile_Machine { proxy.renderUnicodeString("\u2460\u2b06" + String.format(locale, "%+.5E", ((GT_Container_Param) mContainer).value1f), 46, 41, 167, 0x0077ff); GL11.glPushMatrix(); GL11.glScalef(.5f,.5f,.5f); - proxy.renderUnicodeString("\u24EA\u2b06" + Util.longBitsToShortString(Double.doubleToLongBits(((GT_Container_Param) mContainer).value0f)), 46*2, 50*2, 167*2, 0x00bbff); - proxy.renderUnicodeString("\u2460\u2b06" + Util.longBitsToShortString(Double.doubleToLongBits(((GT_Container_Param) mContainer).value1f)), 46*2, 58*2, 167*2, 0x0077ff); + proxy.renderUnicodeString("\u24EA\u2b06" + Util.longBitsToShortString(Double.doubleToLongBits(((GT_Container_Param) mContainer).value0f)), 92, 100, 334, 0x00bbff); + proxy.renderUnicodeString("\u2460\u2b06" + Util.longBitsToShortString(Double.doubleToLongBits(((GT_Container_Param) mContainer).value1f)), 92, 116, 334, 0x0077ff); GL11.glPopMatrix(); } else { proxy.renderUnicodeString("Parameters", 46, 7, 167, 0xffffff); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java index 7482d0a38c..0e89e00303 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java @@ -27,8 +27,8 @@ public class GT_GUIContainer_ParamAdv extends GT_GUIContainerMetaTile_Machine { proxy.renderUnicodeString("\u2460\u2b06" + String.format(locale, "%+.5E", (((GT_Container_ParamAdv) mContainer).value1f)), 46, 41, 167, 0x0077ff); GL11.glPushMatrix(); GL11.glScalef(.5f,.5f,.5f); - proxy.renderUnicodeString("\u24EA\u2b06" + Util.longBitsToShortString(Double.doubleToLongBits(((GT_Container_ParamAdv) mContainer).value0f)), 46*2, 50*2, 167*2, 0x00bbff); - proxy.renderUnicodeString("\u2460\u2b06" + Util.longBitsToShortString(Double.doubleToLongBits(((GT_Container_ParamAdv) mContainer).value1f)), 46*2, 58*2, 167*2, 0x0077ff); + proxy.renderUnicodeString("\u24EA\u2b06" + Util.longBitsToShortString(Double.doubleToLongBits(((GT_Container_ParamAdv) mContainer).value0f)), 92, 100, 334, 0x00bbff); + proxy.renderUnicodeString("\u2460\u2b06" + Util.longBitsToShortString(Double.doubleToLongBits(((GT_Container_ParamAdv) mContainer).value1f)), 92, 116, 334, 0x0077ff); GL11.glPopMatrix(); proxy.renderUnicodeString("Pointer " + Integer.toHexString(((GT_Container_ParamAdv) mContainer).pointer | 0x10000).substring(1), 46, 66, 167, 0x0033ff); } else { -- cgit From d43febcd60496a05d24e60d4004b4d87308dd6f4 Mon Sep 17 00:00:00 2001 From: Tec Date: Mon, 11 Mar 2019 18:22:22 +0100 Subject: remove cast --- .../metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 7d063c5931..b91d932ebd 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 @@ -515,7 +515,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt "Energy Hatches:", EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU", - (mEUt*(double)eAmpereFlow <= 0 ? "Probably uses: " : "Probably makes: ") + + (mEUt*eAmpereFlow <= 0 ? "Probably uses: " : "Probably makes: ") + EnumChatFormatting.RED + Math.abs(mEUt) + EnumChatFormatting.RESET + " EU/t at " + EnumChatFormatting.RED + eAmpereFlow + EnumChatFormatting.RESET + " A", "Tier Rating: " + EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier_EM()] + EnumChatFormatting.RESET + " / " + EnumChatFormatting.GREEN + VN[getMinEnergyInputTier_EM()] + EnumChatFormatting.RESET + -- cgit From 212ae6295324b48980702d9098ea5e727802955d Mon Sep 17 00:00:00 2001 From: Tec Date: Mon, 11 Mar 2019 18:43:36 +0100 Subject: fix dis --- .../dreamcraft/DreamCraftRecipeLoader.java | 2 +- .../GT_MetaTileEntity_EM_essentiaDequantizer.java | 2 +- .../GT_MetaTileEntity_EM_essentiaQuantizer.java | 2 +- .../tectech/loader/thing/MachineLoader.java | 148 ++++++++++----------- .../thing/item/ConstructableTriggerItem.java | 2 +- .../tectech/thing/item/ParametrizerMemoryCard.java | 2 +- .../hatch/GT_MetaTileEntity_Hatch_Capacitor.java | 2 +- ...GT_MetaTileEntity_Hatch_ElementalContainer.java | 2 +- .../hatch/GT_MetaTileEntity_Hatch_Holder.java | 2 +- .../multi/GT_MetaTileEntity_EM_dequantizer.java | 2 +- .../multi/GT_MetaTileEntity_EM_quantizer.java | 2 +- .../multi/GT_MetaTileEntity_EM_research.java | 6 +- .../metaTileEntity/multi/base/Parameters.java | 2 +- 13 files changed, 88 insertions(+), 88 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java index 78f96a6901..73aef326b7 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java @@ -716,7 +716,7 @@ public class DreamCraftRecipeLoader implements Runnable { Materials.SolderingAlloy.getMolten(9216)}, ItemList.Field_Generator_UEV.get(1L), 4000, 800000); - //UHV Energy ParameterGroup + //UHV Energy Hatch TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Hatch_Energy_UV.get(1L), 24000, 16, 50000, 2, new Object[]{ ItemList.Hull_MAX.get(1L), diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java index 96230201ba..6cec48c41f 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java @@ -56,7 +56,7 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_ private static final String[] description = new String[]{ EnumChatFormatting.AQUA+"Hint Details:", "1 - Classic Hatches or High Power Casing", - "2 - Elemental Input ParameterGroup", + "2 - Elemental Input Hatch", "3 - Elemental Overflow Hatches or Elemental Casing", "General - Some sort of Essentia Storage", }; diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java index ba97367cd7..fd56305d5f 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java @@ -56,7 +56,7 @@ public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_Mu private static final String[] description = new String[]{ EnumChatFormatting.AQUA+"Hint Details:", "1 - Classic Hatches or High Power Casing", - "2 - Elemental Output ParameterGroup", + "2 - Elemental Output Hatch", "3 - Elemental Overflow Hatches or Elemental Casing", "General - Some sort of Essentia Storage", }; diff --git a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java index 9ecb1b6526..86b3beac8d 100644 --- a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java @@ -25,133 +25,133 @@ public class MachineLoader implements Runnable { // =================================================================================================== eM_in_UV.set(new GT_MetaTileEntity_Hatch_InputElemental( - 15000, "hatch.emin.tier.08", "UV Elemental Input ParameterGroup", 8).getStackForm(1L)); + 15000, "hatch.emin.tier.08", "UV Elemental Input Hatch", 8).getStackForm(1L)); eM_in_UHV.set(new GT_MetaTileEntity_Hatch_InputElemental( - 15001, "hatch.emin.tier.09", "UHV Elemental Input ParameterGroup", 9).getStackForm(1L)); + 15001, "hatch.emin.tier.09", "UHV Elemental Input Hatch", 9).getStackForm(1L)); eM_in_UEV.set(new GT_MetaTileEntity_Hatch_InputElemental( - 15002, "hatch.emin.tier.10", "UEV Elemental Input ParameterGroup", 10).getStackForm(1L)); + 15002, "hatch.emin.tier.10", "UEV Elemental Input Hatch", 10).getStackForm(1L)); eM_in_UIV.set(new GT_MetaTileEntity_Hatch_InputElemental( - 15003, "hatch.emin.tier.11", "UIV Elemental Input ParameterGroup", 11).getStackForm(1L)); + 15003, "hatch.emin.tier.11", "UIV Elemental Input Hatch", 11).getStackForm(1L)); eM_in_UMV.set(new GT_MetaTileEntity_Hatch_InputElemental( - 15004, "hatch.emin.tier.12", "UMV Elemental Input ParameterGroup", 12).getStackForm(1L)); + 15004, "hatch.emin.tier.12", "UMV Elemental Input Hatch", 12).getStackForm(1L)); eM_in_UXV.set(new GT_MetaTileEntity_Hatch_InputElemental( - 15005, "hatch.emin.tier.13", "UXV Elemental Input ParameterGroup", 13).getStackForm(1L)); + 15005, "hatch.emin.tier.13", "UXV Elemental Input Hatch", 13).getStackForm(1L)); // =================================================================================================== // eM OUT // =================================================================================================== eM_out_UV.set(new GT_MetaTileEntity_Hatch_OutputElemental( - 15010, "hatch.emout.tier.08", "UV Elemental Output ParameterGroup", 8).getStackForm(1L)); + 15010, "hatch.emout.tier.08", "UV Elemental Output Hatch", 8).getStackForm(1L)); eM_out_UHV.set(new GT_MetaTileEntity_Hatch_OutputElemental( - 15011, "hatch.emout.tier.09", "UHV Elemental Output ParameterGroup", 9).getStackForm(1L)); + 15011, "hatch.emout.tier.09", "UHV Elemental Output Hatch", 9).getStackForm(1L)); eM_out_UEV.set(new GT_MetaTileEntity_Hatch_OutputElemental( - 15012, "hatch.emout.tier.10", "UEV Elemental Output ParameterGroup", 10).getStackForm(1L)); + 15012, "hatch.emout.tier.10", "UEV Elemental Output Hatch", 10).getStackForm(1L)); eM_out_UIV.set(new GT_MetaTileEntity_Hatch_OutputElemental( - 15013, "hatch.emout.tier.11", "UIV Elemental Output ParameterGroup", 11).getStackForm(1L)); + 15013, "hatch.emout.tier.11", "UIV Elemental Output Hatch", 11).getStackForm(1L)); eM_out_UMV.set(new GT_MetaTileEntity_Hatch_OutputElemental( - 15014, "hatch.emout.tier.12", "UMV Elemental Output ParameterGroup", 12).getStackForm(1L)); + 15014, "hatch.emout.tier.12", "UMV Elemental Output Hatch", 12).getStackForm(1L)); eM_out_UXV.set(new GT_MetaTileEntity_Hatch_OutputElemental( - 15015, "hatch.emout.tier.13", "UXV Elemental Output ParameterGroup", 13).getStackForm(1L)); + 15015, "hatch.emout.tier.13", "UXV Elemental Output Hatch", 13).getStackForm(1L)); // =================================================================================================== // eM Waste OUT // =================================================================================================== eM_muffler_UV.set(new GT_MetaTileEntity_Hatch_OverflowElemental( - 15020, "hatch.emmuffler.tier.08", "UV Overflow Output ParameterGroup", 8, 1e10f).getStackForm(1L)); + 15020, "hatch.emmuffler.tier.08", "UV Overflow Output Hatch", 8, 1e10f).getStackForm(1L)); eM_muffler_UHV.set(new GT_MetaTileEntity_Hatch_OverflowElemental( - 15021, "hatch.emmuffler.tier.09", "UHV Overflow Output ParameterGroup", 9, 5e10f).getStackForm(1L)); + 15021, "hatch.emmuffler.tier.09", "UHV Overflow Output Hatch", 9, 5e10f).getStackForm(1L)); eM_muffler_UEV.set(new GT_MetaTileEntity_Hatch_OverflowElemental( - 15022, "hatch.emmuffler.tier.10", "UEV Overflow Output ParameterGroup", 10, 25e10f).getStackForm(1L)); + 15022, "hatch.emmuffler.tier.10", "UEV Overflow Output Hatch", 10, 25e10f).getStackForm(1L)); eM_muffler_UIV.set(new GT_MetaTileEntity_Hatch_OverflowElemental( - 15023, "hatch.emmuffler.tier.11", "UIV Overflow Output ParameterGroup", 11, 125e10f).getStackForm(1L)); + 15023, "hatch.emmuffler.tier.11", "UIV Overflow Output Hatch", 11, 125e10f).getStackForm(1L)); eM_muffler_UMV.set(new GT_MetaTileEntity_Hatch_OverflowElemental( - 15024, "hatch.emmuffler.tier.12", "UMV Overflow Output ParameterGroup", 12, 125e11f).getStackForm(1L)); + 15024, "hatch.emmuffler.tier.12", "UMV Overflow Output Hatch", 12, 125e11f).getStackForm(1L)); eM_muffler_UXV.set(new GT_MetaTileEntity_Hatch_OverflowElemental( - 15025, "hatch.emmuffler.tier.13", "UXV Overflow Output ParameterGroup", 13, 125e12f).getStackForm(1L)); + 15025, "hatch.emmuffler.tier.13", "UXV Overflow Output Hatch", 13, 125e12f).getStackForm(1L)); // =================================================================================================== // Multi AMP Power INPUTS // =================================================================================================== eM_energymulti4_IV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15100, "hatch.energymulti04.tier.05", "IV 4A Energy ParameterGroup", 5, 4).getStackForm(1L)); + 15100, "hatch.energymulti04.tier.05", "IV 4A Energy Hatch", 5, 4).getStackForm(1L)); eM_energymulti16_IV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15110, "hatch.energymulti16.tier.05", "IV 16A Energy ParameterGroup", 5, 16).getStackForm(1L)); + 15110, "hatch.energymulti16.tier.05", "IV 16A Energy Hatch", 5, 16).getStackForm(1L)); eM_energymulti64_IV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15120, "hatch.energymulti64.tier.05", "IV 64A Energy ParameterGroup", 5, 64).getStackForm(1L)); + 15120, "hatch.energymulti64.tier.05", "IV 64A Energy Hatch", 5, 64).getStackForm(1L)); eM_energymulti4_LuV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15101, "hatch.energymulti04.tier.06", "LuV 4A Energy ParameterGroup", 6, 4).getStackForm(1L)); + 15101, "hatch.energymulti04.tier.06", "LuV 4A Energy Hatch", 6, 4).getStackForm(1L)); eM_energymulti16_LuV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15111, "hatch.energymulti16.tier.06", "LuV 16A Energy ParameterGroup", 6, 16).getStackForm(1L)); + 15111, "hatch.energymulti16.tier.06", "LuV 16A Energy Hatch", 6, 16).getStackForm(1L)); eM_energymulti64_LuV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15121, "hatch.energymulti64.tier.06", "LuV 64A Energy ParameterGroup", 6, 64).getStackForm(1L)); + 15121, "hatch.energymulti64.tier.06", "LuV 64A Energy Hatch", 6, 64).getStackForm(1L)); eM_energymulti4_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15102, "hatch.energymulti04.tier.07", "ZPM 4A Energy ParameterGroup", 7, 4).getStackForm(1L)); + 15102, "hatch.energymulti04.tier.07", "ZPM 4A Energy Hatch", 7, 4).getStackForm(1L)); eM_energymulti16_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15112, "hatch.energymulti16.tier.07", "ZPM 16A Energy ParameterGroup", 7, 16).getStackForm(1L)); + 15112, "hatch.energymulti16.tier.07", "ZPM 16A Energy Hatch", 7, 16).getStackForm(1L)); eM_energymulti64_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15122, "hatch.energymulti64.tier.07", "ZPM 64A Energy ParameterGroup", 7, 64).getStackForm(1L)); + 15122, "hatch.energymulti64.tier.07", "ZPM 64A Energy Hatch", 7, 64).getStackForm(1L)); eM_energymulti4_UV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15103, "hatch.energymulti04.tier.08", "UV 4A Energy ParameterGroup", 8, 4).getStackForm(1L)); + 15103, "hatch.energymulti04.tier.08", "UV 4A Energy Hatch", 8, 4).getStackForm(1L)); eM_energymulti16_UV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15113, "hatch.energymulti16.tier.08", "UV 16A Energy ParameterGroup", 8, 16).getStackForm(1L)); + 15113, "hatch.energymulti16.tier.08", "UV 16A Energy Hatch", 8, 16).getStackForm(1L)); eM_energymulti64_UV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15123, "hatch.energymulti64.tier.08", "UV 64A Energy ParameterGroup", 8, 64).getStackForm(1L)); + 15123, "hatch.energymulti64.tier.08", "UV 64A Energy Hatch", 8, 64).getStackForm(1L)); eM_energymulti4_UHV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15104, "hatch.energymulti04.tier.09", "UHV 4A Energy ParameterGroup", 9, 4).getStackForm(1L)); + 15104, "hatch.energymulti04.tier.09", "UHV 4A Energy Hatch", 9, 4).getStackForm(1L)); eM_energymulti16_UHV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15114, "hatch.energymulti16.tier.09", "UHV 16A Energy ParameterGroup", 9, 16).getStackForm(1L)); + 15114, "hatch.energymulti16.tier.09", "UHV 16A Energy Hatch", 9, 16).getStackForm(1L)); eM_energymulti64_UHV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15124, "hatch.energymulti64.tier.09", "UHV 64A Energy ParameterGroup", 9, 64).getStackForm(1L)); + 15124, "hatch.energymulti64.tier.09", "UHV 64A Energy Hatch", 9, 64).getStackForm(1L)); eM_energymulti4_UEV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15105, "hatch.energymulti04.tier.10", "UEV 4A Energy ParameterGroup", 10, 4).getStackForm(1L)); + 15105, "hatch.energymulti04.tier.10", "UEV 4A Energy Hatch", 10, 4).getStackForm(1L)); eM_energymulti16_UEV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15115, "hatch.energymulti16.tier.10", "UEV 16A Energy ParameterGroup", 10, 16).getStackForm(1L)); + 15115, "hatch.energymulti16.tier.10", "UEV 16A Energy Hatch", 10, 16).getStackForm(1L)); eM_energymulti64_UEV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15125, "hatch.energymulti64.tier.10", "UEV 64A Energy ParameterGroup", 10, 64).getStackForm(1L)); + 15125, "hatch.energymulti64.tier.10", "UEV 64A Energy Hatch", 10, 64).getStackForm(1L)); eM_energymulti4_UIV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15106, "hatch.energymulti04.tier.11", "UIV 4A Energy ParameterGroup", 11, 4).getStackForm(1L)); + 15106, "hatch.energymulti04.tier.11", "UIV 4A Energy Hatch", 11, 4).getStackForm(1L)); eM_energymulti16_UIV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15116, "hatch.energymulti16.tier.11", "UIV 16A Energy ParameterGroup", 11, 16).getStackForm(1L)); + 15116, "hatch.energymulti16.tier.11", "UIV 16A Energy Hatch", 11, 16).getStackForm(1L)); eM_energymulti64_UIV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15126, "hatch.energymulti64.tier.11", "UIV 64A Energy ParameterGroup", 11, 64).getStackForm(1L)); + 15126, "hatch.energymulti64.tier.11", "UIV 64A Energy Hatch", 11, 64).getStackForm(1L)); eM_energymulti4_UMV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15107, "hatch.energymulti04.tier.12", "UMV 4A Energy ParameterGroup", 12, 4).getStackForm(1L)); + 15107, "hatch.energymulti04.tier.12", "UMV 4A Energy Hatch", 12, 4).getStackForm(1L)); eM_energymulti16_UMV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15117, "hatch.energymulti16.tier.12", "UMV 16A Energy ParameterGroup", 12, 16).getStackForm(1L)); + 15117, "hatch.energymulti16.tier.12", "UMV 16A Energy Hatch", 12, 16).getStackForm(1L)); eM_energymulti64_UMV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15127, "hatch.energymulti64.tier.12", "UMV 64A Energy ParameterGroup", 12, 64).getStackForm(1L)); + 15127, "hatch.energymulti64.tier.12", "UMV 64A Energy Hatch", 12, 64).getStackForm(1L)); eM_energymulti4_UXV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15108, "hatch.energymulti04.tier.13", "UXV 4A Energy ParameterGroup", 13, 4).getStackForm(1L)); + 15108, "hatch.energymulti04.tier.13", "UXV 4A Energy Hatch", 13, 4).getStackForm(1L)); eM_energymulti16_UXV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15118, "hatch.energymulti16.tier.13", "UXV 16A Energy ParameterGroup", 13, 16).getStackForm(1L)); + 15118, "hatch.energymulti16.tier.13", "UXV 16A Energy Hatch", 13, 16).getStackForm(1L)); eM_energymulti64_UXV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( - 15128, "hatch.energymulti64.tier.13", "UXV 64A Energy ParameterGroup", 13, 64).getStackForm(1L)); + 15128, "hatch.energymulti64.tier.13", "UXV 64A Energy Hatch", 13, 64).getStackForm(1L)); // =================================================================================================== // Multi AMP Power OUTPUTS @@ -159,67 +159,67 @@ public class MachineLoader implements Runnable { eM_dynamomulti4_IV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15200, "hatch.dynamomulti04.tier.05", "IV 4A Dynamo ParameterGroup", 5, 4).getStackForm(1L)); + 15200, "hatch.dynamomulti04.tier.05", "IV 4A Dynamo Hatch", 5, 4).getStackForm(1L)); eM_dynamomulti16_IV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15210, "hatch.dynamomulti16.tier.05", "IV 16A Dynamo ParameterGroup", 5, 16).getStackForm(1L)); + 15210, "hatch.dynamomulti16.tier.05", "IV 16A Dynamo Hatch", 5, 16).getStackForm(1L)); eM_dynamomulti64_IV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15220, "hatch.dynamomulti64.tier.05", "IV 64A Dynamo ParameterGroup", 5, 64).getStackForm(1L)); + 15220, "hatch.dynamomulti64.tier.05", "IV 64A Dynamo Hatch", 5, 64).getStackForm(1L)); eM_dynamomulti4_LuV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15201, "hatch.dynamomulti04.tier.06", "LuV 4A Dynamo ParameterGroup", 6, 4).getStackForm(1L)); + 15201, "hatch.dynamomulti04.tier.06", "LuV 4A Dynamo Hatch", 6, 4).getStackForm(1L)); eM_dynamomulti16_LuV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15211, "hatch.dynamomulti16.tier.06", "LuV 16A Dynamo ParameterGroup", 6, 16).getStackForm(1L)); + 15211, "hatch.dynamomulti16.tier.06", "LuV 16A Dynamo Hatch", 6, 16).getStackForm(1L)); eM_dynamomulti64_LuV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15221, "hatch.dynamomulti64.tier.06", "LuV 64A Dynamo ParameterGroup", 6, 64).getStackForm(1L)); + 15221, "hatch.dynamomulti64.tier.06", "LuV 64A Dynamo Hatch", 6, 64).getStackForm(1L)); eM_dynamomulti4_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15202, "hatch.dynamomulti04.tier.07", "ZPM 4A Dynamo ParameterGroup", 7, 4).getStackForm(1L)); + 15202, "hatch.dynamomulti04.tier.07", "ZPM 4A Dynamo Hatch", 7, 4).getStackForm(1L)); eM_dynamomulti16_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15212, "hatch.dynamomulti16.tier.07", "ZPM 16A Dynamo ParameterGroup", 7, 16).getStackForm(1L)); + 15212, "hatch.dynamomulti16.tier.07", "ZPM 16A Dynamo Hatch", 7, 16).getStackForm(1L)); eM_dynamomulti64_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15222, "hatch.dynamomulti64.tier.07", "ZPM 64A Dynamo ParameterGroup", 7, 64).getStackForm(1L)); + 15222, "hatch.dynamomulti64.tier.07", "ZPM 64A Dynamo Hatch", 7, 64).getStackForm(1L)); eM_dynamomulti4_UV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15203, "hatch.dynamomulti04.tier.08", "UV 4A Dynamo ParameterGroup", 8, 4).getStackForm(1L)); + 15203, "hatch.dynamomulti04.tier.08", "UV 4A Dynamo Hatch", 8, 4).getStackForm(1L)); eM_dynamomulti16_UV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15213, "hatch.dynamomulti16.tier.08", "UV 16A Dynamo ParameterGroup", 8, 16).getStackForm(1L)); + 15213, "hatch.dynamomulti16.tier.08", "UV 16A Dynamo Hatch", 8, 16).getStackForm(1L)); eM_dynamomulti64_UV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15223, "hatch.dynamomulti64.tier.08", "UV 64A Dynamo ParameterGroup", 8, 64).getStackForm(1L)); + 15223, "hatch.dynamomulti64.tier.08", "UV 64A Dynamo Hatch", 8, 64).getStackForm(1L)); eM_dynamomulti4_UHV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15204, "hatch.dynamomulti04.tier.09", "UHV 4A Dynamo ParameterGroup", 9, 4).getStackForm(1L)); + 15204, "hatch.dynamomulti04.tier.09", "UHV 4A Dynamo Hatch", 9, 4).getStackForm(1L)); eM_dynamomulti16_UHV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15214, "hatch.dynamomulti16.tier.09", "UHV 16A Dynamo ParameterGroup", 9, 16).getStackForm(1L)); + 15214, "hatch.dynamomulti16.tier.09", "UHV 16A Dynamo Hatch", 9, 16).getStackForm(1L)); eM_dynamomulti64_UHV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15224, "hatch.dynamomulti64.tier.09", "UHV 64A Dynamo ParameterGroup", 9, 64).getStackForm(1L)); + 15224, "hatch.dynamomulti64.tier.09", "UHV 64A Dynamo Hatch", 9, 64).getStackForm(1L)); eM_dynamomulti4_UEV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15205, "hatch.dynamomulti04.tier.10", "UEV 4A Dynamo ParameterGroup", 10, 4).getStackForm(1L)); + 15205, "hatch.dynamomulti04.tier.10", "UEV 4A Dynamo Hatch", 10, 4).getStackForm(1L)); eM_dynamomulti16_UEV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15215, "hatch.dynamomulti16.tier.10", "UEV 16A Dynamo ParameterGroup", 10, 16).getStackForm(1L)); + 15215, "hatch.dynamomulti16.tier.10", "UEV 16A Dynamo Hatch", 10, 16).getStackForm(1L)); eM_dynamomulti64_UEV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15225, "hatch.dynamomulti64.tier.10", "UEV 64A Dynamo ParameterGroup", 10, 64).getStackForm(1L)); + 15225, "hatch.dynamomulti64.tier.10", "UEV 64A Dynamo Hatch", 10, 64).getStackForm(1L)); eM_dynamomulti4_UIV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15206, "hatch.dynamomulti04.tier.11", "UIV 4A Dynamo ParameterGroup", 11, 4).getStackForm(1L)); + 15206, "hatch.dynamomulti04.tier.11", "UIV 4A Dynamo Hatch", 11, 4).getStackForm(1L)); eM_dynamomulti16_UIV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15216, "hatch.dynamomulti16.tier.11", "UIV 16A Dynamo ParameterGroup", 11, 16).getStackForm(1L)); + 15216, "hatch.dynamomulti16.tier.11", "UIV 16A Dynamo Hatch", 11, 16).getStackForm(1L)); eM_dynamomulti64_UIV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15226, "hatch.dynamomulti64.tier.11", "UIV 64A Dynamo ParameterGroup", 11, 64).getStackForm(1L)); + 15226, "hatch.dynamomulti64.tier.11", "UIV 64A Dynamo Hatch", 11, 64).getStackForm(1L)); eM_dynamomulti4_UMV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15207, "hatch.dynamomulti04.tier.12", "UMV 4A Dynamo ParameterGroup", 12, 4).getStackForm(1L)); + 15207, "hatch.dynamomulti04.tier.12", "UMV 4A Dynamo Hatch", 12, 4).getStackForm(1L)); eM_dynamomulti16_UMV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15217, "hatch.dynamomulti16.tier.12", "UMV 16A Dynamo ParameterGroup", 12, 16).getStackForm(1L)); + 15217, "hatch.dynamomulti16.tier.12", "UMV 16A Dynamo Hatch", 12, 16).getStackForm(1L)); eM_dynamomulti64_UMV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15227, "hatch.dynamomulti64.tier.12", "UMV 64A Dynamo ParameterGroup", 12, 64).getStackForm(1L)); + 15227, "hatch.dynamomulti64.tier.12", "UMV 64A Dynamo Hatch", 12, 64).getStackForm(1L)); eM_dynamomulti4_UXV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15208, "hatch.dynamomulti04.tier.13", "UXV 4A Dynamo ParameterGroup", 13, 4).getStackForm(1L)); + 15208, "hatch.dynamomulti04.tier.13", "UXV 4A Dynamo Hatch", 13, 4).getStackForm(1L)); eM_dynamomulti16_UXV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15218, "hatch.dynamomulti16.tier.13", "UXV 16A Dynamo ParameterGroup", 13, 16).getStackForm(1L)); + 15218, "hatch.dynamomulti16.tier.13", "UXV 16A Dynamo Hatch", 13, 16).getStackForm(1L)); eM_dynamomulti64_UXV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( - 15228, "hatch.dynamomulti64.tier.13", "UXV 64A Dynamo ParameterGroup", 13, 64).getStackForm(1L)); + 15228, "hatch.dynamomulti64.tier.13", "UXV 64A Dynamo Hatch", 13, 64).getStackForm(1L)); // =================================================================================================== // MULTIBLOCKS @@ -278,7 +278,7 @@ public class MachineLoader implements Runnable { rack_Hatch.set(new GT_MetaTileEntity_Hatch_Rack(15450, "hatch.rack.tier.08", "Computer Rack", 8, "4 Slot Rack").getStackForm(1L)); holder_Hatch.set(new GT_MetaTileEntity_Hatch_Holder(15451, "hatch.holder.tier.09", "Object Holder", 8, "For Research Station").getStackForm(1L)); - capacitor_Hatch.set(new GT_MetaTileEntity_Hatch_Capacitor(15452, "hatch.capacitor.tier.05", "Capacitor ParameterGroup", 5, "For Tesla Coil").getStackForm(1L)); + capacitor_Hatch.set(new GT_MetaTileEntity_Hatch_Capacitor(15452, "hatch.capacitor.tier.05", "Capacitor Hatch", 5, "For Tesla Coil").getStackForm(1L)); // =================================================================================================== // Pipes @@ -308,7 +308,7 @@ public class MachineLoader implements Runnable { // =================================================================================================== // Debug Stuff // =================================================================================================== - hatch_CreativeMaitenance.set(new GT_MetaTileEntity_Hatch_CreativeMaintenance(15497, "debug.tt.maintenance", "Debug Maintenance ParameterGroup", 15).getStackForm(1L)); + hatch_CreativeMaitenance.set(new GT_MetaTileEntity_Hatch_CreativeMaintenance(15497, "debug.tt.maintenance", "Debug Maintenance Hatch", 15).getStackForm(1L)); Machine_DebugGenny.set(new GT_MetaTileEntity_DebugPowerGenerator(15498, "debug.tt.genny", "Debug Power Generator", 15).getStackForm(1L)); Machine_DebugWriter.set(new GT_MetaTileEntity_DebugStructureWriter(15499, "debug.tt.writer", "Debug Structure Writer", 15).getStackForm(1L)); diff --git a/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java b/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java index cf4b4d2978..efb9e6d644 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java @@ -133,7 +133,7 @@ public final class ConstructableTriggerItem extends Item { private final String[] desc=new String[]{ EnumChatFormatting.AQUA+"Hint Details:", "1 - Classic Hatches or Heat Proof Casing", - "2 - Muffler ParameterGroup", + "2 - Muffler Hatch", "3 - Coil blocks" }; //endregion diff --git a/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java b/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java index 4d7b451dd2..dafc425163 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java @@ -115,7 +115,7 @@ public final class ParametrizerMemoryCard extends Item { long temp; if(tNBT!=null && tNBT.hasKey("param")) { - aList.add("ParameterGroup ID: "+EnumChatFormatting.AQUA + tNBT.getInteger("param")); + aList.add("Hatch ID: "+EnumChatFormatting.AQUA + tNBT.getInteger("param")); temp=tNBT.getInteger("value0D"); aList.add("Value 0D: "+EnumChatFormatting.AQUA + temp); aList.add("Value 0B: "+EnumChatFormatting.AQUA + Util.longBitsToShortString(Double.doubleToLongBits(temp))); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Capacitor.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Capacitor.java index 560a57cd54..2aae2b8c2b 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Capacitor.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Capacitor.java @@ -94,7 +94,7 @@ public class GT_MetaTileEntity_Hatch_Capacitor extends GT_MetaTileEntity_Hatch { @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_Capacitor(aPlayerInventory, aBaseMetaTileEntity, "Capacitor ParameterGroup"); + return new GT_GUIContainer_Capacitor(aPlayerInventory, aBaseMetaTileEntity, "Capacitor Hatch"); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java index 63bd262a75..c84057c121 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java @@ -259,7 +259,7 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta mDescription, "Max stacks amount: " + EnumChatFormatting.AQUA + getMaxStacksCount(), "Stack capacity: " + EnumChatFormatting.AQUA + getMaxStackSize(), - "Place Overflow ParameterGroup behind,on top or below", + "Place Overflow Hatch behind,on top or below", "to provide overflow protection while this block", "is not attached to multi block.", "Transport range can be extended in straight", diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java index 0850bf859a..409f8195e2 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java @@ -94,7 +94,7 @@ public class GT_MetaTileEntity_Hatch_Holder extends GT_MetaTileEntity_Hatch { @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_Holder(aPlayerInventory, aBaseMetaTileEntity, "Holder ParameterGroup"); + return new GT_GUIContainer_Holder(aPlayerInventory, aBaseMetaTileEntity, "Holder Hatch"); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java index 5f5febb383..a837c6a0a2 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java @@ -57,7 +57,7 @@ public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_Multiblo private static final String[] description = new String[]{ EnumChatFormatting.AQUA + "Hint Details:", "1 - Classic Hatches or High Power Casing", - "2 - Elemental Input ParameterGroup", + "2 - Elemental Input Hatch", "3 - Elemental Overflow Hatches or Molecular Casing", }; //endregion diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java index e7a42fa941..381df4b893 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java @@ -63,7 +63,7 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock private static final String[] description = new String[]{ EnumChatFormatting.AQUA+"Hint Details:", "1 - Classic Hatches or High Power Casing", - "2 - Elemental Output ParameterGroup", + "2 - Elemental Output Hatch", "3 - Elemental Overflow Hatches or Molecular Casing", }; //endregion diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java index 6b3cab021e..88b24d11ae 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java @@ -73,7 +73,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB private static final String[] description = new String[]{ EnumChatFormatting.AQUA+"Hint Details:", "1 - Classic/Data Hatches or Computer casing", - "2 - Holder ParameterGroup", + "2 - Holder Hatch", }; //endregion @@ -286,7 +286,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB } for (int i = 0; i < tRecipe.mFluidInputs.length; i++) { if (tRecipe.mFluidInputs[i] != null) { - tNBTList.appendTag(new NBTTagString("Input ParameterGroup " + (i + 1) + ": " + tRecipe.mFluidInputs[i].amount + "L " + GT_LanguageManager.getTranslation(tRecipe.mFluidInputs[i].getLocalizedName()))); + tNBTList.appendTag(new NBTTagString("Input Hatch " + (i + 1) + ": " + tRecipe.mFluidInputs[i].amount + "L " + GT_LanguageManager.getTranslation(tRecipe.mFluidInputs[i].getLocalizedName()))); } } tNBT.setTag("pages", tNBTList); @@ -382,7 +382,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB s = tRecipe.mFluidInputs[i].getLocalizedName(); } } - tNBTList.appendTag(new NBTTagString("Input ParameterGroup "+(i+1)+": "+tRecipe.mFluidInputs[i].amount+"L "+s)); + tNBTList.appendTag(new NBTTagString("Input Hatch "+(i+1)+": "+tRecipe.mFluidInputs[i].amount+"L "+s)); } } tNBT.setTag("pages", tNBTList); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java index 8a0fca3d09..4aba953df6 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java @@ -125,7 +125,7 @@ public class Parameters { private Group(int hatchNo, boolean updateWhileRunning){ if(hatchNo<0 || hatchNo>=10){ - throw new IllegalArgumentException("ParameterGroup id must be in 0 to 9 range"); + throw new IllegalArgumentException("Hatch id must be in 0 to 9 range"); } this.hatchNo=hatchNo; this.updateWhileRunning=updateWhileRunning; -- cgit From 39e53c4354582cbdb5f9a4c078ca0b89b2fe8795 Mon Sep 17 00:00:00 2001 From: Tec Date: Mon, 11 Mar 2019 18:55:20 +0100 Subject: fix small overlook --- .../multi/em_machine/GT_MetaTileEntity_EM_machine.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java index c29da7208a..fc8a6c914e 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java @@ -7,13 +7,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInsta import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.block.QuantumStuffBlock; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; -import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_junction; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockControl; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.NameFunction; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.StatusFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.*; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; @@ -88,7 +82,7 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa } return STATUS_NEUTRAL; }; - private static final NameFunction ROUTE_NAME= + private static final NameFunction ROUTE_NAME= (base,p)->(p.parameterId()==0?"Source ":"Destination ")+p.hatchId(); //endregion -- cgit From 56ef4390954b7680e7b622286d94f945fc241973 Mon Sep 17 00:00:00 2001 From: Tec Date: Mon, 11 Mar 2019 18:57:27 +0100 Subject: just check if valid --- .../thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java index c2b6589901..07868db13a 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java @@ -236,8 +236,10 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB @Override protected void afterRecipeCheckFailed() { super.afterRecipeCheckFailed(); - for (GT_MetaTileEntity_Hatch_Rack r : eRacks) { - r.getBaseMetaTileEntity().setActive(false); + for (GT_MetaTileEntity_Hatch_Rack rack : eRacks) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(rack)) { + rack.getBaseMetaTileEntity().setActive(false); + } } } -- cgit From 4b8cecac8f767ecfd9c587f099c40a077d27aeca Mon Sep 17 00:00:00 2001 From: Tec Date: Mon, 11 Mar 2019 19:23:40 +0100 Subject: fix advanced parametrizer --- .../tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java | 4 ++-- .../thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java index 3ce8b59fd0..e925ed91e8 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java @@ -196,8 +196,8 @@ public class GT_Container_ParamAdv extends GT_ContainerMetaTile_Machine { if (doStuff) { IGregTechTileEntity base=paramH.getBaseMetaTileEntity(); TecTech.proxy.playSound(base,"fx_click"); - if(columnPointer>=32) { - columnPointer = 31; + if(columnPointer>=64) { + columnPointer = 63; } else if(columnPointer<0) { columnPointer = 0; } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java index 0e89e00303..5e83290450 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java @@ -13,7 +13,7 @@ import static gregtech.api.enums.GT_Values.RES_PATH_GUI; public class GT_GUIContainer_ParamAdv extends GT_GUIContainerMetaTile_Machine { public GT_GUIContainer_ParamAdv(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(new GT_Container_Param(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "ParametrizerAdv.png"); + super(new GT_Container_ParamAdv(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "ParametrizerAdv.png"); } @Override -- cgit From c47419f1b60a7772e7f4cba92bc66b33cd32640e Mon Sep 17 00:00:00 2001 From: Tec Date: Mon, 11 Mar 2019 20:41:55 +0100 Subject: fix bit render to string --- src/main/java/com/github/technus/tectech/Util.java | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/Util.java b/src/main/java/com/github/technus/tectech/Util.java index 09aeae6a6b..e8472bfea6 100644 --- a/src/main/java/com/github/technus/tectech/Util.java +++ b/src/main/java/com/github/technus/tectech/Util.java @@ -25,8 +25,7 @@ import net.minecraftforge.fluids.FluidStack; import org.apache.commons.lang3.StringUtils; import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.List; +import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -40,6 +39,18 @@ public final class Util { private Util() { } + @SuppressWarnings("ComparatorMethodParameterNotUsed") + public static > SortedSet> entriesSortedByValues(Map map) { + SortedSet> sortedEntries = new TreeSet>( + (e1, e2) -> { + int res = e1.getValue().compareTo(e2.getValue()); + return res != 0 ? res : 1; // Special fix to preserve items with equal values + } + ); + sortedEntries.addAll(map.entrySet()); + return sortedEntries; + } + public static String intBitsToString(int number) { StringBuilder result = new StringBuilder(16); @@ -57,7 +68,7 @@ public final class Util { } public static String intBitsToShortString(int number) { - StringBuilder result = new StringBuilder(16); + StringBuilder result = new StringBuilder(35); for (int i = 31; i >= 0; i--) { int mask = 1 << i; @@ -73,10 +84,10 @@ public final class Util { } public static String longBitsToShortString(long number) { - StringBuilder result = new StringBuilder(16); + StringBuilder result = new StringBuilder(71); for (int i = 63; i >= 0; i--) { - int mask = 1 << i; + long mask = 1L << i; result.append((number & mask) != 0 ? ":" : "."); if (i % 8 == 0) { -- cgit From d1915c83101e3f97fa0730e1be8a85f4fc5ccdde Mon Sep 17 00:00:00 2001 From: Bass Date: Mon, 11 Mar 2019 06:03:40 +0000 Subject: Cherrypick fix --- .../metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java index 07868db13a..cf5b3bcd80 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java @@ -246,8 +246,10 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB @Override public void onRemoval() { super.onRemoval(); - for (GT_MetaTileEntity_Hatch_Rack r : eRacks) { - r.getBaseMetaTileEntity().setActive(false); + for (GT_MetaTileEntity_Hatch_Rack rack : eRacks) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(rack)) { + rack.getBaseMetaTileEntity().setActive(false); + } } } @@ -255,8 +257,10 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB public void stopMachine() { super.stopMachine(); eAvailableData=0; - for (GT_MetaTileEntity_Hatch_Rack r : eRacks) { - r.getBaseMetaTileEntity().setActive(false); + for (GT_MetaTileEntity_Hatch_Rack rack : eRacks) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(rack)) { + rack.getBaseMetaTileEntity().setActive(false); + } } } -- cgit From 0c56635ff22839201bdaff63276cf2df646ad279 Mon Sep 17 00:00:00 2001 From: Tec Date: Tue, 21 May 2019 22:13:22 +0200 Subject: Cleanup some strings and add creative data hatch --- src/main/java/com/github/technus/tectech/Util.java | 7 ++ .../dreamcraft/DreamCraftRecipeLoader.java | 14 +-- .../tectech/loader/thing/MachineLoader.java | 1 + .../core/stacks/cElementalInstanceStack.java | 6 +- .../core/templates/cElementalPrimitive.java | 14 +-- .../definitions/complex/atom/dAtomDefinition.java | 2 +- .../technus/tectech/recipe/TT_recipeAdder.java | 4 +- .../technus/tectech/thing/CustomItemList.java | 2 +- .../tectech/thing/item/gui/ScanDisplayScreen.java | 6 +- .../GT_MetaTileEntity_Hatch_CreativeData.java | 116 +++++++++++++++++++++ .../multi/GT_MetaTileEntity_EM_scanner.java | 2 +- .../multi/base/GT_Container_MultiMachineEM.java | 10 +- .../multi/base/GT_GUIContainer_MultiMachineEM.java | 30 +++--- .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 9 +- .../thing/metaTileEntity/multi/base/LedStatus.java | 20 ++-- .../metaTileEntity/multi/base/Parameters.java | 8 ++ 16 files changed, 193 insertions(+), 58 deletions(-) create mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_CreativeData.java diff --git a/src/main/java/com/github/technus/tectech/Util.java b/src/main/java/com/github/technus/tectech/Util.java index e8472bfea6..c550203874 100644 --- a/src/main/java/com/github/technus/tectech/Util.java +++ b/src/main/java/com/github/technus/tectech/Util.java @@ -1443,4 +1443,11 @@ public final class Util { crafter.sendProgressBarUpdate(container, startIndex++, (int)(value & 0xFFFFL)); crafter.sendProgressBarUpdate(container, startIndex, (value & 0xFFFF0000)>>>16); } + + public static String doubleToString(double value){ + if(value==(long)value){ + return Long.toString((long)value); + } + return Double.toString(value); + } } diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java index 73aef326b7..33f4840929 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java @@ -511,7 +511,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Bedrockium, 2L)}, new FluidStack[]{ Materials.Naquadria.getMolten(2592), Materials.SolderingAlloy.getMolten(2592), - Materials.Lubricant.getFluid(4000)}, ItemList.Electric_Pump_UHV.get(1, new Object[]{}), 1000, 200000); + Materials.Lubricant.getFluid(4000)}, ItemList.Electric_Pump_UHV.get(1), 1000, 200000); TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Electric_Pump_UHV.get(1L), 48000, 64, 200000, 8, new ItemStack[]{ @@ -524,7 +524,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Draconium, 2L)}, new FluidStack[]{ Materials.Quantium.getMolten(2592), Materials.SolderingAlloy.getMolten(5184), - Materials.Lubricant.getFluid(8000)}, ItemList.Electric_Pump_UEV.get(1, new Object[]{}), 2000, 800000); + Materials.Lubricant.getFluid(8000)}, ItemList.Electric_Pump_UEV.get(1), 2000, 800000); //Conveyor Belt UV-UHV TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Conveyor_Module_UV.get(1L), @@ -537,7 +537,7 @@ public class DreamCraftRecipeLoader implements Runnable { Materials.Naquadria.getMolten(2592), Materials.SolderingAlloy.getMolten(2592), Materials.Lubricant.getFluid(4000), - Materials.Silicone.getMolten(5760)}, ItemList.Conveyor_Module_UHV.get(1, new Object[]{}), 1000, 200000); + Materials.Silicone.getMolten(5760)}, ItemList.Conveyor_Module_UHV.get(1), 1000, 200000); TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Conveyor_Module_UHV.get(1L), 48000, 64, 200000, 8, new ItemStack[]{ @@ -549,7 +549,7 @@ public class DreamCraftRecipeLoader implements Runnable { Materials.Quantium.getMolten(2592), Materials.SolderingAlloy.getMolten(5184), Materials.Lubricant.getFluid(8000), - Materials.Silicone.getMolten(11520)}, ItemList.Conveyor_Module_UEV.get(1, new Object[]{}), 2000, 800000); + Materials.Silicone.getMolten(11520)}, ItemList.Conveyor_Module_UEV.get(1), 2000, 800000); //Piston UV-UHV TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Electric_Piston_UV.get(1L), @@ -564,7 +564,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Bedrockium, 4L)}, new FluidStack[]{ Materials.Naquadria.getMolten(2592), Materials.SolderingAlloy.getMolten(2592), - Materials.Lubricant.getFluid(4000)}, ItemList.Electric_Piston_UHV.get(1, new Object[]{}), 1000, 200000); + Materials.Lubricant.getFluid(4000)}, ItemList.Electric_Piston_UHV.get(1), 1000, 200000); TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Electric_Piston_UHV.get(1L), 48000, 64, 200000, 8, new ItemStack[]{ @@ -578,7 +578,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Draconium, 4L)}, new FluidStack[]{ Materials.Quantium.getMolten(2592), Materials.SolderingAlloy.getMolten(5184), - Materials.Lubricant.getFluid(8000)}, ItemList.Electric_Piston_UEV.get(1, new Object[]{}), 2000, 800000); + Materials.Lubricant.getFluid(8000)}, ItemList.Electric_Piston_UEV.get(1), 2000, 800000); //Robot Arm UV-UHV TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Robot_Arm_UV.get(1L), @@ -944,7 +944,7 @@ public class DreamCraftRecipeLoader implements Runnable { new Object[]{OrePrefixes.circuit.get(Materials.Infinite), 1L}, new Object[]{OrePrefixes.circuit.get(Materials.Infinite), 1L}, new Object[]{OrePrefixes.circuit.get(Materials.Infinite), 1L}, - ItemList.Energy_Cluster.get(8L, new Object[0]), + ItemList.Energy_Cluster.get(8L), ItemList.Field_Generator_UV.get(2), ItemList.Circuit_Wafer_HPIC.get(64), ItemList.Circuit_Wafer_HPIC.get(64), diff --git a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java index 86b3beac8d..da8d70a772 100644 --- a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java @@ -308,6 +308,7 @@ public class MachineLoader implements Runnable { // =================================================================================================== // Debug Stuff // =================================================================================================== + hatch_CreativeData.set(new GT_MetaTileEntity_Hatch_CreativeData(15496,"debug.tt.data","Debug Data Hatch",15).getStackForm(1)); hatch_CreativeMaitenance.set(new GT_MetaTileEntity_Hatch_CreativeMaintenance(15497, "debug.tt.maintenance", "Debug Maintenance Hatch", 15).getStackForm(1L)); Machine_DebugGenny.set(new GT_MetaTileEntity_DebugPowerGenerator(15498, "debug.tt.genny", "Debug Power Generator", 15).getStackForm(1L)); Machine_DebugWriter.set(new GT_MetaTileEntity_DebugStructureWriter(15499, "debug.tt.writer", "Debug Structure Writer", 15).getStackForm(1L)); diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/stacks/cElementalInstanceStack.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/stacks/cElementalInstanceStack.java index d97ec5d1f6..1f93f75213 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/stacks/cElementalInstanceStack.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/stacks/cElementalInstanceStack.java @@ -420,9 +420,9 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { } definition.addScanResults(lines,capabilities,energy); if(Util.areBitsSet(SCAN_GET_TIMESPAN_MULT,capabilities)) { - lines.add("TIME SPAN MULTIPLIER = " + lifeTimeMult); + lines.add("TIME MULT = " + lifeTimeMult); if(Util.areBitsSet(SCAN_GET_TIMESPAN_INFO,capabilities)) { - lines.add("TIME SPAN MULTIPLIED = " + lifeTime + " s"); + lines.add("TIME SPAN = " + lifeTime + " s"); } } if(Util.areBitsSet(SCAN_GET_AGE,capabilities)) { @@ -432,7 +432,7 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { lines.add("COLOR = " + color + " RGB or CMY"); } if(Util.areBitsSet(SCAN_GET_ENERGY_LEVEL,capabilities)) { - lines.add("E. LEVEL = " + energy); + lines.add("ENERGY = " + energy); } if(Util.areBitsSet(SCAN_GET_AMOUNT,capabilities)) { lines.add("AMOUNT = " + amount); diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/templates/cElementalPrimitive.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/templates/cElementalPrimitive.java index 738301d50c..bcd46c579a 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/templates/cElementalPrimitive.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/templates/cElementalPrimitive.java @@ -1,7 +1,6 @@ package com.github.technus.tectech.mechanics.elementalMatter.core.templates; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.Util; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDecay; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDefinitionStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.tElementalException; @@ -16,6 +15,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.Map; +import static com.github.technus.tectech.Util.areBitsSet; import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.cPrimitiveDefinition.null__; import static com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_scanner.*; @@ -212,23 +212,23 @@ public abstract class cElementalPrimitive extends cElementalDefinition { @Override public void addScanResults(ArrayList lines, int capabilities, long energyLevel) { - if(Util.areBitsSet(SCAN_GET_CLASS_TYPE, capabilities)) { + if(areBitsSet(SCAN_GET_CLASS_TYPE, capabilities)) { lines.add("CLASS = " + nbtType + ' ' + getClassType()); } - if(Util.areBitsSet(SCAN_GET_NOMENCLATURE|SCAN_GET_CHARGE|SCAN_GET_MASS|SCAN_GET_TIMESPAN_INFO, capabilities)) { + if(areBitsSet(SCAN_GET_NOMENCLATURE|SCAN_GET_CHARGE|SCAN_GET_MASS|SCAN_GET_TIMESPAN_INFO, capabilities)) { lines.add("NAME = "+getName()); lines.add("SYMBOL = "+getSymbol()); } - if(Util.areBitsSet(SCAN_GET_CHARGE,capabilities)) { + if(areBitsSet(SCAN_GET_CHARGE,capabilities)) { lines.add("CHARGE = " + getCharge() / 3f + " e"); } - if(Util.areBitsSet(SCAN_GET_COLOR,capabilities)) { + if(areBitsSet(SCAN_GET_COLOR,capabilities)) { lines.add(getColor() < 0 ? "COLORLESS" : "CARRIES COLOR"); } - if(Util.areBitsSet(SCAN_GET_MASS,capabilities)) { + if(areBitsSet(SCAN_GET_MASS,capabilities)) { lines.add("MASS = " + getMass() + " eV/c\u00b2"); } - if(Util.areBitsSet(SCAN_GET_TIMESPAN_INFO, capabilities)){ + if(areBitsSet(SCAN_GET_TIMESPAN_INFO, capabilities)){ lines.add((isTimeSpanHalfLife()?"HALF LIFE = ":"LIFE TIME = ")+getRawTimeSpan(energyLevel)+ " s"); lines.add(" "+"At current energy level"); } diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/atom/dAtomDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/atom/dAtomDefinition.java index 23f566075a..99e80b7be2 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/atom/dAtomDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/atom/dAtomDefinition.java @@ -1652,7 +1652,7 @@ public final class dAtomDefinition extends cElementalDefinition { } if(iaeaDefinitionExistsAndHasEnergyLevels && Util.areBitsSet(SCAN_GET_ENERGY_STATES,capabilities)){ for(int i=1;i { + public GT_MetaTileEntity_Hatch_CreativeData(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, "Quantum Data Output"); + Util.setTier(aTier,this); + } + + public GT_MetaTileEntity_Hatch_CreativeData(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Hatch_CreativeData(mName, mTier, mDescription, mTextures); + } + + @Override + public boolean isOutputFacing(byte aSide) { + return aSide == getBaseMetaTileEntity().getFrontFacing(); + } + + @Override + public boolean isInputFacing(byte aSide) { + return false; + } + + @Override + public boolean isSimpleMachine() { + return true; + } + + @Override + public boolean isDataInputFacing(byte side) { + return isInputFacing(side); + } + + @Override + protected QuantumDataPacket loadPacketFromNBT(NBTTagCompound nbt) { + return new QuantumDataPacket(nbt); + } + + @Override + public boolean canConnectData(byte side) { + return isOutputFacing(side); + } + + @Override + public void moveAround(IGregTechTileEntity aBaseMetaTileEntity) { + IConnectsToDataPipe current = this, source = this, next; + int range = 0; + while ((next = current.getNext(source)) != null && range++ < 1000) { + if (next instanceof GT_MetaTileEntity_Hatch_InputData) { + ((GT_MetaTileEntity_Hatch_InputData) next).setContents(q); + break; + } + source = current; + current = next; + } + q = null; + } + + @Override + public IConnectsToDataPipe getNext(IConnectsToDataPipe source/*==this*/) { + IGregTechTileEntity base = getBaseMetaTileEntity(); + byte color = base.getColorization(); + if (color < 0) { + return null; + } + IGregTechTileEntity next = base.getIGregTechTileEntityAtSide(base.getFrontFacing()); + if (next == null) { + return null; + } + IMetaTileEntity meta = next.getMetaTileEntity(); + if (meta instanceof GT_MetaTileEntity_Pipe_Data){ + return (IConnectsToDataPipe) meta; + }else if (meta instanceof GT_MetaTileEntity_Hatch_InputData && + ((GT_MetaTileEntity_Hatch_InputData) meta).getColorization()==color && + ((GT_MetaTileEntity_Hatch_InputData) meta).canConnectData(GT_Utility.getOppositeSide(base.getFrontFacing()))) { + return (IConnectsToDataPipe) meta; + } + return null; + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide()) { + if (MOVE_AT == aTick % 20) { + if (aBaseMetaTileEntity.isAllowedToWork()) { + getBaseMetaTileEntity().setActive(true); + if(q==null) q=new QuantumDataPacket(0xFFFFFFFFL); + moveAround(aBaseMetaTileEntity); + } else { + q=null; + getBaseMetaTileEntity().setActive(false); + } + } + } + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java index 2461fc5534..33de4aa1cc 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java @@ -126,7 +126,7 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa for (int i = 0; i < 10; i++) { Parameters.Group hatch = parametrization.getGroup(i); scanConfiguration[i*2] = hatch.makeInParameter(0, 0, CONFIG_NAME, CONFIG_STATUS); - scanConfiguration[i*2+1] = hatch.makeInParameter(0, 0, CONFIG_NAME, CONFIG_STATUS); + scanConfiguration[i*2+1] = hatch.makeInParameter(1, 0, CONFIG_NAME, CONFIG_STATUS); } } 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 ea22e3c23c..0ad5aa48ca 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 @@ -126,7 +126,7 @@ public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { } var1.sendProgressBarUpdate(this, 120, eCertainMode | (eCertainStatus << 8)); var1.sendProgressBarUpdate(this, 121, (ePowerPass ? 1 : 0) + (eSafeVoid ? 2 : 0) + (allowedToWork ? 4 : 0)); - for(int i=124,k=204,j=0;j<20;j++,i+=4,k+=4) { + for(int i=128,k=208,j=0;j<20;j++,i+=4,k+=4) { Util.sendDouble(eParamsOut[j], this, var1, i); Util.sendDouble(eParamsIn[j], this, var1, k); } @@ -149,11 +149,11 @@ public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { ePowerPass = (par2 & 1) == 1; eSafeVoid = (par2 & 2) == 2; allowedToWork = (par2 & 4) == 4; - } else if(par1>=130 && par1<210){ - int pos=(par1-130)>>2; + } else if(par1>=128 && par1<208){ + int pos=(par1-128)>>2; eParamsIn[pos]=Util.receiveDouble(eParamsIn[pos],par1&0xFFFFFFFC,par1,par2); - }else if(par1>=210 && par1<290){ - int pos=(par1-210)>>2; + }else if(par1>=208 && par1<288){ + int pos=(par1-208)>>2; eParamsIn[pos]=Util.receiveDouble(eParamsIn[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 94e2d0af8d..dea5030fde 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 @@ -207,52 +207,50 @@ public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Mach switch (status) { case STATUS_WRONG: //fallthrough if (counter < 2) { - drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * j, su, sv); + drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * j, su, sv);//blue break; } else if (counter < 4) { - drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * (8 + j), su, sv); + drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * (8 + j), su, sv);//red break; } case STATUS_OK://ok - drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * (4 + j), su, sv); + drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * (4 + j), su, sv);//green break; case STATUS_TOO_LOW://too low blink if (counter < 3) { - drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * j, su, sv); + drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * j, su, sv);//BLUE break; } case STATUS_LOW:// too low - drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * (2 + j), su, sv); + drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * (2 + j), su, sv);//cyan break; case STATUS_TOO_HIGH://too high blink if (counter < 3) { - drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * (8 + j), su, sv); + drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * (8 + j), su, sv);//redd break; } case STATUS_HIGH:// too high - drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * (6 + j), su, sv); + drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * (6 + j), su, sv);//orangeyello break; case STATUS_NEUTRAL: if(counter<3){ - GL11.glColor4f(.85f, .9f, .95f, 1.0F); + GL11.glColor4f(.85f, .9f, .95f, .5F); drawTexturedModalRect(x + su * i, y + sv * j, 212, 96, su+2, sv+2); - GL11.glColor4f(1f, 1f, 1f, 1f); }else { - GL11.glColor4f(.8f, .9f, 1f, 1.0F); + GL11.glColor4f(.8f, .9f, 1f, .5F); drawTexturedModalRect(x + su * i, y + sv * j, 212, 96, su+2, sv+2); - GL11.glColor4f(1f, 1f, 1f, 1f); } + GL11.glColor4f(1f, 1f, 1f, 1f); break; case STATUS_UNDEFINED: if(counter<3) { - GL11.glColor4f(.5f, .1f, .15f, 1.0F); + GL11.glColor4f(.5f, .1f, .15f, .5F); drawTexturedModalRect(x + su * i, y + sv * j, 212, 96, su + 2, sv + 2); - GL11.glColor4f(1f, 1f, 1f, 1f); }else { - GL11.glColor4f(0f, .1f, .2f, 1.0F); + GL11.glColor4f(0f, .1f, .2f, .5F); drawTexturedModalRect(x + su * i, y + sv * j, 212, 96, su + 2, sv + 2); - GL11.glColor4f(1f, 1f, 1f, 1f); } + GL11.glColor4f(1f, 1f, 1f, 1f); break; case STATUS_UNUSED: default: @@ -260,7 +258,7 @@ public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Mach int tColor = this.mContainer.mTileEntity.getColorization() & 15; if (tColor < ItemDye.field_150922_c.length) { tColor = ItemDye.field_150922_c[tColor]; - GL11.glColor4f((float)(tColor >> 16 & 255) / 255.0F, (float)(tColor >> 8 & 255) / 255.0F, (float)(tColor & 255) / 255.0F, 1.0F); + GL11.glColor4f((float)(tColor >> 16 & 255) / 255.0F, (float)(tColor >> 8 & 255) / 255.0F, (float)(tColor & 255) / 255.0F, 1F); } } drawTexturedModalRect(x + su * i, y + sv * j, 212, 96, su+2, sv+2); 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 b91d932ebd..83cf86126d 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 @@ -2,6 +2,7 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.base; import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.Util; import com.github.technus.tectech.Vec3pos; import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalDefinitionStack; @@ -440,9 +441,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt EnumChatFormatting.YELLOW+ ":" + EnumChatFormatting.AQUA+paramID + EnumChatFormatting.YELLOW+ ":"+ - EnumChatFormatting.AQUA+"I"); + EnumChatFormatting.AQUA+"I "+parametrization.getStatusIn(hatchNo, paramID).name); list.add(EnumChatFormatting.WHITE+"Value: "+ - EnumChatFormatting.AQUA+parametrization.getIn(hatchNo,paramID)); + EnumChatFormatting.AQUA+ Util.doubleToString(parametrization.getIn(hatchNo,paramID))); try{ list.add(parametrization.groups[hatchNo].parameterIn[paramID].getBrief()); }catch (NullPointerException|IndexOutOfBoundsException e){ @@ -464,9 +465,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt EnumChatFormatting.YELLOW+ ":" + EnumChatFormatting.AQUA+paramID + EnumChatFormatting.YELLOW+ ":"+ - EnumChatFormatting.AQUA+"O"); + EnumChatFormatting.AQUA+"O "+parametrization.getStatusOut(hatchNo, paramID).name); list.add(EnumChatFormatting.WHITE+"Value: "+ - EnumChatFormatting.AQUA+parametrization.getOut(hatchNo,paramID)); + EnumChatFormatting.AQUA+Util.doubleToString(parametrization.getOut(hatchNo,paramID))); try{ list.add(parametrization.groups[hatchNo].parameterOut[paramID].getBrief()); }catch (NullPointerException|IndexOutOfBoundsException e){ diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/LedStatus.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/LedStatus.java index e32df43ae4..f2eebe3f4b 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/LedStatus.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/LedStatus.java @@ -1,15 +1,17 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.base; +import net.minecraft.util.EnumChatFormatting; + public enum LedStatus { - STATUS_UNUSED("Unused",true), - STATUS_TOO_LOW("Too Low",false), - STATUS_LOW("Low",true), - STATUS_WRONG("Wrong",false), - STATUS_OK("Valid",true), - STATUS_TOO_HIGH("Too High",false), - STATUS_HIGH("High",true), - STATUS_UNDEFINED("Unknown",false), - STATUS_NEUTRAL("Neutral",true); + STATUS_UNUSED(EnumChatFormatting.DARK_GRAY +"Unused",true),// + STATUS_TOO_LOW(EnumChatFormatting.BLUE+"Too Low",false),// + STATUS_LOW(EnumChatFormatting.AQUA+"Low",true),// + STATUS_WRONG(EnumChatFormatting.DARK_PURPLE+"Wrong",false),// + STATUS_OK(EnumChatFormatting.GREEN+"Valid",true),// + STATUS_TOO_HIGH(EnumChatFormatting.RED+"Too High",false),// + STATUS_HIGH(EnumChatFormatting.GOLD+"High",true),// + STATUS_UNDEFINED(EnumChatFormatting.GRAY+"Unknown",false), + STATUS_NEUTRAL(EnumChatFormatting.WHITE+"Neutral",true);// public final String name; public final boolean isOk; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java index 4aba953df6..33d4dd9899 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java @@ -28,6 +28,14 @@ public class Parameters { return iParamsOut[hatchNo+10*parameterId]; } + LedStatus getStatusIn(int hatchNo,int parameterId){ + return eParamsInStatus[hatchNo+10*parameterId]; + } + + LedStatus getStatusOut(int hatchNo,int parameterId){ + return eParamsOutStatus[hatchNo+10*parameterId]; + } + private final GT_MetaTileEntity_MultiblockBase_EM parent; Parameters(GT_MetaTileEntity_MultiblockBase_EM parent){ -- cgit From 3155762aab68c2490fb1a7bd2ea28a0b34fba707 Mon Sep 17 00:00:00 2001 From: Dream-MasterXXL Date: Fri, 24 May 2019 11:12:37 +0200 Subject: bump dependencies to build on jenkins --- build.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.properties b/build.properties index 6a9a79e5d7..284b50bf2f 100644 --- a/build.properties +++ b/build.properties @@ -6,8 +6,8 @@ ic2.version=2.2.790-experimental codechickenlib.version=1.1.3.140 codechickencore.version=1.0.7.47 nei.version=1.0.5.120 -gregtech.jenkinsbuild=241 -gregtech.version=5.09.33.10 +gregtech.jenkinsbuild=293 +gregtech.version=5.09.33.14 cofhcore.version=[1.7.10]3.1.4-329-dev cofhlib.version=[1.7.10]1.0.3-175-dev -- cgit From c7de1c8adff8c2bd0641a4e6cbb24704562e3d61 Mon Sep 17 00:00:00 2001 From: Tec Date: Fri, 7 Jun 2019 18:06:08 +0200 Subject: Reapply Suppliers for behaviours --- .../dreamcraft/DreamCraftRecipeLoader.java | 34 +++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java index 4875847fd4..b13f1b6ce1 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java @@ -974,22 +974,22 @@ public class DreamCraftRecipeLoader implements Runnable { } private void register_machine_EM_behaviours(){ - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(5),ItemList.Machine_IV_Centrifuge.get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(6),getItemContainer("CentrifugeLuV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(7),getItemContainer("CentrifugeZPM").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(8),getItemContainer("CentrifugeUV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(9),getItemContainer("CentrifugeUHV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(10),getItemContainer("CentrifugeUEV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(11),getItemContainer("CentrifugeUIV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_Centrifuge(12),getItemContainer("CentrifugeUMV").get(1)); - - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(5),ItemList.Machine_IV_ElectromagneticSeparator.get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(6),getItemContainer("ElectromagneticSeparatorLuV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(7),getItemContainer("ElectromagneticSeparatorZPM").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(8),getItemContainer("ElectromagneticSeparatorUV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(9),getItemContainer("ElectromagneticSeparatorUHV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(10),getItemContainer("ElectromagneticSeparatorUEV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(11),getItemContainer("ElectromagneticSeparatorUIV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(new Behaviour_ElectromagneticSeparator(12),getItemContainer("ElectromagneticSeparatorUMV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(5),ItemList.Machine_IV_Centrifuge.get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(6),getItemContainer("CentrifugeLuV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(7),getItemContainer("CentrifugeZPM").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(8),getItemContainer("CentrifugeUV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(9),getItemContainer("CentrifugeUHV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(10),getItemContainer("CentrifugeUEV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(11),getItemContainer("CentrifugeUIV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(12),getItemContainer("CentrifugeUMV").get(1)); + + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(5),ItemList.Machine_IV_ElectromagneticSeparator.get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(6),getItemContainer("ElectromagneticSeparatorLuV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(7),getItemContainer("ElectromagneticSeparatorZPM").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(8),getItemContainer("ElectromagneticSeparatorUV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(9),getItemContainer("ElectromagneticSeparatorUHV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(10),getItemContainer("ElectromagneticSeparatorUEV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(11),getItemContainer("ElectromagneticSeparatorUIV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(12),getItemContainer("ElectromagneticSeparatorUMV").get(1)); } } -- cgit From d8a6787fffd976450ba05b3451368cdd7f3bc38c Mon Sep 17 00:00:00 2001 From: Tec Date: Fri, 7 Jun 2019 18:16:56 +0200 Subject: Fix gradle build --- build.gradle | 72 ++++++++++++++++++++++++++++---------------------------- build.properties | 2 +- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/build.gradle b/build.gradle index 3933a94c35..3c33f9d9f7 100644 --- a/build.gradle +++ b/build.gradle @@ -59,12 +59,12 @@ repositories { name = "ic2" url = "http://maven.ic2.player.to/" } - - ivy { + + ivy { name 'gtnh_download_source' artifactPattern "http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]-[revision].[ext]" } - + maven { name = "chickenbones" url = "http://chickenbones.net/maven/" @@ -91,43 +91,43 @@ task getGregTech(type: Download) { mustRunAfter "repackMinecraft" } -//tasks.setupCIWorkspace.dependsOn getGregTech -//tasks.setupDevWorkspace.dependsOn getGregTech -//tasks.setupDecompWorkspace.dependsOn getGregTech -//tasks.compileJava.dependsOn getGregTech +tasks.setupCIWorkspace.dependsOn getGregTech +tasks.setupDevWorkspace.dependsOn getGregTech +tasks.setupDecompWorkspace.dependsOn getGregTech +tasks.compileJava.dependsOn getGregTech processResources -{ - def cleanVersion = project.version.split('-')[1] - // this will ensure that this task is redone when the versions change. - inputs.property "version", cleanVersion - inputs.property "mcversion", project.minecraft.version - - // replace stuff in mcmod.info, nothing else - from(sourceSets.main.resources.srcDirs) { - include 'mcmod.info' - - // replace version and mcversion - expand 'version':cleanVersion, 'mcversion':project.minecraft.version - } - - // copy everything else, thats not the mcmod.info - from(sourceSets.main.resources.srcDirs) { - exclude 'mcmod.info' - } -} + { + def cleanVersion = project.version.split('-')[1] + // this will ensure that this task is redone when the versions change. + inputs.property "version", cleanVersion + inputs.property "mcversion", project.minecraft.version + + // replace stuff in mcmod.info, nothing else + from(sourceSets.main.resources.srcDirs) { + include 'mcmod.info' + + // replace version and mcversion + expand 'version':cleanVersion, 'mcversion':project.minecraft.version + } + + // copy everything else, thats not the mcmod.info + from(sourceSets.main.resources.srcDirs) { + exclude 'mcmod.info' + } + } task signJar(dependsOn: 'reobf'){ doLast { ant.signjar( - destDir: jar.destinationDir, - jar: jar.getArchivePath(), - alias: findProperty('keyStoreAlias') ?: '', - keystore: findProperty('keyStore') ?: '', - storepass: findProperty('keyStorePass') ?: '', - digestalg: findProperty('signDigestAlg') ?: '', - tsaurl: findProperty('signTSAurl') ?: '', - verbose: true - ) + destDir: jar.destinationDir, + jar: jar.getArchivePath(), + alias: findProperty('keyStoreAlias') ?: '', + keystore: findProperty('keyStore') ?: '', + storepass: findProperty('keyStorePass') ?: '', + digestalg: findProperty('signDigestAlg') ?: '', + tsaurl: findProperty('signTSAurl') ?: '', + verbose: true + ) } -} +} \ No newline at end of file diff --git a/build.properties b/build.properties index 1c9906c5b5..f8827f43d0 100644 --- a/build.properties +++ b/build.properties @@ -11,4 +11,4 @@ gregtech.version=5.09.33.14 cofhcore.version=[1.7.10]3.1.4-329-dev cofhlib.version=[1.7.10]1.0.3-175-dev -yamcore.version=0.5.78 +yamcore.version=0.5.78 \ No newline at end of file -- cgit From 06ebe41b63c58d34ae195dc2cf267457cb014364 Mon Sep 17 00:00:00 2001 From: Tec Date: Fri, 7 Jun 2019 21:30:20 +0200 Subject: Working Decay generator --- .../core/stacks/cElementalInstanceStack.java | 41 ++++++++++------- .../GT_MetaTileEntity_Hatch_InputElemental.java | 2 +- .../GT_MetaTileEntity_Hatch_OutputElemental.java | 2 +- .../multi/GT_MetaTileEntity_EM_decay.java | 17 ++----- .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 52 +++++++++++++++++++--- 5 files changed, 76 insertions(+), 38 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/stacks/cElementalInstanceStack.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/stacks/cElementalInstanceStack.java index 1f93f75213..7c04fe2c40 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/stacks/cElementalInstanceStack.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/stacks/cElementalInstanceStack.java @@ -275,17 +275,21 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { } cElementalInstanceStackMap products=decays[0].getResults(lifeTimeMult, newProductsAge, newEnergyLevel, amount); if(newProductsAge<0){ - for(cElementalInstanceStack stack:products.values()){ - if(stack.definition.equals(definition)){ - stack.age= age; - stack.setEnergy(energy); + if(products.size()==1) { + if(products.size()==1 && products.get(0).definition.equals(definition)) { + products.get(0).setEnergy(energy); + products.get(0).age=age; + } + }else { + for (cElementalInstanceStack stack : products.values()) { + if (stack.definition.equals(definition)) { + stack.age = age; + } } } }else{ - for(cElementalInstanceStack stack:products.values()){ - if(stack.definition.equals(definition)){ - stack.setEnergy(energy); - } + if(products.size()==1 && products.get(0).definition.equals(definition)) { + products.get(0).setEnergy(energy); } } if(this.energy <= 0 && products.getMass() > getMass()){ @@ -361,18 +365,21 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { } } - if(newProductsAge<0){ - for(cElementalInstanceStack stack:output.values()){ - if(stack.definition.equals(definition)){ - stack.age= age; - stack.setEnergy(energy); + if(newProductsAge<0) { + if (output.size() == 1 && output.get(0).definition.equals(definition)) { + output.get(0).setEnergy(energy); + output.get(0).age = age; + } else { + for (cElementalInstanceStack stack : output.values()) { + if (stack.definition.equals(definition)) { + stack.age = age; + } } } }else{ - for(cElementalInstanceStack stack:output.values()){ - if(stack.definition.equals(definition)){ - stack.setEnergy(energy); - } + if(output.size()==1 && output.get(0).definition.equals(definition)) { + output.get(0).setEnergy(energy); + output.get(0).age=age; } } if(this.energy <= 0 && output.getMass() > getMass()){ diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java index ccf7f1a063..6078c6379a 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java @@ -10,7 +10,7 @@ import gregtech.api.metatileentity.MetaTileEntity; */ public class GT_MetaTileEntity_Hatch_InputElemental extends GT_MetaTileEntity_Hatch_ElementalContainer { public GT_MetaTileEntity_Hatch_InputElemental(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, "Elemental Input for Multiblocks (" + 1000 * aTier * (aTier - 7) + "U, " + aTier * 2 + " stacks)"); + super(aID, aName, aNameRegional, aTier, "Elemental Input for Multiblocks"); Util.setTier(aTier,this); } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java index 942dc48256..937779ba94 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java @@ -13,7 +13,7 @@ import gregtech.api.util.GT_Utility; */ public class GT_MetaTileEntity_Hatch_OutputElemental extends GT_MetaTileEntity_Hatch_ElementalContainer { public GT_MetaTileEntity_Hatch_OutputElemental(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, "Elemental Output for Multiblocks (" + 1000 * aTier * (aTier - 7) + "U, " + aTier * 2 + " stacks)"); + super(aID, aName, aNameRegional, aTier, "Elemental Output for Multiblocks"); Util.setTier(aTier,this); } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java index b52637d220..14bebc4caa 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java @@ -162,13 +162,10 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase for(cElementalInstanceStack stack:outputEM[0].values()){ - if(stack.getEnergy()==0 && stack.definition.decayMakesEnergy(1)){ - if(getBaseMetaTileEntity().decreaseStoredEnergyUnits((long)(stack.getEnergySettingCost(1)*MASS_TO_EU_INSTANT),false)){ - stack.setEnergy(1); - }else{ - outputEM[0].remove(stack.definition); - outputEM[1].putReplace(stack); - } + if (stack.getEnergy() == 0 && stack.definition.decayMakesEnergy(1) + && getBaseMetaTileEntity().decreaseStoredEnergyUnits( + (long) (stack.getEnergySettingCost(1) * MASS_TO_EU_INSTANT), false)) { + stack.setEnergy(1); }else if(!stack.definition.decayMakesEnergy(stack.getEnergy())){ outputEM[0].remove(stack.definition); outputEM[1].putReplace(stack); @@ -176,7 +173,6 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase //System.out.println(stack.definition.getSymbol()+" "+stack.amount); } - float preMass=outputEM[0].getMass(); outputEM[0].tickContent(1,0,1); double energyDose=((preMass-outputEM[0].getMass())* MASS_TO_EU_PARTIAL); @@ -233,9 +229,4 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase "Computation: " + EnumChatFormatting.GREEN + eAvailableData + EnumChatFormatting.RESET + " / " + EnumChatFormatting.YELLOW + eRequiredData + EnumChatFormatting.RESET, }; } - - @Override - public long maxEUStore() { - return super.maxEUStore(); - } } 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 83cf86126d..53e1803615 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 @@ -124,10 +124,10 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt protected boolean ePowerPass = false, eSafeVoid = false; //max amperes machine can take in after computing it to the lowest tier (exchange packets to min tier count) - protected long eMaxAmpereFlow = 0; + protected long eMaxAmpereFlow = 0,eMaxAmpereGen=0; //What is the max and minimal tier of eu hatches installed - private long maxEUinputMin = 0, maxEUinputMax = 0; + private long maxEUinputMin = 0, maxEUinputMax = 0,maxEUoutputMin = 0, maxEUoutputMax = 0; //read only unless you are making computation generator - read computer class protected long eAvailableData = 0; // data being available @@ -820,7 +820,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); - + aNBT.setLong("eMaxGenEUmin", maxEUoutputMin); + aNBT.setLong("eMaxGenEUmax", maxEUoutputMax); + aNBT.setLong("eGenRating", eMaxAmpereGen); aNBT.setLong("eMaxEUmin", maxEUinputMin); aNBT.setLong("eMaxEUmax", maxEUinputMax); aNBT.setLong("eRating", eAmpereFlow); @@ -907,7 +909,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); - + maxEUoutputMin = aNBT.getLong("eMaxGenEUmin"); + maxEUoutputMax = aNBT.getLong("eMaxGenEUmax"); + eMaxAmpereGen = aNBT.getLong("eGenRating"); maxEUinputMin = aNBT.getLong("eMaxEUmin"); maxEUinputMax = aNBT.getLong("eMaxEUmax"); eAmpereFlow = aNBT.getLong("eRating"); @@ -1359,9 +1363,11 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } } - if (!mEnergyHatches.isEmpty() || !eEnergyMulti.isEmpty()) { + if (!mEnergyHatches.isEmpty() || !eEnergyMulti.isEmpty() || !mDynamoHatches.isEmpty() || !eDynamoMulti.isEmpty()) { maxEUinputMin = V[15]; maxEUinputMax = V[0]; + maxEUoutputMin = V[15]; + maxEUoutputMax = V[0]; for (GT_MetaTileEntity_Hatch_Energy hatch : mEnergyHatches) { if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) { if (hatch.maxEUInput() < maxEUinputMin) { @@ -1382,7 +1388,28 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } } } + for (GT_MetaTileEntity_Hatch_Dynamo hatch : mDynamoHatches) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) { + if (hatch.maxEUOutput() < maxEUoutputMin) { + maxEUoutputMin = hatch.maxEUOutput(); + } + if (hatch.maxEUOutput() > maxEUoutputMax) { + maxEUoutputMax = hatch.maxEUOutput(); + } + } + } + for (GT_MetaTileEntity_Hatch_DynamoMulti hatch : eDynamoMulti) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) { + if (hatch.maxEUOutput() < maxEUoutputMin) { + maxEUoutputMin = hatch.maxEUOutput(); + } + if (hatch.maxEUOutput() > maxEUoutputMax) { + maxEUoutputMax = hatch.maxEUOutput(); + } + } + } eMaxAmpereFlow = 0; + eMaxAmpereGen = 0; //counts only full amps for (GT_MetaTileEntity_Hatch_Energy hatch : mEnergyHatches) { if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) { @@ -1394,6 +1421,16 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt eMaxAmpereFlow += hatch.maxEUInput() / maxEUinputMin * hatch.Amperes; } } + for (GT_MetaTileEntity_Hatch_Dynamo hatch : mDynamoHatches) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) { + eMaxAmpereGen += hatch.maxEUOutput() / maxEUoutputMin; + } + } + for (GT_MetaTileEntity_Hatch_DynamoMulti hatch : eDynamoMulti) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) { + eMaxAmpereGen += hatch.maxEUOutput() / maxEUoutputMin * hatch.Amperes; + } + } if (getEUVar() > maxEUStore()) { setEUVar(maxEUStore()); } @@ -1401,6 +1438,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt maxEUinputMin = 0; maxEUinputMax = 0; eMaxAmpereFlow = 0; + maxEUoutputMin = 0; + maxEUoutputMax = 0; + eMaxAmpereGen = 0; setEUVar(0); } @@ -1690,7 +1730,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt @Override public long maxEUStore() { - return maxEUinputMin * eMaxAmpereFlow << 3; + return Math.max(maxEUinputMin * (eMaxAmpereFlow << 3),maxEUoutputMin*(eMaxAmpereGen << 3)); } @Override -- cgit From 172d658d1d839efeb7b9fa3714a0a6dcdf2678e1 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 7 Jun 2019 21:36:20 +0200 Subject: Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e70c4b62b7..93dc590f32 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ GT additions EXTREME # WIKI -https://github.com/JALGATeam/TecTechWiki/wiki +https://github.com/Technus/TecTech/wiki # Jenkins Builds http://jenkins.usrv.eu:8080/job/Tec%20Tech/ -- cgit From cad268bb938376051765e4f03d0eab90a738172f Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 8 Jun 2019 08:06:10 +0200 Subject: Pipes update --- .../tectech/loader/thing/MachineLoader.java | 282 ++++++++++++++++++++- .../technus/tectech/thing/CustomItemList.java | 20 +- .../tectech/thing/metaTileEntity/Textures.java | 76 ++++-- .../GT_MetaTileEntity_Hatch_CreativeData.java | 3 +- .../hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java | 6 + .../GT_MetaTileEntity_Hatch_DynamoTunnel.java | 41 +-- .../hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java | 6 + .../GT_MetaTileEntity_Hatch_EnergyTunnel.java | 23 +- .../hatch/GT_MetaTileEntity_Hatch_OutputData.java | 1 + .../GT_MetaTileEntity_Hatch_OutputDataItems.java | 1 + .../GT_MetaTileEntity_Hatch_OutputElemental.java | 2 + .../pipe/GT_MetaTileEntity_Pipe_Data.java | 22 +- .../pipe/GT_MetaTileEntity_Pipe_EM.java | 23 +- .../pipe/GT_MetaTileEntity_Pipe_Energy.java | 23 +- .../blocks/iconsets/OVERLAY_ENERGY_IN_LASER.png | Bin 0 -> 559 bytes .../blocks/iconsets/OVERLAY_ENERGY_OUT_LASER.png | Bin 0 -> 555 bytes 16 files changed, 465 insertions(+), 64 deletions(-) create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_ENERGY_IN_LASER.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_ENERGY_OUT_LASER.png diff --git a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java index 24652296b9..20f6cfce58 100644 --- a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java @@ -9,6 +9,7 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.*; import com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.GT_MetaTileEntity_EM_machine; import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_Data; import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_EM; +import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_Energy; import com.github.technus.tectech.thing.metaTileEntity.single.*; import cpw.mods.fml.common.Loader; import net.minecraft.init.Blocks; @@ -155,6 +156,146 @@ public class MachineLoader implements Runnable { eM_energymulti64_UXV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( 15128, "hatch.energymulti64.tier.13", "UXV 64A Energy Hatch", 13, 64).getStackForm(1L)); + + // =================================================================================================== + // Multi AMP Laser INPUTS + // =================================================================================================== + + eM_energytunnel1_IV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15130, "hatch.energytunnel1.tier.05", "IV 256A Laser Target Hatch", 5, 256).getStackForm(1L)); + eM_energytunnel2_IV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15140, "hatch.energytunnel2.tier.05", "IV 1024A Laser Target Hatch", 5, 1024).getStackForm(1L)); + eM_energytunnel3_IV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15150, "hatch.energytunnel3.tier.05", "IV 4096A Laser Target Hatch", 5, 4096).getStackForm(1L)); + eM_energytunnel4_IV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15160, "hatch.energytunnel4.tier.05", "IV 16384A Laser Target Hatch", 5, 16384).getStackForm(1L)); + eM_energytunnel5_IV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15170, "hatch.energytunnel5.tier.05", "IV 65536A Laser Target Hatch", 5, 65536).getStackForm(1L)); + eM_energytunnel6_IV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15180, "hatch.energytunnel6.tier.05", "IV 262144A Laser Target Hatch", 5, 262144).getStackForm(1L)); + eM_energytunnel7_IV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15190, "hatch.energytunnel7.tier.05", "IV 1048576A Laser Target Hatch", 5, 1048576).getStackForm(1L)); + + eM_energytunnel1_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15131, "hatch.energytunnel1.tier.06", "LuV 256A Laser Target Hatch", 5, 256).getStackForm(1L)); + eM_energytunnel2_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15141, "hatch.energytunnel2.tier.06", "LuV 1024A Laser Target Hatch", 5, 1024).getStackForm(1L)); + eM_energytunnel3_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15151, "hatch.energytunnel3.tier.06", "LuV 4096A Laser Target Hatch", 5, 4096).getStackForm(1L)); + eM_energytunnel4_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15161, "hatch.energytunnel4.tier.06", "LuV 16384A Laser Target Hatch", 5, 16384).getStackForm(1L)); + eM_energytunnel5_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15171, "hatch.energytunnel5.tier.06", "LuV 65536A Laser Target Hatch", 5, 65536).getStackForm(1L)); + eM_energytunnel6_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15181, "hatch.energytunnel6.tier.06", "LuV 262144A Laser Target Hatch", 5, 262144).getStackForm(1L)); + eM_energytunnel7_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15191, "hatch.energytunnel7.tier.06", "LuV 1048576A Laser Target Hatch", 5, 1048576).getStackForm(1L)); + + eM_energytunnel1_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15132, "hatch.energytunnel1.tier.07", "ZPM 256A Laser Target Hatch", 5, 256).getStackForm(1L)); + eM_energytunnel2_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15142, "hatch.energytunnel2.tier.07", "ZPM 1024A Laser Target Hatch", 5, 1024).getStackForm(1L)); + eM_energytunnel3_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15152, "hatch.energytunnel3.tier.07", "ZPM 4096A Laser Target Hatch", 5, 4096).getStackForm(1L)); + eM_energytunnel4_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15162, "hatch.energytunnel4.tier.07", "ZPM 16384A Laser Target Hatch", 5, 16384).getStackForm(1L)); + eM_energytunnel5_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15172, "hatch.energytunnel5.tier.07", "ZPM 65536A Laser Target Hatch", 5, 65536).getStackForm(1L)); + eM_energytunnel6_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15182, "hatch.energytunnel6.tier.07", "ZPM 262144A Laser Target Hatch", 5, 262144).getStackForm(1L)); + eM_energytunnel7_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15192, "hatch.energytunnel7.tier.07", "ZPM 1048576A Laser Target Hatch", 5, 1048576).getStackForm(1L)); + + eM_energytunnel1_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15133, "hatch.energytunnel1.tier.08", "UV 256A Laser Target Hatch", 5, 256).getStackForm(1L)); + eM_energytunnel2_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15143, "hatch.energytunnel2.tier.08", "UV 1024A Laser Target Hatch", 5, 1024).getStackForm(1L)); + eM_energytunnel3_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15153, "hatch.energytunnel3.tier.08", "UV 4096A Laser Target Hatch", 5, 4096).getStackForm(1L)); + eM_energytunnel4_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15163, "hatch.energytunnel4.tier.08", "UV 16384A Laser Target Hatch", 5, 16384).getStackForm(1L)); + eM_energytunnel5_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15173, "hatch.energytunnel5.tier.08", "UV 65536A Laser Target Hatch", 5, 65536).getStackForm(1L)); + eM_energytunnel6_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15183, "hatch.energytunnel6.tier.08", "UV 262144A Laser Target Hatch", 5, 262144).getStackForm(1L)); + eM_energytunnel7_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15193, "hatch.energytunnel7.tier.08", "UV 1048576A Laser Target Hatch", 5, 1048576).getStackForm(1L)); + + eM_energytunnel1_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15134, "hatch.energytunnel1.tier.09", "UHV 256A Laser Target Hatch", 5, 256).getStackForm(1L)); + eM_energytunnel2_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15144, "hatch.energytunnel2.tier.09", "UHV 1024A Laser Target Hatch", 5, 1024).getStackForm(1L)); + eM_energytunnel3_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15154, "hatch.energytunnel3.tier.09", "UHV 4096A Laser Target Hatch", 5, 4096).getStackForm(1L)); + eM_energytunnel4_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15164, "hatch.energytunnel4.tier.09", "UHV 16384A Laser Target Hatch", 5, 16384).getStackForm(1L)); + eM_energytunnel5_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15174, "hatch.energytunnel5.tier.09", "UHV 65536A Laser Target Hatch", 5, 65536).getStackForm(1L)); + eM_energytunnel6_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15184, "hatch.energytunnel6.tier.09", "UHV 262144A Laser Target Hatch", 5, 262144).getStackForm(1L)); + eM_energytunnel7_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15194, "hatch.energytunnel7.tier.09", "UHV 1048576A Laser Target Hatch", 5, 1048576).getStackForm(1L)); + + eM_energytunnel1_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15135, "hatch.energytunnel1.tier.10", "UEV 256A Laser Target Hatch", 5, 256).getStackForm(1L)); + eM_energytunnel2_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15145, "hatch.energytunnel2.tier.10", "UEV 1024A Laser Target Hatch", 5, 1024).getStackForm(1L)); + eM_energytunnel3_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15155, "hatch.energytunnel3.tier.10", "UEV 4096A Laser Target Hatch", 5, 4096).getStackForm(1L)); + eM_energytunnel4_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15165, "hatch.energytunnel4.tier.10", "UEV 16384A Laser Target Hatch", 5, 16384).getStackForm(1L)); + eM_energytunnel5_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15175, "hatch.energytunnel5.tier.10", "UEV 65536A Laser Target Hatch", 5, 65536).getStackForm(1L)); + eM_energytunnel6_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15185, "hatch.energytunnel6.tier.10", "UEV 262144A Laser Target Hatch", 5, 262144).getStackForm(1L)); + eM_energytunnel7_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15195, "hatch.energytunnel7.tier.10", "UEV 1048576A Laser Target Hatch", 5, 1048576).getStackForm(1L)); + + eM_energytunnel1_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15136, "hatch.energytunnel1.tier.11", "UIV 256A Laser Target Hatch", 5, 256).getStackForm(1L)); + eM_energytunnel2_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15146, "hatch.energytunnel2.tier.11", "UIV 1024A Laser Target Hatch", 5, 1024).getStackForm(1L)); + eM_energytunnel3_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15156, "hatch.energytunnel3.tier.11", "UIV 4096A Laser Target Hatch", 5, 4096).getStackForm(1L)); + eM_energytunnel4_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15166, "hatch.energytunnel4.tier.11", "UIV 16384A Laser Target Hatch", 5, 16384).getStackForm(1L)); + eM_energytunnel5_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15176, "hatch.energytunnel5.tier.11", "UIV 65536A Laser Target Hatch", 5, 65536).getStackForm(1L)); + eM_energytunnel6_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15186, "hatch.energytunnel6.tier.11", "UIV 262144A Laser Target Hatch", 5, 262144).getStackForm(1L)); + eM_energytunnel7_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15196, "hatch.energytunnel7.tier.11", "UIV 1048576A Laser Target Hatch", 5, 1048576).getStackForm(1L)); + + eM_energytunnel1_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15137, "hatch.energytunnel1.tier.12", "UMV 256A Laser Target Hatch", 5, 256).getStackForm(1L)); + eM_energytunnel2_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15147, "hatch.energytunnel2.tier.12", "UMV 1024A Laser Target Hatch", 5, 1024).getStackForm(1L)); + eM_energytunnel3_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15157, "hatch.energytunnel3.tier.12", "UMV 4096A Laser Target Hatch", 5, 4096).getStackForm(1L)); + eM_energytunnel4_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15167, "hatch.energytunnel4.tier.12", "UMV 16384A Laser Target Hatch", 5, 16384).getStackForm(1L)); + eM_energytunnel5_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15177, "hatch.energytunnel5.tier.12", "UMV 65536A Laser Target Hatch", 5, 65536).getStackForm(1L)); + eM_energytunnel6_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15187, "hatch.energytunnel6.tier.12", "UMV 262144A Laser Target Hatch", 5, 262144).getStackForm(1L)); + eM_energytunnel7_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15197, "hatch.energytunnel7.tier.12", "UMV 1048576A Laser Target Hatch", 5, 1048576).getStackForm(1L)); + + eM_energytunnel1_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15138, "hatch.energytunnel1.tier.13", "UXV 256A Laser Target Hatch", 5, 256).getStackForm(1L)); + eM_energytunnel2_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15148, "hatch.energytunnel2.tier.13", "UXV 1024A Laser Target Hatch", 5, 1024).getStackForm(1L)); + eM_energytunnel3_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15158, "hatch.energytunnel3.tier.13", "UXV 4096A Laser Target Hatch", 5, 4096).getStackForm(1L)); + eM_energytunnel4_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15168, "hatch.energytunnel4.tier.13", "UXV 16384A Laser Target Hatch", 5, 16384).getStackForm(1L)); + eM_energytunnel5_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15178, "hatch.energytunnel5.tier.13", "UXV 65536A Laser Target Hatch", 5, 65536).getStackForm(1L)); + eM_energytunnel6_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15188, "hatch.energytunnel6.tier.13", "UXV 262144A Laser Target Hatch", 5, 262144).getStackForm(1L)); + eM_energytunnel7_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15198, "hatch.energytunnel7.tier.13", "UXV 1048576A Laser Target Hatch", 5, 1048576).getStackForm(1L)); + // =================================================================================================== // Multi AMP Power OUTPUTS // =================================================================================================== @@ -223,6 +364,145 @@ public class MachineLoader implements Runnable { eM_dynamomulti64_UXV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( 15228, "hatch.dynamomulti64.tier.13", "UXV 64A Dynamo Hatch", 13, 64).getStackForm(1L)); + // =================================================================================================== + // Multi AMP Laser OUTPUTS + // =================================================================================================== + + eM_dynamotunnel1_IV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15230, "hatch.dynamotunnel1.tier.05", "IV 256A Laser Source Hatch", 5, 256).getStackForm(1L)); + eM_dynamotunnel2_IV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15240, "hatch.dynamotunnel2.tier.05", "IV 1024A Laser Source Hatch", 5, 1024).getStackForm(1L)); + eM_dynamotunnel3_IV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15250, "hatch.dynamotunnel3.tier.05", "IV 4096A Laser Source Hatch", 5, 4096).getStackForm(1L)); + eM_dynamotunnel4_IV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15260, "hatch.dynamotunnel4.tier.05", "IV 16384A Laser Source Hatch", 5, 16384).getStackForm(1L)); + eM_dynamotunnel5_IV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15270, "hatch.dynamotunnel5.tier.05", "IV 65536A Laser Source Hatch", 5, 65536).getStackForm(1L)); + eM_dynamotunnel6_IV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15280, "hatch.dynamotunnel6.tier.05", "IV 262144A Laser Source Hatch", 5, 262144).getStackForm(1L)); + eM_dynamotunnel7_IV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15290, "hatch.dynamotunnel7.tier.05", "IV 1048576A Laser Source Hatch", 5, 1048576).getStackForm(1L)); + + eM_dynamotunnel1_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15231, "hatch.dynamotunnel1.tier.06", "LuV 256A Laser Source Hatch", 5, 256).getStackForm(1L)); + eM_dynamotunnel2_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15241, "hatch.dynamotunnel2.tier.06", "LuV 1024A Laser Source Hatch", 5, 1024).getStackForm(1L)); + eM_dynamotunnel3_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15251, "hatch.dynamotunnel3.tier.06", "LuV 4096A Laser Source Hatch", 5, 4096).getStackForm(1L)); + eM_dynamotunnel4_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15261, "hatch.dynamotunnel4.tier.06", "LuV 16384A Laser Source Hatch", 5, 16384).getStackForm(1L)); + eM_dynamotunnel5_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15271, "hatch.dynamotunnel5.tier.06", "LuV 65536A Laser Source Hatch", 5, 65536).getStackForm(1L)); + eM_dynamotunnel6_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15281, "hatch.dynamotunnel6.tier.06", "LuV 262144A Laser Source Hatch", 5, 262144).getStackForm(1L)); + eM_dynamotunnel7_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15291, "hatch.dynamotunnel7.tier.06", "LuV 1048576A Laser Source Hatch", 5, 1048576).getStackForm(1L)); + + eM_dynamotunnel1_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15232, "hatch.dynamotunnel1.tier.07", "ZPM 256A Laser Source Hatch", 5, 256).getStackForm(1L)); + eM_dynamotunnel2_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15242, "hatch.dynamotunnel2.tier.07", "ZPM 1024A Laser Source Hatch", 5, 1024).getStackForm(1L)); + eM_dynamotunnel3_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15252, "hatch.dynamotunnel3.tier.07", "ZPM 4096A Laser Source Hatch", 5, 4096).getStackForm(1L)); + eM_dynamotunnel4_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15262, "hatch.dynamotunnel4.tier.07", "ZPM 16384A Laser Source Hatch", 5, 16384).getStackForm(1L)); + eM_dynamotunnel5_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15272, "hatch.dynamotunnel5.tier.07", "ZPM 65536A Laser Source Hatch", 5, 65536).getStackForm(1L)); + eM_dynamotunnel6_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15282, "hatch.dynamotunnel6.tier.07", "ZPM 262144A Laser Source Hatch", 5, 262144).getStackForm(1L)); + eM_dynamotunnel7_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15292, "hatch.dynamotunnel7.tier.07", "ZPM 1048576A Laser Source Hatch", 5, 1048576).getStackForm(1L)); + + eM_dynamotunnel1_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15233, "hatch.dynamotunnel1.tier.08", "UV 256A Laser Source Hatch", 5, 256).getStackForm(1L)); + eM_dynamotunnel2_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15243, "hatch.dynamotunnel2.tier.08", "UV 1024A Laser Source Hatch", 5, 1024).getStackForm(1L)); + eM_dynamotunnel3_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15253, "hatch.dynamotunnel3.tier.08", "UV 4096A Laser Source Hatch", 5, 4096).getStackForm(1L)); + eM_dynamotunnel4_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15263, "hatch.dynamotunnel4.tier.08", "UV 16384A Laser Source Hatch", 5, 16384).getStackForm(1L)); + eM_dynamotunnel5_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15273, "hatch.dynamotunnel5.tier.08", "UV 65536A Laser Source Hatch", 5, 65536).getStackForm(1L)); + eM_dynamotunnel6_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15283, "hatch.dynamotunnel6.tier.08", "UV 262144A Laser Source Hatch", 5, 262144).getStackForm(1L)); + eM_dynamotunnel7_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15293, "hatch.dynamotunnel7.tier.08", "UV 1048576A Laser Source Hatch", 5, 1048576).getStackForm(1L)); + + eM_dynamotunnel1_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15234, "hatch.dynamotunnel1.tier.09", "UHV 256A Laser Source Hatch", 5, 256).getStackForm(1L)); + eM_dynamotunnel2_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15244, "hatch.dynamotunnel2.tier.09", "UHV 1024A Laser Source Hatch", 5, 1024).getStackForm(1L)); + eM_dynamotunnel3_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15254, "hatch.dynamotunnel3.tier.09", "UHV 4096A Laser Source Hatch", 5, 4096).getStackForm(1L)); + eM_dynamotunnel4_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15264, "hatch.dynamotunnel4.tier.09", "UHV 16384A Laser Source Hatch", 5, 16384).getStackForm(1L)); + eM_dynamotunnel5_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15274, "hatch.dynamotunnel5.tier.09", "UHV 65536A Laser Source Hatch", 5, 65536).getStackForm(1L)); + eM_dynamotunnel6_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15284, "hatch.dynamotunnel6.tier.09", "UHV 262144A Laser Source Hatch", 5, 262144).getStackForm(1L)); + eM_dynamotunnel7_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15294, "hatch.dynamotunnel7.tier.09", "UHV 1048576A Laser Source Hatch", 5, 1048576).getStackForm(1L)); + + eM_dynamotunnel1_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15235, "hatch.dynamotunnel1.tier.10", "UEV 256A Laser Source Hatch", 5, 256).getStackForm(1L)); + eM_dynamotunnel2_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15245, "hatch.dynamotunnel2.tier.10", "UEV 1024A Laser Source Hatch", 5, 1024).getStackForm(1L)); + eM_dynamotunnel3_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15255, "hatch.dynamotunnel3.tier.10", "UEV 4096A Laser Source Hatch", 5, 4096).getStackForm(1L)); + eM_dynamotunnel4_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15265, "hatch.dynamotunnel4.tier.10", "UEV 16384A Laser Source Hatch", 5, 16384).getStackForm(1L)); + eM_dynamotunnel5_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15275, "hatch.dynamotunnel5.tier.10", "UEV 65536A Laser Source Hatch", 5, 65536).getStackForm(1L)); + eM_dynamotunnel6_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15285, "hatch.dynamotunnel6.tier.10", "UEV 262144A Laser Source Hatch", 5, 262144).getStackForm(1L)); + eM_dynamotunnel7_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15295, "hatch.dynamotunnel7.tier.10", "UEV 1048576A Laser Source Hatch", 5, 1048576).getStackForm(1L)); + + eM_dynamotunnel1_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15236, "hatch.dynamotunnel1.tier.11", "UIV 256A Laser Source Hatch", 5, 256).getStackForm(1L)); + eM_dynamotunnel2_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15246, "hatch.dynamotunnel2.tier.11", "UIV 1024A Laser Source Hatch", 5, 1024).getStackForm(1L)); + eM_dynamotunnel3_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15256, "hatch.dynamotunnel3.tier.11", "UIV 4096A Laser Source Hatch", 5, 4096).getStackForm(1L)); + eM_dynamotunnel4_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15266, "hatch.dynamotunnel4.tier.11", "UIV 16384A Laser Source Hatch", 5, 16384).getStackForm(1L)); + eM_dynamotunnel5_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15276, "hatch.dynamotunnel5.tier.11", "UIV 65536A Laser Source Hatch", 5, 65536).getStackForm(1L)); + eM_dynamotunnel6_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15286, "hatch.dynamotunnel6.tier.11", "UIV 262144A Laser Source Hatch", 5, 262144).getStackForm(1L)); + eM_dynamotunnel7_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15296, "hatch.dynamotunnel7.tier.11", "UIV 1048576A Laser Source Hatch", 5, 1048576).getStackForm(1L)); + + eM_dynamotunnel1_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15237, "hatch.dynamotunnel1.tier.12", "UMV 256A Laser Source Hatch", 5, 256).getStackForm(1L)); + eM_dynamotunnel2_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15247, "hatch.dynamotunnel2.tier.12", "UMV 1024A Laser Source Hatch", 5, 1024).getStackForm(1L)); + eM_dynamotunnel3_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15257, "hatch.dynamotunnel3.tier.12", "UMV 4096A Laser Source Hatch", 5, 4096).getStackForm(1L)); + eM_dynamotunnel4_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15267, "hatch.dynamotunnel4.tier.12", "UMV 16384A Laser Source Hatch", 5, 16384).getStackForm(1L)); + eM_dynamotunnel5_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15277, "hatch.dynamotunnel5.tier.12", "UMV 65536A Laser Source Hatch", 5, 65536).getStackForm(1L)); + eM_dynamotunnel6_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15287, "hatch.dynamotunnel6.tier.12", "UMV 262144A Laser Source Hatch", 5, 262144).getStackForm(1L)); + eM_dynamotunnel7_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15297, "hatch.dynamotunnel7.tier.12", "UMV 1048576A Laser Source Hatch", 5, 1048576).getStackForm(1L)); + + eM_dynamotunnel1_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15238, "hatch.dynamotunnel1.tier.13", "UXV 256A Laser Source Hatch", 5, 256).getStackForm(1L)); + eM_dynamotunnel2_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15248, "hatch.dynamotunnel2.tier.13", "UXV 1024A Laser Source Hatch", 5, 1024).getStackForm(1L)); + eM_dynamotunnel3_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15258, "hatch.dynamotunnel3.tier.13", "UXV 4096A Laser Source Hatch", 5, 4096).getStackForm(1L)); + eM_dynamotunnel4_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15268, "hatch.dynamotunnel4.tier.13", "UXV 16384A Laser Source Hatch", 5, 16384).getStackForm(1L)); + eM_dynamotunnel5_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15278, "hatch.dynamotunnel5.tier.13", "UXV 65536A Laser Source Hatch", 5, 65536).getStackForm(1L)); + eM_dynamotunnel6_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15288, "hatch.dynamotunnel6.tier.13", "UXV 262144A Laser Source Hatch", 5, 262144).getStackForm(1L)); + eM_dynamotunnel7_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15298, "hatch.dynamotunnel7.tier.13", "UXV 1048576A Laser Source Hatch", 5, 1048576).getStackForm(1L)); + // =================================================================================================== // MULTIBLOCKS // =================================================================================================== @@ -287,7 +567,7 @@ public class MachineLoader implements Runnable { // =================================================================================================== EMpipe.set(new GT_MetaTileEntity_Pipe_EM(15460, "pipe.elementalmatter", "Quantum \"Tunnel\"").getStackForm(1L)); - + LASERpipe.set(new GT_MetaTileEntity_Pipe_Energy(15465, "pipe.energystream", "High Power Optical Fiber Cable").getStackForm(1L)); DATApipe.set(new GT_MetaTileEntity_Pipe_Data(15470, "pipe.datastream", "Optical Fiber Cable").getStackForm(1L)); // =================================================================================================== diff --git a/src/main/java/com/github/technus/tectech/thing/CustomItemList.java b/src/main/java/com/github/technus/tectech/thing/CustomItemList.java index e17766ce5b..2a7674f0ab 100644 --- a/src/main/java/com/github/technus/tectech/thing/CustomItemList.java +++ b/src/main/java/com/github/technus/tectech/thing/CustomItemList.java @@ -29,7 +29,7 @@ public enum CustomItemList implements IItemContainer { Machine_BuckConverter_UV,Machine_BuckConverter_UHV,Machine_BuckConverter_UEV, Machine_BuckConverter_UIV,Machine_BuckConverter_UMV, Machine_BuckConverter_UXV, Machine_DebugWriter,Machine_DebugGenny,UnusedStuff, - EMpipe, DATApipe, rack_Hatch, holder_Hatch, capacitor_Hatch, + EMpipe, DATApipe, LASERpipe, rack_Hatch, holder_Hatch, capacitor_Hatch, eM_dynamomulti4_IV, eM_dynamomulti16_IV, eM_dynamomulti64_IV, eM_dynamomulti4_LuV, eM_dynamomulti16_LuV, eM_dynamomulti64_LuV, @@ -40,6 +40,15 @@ public enum CustomItemList implements IItemContainer { eM_dynamomulti4_UIV, eM_dynamomulti16_UIV, eM_dynamomulti64_UIV, eM_dynamomulti4_UMV, eM_dynamomulti16_UMV, eM_dynamomulti64_UMV, eM_dynamomulti4_UXV, eM_dynamomulti16_UXV, eM_dynamomulti64_UXV, + eM_dynamotunnel1_IV,eM_dynamotunnel2_IV,eM_dynamotunnel3_IV,eM_dynamotunnel4_IV,eM_dynamotunnel5_IV,eM_dynamotunnel6_IV,eM_dynamotunnel7_IV, + eM_dynamotunnel1_LuV,eM_dynamotunnel2_LuV,eM_dynamotunnel3_LuV,eM_dynamotunnel4_LuV,eM_dynamotunnel5_LuV,eM_dynamotunnel6_LuV,eM_dynamotunnel7_LuV, + eM_dynamotunnel1_ZPM,eM_dynamotunnel2_ZPM,eM_dynamotunnel3_ZPM,eM_dynamotunnel4_ZPM,eM_dynamotunnel5_ZPM,eM_dynamotunnel6_ZPM,eM_dynamotunnel7_ZPM, + eM_dynamotunnel1_UV,eM_dynamotunnel2_UV,eM_dynamotunnel3_UV,eM_dynamotunnel4_UV,eM_dynamotunnel5_UV,eM_dynamotunnel6_UV,eM_dynamotunnel7_UV, + eM_dynamotunnel1_UHV,eM_dynamotunnel2_UHV,eM_dynamotunnel3_UHV,eM_dynamotunnel4_UHV,eM_dynamotunnel5_UHV,eM_dynamotunnel6_UHV,eM_dynamotunnel7_UHV, + eM_dynamotunnel1_UEV,eM_dynamotunnel2_UEV,eM_dynamotunnel3_UEV,eM_dynamotunnel4_UEV,eM_dynamotunnel5_UEV,eM_dynamotunnel6_UEV,eM_dynamotunnel7_UEV, + eM_dynamotunnel1_UIV,eM_dynamotunnel2_UIV,eM_dynamotunnel3_UIV,eM_dynamotunnel4_UIV,eM_dynamotunnel5_UIV,eM_dynamotunnel6_UIV,eM_dynamotunnel7_UIV, + eM_dynamotunnel1_UMV,eM_dynamotunnel2_UMV,eM_dynamotunnel3_UMV,eM_dynamotunnel4_UMV,eM_dynamotunnel5_UMV,eM_dynamotunnel6_UMV,eM_dynamotunnel7_UMV, + eM_dynamotunnel1_UXV,eM_dynamotunnel2_UXV,eM_dynamotunnel3_UXV,eM_dynamotunnel4_UXV,eM_dynamotunnel5_UXV,eM_dynamotunnel6_UXV,eM_dynamotunnel7_UXV, eM_energymulti4_IV, eM_energymulti16_IV, eM_energymulti64_IV, eM_energymulti4_LuV, eM_energymulti16_LuV, eM_energymulti64_LuV, @@ -50,6 +59,15 @@ public enum CustomItemList implements IItemContainer { eM_energymulti4_UIV, eM_energymulti16_UIV, eM_energymulti64_UIV, eM_energymulti4_UMV, eM_energymulti16_UMV, eM_energymulti64_UMV, eM_energymulti4_UXV, eM_energymulti16_UXV, eM_energymulti64_UXV, + eM_energytunnel1_IV,eM_energytunnel2_IV,eM_energytunnel3_IV,eM_energytunnel4_IV,eM_energytunnel5_IV,eM_energytunnel6_IV,eM_energytunnel7_IV, + eM_energytunnel1_LuV,eM_energytunnel2_LuV,eM_energytunnel3_LuV,eM_energytunnel4_LuV,eM_energytunnel5_LuV,eM_energytunnel6_LuV,eM_energytunnel7_LuV, + eM_energytunnel1_ZPM,eM_energytunnel2_ZPM,eM_energytunnel3_ZPM,eM_energytunnel4_ZPM,eM_energytunnel5_ZPM,eM_energytunnel6_ZPM,eM_energytunnel7_ZPM, + eM_energytunnel1_UV,eM_energytunnel2_UV,eM_energytunnel3_UV,eM_energytunnel4_UV,eM_energytunnel5_UV,eM_energytunnel6_UV,eM_energytunnel7_UV, + eM_energytunnel1_UHV,eM_energytunnel2_UHV,eM_energytunnel3_UHV,eM_energytunnel4_UHV,eM_energytunnel5_UHV,eM_energytunnel6_UHV,eM_energytunnel7_UHV, + eM_energytunnel1_UEV,eM_energytunnel2_UEV,eM_energytunnel3_UEV,eM_energytunnel4_UEV,eM_energytunnel5_UEV,eM_energytunnel6_UEV,eM_energytunnel7_UEV, + eM_energytunnel1_UIV,eM_energytunnel2_UIV,eM_energytunnel3_UIV,eM_energytunnel4_UIV,eM_energytunnel5_UIV,eM_energytunnel6_UIV,eM_energytunnel7_UIV, + eM_energytunnel1_UMV,eM_energytunnel2_UMV,eM_energytunnel3_UMV,eM_energytunnel4_UMV,eM_energytunnel5_UMV,eM_energytunnel6_UMV,eM_energytunnel7_UMV, + eM_energytunnel1_UXV,eM_energytunnel2_UXV,eM_energytunnel3_UXV,eM_energytunnel4_UXV,eM_energytunnel5_UXV,eM_energytunnel6_UXV,eM_energytunnel7_UXV, eM_in_UV, eM_in_UHV, eM_in_UEV, eM_in_UIV, eM_in_UMV, eM_in_UXV, eM_out_UV, eM_out_UHV, eM_out_UEV, eM_out_UIV, eM_out_UMV, eM_out_UXV, diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/Textures.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/Textures.java index 99ff2bea97..d77749d130 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/Textures.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/Textures.java @@ -10,26 +10,28 @@ import static gregtech.api.enums.Dyes.MACHINE_METAL; import static gregtech.api.enums.Textures.BlockIcons.*; public class Textures { - private static IIconContainer OVERLAY_ENERGY_IN_POWER = new CustomIcon("iconsets/OVERLAY_ENERGY_IN_POWER"); - private static IIconContainer OVERLAY_ENERGY_OUT_POWER = new CustomIcon("iconsets/OVERLAY_ENERGY_OUT_POWER"); - private static IIconContainer MACHINE_UEV_SIDE = new CustomIcon("iconsets/MACHINE_UEV_SIDE"); - private static IIconContainer MACHINE_UIV_SIDE = new CustomIcon("iconsets/MACHINE_UIV_SIDE"); - private static IIconContainer MACHINE_UMV_SIDE = new CustomIcon("iconsets/MACHINE_UMV_SIDE"); - private static IIconContainer MACHINE_UXV_SIDE = new CustomIcon("iconsets/MACHINE_UXV_SIDE"); - private static IIconContainer MACHINE_OPV_SIDE = new CustomIcon("iconsets/MACHINE_OPV_SIDE"); - private static IIconContainer MACHINE_MAXV_SIDE = new CustomIcon("iconsets/MACHINE_MAXV_SIDE"); - private static IIconContainer MACHINE_UEV_TOP = new CustomIcon("iconsets/MACHINE_UEV_TOP"); - private static IIconContainer MACHINE_UIV_TOP = new CustomIcon("iconsets/MACHINE_UIV_TOP"); - private static IIconContainer MACHINE_UMV_TOP = new CustomIcon("iconsets/MACHINE_UMV_TOP"); - private static IIconContainer MACHINE_UXV_TOP = new CustomIcon("iconsets/MACHINE_UXV_TOP"); - private static IIconContainer MACHINE_OPV_TOP = new CustomIcon("iconsets/MACHINE_OPV_TOP"); - private static IIconContainer MACHINE_MAXV_TOP = new CustomIcon("iconsets/MACHINE_MAXV_TOP"); - private static IIconContainer MACHINE_UEV_BOTTOM = new CustomIcon("iconsets/MACHINE_UEV_BOTTOM"); - private static IIconContainer MACHINE_UIV_BOTTOM = new CustomIcon("iconsets/MACHINE_UIV_BOTTOM"); - private static IIconContainer MACHINE_UMV_BOTTOM = new CustomIcon("iconsets/MACHINE_UMV_BOTTOM"); - private static IIconContainer MACHINE_UXV_BOTTOM = new CustomIcon("iconsets/MACHINE_UXV_BOTTOM"); - private static IIconContainer MACHINE_OPV_BOTTOM = new CustomIcon("iconsets/MACHINE_OPV_BOTTOM"); - private static IIconContainer MACHINE_MAXV_BOTTOM = new CustomIcon("iconsets/MACHINE_MAXV_BOTTOM"); + private static final IIconContainer OVERLAY_ENERGY_IN_POWER = new CustomIcon("iconsets/OVERLAY_ENERGY_IN_POWER"); + private static final IIconContainer OVERLAY_ENERGY_OUT_POWER = new CustomIcon("iconsets/OVERLAY_ENERGY_OUT_POWER"); + private static final IIconContainer OVERLAY_ENERGY_IN_LASER = new CustomIcon("iconsets/OVERLAY_ENERGY_IN_LASER"); + private static final IIconContainer OVERLAY_ENERGY_OUT_LASER = new CustomIcon("iconsets/OVERLAY_ENERGY_OUT_LASER"); + private static final IIconContainer MACHINE_UEV_SIDE = new CustomIcon("iconsets/MACHINE_UEV_SIDE"); + private static final IIconContainer MACHINE_UIV_SIDE = new CustomIcon("iconsets/MACHINE_UIV_SIDE"); + private static final IIconContainer MACHINE_UMV_SIDE = new CustomIcon("iconsets/MACHINE_UMV_SIDE"); + private static final IIconContainer MACHINE_UXV_SIDE = new CustomIcon("iconsets/MACHINE_UXV_SIDE"); + private static final IIconContainer MACHINE_OPV_SIDE = new CustomIcon("iconsets/MACHINE_OPV_SIDE"); + private static final IIconContainer MACHINE_MAXV_SIDE = new CustomIcon("iconsets/MACHINE_MAXV_SIDE"); + private static final IIconContainer MACHINE_UEV_TOP = new CustomIcon("iconsets/MACHINE_UEV_TOP"); + private static final IIconContainer MACHINE_UIV_TOP = new CustomIcon("iconsets/MACHINE_UIV_TOP"); + private static final IIconContainer MACHINE_UMV_TOP = new CustomIcon("iconsets/MACHINE_UMV_TOP"); + private static final IIconContainer MACHINE_UXV_TOP = new CustomIcon("iconsets/MACHINE_UXV_TOP"); + private static final IIconContainer MACHINE_OPV_TOP = new CustomIcon("iconsets/MACHINE_OPV_TOP"); + private static final IIconContainer MACHINE_MAXV_TOP = new CustomIcon("iconsets/MACHINE_MAXV_TOP"); + private static final IIconContainer MACHINE_UEV_BOTTOM = new CustomIcon("iconsets/MACHINE_UEV_BOTTOM"); + private static final IIconContainer MACHINE_UIV_BOTTOM = new CustomIcon("iconsets/MACHINE_UIV_BOTTOM"); + private static final IIconContainer MACHINE_UMV_BOTTOM = new CustomIcon("iconsets/MACHINE_UMV_BOTTOM"); + private static final IIconContainer MACHINE_UXV_BOTTOM = new CustomIcon("iconsets/MACHINE_UXV_BOTTOM"); + private static final IIconContainer MACHINE_OPV_BOTTOM = new CustomIcon("iconsets/MACHINE_OPV_BOTTOM"); + private static final IIconContainer MACHINE_MAXV_BOTTOM = new CustomIcon("iconsets/MACHINE_MAXV_BOTTOM"); public static IIconContainer[] MACHINECASINGS_SIDE_TT = new IIconContainer[]{ MACHINE_8V_SIDE, MACHINE_LV_SIDE, MACHINE_MV_SIDE, MACHINE_HV_SIDE, @@ -149,6 +151,40 @@ public class Textures { new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{80, 80, 245, 0}), new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{60, 60, 245, 0}), new GT_RenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[]{40, 40, 245, 0}), + }, OVERLAYS_ENERGY_IN_LASER_TT = new ITexture[]{ + new GT_RenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[]{180, 180, 180, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[]{220, 220, 220, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[]{255, 100, 0, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[]{255, 255, 30, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[]{128, 128, 128, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[]{240, 240, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[]{220, 220, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[]{200, 200, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[]{180, 180, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[]{160, 160, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[]{140, 140, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[]{120, 120, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[]{100, 100, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[]{80, 80, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[]{60, 60, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[]{40, 40, 245, 0}), + }, OVERLAYS_ENERGY_OUT_LASER_TT = new ITexture[]{ + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[]{180, 180, 180, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[]{220, 220, 220, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[]{255, 100, 0, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[]{255, 255, 30, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[]{128, 128, 128, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[]{240, 240, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[]{220, 220, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[]{200, 200, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[]{180, 180, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[]{160, 160, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[]{140, 140, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[]{120, 120, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[]{100, 100, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[]{80, 80, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[]{60, 60, 245, 0}), + new GT_RenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[]{40, 40, 245, 0}), }; public static ITexture[][] MACHINE_CASINGS_TT = new ITexture[16][17]; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_CreativeData.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_CreativeData.java index eb6909a4a4..d12b0d42d8 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_CreativeData.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_CreativeData.java @@ -88,7 +88,8 @@ public class GT_MetaTileEntity_Hatch_CreativeData extends GT_MetaTileEntity_Hatc return null; } IMetaTileEntity meta = next.getMetaTileEntity(); - if (meta instanceof GT_MetaTileEntity_Pipe_Data){ + if (meta instanceof GT_MetaTileEntity_Pipe_Data) { + ((GT_MetaTileEntity_Pipe_Data) meta).markUsed(); return (IConnectsToDataPipe) meta; }else if (meta instanceof GT_MetaTileEntity_Hatch_InputData && ((GT_MetaTileEntity_Hatch_InputData) meta).getColorization()==color && diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java index 2ad4593984..cc297d01ea 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java @@ -29,6 +29,12 @@ public class GT_MetaTileEntity_Hatch_DynamoMulti extends GT_MetaTileEntity_Hatch Amperes = aAmp; } + public GT_MetaTileEntity_Hatch_DynamoMulti(int aID, String aName, String aNameRegional, int aTier, int i, String description, int aAmp) { + super(aID, aName, aNameRegional, aTier, i, description); + Amperes = aAmp; + Util.setTier(aTier,this); + } + @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { return new ITexture[]{aBaseTexture, OVERLAYS_ENERGY_IN_POWER_TT[mTier]}; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java index eeacf91014..24a8faf799 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java @@ -1,14 +1,12 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; import com.github.technus.tectech.CommonValues; -import com.github.technus.tectech.Util; import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_Energy; import com.github.technus.tectech.thing.metaTileEntity.pipe.IConnectsToEnergyTunnel; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -16,37 +14,33 @@ import net.minecraft.nbt.NBTTagCompound; import static com.github.technus.tectech.CommonValues.TRANSFER_AT; import static com.github.technus.tectech.CommonValues.V; -import static com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_POWER_TT; +import static com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT; /** * Created by danie_000 on 16.12.2016. */ -public class GT_MetaTileEntity_Hatch_DynamoTunnel extends GT_MetaTileEntity_Hatch implements IConnectsToEnergyTunnel { - public final int Amperes; +public class GT_MetaTileEntity_Hatch_DynamoTunnel extends GT_MetaTileEntity_Hatch_DynamoMulti implements IConnectsToEnergyTunnel { private final long upkeep; private long packetsCount=0; public GT_MetaTileEntity_Hatch_DynamoTunnel(int aID, String aName, String aNameRegional, int aTier, int aAmp) { - super(aID, aName, aNameRegional, aTier, 0, "Energy extracting terminal for Multiblocks"); - Amperes = aAmp; - Util.setTier(aTier,this); + super(aID, aName, aNameRegional, aTier, 0, "Energy extracting terminal for Multiblocks",aAmp); upkeep=Math.max(V[mTier]/Amperes,V[4]); } public GT_MetaTileEntity_Hatch_DynamoTunnel(String aName, int aTier, int aAmp, long aUpkeep, String aDescription, ITexture[][][] aTextures) { - super(aName, aTier, 0, aDescription, aTextures); - Amperes = aAmp; + super(aName, aTier, aAmp, aDescription, aTextures); upkeep=aUpkeep; } @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, OVERLAYS_ENERGY_IN_POWER_TT[mTier]}; + return new ITexture[]{aBaseTexture, OVERLAYS_ENERGY_IN_LASER_TT[mTier]}; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, OVERLAYS_ENERGY_IN_POWER_TT[mTier]}; + return new ITexture[]{aBaseTexture, OVERLAYS_ENERGY_IN_LASER_TT[mTier]}; } @Override @@ -175,14 +169,16 @@ public class GT_MetaTileEntity_Hatch_DynamoTunnel extends GT_MetaTileEntity_Hatc opposite == tGTTileEntity.getFrontFacing()) { if(maxEUOutput()>((GT_MetaTileEntity_Hatch_EnergyTunnel) aMetaTileEntity).maxEUInput()){ aMetaTileEntity.doExplosion(maxEUOutput()); - }else if(maxEUOutput()==((GT_MetaTileEntity_Hatch_EnergyTunnel) aMetaTileEntity).maxEUInput()){ - long ampRx=((GT_MetaTileEntity_Hatch_EnergyTunnel) aMetaTileEntity).Amperes; - if(packetsCount > ampRx && Amperes>ampRx){ - tGTTileEntity.setToFire(); - }else if(Amperes>ampRx){ - tGTTileEntity.setOnFire(); - ((GT_MetaTileEntity_Hatch_EnergyTunnel) aMetaTileEntity).addPackets(takePackets(Amperes)); - }else { + }else if(maxEUOutput()==((GT_MetaTileEntity_Hatch_EnergyTunnel) aMetaTileEntity).maxEUInput()) { + long ampRx = ((GT_MetaTileEntity_Hatch_EnergyTunnel) aMetaTileEntity).Amperes; + if (Amperes > ampRx) { + if (packetsCount > ampRx) { + tGTTileEntity.setToFire(); + } else { + tGTTileEntity.setOnFire(); + ((GT_MetaTileEntity_Hatch_EnergyTunnel) aMetaTileEntity).addPackets(takePackets(Amperes)); + } + } else { ((GT_MetaTileEntity_Hatch_EnergyTunnel) aMetaTileEntity).addPackets(takePackets(Amperes)); } } @@ -190,6 +186,8 @@ public class GT_MetaTileEntity_Hatch_DynamoTunnel extends GT_MetaTileEntity_Hatc } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Pipe_Energy) { if (((GT_MetaTileEntity_Pipe_Energy) aMetaTileEntity).connectionCount > 2) { return; + }else { + ((GT_MetaTileEntity_Pipe_Energy) aMetaTileEntity).markUsed(); } } else { return; @@ -210,6 +208,9 @@ public class GT_MetaTileEntity_Hatch_DynamoTunnel extends GT_MetaTileEntity_Hatc public void addPackets(long count){ packetsCount+=count; + if(packetsCount>Amperes<<2){ + packetsCount=Amperes<<2; + } } public long takePackets(long count){ diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java index 64dda8f84a..b6e58026e4 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java @@ -30,6 +30,12 @@ public class GT_MetaTileEntity_Hatch_EnergyMulti extends GT_MetaTileEntity_Hatch Amperes = aAmp; } + public GT_MetaTileEntity_Hatch_EnergyMulti(int aID, String aName, String aNameRegional, int aTier, int i, String description,int aAmp) { + super(aID, aName, aNameRegional, aTier, i, description); + Amperes = aAmp; + Util.setTier(aTier,this); + } + @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { return new ITexture[]{aBaseTexture, OVERLAYS_ENERGY_IN_POWER_TT[mTier]}; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java index 4e7fffcf9f..e844c8eb86 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java @@ -1,49 +1,43 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; import com.github.technus.tectech.CommonValues; -import com.github.technus.tectech.Util; import com.github.technus.tectech.thing.metaTileEntity.pipe.IConnectsToEnergyTunnel; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import static com.github.technus.tectech.CommonValues.TRANSFER_AT; import static com.github.technus.tectech.CommonValues.V; -import static com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_POWER_TT; +import static com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT; /** * Created by danie_000 on 16.12.2016. */ -public class GT_MetaTileEntity_Hatch_EnergyTunnel extends GT_MetaTileEntity_Hatch implements IConnectsToEnergyTunnel { - public final int Amperes; +public class GT_MetaTileEntity_Hatch_EnergyTunnel extends GT_MetaTileEntity_Hatch_EnergyMulti implements IConnectsToEnergyTunnel { private final long upkeep; private long packetsCount=0; public GT_MetaTileEntity_Hatch_EnergyTunnel(int aID, String aName, String aNameRegional, int aTier, int aAmp) { - super(aID, aName, aNameRegional, aTier, 0, "Energy injecting terminal for Multiblocks"); - Amperes = aAmp; - Util.setTier(aTier,this); + super(aID, aName, aNameRegional, aTier, 0, "Energy injecting terminal for Multiblocks",aAmp); upkeep=Math.max(V[mTier]/Amperes,V[4]); } public GT_MetaTileEntity_Hatch_EnergyTunnel(String aName, int aTier, int aAmp, long aUpkeep, String aDescription, ITexture[][][] aTextures) { - super(aName, aTier, 0, aDescription, aTextures); - Amperes = aAmp; - this.upkeep=aUpkeep; + super(aName, aTier, aAmp, aDescription, aTextures); + upkeep=aUpkeep; } @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, OVERLAYS_ENERGY_IN_POWER_TT[mTier]}; + return new ITexture[]{aBaseTexture, OVERLAYS_ENERGY_OUT_LASER_TT[mTier]}; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, OVERLAYS_ENERGY_IN_POWER_TT[mTier]}; + return new ITexture[]{aBaseTexture, OVERLAYS_ENERGY_OUT_LASER_TT[mTier]}; } @Override @@ -155,6 +149,9 @@ public class GT_MetaTileEntity_Hatch_EnergyTunnel extends GT_MetaTileEntity_Hatc public void addPackets(long count){ packetsCount+=count; + if(packetsCount>Amperes<<2){ + packetsCount=Amperes<<2; + } } public long takePackets(long count){ diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputData.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputData.java index d0e5399f75..7c9f8fba5c 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputData.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputData.java @@ -87,6 +87,7 @@ public class GT_MetaTileEntity_Hatch_OutputData extends GT_MetaTileEntity_Hatch_ } IMetaTileEntity meta = next.getMetaTileEntity(); if (meta instanceof GT_MetaTileEntity_Pipe_Data){ + ((GT_MetaTileEntity_Pipe_Data) meta).markUsed(); return (IConnectsToDataPipe) meta; }else if (meta instanceof GT_MetaTileEntity_Hatch_InputData && ((GT_MetaTileEntity_Hatch_InputData) meta).getColorization()==color && diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputDataItems.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputDataItems.java index 82bda9d326..472f998d89 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputDataItems.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputDataItems.java @@ -127,6 +127,7 @@ public class GT_MetaTileEntity_Hatch_OutputDataItems extends GT_MetaTileEntity_H } IMetaTileEntity meta = next.getMetaTileEntity(); if (meta instanceof GT_MetaTileEntity_Pipe_Data){ + ((GT_MetaTileEntity_Pipe_Data) meta).markUsed(); return (IConnectsToDataPipe) meta; }else if (meta instanceof GT_MetaTileEntity_Hatch_InputDataItems && ((GT_MetaTileEntity_Hatch_InputDataItems) meta).getColorization()==color && diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java index 937779ba94..39889e5c3f 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java @@ -67,6 +67,8 @@ public class GT_MetaTileEntity_Hatch_OutputElemental extends GT_MetaTileEntity_H } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Pipe_EM) { if (((GT_MetaTileEntity_Pipe_EM) aMetaTileEntity).connectionCount > 2) { return; + }else { + ((GT_MetaTileEntity_Pipe_EM) aMetaTileEntity).markUsed(); } } else { return; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java index 5234de7129..09f52e2611 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java @@ -1,6 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.pipe; import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.TecTech; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.GT_Mod; @@ -30,9 +31,11 @@ import static gregtech.api.enums.Dyes.MACHINE_METAL; */ public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements IConnectsToDataPipe { private static Textures.BlockIcons.CustomIcon EMpipe; - private static Textures.BlockIcons.CustomIcon EMbar; + private static Textures.BlockIcons.CustomIcon EMbar,EMbarActive; public byte connectionCount = 0; + private boolean activity; + public GT_MetaTileEntity_Pipe_Data(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, 0); } @@ -51,12 +54,13 @@ public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements IConn public void registerIcons(IIconRegister aBlockIconRegister) { EMpipe = new Textures.BlockIcons.CustomIcon("iconsets/EM_DATA"); EMbar = new Textures.BlockIcons.CustomIcon("iconsets/EM_BAR"); + EMbarActive = new Textures.BlockIcons.CustomIcon("iconsets/EM_BAR_ACTIVE"); super.registerIcons(aBlockIconRegister); } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) { - return new ITexture[]{new GT_RenderedTexture(EMpipe), new GT_RenderedTexture(EMbar, Dyes.getModulation(aColorIndex, MACHINE_METAL.getRGBA()))}; + return new ITexture[]{new GT_RenderedTexture(EMpipe), new GT_RenderedTexture(aBaseMetaTileEntity.isActive()?EMbarActive:EMbar, Dyes.getModulation(aColorIndex, MACHINE_METAL.getRGBA()))}; } @Override @@ -107,6 +111,16 @@ public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements IConn public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide()) { if ((aTick & 31) == 31) { + if(activity){ + if(TecTech.RANDOM.next(15)==0) { + aBaseMetaTileEntity.setActive(true); + } + activity=false; + }else if(aBaseMetaTileEntity.isActive()){ + if(TecTech.RANDOM.next(15)==0) { + aBaseMetaTileEntity.setActive(false); + } + } mConnections = 0; connectionCount = 0; byte myColor=aBaseMetaTileEntity.getColorization(); @@ -237,4 +251,8 @@ public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements IConn public byte getColorization() { return getBaseMetaTileEntity().getColorization(); } + + public void markUsed() { + this.activity = true; + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java index 6b7b36fb54..e2a17da4ac 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java @@ -1,6 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.pipe; import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.TecTech; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.GT_Mod; @@ -31,9 +32,11 @@ import static gregtech.api.enums.Dyes.MACHINE_METAL; */ public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements IConnectsToElementalPipe { private static Textures.BlockIcons.CustomIcon EMpipe; - private static Textures.BlockIcons.CustomIcon EMcandy; + static Textures.BlockIcons.CustomIcon EMcandy,EMCandyActive; public byte connectionCount = 0; + private boolean activity; + public GT_MetaTileEntity_Pipe_EM(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, 0); } @@ -52,12 +55,13 @@ public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements IConnec public void registerIcons(IIconRegister aBlockIconRegister) { EMpipe = new Textures.BlockIcons.CustomIcon("iconsets/EM_PIPE"); EMcandy = new Textures.BlockIcons.CustomIcon("iconsets/EM_CANDY"); + EMCandyActive = new Textures.BlockIcons.CustomIcon("iconsets/EM_CANDY_ACTIVE"); super.registerIcons(aBlockIconRegister); } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) { - return new ITexture[]{new GT_RenderedTexture(EMpipe), new GT_RenderedTexture(EMcandy, Dyes.getModulation(aColorIndex, MACHINE_METAL.getRGBA()))}; + return new ITexture[]{new GT_RenderedTexture(EMpipe), new GT_RenderedTexture(aBaseMetaTileEntity.isActive()?EMCandyActive:EMcandy, Dyes.getModulation(aColorIndex, MACHINE_METAL.getRGBA()))}; } @Override @@ -108,6 +112,16 @@ public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements IConnec public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide()) { if ((aTick & 31) == 31) { + if(activity){ + if(TecTech.RANDOM.next(7)==0) { + aBaseMetaTileEntity.setActive(true); + } + activity=false; + }else if(aBaseMetaTileEntity.isActive()){ + if(TecTech.RANDOM.next(7)==0) { + aBaseMetaTileEntity.setActive(false); + } + } mConnections = 0; connectionCount = 0; if (aBaseMetaTileEntity.getColorization() < 0) { @@ -145,7 +159,6 @@ public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements IConnec //} } } - } else if (aBaseMetaTileEntity.isClientSide() && GT_Client.changeDetected == 4) { aBaseMetaTileEntity.issueTextureUpdate(); } @@ -203,4 +216,8 @@ public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements IConnec } return 0.5f; } + + public void markUsed() { + this.activity = true; + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java index 6d4be98634..ad5aec16bd 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java @@ -1,6 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.pipe; import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.TecTech; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.GT_Mod; @@ -24,13 +25,16 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import static com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_EM.EMCandyActive; +import static com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_EM.EMcandy; import static gregtech.api.enums.Dyes.MACHINE_METAL; public class GT_MetaTileEntity_Pipe_Energy extends MetaPipeEntity implements IConnectsToEnergyTunnel { private static Textures.BlockIcons.CustomIcon EMpipe; - private static Textures.BlockIcons.CustomIcon EMcandy; public byte connectionCount = 0; + private boolean activity; + public GT_MetaTileEntity_Pipe_Energy(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, 0); } @@ -48,13 +52,12 @@ public class GT_MetaTileEntity_Pipe_Energy extends MetaPipeEntity implements ICo @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister aBlockIconRegister) { EMpipe = new Textures.BlockIcons.CustomIcon("iconsets/EM_LASER"); - EMcandy = new Textures.BlockIcons.CustomIcon("iconsets/EM_CANDY"); super.registerIcons(aBlockIconRegister); } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) { - return new ITexture[]{new GT_RenderedTexture(EMpipe), new GT_RenderedTexture(EMcandy, Dyes.getModulation(aColorIndex, MACHINE_METAL.getRGBA()))}; + return new ITexture[]{new GT_RenderedTexture(EMpipe), new GT_RenderedTexture(aBaseMetaTileEntity.isActive()?EMCandyActive:EMcandy, Dyes.getModulation(aColorIndex, MACHINE_METAL.getRGBA()))}; } @Override @@ -105,6 +108,16 @@ public class GT_MetaTileEntity_Pipe_Energy extends MetaPipeEntity implements ICo public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide()) { if ((aTick & 31) == 31) { + if(activity){ + if(TecTech.RANDOM.next(31)==0) { + aBaseMetaTileEntity.setActive(true); + } + activity=false; + }else if(aBaseMetaTileEntity.isActive()){ + if(TecTech.RANDOM.next(31)==0) { + aBaseMetaTileEntity.setActive(false); + } + } mConnections = 0; connectionCount = 0; if (aBaseMetaTileEntity.getColorization() < 0) { @@ -200,4 +213,8 @@ public class GT_MetaTileEntity_Pipe_Energy extends MetaPipeEntity implements ICo } return 0.5f; } + + public void markUsed() { + this.activity = true; + } } \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_ENERGY_IN_LASER.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_ENERGY_IN_LASER.png new file mode 100644 index 0000000000..51f387ba35 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_ENERGY_IN_LASER.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_ENERGY_OUT_LASER.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_ENERGY_OUT_LASER.png new file mode 100644 index 0000000000..4706e3cf6a Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_ENERGY_OUT_LASER.png differ -- cgit From 66fa7c65905c1483db0226d348021de05b1c6892 Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 8 Jun 2019 08:08:13 +0200 Subject: Use valid texture set --- .../metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java | 6 +++--- .../metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java index 24a8faf799..2312f704fd 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java @@ -14,7 +14,7 @@ import net.minecraft.nbt.NBTTagCompound; import static com.github.technus.tectech.CommonValues.TRANSFER_AT; import static com.github.technus.tectech.CommonValues.V; -import static com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT; +import static com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT; /** * Created by danie_000 on 16.12.2016. @@ -35,12 +35,12 @@ public class GT_MetaTileEntity_Hatch_DynamoTunnel extends GT_MetaTileEntity_Hatc @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, OVERLAYS_ENERGY_IN_LASER_TT[mTier]}; + return new ITexture[]{aBaseTexture, OVERLAYS_ENERGY_OUT_LASER_TT[mTier]}; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, OVERLAYS_ENERGY_IN_LASER_TT[mTier]}; + return new ITexture[]{aBaseTexture, OVERLAYS_ENERGY_OUT_LASER_TT[mTier]}; } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java index e844c8eb86..e22c699746 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java @@ -11,7 +11,7 @@ import net.minecraft.nbt.NBTTagCompound; import static com.github.technus.tectech.CommonValues.TRANSFER_AT; import static com.github.technus.tectech.CommonValues.V; -import static com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT; +import static com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT; /** * Created by danie_000 on 16.12.2016. @@ -32,12 +32,12 @@ public class GT_MetaTileEntity_Hatch_EnergyTunnel extends GT_MetaTileEntity_Hatc @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, OVERLAYS_ENERGY_OUT_LASER_TT[mTier]}; + return new ITexture[]{aBaseTexture, OVERLAYS_ENERGY_IN_LASER_TT[mTier]}; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, OVERLAYS_ENERGY_OUT_LASER_TT[mTier]}; + return new ITexture[]{aBaseTexture, OVERLAYS_ENERGY_IN_LASER_TT[mTier]}; } @Override -- cgit From a2a9323905e9f4559477a4f359fa7f5e3e923edc Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 8 Jun 2019 08:40:55 +0200 Subject: Add missing texture, fix tiers of laser hatches and change descriptions --- .../tectech/loader/thing/MachineLoader.java | 226 ++++++++++----------- .../hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java | 3 +- .../GT_MetaTileEntity_Hatch_DynamoTunnel.java | 2 + .../hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java | 3 +- .../GT_MetaTileEntity_Hatch_EnergyTunnel.java | 2 + .../pipe/GT_MetaTileEntity_Pipe_Energy.java | 4 +- .../gregtech/textures/blocks/iconsets/EM_LASER.png | Bin 0 -> 369 bytes 7 files changed, 121 insertions(+), 119 deletions(-) create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_LASER.png diff --git a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java index 20f6cfce58..920e14a16e 100644 --- a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java @@ -177,124 +177,124 @@ public class MachineLoader implements Runnable { 15190, "hatch.energytunnel7.tier.05", "IV 1048576A Laser Target Hatch", 5, 1048576).getStackForm(1L)); eM_energytunnel1_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15131, "hatch.energytunnel1.tier.06", "LuV 256A Laser Target Hatch", 5, 256).getStackForm(1L)); + 15131, "hatch.energytunnel1.tier.06", "LuV 256A Laser Target Hatch", 6, 256).getStackForm(1L)); eM_energytunnel2_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15141, "hatch.energytunnel2.tier.06", "LuV 1024A Laser Target Hatch", 5, 1024).getStackForm(1L)); + 15141, "hatch.energytunnel2.tier.06", "LuV 1024A Laser Target Hatch", 6, 1024).getStackForm(1L)); eM_energytunnel3_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15151, "hatch.energytunnel3.tier.06", "LuV 4096A Laser Target Hatch", 5, 4096).getStackForm(1L)); + 15151, "hatch.energytunnel3.tier.06", "LuV 4096A Laser Target Hatch", 6, 4096).getStackForm(1L)); eM_energytunnel4_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15161, "hatch.energytunnel4.tier.06", "LuV 16384A Laser Target Hatch", 5, 16384).getStackForm(1L)); + 15161, "hatch.energytunnel4.tier.06", "LuV 16384A Laser Target Hatch", 6, 16384).getStackForm(1L)); eM_energytunnel5_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15171, "hatch.energytunnel5.tier.06", "LuV 65536A Laser Target Hatch", 5, 65536).getStackForm(1L)); + 15171, "hatch.energytunnel5.tier.06", "LuV 65536A Laser Target Hatch", 6, 65536).getStackForm(1L)); eM_energytunnel6_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15181, "hatch.energytunnel6.tier.06", "LuV 262144A Laser Target Hatch", 5, 262144).getStackForm(1L)); + 15181, "hatch.energytunnel6.tier.06", "LuV 262144A Laser Target Hatch", 6, 262144).getStackForm(1L)); eM_energytunnel7_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15191, "hatch.energytunnel7.tier.06", "LuV 1048576A Laser Target Hatch", 5, 1048576).getStackForm(1L)); + 15191, "hatch.energytunnel7.tier.06", "LuV 1048576A Laser Target Hatch", 6, 1048576).getStackForm(1L)); eM_energytunnel1_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15132, "hatch.energytunnel1.tier.07", "ZPM 256A Laser Target Hatch", 5, 256).getStackForm(1L)); + 15132, "hatch.energytunnel1.tier.07", "ZPM 256A Laser Target Hatch", 7, 256).getStackForm(1L)); eM_energytunnel2_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15142, "hatch.energytunnel2.tier.07", "ZPM 1024A Laser Target Hatch", 5, 1024).getStackForm(1L)); + 15142, "hatch.energytunnel2.tier.07", "ZPM 1024A Laser Target Hatch", 7, 1024).getStackForm(1L)); eM_energytunnel3_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15152, "hatch.energytunnel3.tier.07", "ZPM 4096A Laser Target Hatch", 5, 4096).getStackForm(1L)); + 15152, "hatch.energytunnel3.tier.07", "ZPM 4096A Laser Target Hatch", 7, 4096).getStackForm(1L)); eM_energytunnel4_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15162, "hatch.energytunnel4.tier.07", "ZPM 16384A Laser Target Hatch", 5, 16384).getStackForm(1L)); + 15162, "hatch.energytunnel4.tier.07", "ZPM 16384A Laser Target Hatch", 7, 16384).getStackForm(1L)); eM_energytunnel5_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15172, "hatch.energytunnel5.tier.07", "ZPM 65536A Laser Target Hatch", 5, 65536).getStackForm(1L)); + 15172, "hatch.energytunnel5.tier.07", "ZPM 65536A Laser Target Hatch", 7, 65536).getStackForm(1L)); eM_energytunnel6_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15182, "hatch.energytunnel6.tier.07", "ZPM 262144A Laser Target Hatch", 5, 262144).getStackForm(1L)); + 15182, "hatch.energytunnel6.tier.07", "ZPM 262144A Laser Target Hatch", 7, 262144).getStackForm(1L)); eM_energytunnel7_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15192, "hatch.energytunnel7.tier.07", "ZPM 1048576A Laser Target Hatch", 5, 1048576).getStackForm(1L)); + 15192, "hatch.energytunnel7.tier.07", "ZPM 1048576A Laser Target Hatch", 7, 1048576).getStackForm(1L)); eM_energytunnel1_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15133, "hatch.energytunnel1.tier.08", "UV 256A Laser Target Hatch", 5, 256).getStackForm(1L)); + 15133, "hatch.energytunnel1.tier.08", "UV 256A Laser Target Hatch", 8, 256).getStackForm(1L)); eM_energytunnel2_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15143, "hatch.energytunnel2.tier.08", "UV 1024A Laser Target Hatch", 5, 1024).getStackForm(1L)); + 15143, "hatch.energytunnel2.tier.08", "UV 1024A Laser Target Hatch", 8, 1024).getStackForm(1L)); eM_energytunnel3_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15153, "hatch.energytunnel3.tier.08", "UV 4096A Laser Target Hatch", 5, 4096).getStackForm(1L)); + 15153, "hatch.energytunnel3.tier.08", "UV 4096A Laser Target Hatch", 8, 4096).getStackForm(1L)); eM_energytunnel4_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15163, "hatch.energytunnel4.tier.08", "UV 16384A Laser Target Hatch", 5, 16384).getStackForm(1L)); + 15163, "hatch.energytunnel4.tier.08", "UV 16384A Laser Target Hatch", 8, 16384).getStackForm(1L)); eM_energytunnel5_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15173, "hatch.energytunnel5.tier.08", "UV 65536A Laser Target Hatch", 5, 65536).getStackForm(1L)); + 15173, "hatch.energytunnel5.tier.08", "UV 65536A Laser Target Hatch", 8, 65536).getStackForm(1L)); eM_energytunnel6_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15183, "hatch.energytunnel6.tier.08", "UV 262144A Laser Target Hatch", 5, 262144).getStackForm(1L)); + 15183, "hatch.energytunnel6.tier.08", "UV 262144A Laser Target Hatch", 8, 262144).getStackForm(1L)); eM_energytunnel7_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15193, "hatch.energytunnel7.tier.08", "UV 1048576A Laser Target Hatch", 5, 1048576).getStackForm(1L)); + 15193, "hatch.energytunnel7.tier.08", "UV 1048576A Laser Target Hatch", 8, 1048576).getStackForm(1L)); eM_energytunnel1_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15134, "hatch.energytunnel1.tier.09", "UHV 256A Laser Target Hatch", 5, 256).getStackForm(1L)); + 15134, "hatch.energytunnel1.tier.09", "UHV 256A Laser Target Hatch", 9, 256).getStackForm(1L)); eM_energytunnel2_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15144, "hatch.energytunnel2.tier.09", "UHV 1024A Laser Target Hatch", 5, 1024).getStackForm(1L)); + 15144, "hatch.energytunnel2.tier.09", "UHV 1024A Laser Target Hatch", 9, 1024).getStackForm(1L)); eM_energytunnel3_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15154, "hatch.energytunnel3.tier.09", "UHV 4096A Laser Target Hatch", 5, 4096).getStackForm(1L)); + 15154, "hatch.energytunnel3.tier.09", "UHV 4096A Laser Target Hatch", 9, 4096).getStackForm(1L)); eM_energytunnel4_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15164, "hatch.energytunnel4.tier.09", "UHV 16384A Laser Target Hatch", 5, 16384).getStackForm(1L)); + 15164, "hatch.energytunnel4.tier.09", "UHV 16384A Laser Target Hatch", 9, 16384).getStackForm(1L)); eM_energytunnel5_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15174, "hatch.energytunnel5.tier.09", "UHV 65536A Laser Target Hatch", 5, 65536).getStackForm(1L)); + 15174, "hatch.energytunnel5.tier.09", "UHV 65536A Laser Target Hatch", 9, 65536).getStackForm(1L)); eM_energytunnel6_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15184, "hatch.energytunnel6.tier.09", "UHV 262144A Laser Target Hatch", 5, 262144).getStackForm(1L)); + 15184, "hatch.energytunnel6.tier.09", "UHV 262144A Laser Target Hatch", 9, 262144).getStackForm(1L)); eM_energytunnel7_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15194, "hatch.energytunnel7.tier.09", "UHV 1048576A Laser Target Hatch", 5, 1048576).getStackForm(1L)); + 15194, "hatch.energytunnel7.tier.09", "UHV 1048576A Laser Target Hatch", 9, 1048576).getStackForm(1L)); eM_energytunnel1_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15135, "hatch.energytunnel1.tier.10", "UEV 256A Laser Target Hatch", 5, 256).getStackForm(1L)); + 15135, "hatch.energytunnel1.tier.10", "UEV 256A Laser Target Hatch", 10, 256).getStackForm(1L)); eM_energytunnel2_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15145, "hatch.energytunnel2.tier.10", "UEV 1024A Laser Target Hatch", 5, 1024).getStackForm(1L)); + 15145, "hatch.energytunnel2.tier.10", "UEV 1024A Laser Target Hatch", 10, 1024).getStackForm(1L)); eM_energytunnel3_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15155, "hatch.energytunnel3.tier.10", "UEV 4096A Laser Target Hatch", 5, 4096).getStackForm(1L)); + 15155, "hatch.energytunnel3.tier.10", "UEV 4096A Laser Target Hatch", 10, 4096).getStackForm(1L)); eM_energytunnel4_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15165, "hatch.energytunnel4.tier.10", "UEV 16384A Laser Target Hatch", 5, 16384).getStackForm(1L)); + 15165, "hatch.energytunnel4.tier.10", "UEV 16384A Laser Target Hatch", 10, 16384).getStackForm(1L)); eM_energytunnel5_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15175, "hatch.energytunnel5.tier.10", "UEV 65536A Laser Target Hatch", 5, 65536).getStackForm(1L)); + 15175, "hatch.energytunnel5.tier.10", "UEV 65536A Laser Target Hatch", 10, 65536).getStackForm(1L)); eM_energytunnel6_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15185, "hatch.energytunnel6.tier.10", "UEV 262144A Laser Target Hatch", 5, 262144).getStackForm(1L)); + 15185, "hatch.energytunnel6.tier.10", "UEV 262144A Laser Target Hatch", 10, 262144).getStackForm(1L)); eM_energytunnel7_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15195, "hatch.energytunnel7.tier.10", "UEV 1048576A Laser Target Hatch", 5, 1048576).getStackForm(1L)); + 15195, "hatch.energytunnel7.tier.10", "UEV 1048576A Laser Target Hatch", 10, 1048576).getStackForm(1L)); eM_energytunnel1_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15136, "hatch.energytunnel1.tier.11", "UIV 256A Laser Target Hatch", 5, 256).getStackForm(1L)); + 15136, "hatch.energytunnel1.tier.11", "UIV 256A Laser Target Hatch", 11, 256).getStackForm(1L)); eM_energytunnel2_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15146, "hatch.energytunnel2.tier.11", "UIV 1024A Laser Target Hatch", 5, 1024).getStackForm(1L)); + 15146, "hatch.energytunnel2.tier.11", "UIV 1024A Laser Target Hatch", 11, 1024).getStackForm(1L)); eM_energytunnel3_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15156, "hatch.energytunnel3.tier.11", "UIV 4096A Laser Target Hatch", 5, 4096).getStackForm(1L)); + 15156, "hatch.energytunnel3.tier.11", "UIV 4096A Laser Target Hatch", 11, 4096).getStackForm(1L)); eM_energytunnel4_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15166, "hatch.energytunnel4.tier.11", "UIV 16384A Laser Target Hatch", 5, 16384).getStackForm(1L)); + 15166, "hatch.energytunnel4.tier.11", "UIV 16384A Laser Target Hatch", 11, 16384).getStackForm(1L)); eM_energytunnel5_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15176, "hatch.energytunnel5.tier.11", "UIV 65536A Laser Target Hatch", 5, 65536).getStackForm(1L)); + 15176, "hatch.energytunnel5.tier.11", "UIV 65536A Laser Target Hatch", 11, 65536).getStackForm(1L)); eM_energytunnel6_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15186, "hatch.energytunnel6.tier.11", "UIV 262144A Laser Target Hatch", 5, 262144).getStackForm(1L)); + 15186, "hatch.energytunnel6.tier.11", "UIV 262144A Laser Target Hatch", 11, 262144).getStackForm(1L)); eM_energytunnel7_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15196, "hatch.energytunnel7.tier.11", "UIV 1048576A Laser Target Hatch", 5, 1048576).getStackForm(1L)); + 15196, "hatch.energytunnel7.tier.11", "UIV 1048576A Laser Target Hatch", 11, 1048576).getStackForm(1L)); eM_energytunnel1_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15137, "hatch.energytunnel1.tier.12", "UMV 256A Laser Target Hatch", 5, 256).getStackForm(1L)); + 15137, "hatch.energytunnel1.tier.12", "UMV 256A Laser Target Hatch", 12, 256).getStackForm(1L)); eM_energytunnel2_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15147, "hatch.energytunnel2.tier.12", "UMV 1024A Laser Target Hatch", 5, 1024).getStackForm(1L)); + 15147, "hatch.energytunnel2.tier.12", "UMV 1024A Laser Target Hatch", 12, 1024).getStackForm(1L)); eM_energytunnel3_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15157, "hatch.energytunnel3.tier.12", "UMV 4096A Laser Target Hatch", 5, 4096).getStackForm(1L)); + 15157, "hatch.energytunnel3.tier.12", "UMV 4096A Laser Target Hatch", 12, 4096).getStackForm(1L)); eM_energytunnel4_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15167, "hatch.energytunnel4.tier.12", "UMV 16384A Laser Target Hatch", 5, 16384).getStackForm(1L)); + 15167, "hatch.energytunnel4.tier.12", "UMV 16384A Laser Target Hatch", 12, 16384).getStackForm(1L)); eM_energytunnel5_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15177, "hatch.energytunnel5.tier.12", "UMV 65536A Laser Target Hatch", 5, 65536).getStackForm(1L)); + 15177, "hatch.energytunnel5.tier.12", "UMV 65536A Laser Target Hatch", 12, 65536).getStackForm(1L)); eM_energytunnel6_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15187, "hatch.energytunnel6.tier.12", "UMV 262144A Laser Target Hatch", 5, 262144).getStackForm(1L)); + 15187, "hatch.energytunnel6.tier.12", "UMV 262144A Laser Target Hatch", 12, 262144).getStackForm(1L)); eM_energytunnel7_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15197, "hatch.energytunnel7.tier.12", "UMV 1048576A Laser Target Hatch", 5, 1048576).getStackForm(1L)); + 15197, "hatch.energytunnel7.tier.12", "UMV 1048576A Laser Target Hatch", 12, 1048576).getStackForm(1L)); eM_energytunnel1_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15138, "hatch.energytunnel1.tier.13", "UXV 256A Laser Target Hatch", 5, 256).getStackForm(1L)); + 15138, "hatch.energytunnel1.tier.13", "UXV 256A Laser Target Hatch", 13, 256).getStackForm(1L)); eM_energytunnel2_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15148, "hatch.energytunnel2.tier.13", "UXV 1024A Laser Target Hatch", 5, 1024).getStackForm(1L)); + 15148, "hatch.energytunnel2.tier.13", "UXV 1024A Laser Target Hatch", 13, 1024).getStackForm(1L)); eM_energytunnel3_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15158, "hatch.energytunnel3.tier.13", "UXV 4096A Laser Target Hatch", 5, 4096).getStackForm(1L)); + 15158, "hatch.energytunnel3.tier.13", "UXV 4096A Laser Target Hatch", 13, 4096).getStackForm(1L)); eM_energytunnel4_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15168, "hatch.energytunnel4.tier.13", "UXV 16384A Laser Target Hatch", 5, 16384).getStackForm(1L)); + 15168, "hatch.energytunnel4.tier.13", "UXV 16384A Laser Target Hatch", 13, 16384).getStackForm(1L)); eM_energytunnel5_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15178, "hatch.energytunnel5.tier.13", "UXV 65536A Laser Target Hatch", 5, 65536).getStackForm(1L)); + 15178, "hatch.energytunnel5.tier.13", "UXV 65536A Laser Target Hatch", 13, 65536).getStackForm(1L)); eM_energytunnel6_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15188, "hatch.energytunnel6.tier.13", "UXV 262144A Laser Target Hatch", 5, 262144).getStackForm(1L)); + 15188, "hatch.energytunnel6.tier.13", "UXV 262144A Laser Target Hatch", 13, 262144).getStackForm(1L)); eM_energytunnel7_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15198, "hatch.energytunnel7.tier.13", "UXV 1048576A Laser Target Hatch", 5, 1048576).getStackForm(1L)); + 15198, "hatch.energytunnel7.tier.13", "UXV 1048576A Laser Target Hatch", 13, 1048576).getStackForm(1L)); // =================================================================================================== // Multi AMP Power OUTPUTS @@ -384,124 +384,124 @@ public class MachineLoader implements Runnable { 15290, "hatch.dynamotunnel7.tier.05", "IV 1048576A Laser Source Hatch", 5, 1048576).getStackForm(1L)); eM_dynamotunnel1_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15231, "hatch.dynamotunnel1.tier.06", "LuV 256A Laser Source Hatch", 5, 256).getStackForm(1L)); + 15231, "hatch.dynamotunnel1.tier.06", "LuV 256A Laser Source Hatch", 6, 256).getStackForm(1L)); eM_dynamotunnel2_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15241, "hatch.dynamotunnel2.tier.06", "LuV 1024A Laser Source Hatch", 5, 1024).getStackForm(1L)); + 15241, "hatch.dynamotunnel2.tier.06", "LuV 1024A Laser Source Hatch", 6, 1024).getStackForm(1L)); eM_dynamotunnel3_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15251, "hatch.dynamotunnel3.tier.06", "LuV 4096A Laser Source Hatch", 5, 4096).getStackForm(1L)); + 15251, "hatch.dynamotunnel3.tier.06", "LuV 4096A Laser Source Hatch", 6, 4096).getStackForm(1L)); eM_dynamotunnel4_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15261, "hatch.dynamotunnel4.tier.06", "LuV 16384A Laser Source Hatch", 5, 16384).getStackForm(1L)); + 15261, "hatch.dynamotunnel4.tier.06", "LuV 16384A Laser Source Hatch", 6, 16384).getStackForm(1L)); eM_dynamotunnel5_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15271, "hatch.dynamotunnel5.tier.06", "LuV 65536A Laser Source Hatch", 5, 65536).getStackForm(1L)); + 15271, "hatch.dynamotunnel5.tier.06", "LuV 65536A Laser Source Hatch", 6, 65536).getStackForm(1L)); eM_dynamotunnel6_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15281, "hatch.dynamotunnel6.tier.06", "LuV 262144A Laser Source Hatch", 5, 262144).getStackForm(1L)); + 15281, "hatch.dynamotunnel6.tier.06", "LuV 262144A Laser Source Hatch", 6, 262144).getStackForm(1L)); eM_dynamotunnel7_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15291, "hatch.dynamotunnel7.tier.06", "LuV 1048576A Laser Source Hatch", 5, 1048576).getStackForm(1L)); + 15291, "hatch.dynamotunnel7.tier.06", "LuV 1048576A Laser Source Hatch", 6, 1048576).getStackForm(1L)); eM_dynamotunnel1_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15232, "hatch.dynamotunnel1.tier.07", "ZPM 256A Laser Source Hatch", 5, 256).getStackForm(1L)); + 15232, "hatch.dynamotunnel1.tier.07", "ZPM 256A Laser Source Hatch", 7, 256).getStackForm(1L)); eM_dynamotunnel2_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15242, "hatch.dynamotunnel2.tier.07", "ZPM 1024A Laser Source Hatch", 5, 1024).getStackForm(1L)); + 15242, "hatch.dynamotunnel2.tier.07", "ZPM 1024A Laser Source Hatch", 7, 1024).getStackForm(1L)); eM_dynamotunnel3_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15252, "hatch.dynamotunnel3.tier.07", "ZPM 4096A Laser Source Hatch", 5, 4096).getStackForm(1L)); + 15252, "hatch.dynamotunnel3.tier.07", "ZPM 4096A Laser Source Hatch", 7, 4096).getStackForm(1L)); eM_dynamotunnel4_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15262, "hatch.dynamotunnel4.tier.07", "ZPM 16384A Laser Source Hatch", 5, 16384).getStackForm(1L)); + 15262, "hatch.dynamotunnel4.tier.07", "ZPM 16384A Laser Source Hatch", 7, 16384).getStackForm(1L)); eM_dynamotunnel5_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15272, "hatch.dynamotunnel5.tier.07", "ZPM 65536A Laser Source Hatch", 5, 65536).getStackForm(1L)); + 15272, "hatch.dynamotunnel5.tier.07", "ZPM 65536A Laser Source Hatch", 7, 65536).getStackForm(1L)); eM_dynamotunnel6_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15282, "hatch.dynamotunnel6.tier.07", "ZPM 262144A Laser Source Hatch", 5, 262144).getStackForm(1L)); + 15282, "hatch.dynamotunnel6.tier.07", "ZPM 262144A Laser Source Hatch", 7, 262144).getStackForm(1L)); eM_dynamotunnel7_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15292, "hatch.dynamotunnel7.tier.07", "ZPM 1048576A Laser Source Hatch", 5, 1048576).getStackForm(1L)); + 15292, "hatch.dynamotunnel7.tier.07", "ZPM 1048576A Laser Source Hatch", 7, 1048576).getStackForm(1L)); eM_dynamotunnel1_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15233, "hatch.dynamotunnel1.tier.08", "UV 256A Laser Source Hatch", 5, 256).getStackForm(1L)); + 15233, "hatch.dynamotunnel1.tier.08", "UV 256A Laser Source Hatch", 8, 256).getStackForm(1L)); eM_dynamotunnel2_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15243, "hatch.dynamotunnel2.tier.08", "UV 1024A Laser Source Hatch", 5, 1024).getStackForm(1L)); + 15243, "hatch.dynamotunnel2.tier.08", "UV 1024A Laser Source Hatch", 8, 1024).getStackForm(1L)); eM_dynamotunnel3_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15253, "hatch.dynamotunnel3.tier.08", "UV 4096A Laser Source Hatch", 5, 4096).getStackForm(1L)); + 15253, "hatch.dynamotunnel3.tier.08", "UV 4096A Laser Source Hatch", 8, 4096).getStackForm(1L)); eM_dynamotunnel4_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15263, "hatch.dynamotunnel4.tier.08", "UV 16384A Laser Source Hatch", 5, 16384).getStackForm(1L)); + 15263, "hatch.dynamotunnel4.tier.08", "UV 16384A Laser Source Hatch", 8, 16384).getStackForm(1L)); eM_dynamotunnel5_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15273, "hatch.dynamotunnel5.tier.08", "UV 65536A Laser Source Hatch", 5, 65536).getStackForm(1L)); + 15273, "hatch.dynamotunnel5.tier.08", "UV 65536A Laser Source Hatch", 8, 65536).getStackForm(1L)); eM_dynamotunnel6_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15283, "hatch.dynamotunnel6.tier.08", "UV 262144A Laser Source Hatch", 5, 262144).getStackForm(1L)); + 15283, "hatch.dynamotunnel6.tier.08", "UV 262144A Laser Source Hatch", 8, 262144).getStackForm(1L)); eM_dynamotunnel7_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15293, "hatch.dynamotunnel7.tier.08", "UV 1048576A Laser Source Hatch", 5, 1048576).getStackForm(1L)); + 15293, "hatch.dynamotunnel7.tier.08", "UV 1048576A Laser Source Hatch", 8, 1048576).getStackForm(1L)); eM_dynamotunnel1_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15234, "hatch.dynamotunnel1.tier.09", "UHV 256A Laser Source Hatch", 5, 256).getStackForm(1L)); + 15234, "hatch.dynamotunnel1.tier.09", "UHV 256A Laser Source Hatch", 9, 256).getStackForm(1L)); eM_dynamotunnel2_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15244, "hatch.dynamotunnel2.tier.09", "UHV 1024A Laser Source Hatch", 5, 1024).getStackForm(1L)); + 15244, "hatch.dynamotunnel2.tier.09", "UHV 1024A Laser Source Hatch", 9, 1024).getStackForm(1L)); eM_dynamotunnel3_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15254, "hatch.dynamotunnel3.tier.09", "UHV 4096A Laser Source Hatch", 5, 4096).getStackForm(1L)); + 15254, "hatch.dynamotunnel3.tier.09", "UHV 4096A Laser Source Hatch", 9, 4096).getStackForm(1L)); eM_dynamotunnel4_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15264, "hatch.dynamotunnel4.tier.09", "UHV 16384A Laser Source Hatch", 5, 16384).getStackForm(1L)); + 15264, "hatch.dynamotunnel4.tier.09", "UHV 16384A Laser Source Hatch", 9, 16384).getStackForm(1L)); eM_dynamotunnel5_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15274, "hatch.dynamotunnel5.tier.09", "UHV 65536A Laser Source Hatch", 5, 65536).getStackForm(1L)); + 15274, "hatch.dynamotunnel5.tier.09", "UHV 65536A Laser Source Hatch", 9, 65536).getStackForm(1L)); eM_dynamotunnel6_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15284, "hatch.dynamotunnel6.tier.09", "UHV 262144A Laser Source Hatch", 5, 262144).getStackForm(1L)); + 15284, "hatch.dynamotunnel6.tier.09", "UHV 262144A Laser Source Hatch", 9, 262144).getStackForm(1L)); eM_dynamotunnel7_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15294, "hatch.dynamotunnel7.tier.09", "UHV 1048576A Laser Source Hatch", 5, 1048576).getStackForm(1L)); + 15294, "hatch.dynamotunnel7.tier.09", "UHV 1048576A Laser Source Hatch", 9, 1048576).getStackForm(1L)); eM_dynamotunnel1_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15235, "hatch.dynamotunnel1.tier.10", "UEV 256A Laser Source Hatch", 5, 256).getStackForm(1L)); + 15235, "hatch.dynamotunnel1.tier.10", "UEV 256A Laser Source Hatch", 10, 256).getStackForm(1L)); eM_dynamotunnel2_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15245, "hatch.dynamotunnel2.tier.10", "UEV 1024A Laser Source Hatch", 5, 1024).getStackForm(1L)); + 15245, "hatch.dynamotunnel2.tier.10", "UEV 1024A Laser Source Hatch", 10, 1024).getStackForm(1L)); eM_dynamotunnel3_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15255, "hatch.dynamotunnel3.tier.10", "UEV 4096A Laser Source Hatch", 5, 4096).getStackForm(1L)); + 15255, "hatch.dynamotunnel3.tier.10", "UEV 4096A Laser Source Hatch", 10, 4096).getStackForm(1L)); eM_dynamotunnel4_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15265, "hatch.dynamotunnel4.tier.10", "UEV 16384A Laser Source Hatch", 5, 16384).getStackForm(1L)); + 15265, "hatch.dynamotunnel4.tier.10", "UEV 16384A Laser Source Hatch", 10, 16384).getStackForm(1L)); eM_dynamotunnel5_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15275, "hatch.dynamotunnel5.tier.10", "UEV 65536A Laser Source Hatch", 5, 65536).getStackForm(1L)); + 15275, "hatch.dynamotunnel5.tier.10", "UEV 65536A Laser Source Hatch", 10, 65536).getStackForm(1L)); eM_dynamotunnel6_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15285, "hatch.dynamotunnel6.tier.10", "UEV 262144A Laser Source Hatch", 5, 262144).getStackForm(1L)); + 15285, "hatch.dynamotunnel6.tier.10", "UEV 262144A Laser Source Hatch", 10, 262144).getStackForm(1L)); eM_dynamotunnel7_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15295, "hatch.dynamotunnel7.tier.10", "UEV 1048576A Laser Source Hatch", 5, 1048576).getStackForm(1L)); + 15295, "hatch.dynamotunnel7.tier.10", "UEV 1048576A Laser Source Hatch", 10, 1048576).getStackForm(1L)); eM_dynamotunnel1_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15236, "hatch.dynamotunnel1.tier.11", "UIV 256A Laser Source Hatch", 5, 256).getStackForm(1L)); + 15236, "hatch.dynamotunnel1.tier.11", "UIV 256A Laser Source Hatch", 11, 256).getStackForm(1L)); eM_dynamotunnel2_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15246, "hatch.dynamotunnel2.tier.11", "UIV 1024A Laser Source Hatch", 5, 1024).getStackForm(1L)); + 15246, "hatch.dynamotunnel2.tier.11", "UIV 1024A Laser Source Hatch", 11, 1024).getStackForm(1L)); eM_dynamotunnel3_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15256, "hatch.dynamotunnel3.tier.11", "UIV 4096A Laser Source Hatch", 5, 4096).getStackForm(1L)); + 15256, "hatch.dynamotunnel3.tier.11", "UIV 4096A Laser Source Hatch", 11, 4096).getStackForm(1L)); eM_dynamotunnel4_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15266, "hatch.dynamotunnel4.tier.11", "UIV 16384A Laser Source Hatch", 5, 16384).getStackForm(1L)); + 15266, "hatch.dynamotunnel4.tier.11", "UIV 16384A Laser Source Hatch", 11, 16384).getStackForm(1L)); eM_dynamotunnel5_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15276, "hatch.dynamotunnel5.tier.11", "UIV 65536A Laser Source Hatch", 5, 65536).getStackForm(1L)); + 15276, "hatch.dynamotunnel5.tier.11", "UIV 65536A Laser Source Hatch", 11, 65536).getStackForm(1L)); eM_dynamotunnel6_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15286, "hatch.dynamotunnel6.tier.11", "UIV 262144A Laser Source Hatch", 5, 262144).getStackForm(1L)); + 15286, "hatch.dynamotunnel6.tier.11", "UIV 262144A Laser Source Hatch", 11, 262144).getStackForm(1L)); eM_dynamotunnel7_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15296, "hatch.dynamotunnel7.tier.11", "UIV 1048576A Laser Source Hatch", 5, 1048576).getStackForm(1L)); + 15296, "hatch.dynamotunnel7.tier.11", "UIV 1048576A Laser Source Hatch", 11, 1048576).getStackForm(1L)); eM_dynamotunnel1_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15237, "hatch.dynamotunnel1.tier.12", "UMV 256A Laser Source Hatch", 5, 256).getStackForm(1L)); + 15237, "hatch.dynamotunnel1.tier.12", "UMV 256A Laser Source Hatch", 12, 256).getStackForm(1L)); eM_dynamotunnel2_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15247, "hatch.dynamotunnel2.tier.12", "UMV 1024A Laser Source Hatch", 5, 1024).getStackForm(1L)); + 15247, "hatch.dynamotunnel2.tier.12", "UMV 1024A Laser Source Hatch", 12, 1024).getStackForm(1L)); eM_dynamotunnel3_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15257, "hatch.dynamotunnel3.tier.12", "UMV 4096A Laser Source Hatch", 5, 4096).getStackForm(1L)); + 15257, "hatch.dynamotunnel3.tier.12", "UMV 4096A Laser Source Hatch", 12, 4096).getStackForm(1L)); eM_dynamotunnel4_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15267, "hatch.dynamotunnel4.tier.12", "UMV 16384A Laser Source Hatch", 5, 16384).getStackForm(1L)); + 15267, "hatch.dynamotunnel4.tier.12", "UMV 16384A Laser Source Hatch", 12, 16384).getStackForm(1L)); eM_dynamotunnel5_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15277, "hatch.dynamotunnel5.tier.12", "UMV 65536A Laser Source Hatch", 5, 65536).getStackForm(1L)); + 15277, "hatch.dynamotunnel5.tier.12", "UMV 65536A Laser Source Hatch", 12, 65536).getStackForm(1L)); eM_dynamotunnel6_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15287, "hatch.dynamotunnel6.tier.12", "UMV 262144A Laser Source Hatch", 5, 262144).getStackForm(1L)); + 15287, "hatch.dynamotunnel6.tier.12", "UMV 262144A Laser Source Hatch", 12, 262144).getStackForm(1L)); eM_dynamotunnel7_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15297, "hatch.dynamotunnel7.tier.12", "UMV 1048576A Laser Source Hatch", 5, 1048576).getStackForm(1L)); + 15297, "hatch.dynamotunnel7.tier.12", "UMV 1048576A Laser Source Hatch", 12, 1048576).getStackForm(1L)); eM_dynamotunnel1_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15238, "hatch.dynamotunnel1.tier.13", "UXV 256A Laser Source Hatch", 5, 256).getStackForm(1L)); + 15238, "hatch.dynamotunnel1.tier.13", "UXV 256A Laser Source Hatch", 13, 256).getStackForm(1L)); eM_dynamotunnel2_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15248, "hatch.dynamotunnel2.tier.13", "UXV 1024A Laser Source Hatch", 5, 1024).getStackForm(1L)); + 15248, "hatch.dynamotunnel2.tier.13", "UXV 1024A Laser Source Hatch", 13, 1024).getStackForm(1L)); eM_dynamotunnel3_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15258, "hatch.dynamotunnel3.tier.13", "UXV 4096A Laser Source Hatch", 5, 4096).getStackForm(1L)); + 15258, "hatch.dynamotunnel3.tier.13", "UXV 4096A Laser Source Hatch", 13, 4096).getStackForm(1L)); eM_dynamotunnel4_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15268, "hatch.dynamotunnel4.tier.13", "UXV 16384A Laser Source Hatch", 5, 16384).getStackForm(1L)); + 15268, "hatch.dynamotunnel4.tier.13", "UXV 16384A Laser Source Hatch", 13, 16384).getStackForm(1L)); eM_dynamotunnel5_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15278, "hatch.dynamotunnel5.tier.13", "UXV 65536A Laser Source Hatch", 5, 65536).getStackForm(1L)); + 15278, "hatch.dynamotunnel5.tier.13", "UXV 65536A Laser Source Hatch", 13, 65536).getStackForm(1L)); eM_dynamotunnel6_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15288, "hatch.dynamotunnel6.tier.13", "UXV 262144A Laser Source Hatch", 5, 262144).getStackForm(1L)); + 15288, "hatch.dynamotunnel6.tier.13", "UXV 262144A Laser Source Hatch", 13, 262144).getStackForm(1L)); eM_dynamotunnel7_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15298, "hatch.dynamotunnel7.tier.13", "UXV 1048576A Laser Source Hatch", 5, 1048576).getStackForm(1L)); + 15298, "hatch.dynamotunnel7.tier.13", "UXV 1048576A Laser Source Hatch", 13, 1048576).getStackForm(1L)); // =================================================================================================== // MULTIBLOCKS @@ -567,7 +567,7 @@ public class MachineLoader implements Runnable { // =================================================================================================== EMpipe.set(new GT_MetaTileEntity_Pipe_EM(15460, "pipe.elementalmatter", "Quantum \"Tunnel\"").getStackForm(1L)); - LASERpipe.set(new GT_MetaTileEntity_Pipe_Energy(15465, "pipe.energystream", "High Power Optical Fiber Cable").getStackForm(1L)); + LASERpipe.set(new GT_MetaTileEntity_Pipe_Energy(15465, "pipe.energystream", "Laser Vacuum Pipe").getStackForm(1L)); DATApipe.set(new GT_MetaTileEntity_Pipe_Data(15470, "pipe.datastream", "Optical Fiber Cable").getStackForm(1L)); // =================================================================================================== diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java index cc297d01ea..1ba4854b62 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java @@ -30,9 +30,8 @@ public class GT_MetaTileEntity_Hatch_DynamoMulti extends GT_MetaTileEntity_Hatch } public GT_MetaTileEntity_Hatch_DynamoMulti(int aID, String aName, String aNameRegional, int aTier, int i, String description, int aAmp) { - super(aID, aName, aNameRegional, aTier, i, description); + super(aID, aName, aNameRegional, aTier, 0, description); Amperes = aAmp; - Util.setTier(aTier,this); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java index 2312f704fd..1d29cef285 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java @@ -1,6 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.Util; import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_Energy; import com.github.technus.tectech.thing.metaTileEntity.pipe.IConnectsToEnergyTunnel; import gregtech.api.interfaces.ITexture; @@ -26,6 +27,7 @@ public class GT_MetaTileEntity_Hatch_DynamoTunnel extends GT_MetaTileEntity_Hatc public GT_MetaTileEntity_Hatch_DynamoTunnel(int aID, String aName, String aNameRegional, int aTier, int aAmp) { super(aID, aName, aNameRegional, aTier, 0, "Energy extracting terminal for Multiblocks",aAmp); upkeep=Math.max(V[mTier]/Amperes,V[4]); + Util.setTier(aTier,this); } public GT_MetaTileEntity_Hatch_DynamoTunnel(String aName, int aTier, int aAmp, long aUpkeep, String aDescription, ITexture[][][] aTextures) { diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java index b6e58026e4..06bdd4faba 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java @@ -31,9 +31,8 @@ public class GT_MetaTileEntity_Hatch_EnergyMulti extends GT_MetaTileEntity_Hatch } public GT_MetaTileEntity_Hatch_EnergyMulti(int aID, String aName, String aNameRegional, int aTier, int i, String description,int aAmp) { - super(aID, aName, aNameRegional, aTier, i, description); + super(aID, aName, aNameRegional, aTier, 0, description); Amperes = aAmp; - Util.setTier(aTier,this); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java index e22c699746..b0dd51182c 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java @@ -1,6 +1,7 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.Util; import com.github.technus.tectech.thing.metaTileEntity.pipe.IConnectsToEnergyTunnel; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -23,6 +24,7 @@ public class GT_MetaTileEntity_Hatch_EnergyTunnel extends GT_MetaTileEntity_Hatc public GT_MetaTileEntity_Hatch_EnergyTunnel(int aID, String aName, String aNameRegional, int aTier, int aAmp) { super(aID, aName, aNameRegional, aTier, 0, "Energy injecting terminal for Multiblocks",aAmp); upkeep=Math.max(V[mTier]/Amperes,V[4]); + Util.setTier(aTier,this); } public GT_MetaTileEntity_Hatch_EnergyTunnel(String aName, int aTier, int aAmp, long aUpkeep, String aDescription, ITexture[][][] aTextures) { diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java index ad5aec16bd..761cef3c23 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java @@ -92,8 +92,8 @@ public class GT_MetaTileEntity_Pipe_Energy extends MetaPipeEntity implements ICo public String[] getDescription() { return new String[]{ CommonValues.TEC_MARK_EM, - "Energy tunneling device.", - EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Not a portal!!!", + "Laser tunneling device.", + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Bright Vacuum!!!", EnumChatFormatting.AQUA + "Must be painted to work", EnumChatFormatting.AQUA + "Do not cross,split or turn" }; diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_LASER.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_LASER.png new file mode 100644 index 0000000000..72e277673e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_LASER.png differ -- cgit From 05d2235f80b41297adbeac81d9b986eda1048c51 Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 8 Jun 2019 10:32:47 +0200 Subject: Rework laser logic - optimization --- .../tectech/loader/thing/MachineLoader.java | 252 ++++++++++----------- .../GT_MetaTileEntity_Hatch_DynamoTunnel.java | 82 ++----- .../GT_MetaTileEntity_Hatch_EnergyTunnel.java | 30 +-- .../GT_MetaTileEntity_Hatch_OutputElemental.java | 2 +- .../pipe/GT_MetaTileEntity_Pipe_Data.java | 4 +- .../pipe/GT_MetaTileEntity_Pipe_EM.java | 4 +- .../pipe/GT_MetaTileEntity_Pipe_Energy.java | 4 +- 7 files changed, 157 insertions(+), 221 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java index 920e14a16e..0d3ef48d8d 100644 --- a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java @@ -162,139 +162,139 @@ public class MachineLoader implements Runnable { // =================================================================================================== eM_energytunnel1_IV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15130, "hatch.energytunnel1.tier.05", "IV 256A Laser Target Hatch", 5, 256).getStackForm(1L)); + 15130, "hatch.energytunnel1.tier.05", "IV 256/t Laser Target Hatch", 5, 256).getStackForm(1L)); eM_energytunnel2_IV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15140, "hatch.energytunnel2.tier.05", "IV 1024A Laser Target Hatch", 5, 1024).getStackForm(1L)); + 15140, "hatch.energytunnel2.tier.05", "IV 1024/t Laser Target Hatch", 5, 1024).getStackForm(1L)); eM_energytunnel3_IV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15150, "hatch.energytunnel3.tier.05", "IV 4096A Laser Target Hatch", 5, 4096).getStackForm(1L)); + 15150, "hatch.energytunnel3.tier.05", "IV 4096/t Laser Target Hatch", 5, 4096).getStackForm(1L)); eM_energytunnel4_IV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15160, "hatch.energytunnel4.tier.05", "IV 16384A Laser Target Hatch", 5, 16384).getStackForm(1L)); + 15160, "hatch.energytunnel4.tier.05", "IV 16384/t Laser Target Hatch", 5, 16384).getStackForm(1L)); eM_energytunnel5_IV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15170, "hatch.energytunnel5.tier.05", "IV 65536A Laser Target Hatch", 5, 65536).getStackForm(1L)); + 15170, "hatch.energytunnel5.tier.05", "IV 65536/t Laser Target Hatch", 5, 65536).getStackForm(1L)); eM_energytunnel6_IV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15180, "hatch.energytunnel6.tier.05", "IV 262144A Laser Target Hatch", 5, 262144).getStackForm(1L)); + 15180, "hatch.energytunnel6.tier.05", "IV 262144/t Laser Target Hatch", 5, 262144).getStackForm(1L)); eM_energytunnel7_IV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15190, "hatch.energytunnel7.tier.05", "IV 1048576A Laser Target Hatch", 5, 1048576).getStackForm(1L)); + 15190, "hatch.energytunnel7.tier.05", "IV 1048576/t Laser Target Hatch", 5, 1048576).getStackForm(1L)); eM_energytunnel1_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15131, "hatch.energytunnel1.tier.06", "LuV 256A Laser Target Hatch", 6, 256).getStackForm(1L)); + 15131, "hatch.energytunnel1.tier.06", "LuV 256/t Laser Target Hatch", 6, 256).getStackForm(1L)); eM_energytunnel2_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15141, "hatch.energytunnel2.tier.06", "LuV 1024A Laser Target Hatch", 6, 1024).getStackForm(1L)); + 15141, "hatch.energytunnel2.tier.06", "LuV 1024/t Laser Target Hatch", 6, 1024).getStackForm(1L)); eM_energytunnel3_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15151, "hatch.energytunnel3.tier.06", "LuV 4096A Laser Target Hatch", 6, 4096).getStackForm(1L)); + 15151, "hatch.energytunnel3.tier.06", "LuV 4096/t Laser Target Hatch", 6, 4096).getStackForm(1L)); eM_energytunnel4_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15161, "hatch.energytunnel4.tier.06", "LuV 16384A Laser Target Hatch", 6, 16384).getStackForm(1L)); + 15161, "hatch.energytunnel4.tier.06", "LuV 16384/t Laser Target Hatch", 6, 16384).getStackForm(1L)); eM_energytunnel5_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15171, "hatch.energytunnel5.tier.06", "LuV 65536A Laser Target Hatch", 6, 65536).getStackForm(1L)); + 15171, "hatch.energytunnel5.tier.06", "LuV 65536/t Laser Target Hatch", 6, 65536).getStackForm(1L)); eM_energytunnel6_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15181, "hatch.energytunnel6.tier.06", "LuV 262144A Laser Target Hatch", 6, 262144).getStackForm(1L)); + 15181, "hatch.energytunnel6.tier.06", "LuV 262144/t Laser Target Hatch", 6, 262144).getStackForm(1L)); eM_energytunnel7_LuV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15191, "hatch.energytunnel7.tier.06", "LuV 1048576A Laser Target Hatch", 6, 1048576).getStackForm(1L)); + 15191, "hatch.energytunnel7.tier.06", "LuV 1048576/t Laser Target Hatch", 6, 1048576).getStackForm(1L)); eM_energytunnel1_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15132, "hatch.energytunnel1.tier.07", "ZPM 256A Laser Target Hatch", 7, 256).getStackForm(1L)); + 15132, "hatch.energytunnel1.tier.07", "ZPM 256/t Laser Target Hatch", 7, 256).getStackForm(1L)); eM_energytunnel2_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15142, "hatch.energytunnel2.tier.07", "ZPM 1024A Laser Target Hatch", 7, 1024).getStackForm(1L)); + 15142, "hatch.energytunnel2.tier.07", "ZPM 1024/t Laser Target Hatch", 7, 1024).getStackForm(1L)); eM_energytunnel3_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15152, "hatch.energytunnel3.tier.07", "ZPM 4096A Laser Target Hatch", 7, 4096).getStackForm(1L)); + 15152, "hatch.energytunnel3.tier.07", "ZPM 4096/t Laser Target Hatch", 7, 4096).getStackForm(1L)); eM_energytunnel4_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15162, "hatch.energytunnel4.tier.07", "ZPM 16384A Laser Target Hatch", 7, 16384).getStackForm(1L)); + 15162, "hatch.energytunnel4.tier.07", "ZPM 16384/t Laser Target Hatch", 7, 16384).getStackForm(1L)); eM_energytunnel5_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15172, "hatch.energytunnel5.tier.07", "ZPM 65536A Laser Target Hatch", 7, 65536).getStackForm(1L)); + 15172, "hatch.energytunnel5.tier.07", "ZPM 65536/t Laser Target Hatch", 7, 65536).getStackForm(1L)); eM_energytunnel6_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15182, "hatch.energytunnel6.tier.07", "ZPM 262144A Laser Target Hatch", 7, 262144).getStackForm(1L)); + 15182, "hatch.energytunnel6.tier.07", "ZPM 262144/t Laser Target Hatch", 7, 262144).getStackForm(1L)); eM_energytunnel7_ZPM.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15192, "hatch.energytunnel7.tier.07", "ZPM 1048576A Laser Target Hatch", 7, 1048576).getStackForm(1L)); + 15192, "hatch.energytunnel7.tier.07", "ZPM 1048576/t Laser Target Hatch", 7, 1048576).getStackForm(1L)); eM_energytunnel1_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15133, "hatch.energytunnel1.tier.08", "UV 256A Laser Target Hatch", 8, 256).getStackForm(1L)); + 15133, "hatch.energytunnel1.tier.08", "UV 256/t Laser Target Hatch", 8, 256).getStackForm(1L)); eM_energytunnel2_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15143, "hatch.energytunnel2.tier.08", "UV 1024A Laser Target Hatch", 8, 1024).getStackForm(1L)); + 15143, "hatch.energytunnel2.tier.08", "UV 1024/t Laser Target Hatch", 8, 1024).getStackForm(1L)); eM_energytunnel3_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15153, "hatch.energytunnel3.tier.08", "UV 4096A Laser Target Hatch", 8, 4096).getStackForm(1L)); + 15153, "hatch.energytunnel3.tier.08", "UV 4096/t Laser Target Hatch", 8, 4096).getStackForm(1L)); eM_energytunnel4_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15163, "hatch.energytunnel4.tier.08", "UV 16384A Laser Target Hatch", 8, 16384).getStackForm(1L)); + 15163, "hatch.energytunnel4.tier.08", "UV 16384/t Laser Target Hatch", 8, 16384).getStackForm(1L)); eM_energytunnel5_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15173, "hatch.energytunnel5.tier.08", "UV 65536A Laser Target Hatch", 8, 65536).getStackForm(1L)); + 15173, "hatch.energytunnel5.tier.08", "UV 65536/t Laser Target Hatch", 8, 65536).getStackForm(1L)); eM_energytunnel6_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15183, "hatch.energytunnel6.tier.08", "UV 262144A Laser Target Hatch", 8, 262144).getStackForm(1L)); + 15183, "hatch.energytunnel6.tier.08", "UV 262144/t Laser Target Hatch", 8, 262144).getStackForm(1L)); eM_energytunnel7_UV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15193, "hatch.energytunnel7.tier.08", "UV 1048576A Laser Target Hatch", 8, 1048576).getStackForm(1L)); + 15193, "hatch.energytunnel7.tier.08", "UV 1048576/t Laser Target Hatch", 8, 1048576).getStackForm(1L)); eM_energytunnel1_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15134, "hatch.energytunnel1.tier.09", "UHV 256A Laser Target Hatch", 9, 256).getStackForm(1L)); + 15134, "hatch.energytunnel1.tier.09", "UHV 256/t Laser Target Hatch", 9, 256).getStackForm(1L)); eM_energytunnel2_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15144, "hatch.energytunnel2.tier.09", "UHV 1024A Laser Target Hatch", 9, 1024).getStackForm(1L)); + 15144, "hatch.energytunnel2.tier.09", "UHV 1024/t Laser Target Hatch", 9, 1024).getStackForm(1L)); eM_energytunnel3_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15154, "hatch.energytunnel3.tier.09", "UHV 4096A Laser Target Hatch", 9, 4096).getStackForm(1L)); + 15154, "hatch.energytunnel3.tier.09", "UHV 4096/t Laser Target Hatch", 9, 4096).getStackForm(1L)); eM_energytunnel4_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15164, "hatch.energytunnel4.tier.09", "UHV 16384A Laser Target Hatch", 9, 16384).getStackForm(1L)); + 15164, "hatch.energytunnel4.tier.09", "UHV 16384/t Laser Target Hatch", 9, 16384).getStackForm(1L)); eM_energytunnel5_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15174, "hatch.energytunnel5.tier.09", "UHV 65536A Laser Target Hatch", 9, 65536).getStackForm(1L)); + 15174, "hatch.energytunnel5.tier.09", "UHV 65536/t Laser Target Hatch", 9, 65536).getStackForm(1L)); eM_energytunnel6_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15184, "hatch.energytunnel6.tier.09", "UHV 262144A Laser Target Hatch", 9, 262144).getStackForm(1L)); + 15184, "hatch.energytunnel6.tier.09", "UHV 262144/t Laser Target Hatch", 9, 262144).getStackForm(1L)); eM_energytunnel7_UHV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15194, "hatch.energytunnel7.tier.09", "UHV 1048576A Laser Target Hatch", 9, 1048576).getStackForm(1L)); + 15194, "hatch.energytunnel7.tier.09", "UHV 1048576/t Laser Target Hatch", 9, 1048576).getStackForm(1L)); eM_energytunnel1_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15135, "hatch.energytunnel1.tier.10", "UEV 256A Laser Target Hatch", 10, 256).getStackForm(1L)); + 15135, "hatch.energytunnel1.tier.10", "UEV 256/t Laser Target Hatch", 10, 256).getStackForm(1L)); eM_energytunnel2_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15145, "hatch.energytunnel2.tier.10", "UEV 1024A Laser Target Hatch", 10, 1024).getStackForm(1L)); + 15145, "hatch.energytunnel2.tier.10", "UEV 1024/t Laser Target Hatch", 10, 1024).getStackForm(1L)); eM_energytunnel3_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15155, "hatch.energytunnel3.tier.10", "UEV 4096A Laser Target Hatch", 10, 4096).getStackForm(1L)); + 15155, "hatch.energytunnel3.tier.10", "UEV 4096/t Laser Target Hatch", 10, 4096).getStackForm(1L)); eM_energytunnel4_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15165, "hatch.energytunnel4.tier.10", "UEV 16384A Laser Target Hatch", 10, 16384).getStackForm(1L)); + 15165, "hatch.energytunnel4.tier.10", "UEV 16384/t Laser Target Hatch", 10, 16384).getStackForm(1L)); eM_energytunnel5_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15175, "hatch.energytunnel5.tier.10", "UEV 65536A Laser Target Hatch", 10, 65536).getStackForm(1L)); + 15175, "hatch.energytunnel5.tier.10", "UEV 65536/t Laser Target Hatch", 10, 65536).getStackForm(1L)); eM_energytunnel6_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15185, "hatch.energytunnel6.tier.10", "UEV 262144A Laser Target Hatch", 10, 262144).getStackForm(1L)); + 15185, "hatch.energytunnel6.tier.10", "UEV 262144/t Laser Target Hatch", 10, 262144).getStackForm(1L)); eM_energytunnel7_UEV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15195, "hatch.energytunnel7.tier.10", "UEV 1048576A Laser Target Hatch", 10, 1048576).getStackForm(1L)); + 15195, "hatch.energytunnel7.tier.10", "UEV 1048576/t Laser Target Hatch", 10, 1048576).getStackForm(1L)); eM_energytunnel1_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15136, "hatch.energytunnel1.tier.11", "UIV 256A Laser Target Hatch", 11, 256).getStackForm(1L)); + 15136, "hatch.energytunnel1.tier.11", "UIV 256/t Laser Target Hatch", 11, 256).getStackForm(1L)); eM_energytunnel2_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15146, "hatch.energytunnel2.tier.11", "UIV 1024A Laser Target Hatch", 11, 1024).getStackForm(1L)); + 15146, "hatch.energytunnel2.tier.11", "UIV 1024/t Laser Target Hatch", 11, 1024).getStackForm(1L)); eM_energytunnel3_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15156, "hatch.energytunnel3.tier.11", "UIV 4096A Laser Target Hatch", 11, 4096).getStackForm(1L)); + 15156, "hatch.energytunnel3.tier.11", "UIV 4096/t Laser Target Hatch", 11, 4096).getStackForm(1L)); eM_energytunnel4_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15166, "hatch.energytunnel4.tier.11", "UIV 16384A Laser Target Hatch", 11, 16384).getStackForm(1L)); + 15166, "hatch.energytunnel4.tier.11", "UIV 16384/t Laser Target Hatch", 11, 16384).getStackForm(1L)); eM_energytunnel5_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15176, "hatch.energytunnel5.tier.11", "UIV 65536A Laser Target Hatch", 11, 65536).getStackForm(1L)); + 15176, "hatch.energytunnel5.tier.11", "UIV 65536/t Laser Target Hatch", 11, 65536).getStackForm(1L)); eM_energytunnel6_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15186, "hatch.energytunnel6.tier.11", "UIV 262144A Laser Target Hatch", 11, 262144).getStackForm(1L)); + 15186, "hatch.energytunnel6.tier.11", "UIV 262144/t Laser Target Hatch", 11, 262144).getStackForm(1L)); eM_energytunnel7_UIV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15196, "hatch.energytunnel7.tier.11", "UIV 1048576A Laser Target Hatch", 11, 1048576).getStackForm(1L)); + 15196, "hatch.energytunnel7.tier.11", "UIV 1048576/t Laser Target Hatch", 11, 1048576).getStackForm(1L)); eM_energytunnel1_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15137, "hatch.energytunnel1.tier.12", "UMV 256A Laser Target Hatch", 12, 256).getStackForm(1L)); + 15137, "hatch.energytunnel1.tier.12", "UMV 256/t Laser Target Hatch", 12, 256).getStackForm(1L)); eM_energytunnel2_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15147, "hatch.energytunnel2.tier.12", "UMV 1024A Laser Target Hatch", 12, 1024).getStackForm(1L)); + 15147, "hatch.energytunnel2.tier.12", "UMV 1024/t Laser Target Hatch", 12, 1024).getStackForm(1L)); eM_energytunnel3_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15157, "hatch.energytunnel3.tier.12", "UMV 4096A Laser Target Hatch", 12, 4096).getStackForm(1L)); + 15157, "hatch.energytunnel3.tier.12", "UMV 4096/t Laser Target Hatch", 12, 4096).getStackForm(1L)); eM_energytunnel4_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15167, "hatch.energytunnel4.tier.12", "UMV 16384A Laser Target Hatch", 12, 16384).getStackForm(1L)); + 15167, "hatch.energytunnel4.tier.12", "UMV 16384/t Laser Target Hatch", 12, 16384).getStackForm(1L)); eM_energytunnel5_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15177, "hatch.energytunnel5.tier.12", "UMV 65536A Laser Target Hatch", 12, 65536).getStackForm(1L)); + 15177, "hatch.energytunnel5.tier.12", "UMV 65536/t Laser Target Hatch", 12, 65536).getStackForm(1L)); eM_energytunnel6_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15187, "hatch.energytunnel6.tier.12", "UMV 262144A Laser Target Hatch", 12, 262144).getStackForm(1L)); + 15187, "hatch.energytunnel6.tier.12", "UMV 262144/t Laser Target Hatch", 12, 262144).getStackForm(1L)); eM_energytunnel7_UMV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15197, "hatch.energytunnel7.tier.12", "UMV 1048576A Laser Target Hatch", 12, 1048576).getStackForm(1L)); + 15197, "hatch.energytunnel7.tier.12", "UMV 1048576/t Laser Target Hatch", 12, 1048576).getStackForm(1L)); eM_energytunnel1_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15138, "hatch.energytunnel1.tier.13", "UXV 256A Laser Target Hatch", 13, 256).getStackForm(1L)); + 15138, "hatch.energytunnel1.tier.13", "UXV 256/t Laser Target Hatch", 13, 256).getStackForm(1L)); eM_energytunnel2_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15148, "hatch.energytunnel2.tier.13", "UXV 1024A Laser Target Hatch", 13, 1024).getStackForm(1L)); + 15148, "hatch.energytunnel2.tier.13", "UXV 1024/t Laser Target Hatch", 13, 1024).getStackForm(1L)); eM_energytunnel3_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15158, "hatch.energytunnel3.tier.13", "UXV 4096A Laser Target Hatch", 13, 4096).getStackForm(1L)); + 15158, "hatch.energytunnel3.tier.13", "UXV 4096/t Laser Target Hatch", 13, 4096).getStackForm(1L)); eM_energytunnel4_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15168, "hatch.energytunnel4.tier.13", "UXV 16384A Laser Target Hatch", 13, 16384).getStackForm(1L)); + 15168, "hatch.energytunnel4.tier.13", "UXV 16384/t Laser Target Hatch", 13, 16384).getStackForm(1L)); eM_energytunnel5_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15178, "hatch.energytunnel5.tier.13", "UXV 65536A Laser Target Hatch", 13, 65536).getStackForm(1L)); + 15178, "hatch.energytunnel5.tier.13", "UXV 65536/t Laser Target Hatch", 13, 65536).getStackForm(1L)); eM_energytunnel6_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15188, "hatch.energytunnel6.tier.13", "UXV 262144A Laser Target Hatch", 13, 262144).getStackForm(1L)); + 15188, "hatch.energytunnel6.tier.13", "UXV 262144/t Laser Target Hatch", 13, 262144).getStackForm(1L)); eM_energytunnel7_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15198, "hatch.energytunnel7.tier.13", "UXV 1048576A Laser Target Hatch", 13, 1048576).getStackForm(1L)); + 15198, "hatch.energytunnel7.tier.13", "UXV 1048576/t Laser Target Hatch", 13, 1048576).getStackForm(1L)); // =================================================================================================== // Multi AMP Power OUTPUTS @@ -369,139 +369,139 @@ public class MachineLoader implements Runnable { // =================================================================================================== eM_dynamotunnel1_IV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15230, "hatch.dynamotunnel1.tier.05", "IV 256A Laser Source Hatch", 5, 256).getStackForm(1L)); + 15230, "hatch.dynamotunnel1.tier.05", "IV 256/t Laser Source Hatch", 5, 256).getStackForm(1L)); eM_dynamotunnel2_IV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15240, "hatch.dynamotunnel2.tier.05", "IV 1024A Laser Source Hatch", 5, 1024).getStackForm(1L)); + 15240, "hatch.dynamotunnel2.tier.05", "IV 1024/t Laser Source Hatch", 5, 1024).getStackForm(1L)); eM_dynamotunnel3_IV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15250, "hatch.dynamotunnel3.tier.05", "IV 4096A Laser Source Hatch", 5, 4096).getStackForm(1L)); + 15250, "hatch.dynamotunnel3.tier.05", "IV 4096/t Laser Source Hatch", 5, 4096).getStackForm(1L)); eM_dynamotunnel4_IV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15260, "hatch.dynamotunnel4.tier.05", "IV 16384A Laser Source Hatch", 5, 16384).getStackForm(1L)); + 15260, "hatch.dynamotunnel4.tier.05", "IV 16384/t Laser Source Hatch", 5, 16384).getStackForm(1L)); eM_dynamotunnel5_IV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15270, "hatch.dynamotunnel5.tier.05", "IV 65536A Laser Source Hatch", 5, 65536).getStackForm(1L)); + 15270, "hatch.dynamotunnel5.tier.05", "IV 65536/t Laser Source Hatch", 5, 65536).getStackForm(1L)); eM_dynamotunnel6_IV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15280, "hatch.dynamotunnel6.tier.05", "IV 262144A Laser Source Hatch", 5, 262144).getStackForm(1L)); + 15280, "hatch.dynamotunnel6.tier.05", "IV 262144/t Laser Source Hatch", 5, 262144).getStackForm(1L)); eM_dynamotunnel7_IV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15290, "hatch.dynamotunnel7.tier.05", "IV 1048576A Laser Source Hatch", 5, 1048576).getStackForm(1L)); + 15290, "hatch.dynamotunnel7.tier.05", "IV 1048576/t Laser Source Hatch", 5, 1048576).getStackForm(1L)); eM_dynamotunnel1_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15231, "hatch.dynamotunnel1.tier.06", "LuV 256A Laser Source Hatch", 6, 256).getStackForm(1L)); + 15231, "hatch.dynamotunnel1.tier.06", "LuV 256/t Laser Source Hatch", 6, 256).getStackForm(1L)); eM_dynamotunnel2_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15241, "hatch.dynamotunnel2.tier.06", "LuV 1024A Laser Source Hatch", 6, 1024).getStackForm(1L)); + 15241, "hatch.dynamotunnel2.tier.06", "LuV 1024/t Laser Source Hatch", 6, 1024).getStackForm(1L)); eM_dynamotunnel3_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15251, "hatch.dynamotunnel3.tier.06", "LuV 4096A Laser Source Hatch", 6, 4096).getStackForm(1L)); + 15251, "hatch.dynamotunnel3.tier.06", "LuV 4096/t Laser Source Hatch", 6, 4096).getStackForm(1L)); eM_dynamotunnel4_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15261, "hatch.dynamotunnel4.tier.06", "LuV 16384A Laser Source Hatch", 6, 16384).getStackForm(1L)); + 15261, "hatch.dynamotunnel4.tier.06", "LuV 16384/t Laser Source Hatch", 6, 16384).getStackForm(1L)); eM_dynamotunnel5_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15271, "hatch.dynamotunnel5.tier.06", "LuV 65536A Laser Source Hatch", 6, 65536).getStackForm(1L)); + 15271, "hatch.dynamotunnel5.tier.06", "LuV 65536/t Laser Source Hatch", 6, 65536).getStackForm(1L)); eM_dynamotunnel6_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15281, "hatch.dynamotunnel6.tier.06", "LuV 262144A Laser Source Hatch", 6, 262144).getStackForm(1L)); + 15281, "hatch.dynamotunnel6.tier.06", "LuV 262144/t Laser Source Hatch", 6, 262144).getStackForm(1L)); eM_dynamotunnel7_LuV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15291, "hatch.dynamotunnel7.tier.06", "LuV 1048576A Laser Source Hatch", 6, 1048576).getStackForm(1L)); + 15291, "hatch.dynamotunnel7.tier.06", "LuV 1048576/t Laser Source Hatch", 6, 1048576).getStackForm(1L)); eM_dynamotunnel1_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15232, "hatch.dynamotunnel1.tier.07", "ZPM 256A Laser Source Hatch", 7, 256).getStackForm(1L)); + 15232, "hatch.dynamotunnel1.tier.07", "ZPM 256/t Laser Source Hatch", 7, 256).getStackForm(1L)); eM_dynamotunnel2_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15242, "hatch.dynamotunnel2.tier.07", "ZPM 1024A Laser Source Hatch", 7, 1024).getStackForm(1L)); + 15242, "hatch.dynamotunnel2.tier.07", "ZPM 1024/t Laser Source Hatch", 7, 1024).getStackForm(1L)); eM_dynamotunnel3_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15252, "hatch.dynamotunnel3.tier.07", "ZPM 4096A Laser Source Hatch", 7, 4096).getStackForm(1L)); + 15252, "hatch.dynamotunnel3.tier.07", "ZPM 4096/t Laser Source Hatch", 7, 4096).getStackForm(1L)); eM_dynamotunnel4_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15262, "hatch.dynamotunnel4.tier.07", "ZPM 16384A Laser Source Hatch", 7, 16384).getStackForm(1L)); + 15262, "hatch.dynamotunnel4.tier.07", "ZPM 16384/t Laser Source Hatch", 7, 16384).getStackForm(1L)); eM_dynamotunnel5_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15272, "hatch.dynamotunnel5.tier.07", "ZPM 65536A Laser Source Hatch", 7, 65536).getStackForm(1L)); + 15272, "hatch.dynamotunnel5.tier.07", "ZPM 65536/t Laser Source Hatch", 7, 65536).getStackForm(1L)); eM_dynamotunnel6_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15282, "hatch.dynamotunnel6.tier.07", "ZPM 262144A Laser Source Hatch", 7, 262144).getStackForm(1L)); + 15282, "hatch.dynamotunnel6.tier.07", "ZPM 262144/t Laser Source Hatch", 7, 262144).getStackForm(1L)); eM_dynamotunnel7_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15292, "hatch.dynamotunnel7.tier.07", "ZPM 1048576A Laser Source Hatch", 7, 1048576).getStackForm(1L)); + 15292, "hatch.dynamotunnel7.tier.07", "ZPM 1048576/t Laser Source Hatch", 7, 1048576).getStackForm(1L)); eM_dynamotunnel1_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15233, "hatch.dynamotunnel1.tier.08", "UV 256A Laser Source Hatch", 8, 256).getStackForm(1L)); + 15233, "hatch.dynamotunnel1.tier.08", "UV 256/t Laser Source Hatch", 8, 256).getStackForm(1L)); eM_dynamotunnel2_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15243, "hatch.dynamotunnel2.tier.08", "UV 1024A Laser Source Hatch", 8, 1024).getStackForm(1L)); + 15243, "hatch.dynamotunnel2.tier.08", "UV 1024/t Laser Source Hatch", 8, 1024).getStackForm(1L)); eM_dynamotunnel3_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15253, "hatch.dynamotunnel3.tier.08", "UV 4096A Laser Source Hatch", 8, 4096).getStackForm(1L)); + 15253, "hatch.dynamotunnel3.tier.08", "UV 4096/t Laser Source Hatch", 8, 4096).getStackForm(1L)); eM_dynamotunnel4_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15263, "hatch.dynamotunnel4.tier.08", "UV 16384A Laser Source Hatch", 8, 16384).getStackForm(1L)); + 15263, "hatch.dynamotunnel4.tier.08", "UV 16384/t Laser Source Hatch", 8, 16384).getStackForm(1L)); eM_dynamotunnel5_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15273, "hatch.dynamotunnel5.tier.08", "UV 65536A Laser Source Hatch", 8, 65536).getStackForm(1L)); + 15273, "hatch.dynamotunnel5.tier.08", "UV 65536/t Laser Source Hatch", 8, 65536).getStackForm(1L)); eM_dynamotunnel6_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15283, "hatch.dynamotunnel6.tier.08", "UV 262144A Laser Source Hatch", 8, 262144).getStackForm(1L)); + 15283, "hatch.dynamotunnel6.tier.08", "UV 262144/t Laser Source Hatch", 8, 262144).getStackForm(1L)); eM_dynamotunnel7_UV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15293, "hatch.dynamotunnel7.tier.08", "UV 1048576A Laser Source Hatch", 8, 1048576).getStackForm(1L)); + 15293, "hatch.dynamotunnel7.tier.08", "UV 1048576/t Laser Source Hatch", 8, 1048576).getStackForm(1L)); eM_dynamotunnel1_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15234, "hatch.dynamotunnel1.tier.09", "UHV 256A Laser Source Hatch", 9, 256).getStackForm(1L)); + 15234, "hatch.dynamotunnel1.tier.09", "UHV 256/t Laser Source Hatch", 9, 256).getStackForm(1L)); eM_dynamotunnel2_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15244, "hatch.dynamotunnel2.tier.09", "UHV 1024A Laser Source Hatch", 9, 1024).getStackForm(1L)); + 15244, "hatch.dynamotunnel2.tier.09", "UHV 1024/t Laser Source Hatch", 9, 1024).getStackForm(1L)); eM_dynamotunnel3_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15254, "hatch.dynamotunnel3.tier.09", "UHV 4096A Laser Source Hatch", 9, 4096).getStackForm(1L)); + 15254, "hatch.dynamotunnel3.tier.09", "UHV 4096/t Laser Source Hatch", 9, 4096).getStackForm(1L)); eM_dynamotunnel4_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15264, "hatch.dynamotunnel4.tier.09", "UHV 16384A Laser Source Hatch", 9, 16384).getStackForm(1L)); + 15264, "hatch.dynamotunnel4.tier.09", "UHV 16384/t Laser Source Hatch", 9, 16384).getStackForm(1L)); eM_dynamotunnel5_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15274, "hatch.dynamotunnel5.tier.09", "UHV 65536A Laser Source Hatch", 9, 65536).getStackForm(1L)); + 15274, "hatch.dynamotunnel5.tier.09", "UHV 65536/t Laser Source Hatch", 9, 65536).getStackForm(1L)); eM_dynamotunnel6_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15284, "hatch.dynamotunnel6.tier.09", "UHV 262144A Laser Source Hatch", 9, 262144).getStackForm(1L)); + 15284, "hatch.dynamotunnel6.tier.09", "UHV 262144/t Laser Source Hatch", 9, 262144).getStackForm(1L)); eM_dynamotunnel7_UHV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15294, "hatch.dynamotunnel7.tier.09", "UHV 1048576A Laser Source Hatch", 9, 1048576).getStackForm(1L)); + 15294, "hatch.dynamotunnel7.tier.09", "UHV 1048576/t Laser Source Hatch", 9, 1048576).getStackForm(1L)); eM_dynamotunnel1_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15235, "hatch.dynamotunnel1.tier.10", "UEV 256A Laser Source Hatch", 10, 256).getStackForm(1L)); + 15235, "hatch.dynamotunnel1.tier.10", "UEV 256/t Laser Source Hatch", 10, 256).getStackForm(1L)); eM_dynamotunnel2_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15245, "hatch.dynamotunnel2.tier.10", "UEV 1024A Laser Source Hatch", 10, 1024).getStackForm(1L)); + 15245, "hatch.dynamotunnel2.tier.10", "UEV 1024/t Laser Source Hatch", 10, 1024).getStackForm(1L)); eM_dynamotunnel3_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15255, "hatch.dynamotunnel3.tier.10", "UEV 4096A Laser Source Hatch", 10, 4096).getStackForm(1L)); + 15255, "hatch.dynamotunnel3.tier.10", "UEV 4096/t Laser Source Hatch", 10, 4096).getStackForm(1L)); eM_dynamotunnel4_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15265, "hatch.dynamotunnel4.tier.10", "UEV 16384A Laser Source Hatch", 10, 16384).getStackForm(1L)); + 15265, "hatch.dynamotunnel4.tier.10", "UEV 16384/t Laser Source Hatch", 10, 16384).getStackForm(1L)); eM_dynamotunnel5_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15275, "hatch.dynamotunnel5.tier.10", "UEV 65536A Laser Source Hatch", 10, 65536).getStackForm(1L)); + 15275, "hatch.dynamotunnel5.tier.10", "UEV 65536/t Laser Source Hatch", 10, 65536).getStackForm(1L)); eM_dynamotunnel6_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15285, "hatch.dynamotunnel6.tier.10", "UEV 262144A Laser Source Hatch", 10, 262144).getStackForm(1L)); + 15285, "hatch.dynamotunnel6.tier.10", "UEV 262144/t Laser Source Hatch", 10, 262144).getStackForm(1L)); eM_dynamotunnel7_UEV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15295, "hatch.dynamotunnel7.tier.10", "UEV 1048576A Laser Source Hatch", 10, 1048576).getStackForm(1L)); + 15295, "hatch.dynamotunnel7.tier.10", "UEV 1048576/t Laser Source Hatch", 10, 1048576).getStackForm(1L)); eM_dynamotunnel1_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15236, "hatch.dynamotunnel1.tier.11", "UIV 256A Laser Source Hatch", 11, 256).getStackForm(1L)); + 15236, "hatch.dynamotunnel1.tier.11", "UIV 256/t Laser Source Hatch", 11, 256).getStackForm(1L)); eM_dynamotunnel2_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15246, "hatch.dynamotunnel2.tier.11", "UIV 1024A Laser Source Hatch", 11, 1024).getStackForm(1L)); + 15246, "hatch.dynamotunnel2.tier.11", "UIV 1024/t Laser Source Hatch", 11, 1024).getStackForm(1L)); eM_dynamotunnel3_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15256, "hatch.dynamotunnel3.tier.11", "UIV 4096A Laser Source Hatch", 11, 4096).getStackForm(1L)); + 15256, "hatch.dynamotunnel3.tier.11", "UIV 4096/t Laser Source Hatch", 11, 4096).getStackForm(1L)); eM_dynamotunnel4_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15266, "hatch.dynamotunnel4.tier.11", "UIV 16384A Laser Source Hatch", 11, 16384).getStackForm(1L)); + 15266, "hatch.dynamotunnel4.tier.11", "UIV 16384/t Laser Source Hatch", 11, 16384).getStackForm(1L)); eM_dynamotunnel5_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15276, "hatch.dynamotunnel5.tier.11", "UIV 65536A Laser Source Hatch", 11, 65536).getStackForm(1L)); + 15276, "hatch.dynamotunnel5.tier.11", "UIV 65536/t Laser Source Hatch", 11, 65536).getStackForm(1L)); eM_dynamotunnel6_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15286, "hatch.dynamotunnel6.tier.11", "UIV 262144A Laser Source Hatch", 11, 262144).getStackForm(1L)); + 15286, "hatch.dynamotunnel6.tier.11", "UIV 262144/t Laser Source Hatch", 11, 262144).getStackForm(1L)); eM_dynamotunnel7_UIV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15296, "hatch.dynamotunnel7.tier.11", "UIV 1048576A Laser Source Hatch", 11, 1048576).getStackForm(1L)); + 15296, "hatch.dynamotunnel7.tier.11", "UIV 1048576/t Laser Source Hatch", 11, 1048576).getStackForm(1L)); eM_dynamotunnel1_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15237, "hatch.dynamotunnel1.tier.12", "UMV 256A Laser Source Hatch", 12, 256).getStackForm(1L)); + 15237, "hatch.dynamotunnel1.tier.12", "UMV 256/t Laser Source Hatch", 12, 256).getStackForm(1L)); eM_dynamotunnel2_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15247, "hatch.dynamotunnel2.tier.12", "UMV 1024A Laser Source Hatch", 12, 1024).getStackForm(1L)); + 15247, "hatch.dynamotunnel2.tier.12", "UMV 1024/t Laser Source Hatch", 12, 1024).getStackForm(1L)); eM_dynamotunnel3_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15257, "hatch.dynamotunnel3.tier.12", "UMV 4096A Laser Source Hatch", 12, 4096).getStackForm(1L)); + 15257, "hatch.dynamotunnel3.tier.12", "UMV 4096/t Laser Source Hatch", 12, 4096).getStackForm(1L)); eM_dynamotunnel4_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15267, "hatch.dynamotunnel4.tier.12", "UMV 16384A Laser Source Hatch", 12, 16384).getStackForm(1L)); + 15267, "hatch.dynamotunnel4.tier.12", "UMV 16384/t Laser Source Hatch", 12, 16384).getStackForm(1L)); eM_dynamotunnel5_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15277, "hatch.dynamotunnel5.tier.12", "UMV 65536A Laser Source Hatch", 12, 65536).getStackForm(1L)); + 15277, "hatch.dynamotunnel5.tier.12", "UMV 65536/t Laser Source Hatch", 12, 65536).getStackForm(1L)); eM_dynamotunnel6_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15287, "hatch.dynamotunnel6.tier.12", "UMV 262144A Laser Source Hatch", 12, 262144).getStackForm(1L)); + 15287, "hatch.dynamotunnel6.tier.12", "UMV 262144/t Laser Source Hatch", 12, 262144).getStackForm(1L)); eM_dynamotunnel7_UMV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15297, "hatch.dynamotunnel7.tier.12", "UMV 1048576A Laser Source Hatch", 12, 1048576).getStackForm(1L)); + 15297, "hatch.dynamotunnel7.tier.12", "UMV 1048576/t Laser Source Hatch", 12, 1048576).getStackForm(1L)); eM_dynamotunnel1_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15238, "hatch.dynamotunnel1.tier.13", "UXV 256A Laser Source Hatch", 13, 256).getStackForm(1L)); + 15238, "hatch.dynamotunnel1.tier.13", "UXV 256/t Laser Source Hatch", 13, 256).getStackForm(1L)); eM_dynamotunnel2_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15248, "hatch.dynamotunnel2.tier.13", "UXV 1024A Laser Source Hatch", 13, 1024).getStackForm(1L)); + 15248, "hatch.dynamotunnel2.tier.13", "UXV 1024/t Laser Source Hatch", 13, 1024).getStackForm(1L)); eM_dynamotunnel3_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15258, "hatch.dynamotunnel3.tier.13", "UXV 4096A Laser Source Hatch", 13, 4096).getStackForm(1L)); + 15258, "hatch.dynamotunnel3.tier.13", "UXV 4096/t Laser Source Hatch", 13, 4096).getStackForm(1L)); eM_dynamotunnel4_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15268, "hatch.dynamotunnel4.tier.13", "UXV 16384A Laser Source Hatch", 13, 16384).getStackForm(1L)); + 15268, "hatch.dynamotunnel4.tier.13", "UXV 16384/t Laser Source Hatch", 13, 16384).getStackForm(1L)); eM_dynamotunnel5_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15278, "hatch.dynamotunnel5.tier.13", "UXV 65536A Laser Source Hatch", 13, 65536).getStackForm(1L)); + 15278, "hatch.dynamotunnel5.tier.13", "UXV 65536/t Laser Source Hatch", 13, 65536).getStackForm(1L)); eM_dynamotunnel6_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15288, "hatch.dynamotunnel6.tier.13", "UXV 262144A Laser Source Hatch", 13, 262144).getStackForm(1L)); + 15288, "hatch.dynamotunnel6.tier.13", "UXV 262144/t Laser Source Hatch", 13, 262144).getStackForm(1L)); eM_dynamotunnel7_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15298, "hatch.dynamotunnel7.tier.13", "UXV 1048576A Laser Source Hatch", 13, 1048576).getStackForm(1L)); + 15298, "hatch.dynamotunnel7.tier.13", "UXV 1048576/t Laser Source Hatch", 13, 1048576).getStackForm(1L)); // =================================================================================================== // MULTIBLOCKS diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java index 1d29cef285..46daa46729 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java @@ -11,7 +11,7 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; import static com.github.technus.tectech.CommonValues.TRANSFER_AT; import static com.github.technus.tectech.CommonValues.V; @@ -22,7 +22,6 @@ import static com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ */ public class GT_MetaTileEntity_Hatch_DynamoTunnel extends GT_MetaTileEntity_Hatch_DynamoMulti implements IConnectsToEnergyTunnel { private final long upkeep; - private long packetsCount=0; public GT_MetaTileEntity_Hatch_DynamoTunnel(int aID, String aName, String aNameRegional, int aTier, int aAmp) { super(aID, aName, aNameRegional, aTier, 0, "Energy extracting terminal for Multiblocks",aAmp); @@ -45,18 +44,6 @@ public class GT_MetaTileEntity_Hatch_DynamoTunnel extends GT_MetaTileEntity_Hatc return new ITexture[]{aBaseTexture, OVERLAYS_ENERGY_OUT_LASER_TT[mTier]}; } - @Override - public void loadNBTData(NBTTagCompound aNBT) { - super.loadNBTData(aNBT); - packetsCount=aNBT.getLong("ePackets"); - } - - @Override - public void saveNBTData(NBTTagCompound aNBT) { - super.saveNBTData(aNBT); - aNBT.setLong("ePackets",packetsCount); - } - @Override public boolean isSimpleMachine() { return true; @@ -121,7 +108,8 @@ public class GT_MetaTileEntity_Hatch_DynamoTunnel extends GT_MetaTileEntity_Hatc public String[] getDescription() { return new String[]{ CommonValues.TEC_MARK_GENERAL, - mDescription + mDescription, + "Throughput: "+ EnumChatFormatting.YELLOW +(Amperes*maxEUOutput())+EnumChatFormatting.RESET+" EU/t" }; } @@ -130,27 +118,15 @@ public class GT_MetaTileEntity_Hatch_DynamoTunnel extends GT_MetaTileEntity_Hatc if (aBaseMetaTileEntity.isServerSide()) { byte Tick = (byte) (aTick % 20); if (TRANSFER_AT == Tick) { - if(aBaseMetaTileEntity.getStoredEU()>=maxEUOutput()) { - long diff = aBaseMetaTileEntity.getStoredEU() / maxEUOutput(); - setEUVar(aBaseMetaTileEntity.getStoredEU() - diff * maxEUOutput()); - addPackets(diff); - } - if(packetsCount>0){ - moveAround(aBaseMetaTileEntity); - } - if(packetsCount>0){ - long diff=(maxEUStore()-aBaseMetaTileEntity.getStoredEU())/maxEUOutput(); - if(diff>0) { - setEUVar(aBaseMetaTileEntity.getStoredEU() + takePackets(diff) * maxEUOutput()); - } - } if(aBaseMetaTileEntity.getStoredEU()>0){ setEUVar(aBaseMetaTileEntity.getStoredEU()-upkeep); if(aBaseMetaTileEntity.getStoredEU()<0){ setEUVar(0); } } - getBaseMetaTileEntity().setActive(packetsCount>0); + if(aBaseMetaTileEntity.getStoredEU()>getMinimumStoredEU()){ + moveAround(aBaseMetaTileEntity); + } } } } @@ -171,22 +147,26 @@ public class GT_MetaTileEntity_Hatch_DynamoTunnel extends GT_MetaTileEntity_Hatc opposite == tGTTileEntity.getFrontFacing()) { if(maxEUOutput()>((GT_MetaTileEntity_Hatch_EnergyTunnel) aMetaTileEntity).maxEUInput()){ aMetaTileEntity.doExplosion(maxEUOutput()); + setEUVar(aBaseMetaTileEntity.getStoredEU()-maxEUOutput()); + return; }else if(maxEUOutput()==((GT_MetaTileEntity_Hatch_EnergyTunnel) aMetaTileEntity).maxEUInput()) { - long ampRx = ((GT_MetaTileEntity_Hatch_EnergyTunnel) aMetaTileEntity).Amperes; - if (Amperes > ampRx) { - if (packetsCount > ampRx) { - tGTTileEntity.setToFire(); - } else { - tGTTileEntity.setOnFire(); - ((GT_MetaTileEntity_Hatch_EnergyTunnel) aMetaTileEntity).addPackets(takePackets(Amperes)); - } - } else { - ((GT_MetaTileEntity_Hatch_EnergyTunnel) aMetaTileEntity).addPackets(takePackets(Amperes)); - } + long diff=Math.min( + Amperes*20, + Math.min( + ((GT_MetaTileEntity_Hatch_EnergyTunnel) aMetaTileEntity).maxEUStore()- + aMetaTileEntity.getBaseMetaTileEntity().getStoredEU(), + maxEUStore()-aBaseMetaTileEntity.getStoredEU() + )/maxEUOutput() + )*maxEUOutput(); + + setEUVar(aBaseMetaTileEntity.getStoredEU()-diff); + + ((GT_MetaTileEntity_Hatch_EnergyTunnel) aMetaTileEntity) + .setEUVar(aMetaTileEntity.getBaseMetaTileEntity().getStoredEU()+diff); } return; } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Pipe_Energy) { - if (((GT_MetaTileEntity_Pipe_Energy) aMetaTileEntity).connectionCount > 2) { + if (((GT_MetaTileEntity_Pipe_Energy) aMetaTileEntity).connectionCount != 2) { return; }else { ((GT_MetaTileEntity_Pipe_Energy) aMetaTileEntity).markUsed(); @@ -207,22 +187,4 @@ public class GT_MetaTileEntity_Hatch_DynamoTunnel extends GT_MetaTileEntity_Hatc public boolean canConnect(byte side) { return isOutputFacing(side); } - - public void addPackets(long count){ - packetsCount+=count; - if(packetsCount>Amperes<<2){ - packetsCount=Amperes<<2; - } - } - - public long takePackets(long count){ - if(packetsCount>count){ - packetsCount-=count; - return count; - }else { - count=packetsCount; - packetsCount=0; - return count; - } - } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java index b0dd51182c..7241ba763b 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java @@ -9,6 +9,7 @@ import gregtech.api.metatileentity.MetaTileEntity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; import static com.github.technus.tectech.CommonValues.TRANSFER_AT; import static com.github.technus.tectech.CommonValues.V; @@ -19,7 +20,6 @@ import static com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ */ public class GT_MetaTileEntity_Hatch_EnergyTunnel extends GT_MetaTileEntity_Hatch_EnergyMulti implements IConnectsToEnergyTunnel { private final long upkeep; - private long packetsCount=0; public GT_MetaTileEntity_Hatch_EnergyTunnel(int aID, String aName, String aNameRegional, int aTier, int aAmp) { super(aID, aName, aNameRegional, aTier, 0, "Energy injecting terminal for Multiblocks",aAmp); @@ -45,13 +45,11 @@ public class GT_MetaTileEntity_Hatch_EnergyTunnel extends GT_MetaTileEntity_Hatc @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); - packetsCount=aNBT.getLong("ePackets"); } @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); - aNBT.setLong("ePackets",packetsCount); } @Override @@ -119,6 +117,7 @@ public class GT_MetaTileEntity_Hatch_EnergyTunnel extends GT_MetaTileEntity_Hatc return new String[]{ CommonValues.TEC_MARK_GENERAL, mDescription, + "Throughput: "+ EnumChatFormatting.YELLOW +(Amperes*maxEUInput())+EnumChatFormatting.RESET+" EU/t" }; } @@ -132,38 +131,13 @@ public class GT_MetaTileEntity_Hatch_EnergyTunnel extends GT_MetaTileEntity_Hatc if (aBaseMetaTileEntity.isServerSide()) { byte Tick = (byte) (aTick % 20); if (TRANSFER_AT == Tick) { - if(packetsCount>0){ - long diff=(maxEUStore()-aBaseMetaTileEntity.getStoredEU())/maxEUInput(); - if(diff>0) { - setEUVar(aBaseMetaTileEntity.getStoredEU() + takePackets(diff) * maxEUInput()); - } - } if(aBaseMetaTileEntity.getStoredEU()>0){ setEUVar(aBaseMetaTileEntity.getStoredEU()-upkeep); if(aBaseMetaTileEntity.getStoredEU()<0){ setEUVar(0); } } - getBaseMetaTileEntity().setActive(packetsCount>0); } } } - - public void addPackets(long count){ - packetsCount+=count; - if(packetsCount>Amperes<<2){ - packetsCount=Amperes<<2; - } - } - - public long takePackets(long count){ - if(packetsCount>count){ - packetsCount-=count; - return count; - }else { - count=packetsCount; - packetsCount=0; - return count; - } - } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java index 39889e5c3f..adfcb1d464 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java @@ -65,7 +65,7 @@ public class GT_MetaTileEntity_Hatch_OutputElemental extends GT_MetaTileEntity_H content.clear(); return; } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Pipe_EM) { - if (((GT_MetaTileEntity_Pipe_EM) aMetaTileEntity).connectionCount > 2) { + if (((GT_MetaTileEntity_Pipe_EM) aMetaTileEntity).connectionCount != 2) { return; }else { ((GT_MetaTileEntity_Pipe_EM) aMetaTileEntity).markUsed(); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java index 09f52e2611..826f75696a 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java @@ -112,12 +112,12 @@ public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements IConn if (aBaseMetaTileEntity.isServerSide()) { if ((aTick & 31) == 31) { if(activity){ - if(TecTech.RANDOM.next(15)==0) { + if(TecTech.RANDOM.nextInt(15)==0) { aBaseMetaTileEntity.setActive(true); } activity=false; }else if(aBaseMetaTileEntity.isActive()){ - if(TecTech.RANDOM.next(15)==0) { + if(TecTech.RANDOM.nextInt(15)==0) { aBaseMetaTileEntity.setActive(false); } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java index e2a17da4ac..ef17d9b688 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java @@ -113,12 +113,12 @@ public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements IConnec if (aBaseMetaTileEntity.isServerSide()) { if ((aTick & 31) == 31) { if(activity){ - if(TecTech.RANDOM.next(7)==0) { + if(TecTech.RANDOM.nextInt(7)==0) { aBaseMetaTileEntity.setActive(true); } activity=false; }else if(aBaseMetaTileEntity.isActive()){ - if(TecTech.RANDOM.next(7)==0) { + if(TecTech.RANDOM.nextInt(7)==0) { aBaseMetaTileEntity.setActive(false); } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java index 761cef3c23..3d49077c3a 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java @@ -109,12 +109,12 @@ public class GT_MetaTileEntity_Pipe_Energy extends MetaPipeEntity implements ICo if (aBaseMetaTileEntity.isServerSide()) { if ((aTick & 31) == 31) { if(activity){ - if(TecTech.RANDOM.next(31)==0) { + if(TecTech.RANDOM.nextInt(31)==0) { aBaseMetaTileEntity.setActive(true); } activity=false; }else if(aBaseMetaTileEntity.isActive()){ - if(TecTech.RANDOM.next(31)==0) { + if(TecTech.RANDOM.nextInt(31)==0) { aBaseMetaTileEntity.setActive(false); } } -- cgit From e3832c07cffa43fb564250bb90fbbcb27b18d7a5 Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 8 Jun 2019 10:37:53 +0200 Subject: Add stupid op lasers --- .../java/com/github/technus/tectech/loader/thing/MachineLoader.java | 6 ++++++ src/main/java/com/github/technus/tectech/thing/CustomItemList.java | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java index 0d3ef48d8d..1a0cf069fe 100644 --- a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java @@ -15,7 +15,9 @@ import cpw.mods.fml.common.Loader; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; +import static com.github.technus.tectech.CommonValues.V; import static com.github.technus.tectech.thing.CustomItemList.*; +import static com.github.technus.tectech.thing.CustomItemList.eM_dynamotunnel9001; /** * Created by danie_000 on 16.11.2016. @@ -295,6 +297,8 @@ public class MachineLoader implements Runnable { 15188, "hatch.energytunnel6.tier.13", "UXV 262144/t Laser Target Hatch", 13, 262144).getStackForm(1L)); eM_energytunnel7_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( 15198, "hatch.energytunnel7.tier.13", "UXV 1048576/t Laser Target Hatch", 13, 1048576).getStackForm(1L)); + eM_energytunnel9001.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( + 15198, "hatch.energytunnel.tier.14", "Legendary Laser Target Hatch", 14, (int)V[14]).getStackForm(1L)); // =================================================================================================== // Multi AMP Power OUTPUTS @@ -502,6 +506,8 @@ public class MachineLoader implements Runnable { 15288, "hatch.dynamotunnel6.tier.13", "UXV 262144/t Laser Source Hatch", 13, 262144).getStackForm(1L)); eM_dynamotunnel7_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( 15298, "hatch.dynamotunnel7.tier.13", "UXV 1048576/t Laser Source Hatch", 13, 1048576).getStackForm(1L)); + eM_dynamotunnel9001.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( + 15299, "hatch.dynamotunnel.tier.14", "Legendary Laser Source Hatch", 14, (int)V[14]).getStackForm(1L)); // =================================================================================================== // MULTIBLOCKS diff --git a/src/main/java/com/github/technus/tectech/thing/CustomItemList.java b/src/main/java/com/github/technus/tectech/thing/CustomItemList.java index 2a7674f0ab..9a50d33f2e 100644 --- a/src/main/java/com/github/technus/tectech/thing/CustomItemList.java +++ b/src/main/java/com/github/technus/tectech/thing/CustomItemList.java @@ -49,6 +49,7 @@ public enum CustomItemList implements IItemContainer { eM_dynamotunnel1_UIV,eM_dynamotunnel2_UIV,eM_dynamotunnel3_UIV,eM_dynamotunnel4_UIV,eM_dynamotunnel5_UIV,eM_dynamotunnel6_UIV,eM_dynamotunnel7_UIV, eM_dynamotunnel1_UMV,eM_dynamotunnel2_UMV,eM_dynamotunnel3_UMV,eM_dynamotunnel4_UMV,eM_dynamotunnel5_UMV,eM_dynamotunnel6_UMV,eM_dynamotunnel7_UMV, eM_dynamotunnel1_UXV,eM_dynamotunnel2_UXV,eM_dynamotunnel3_UXV,eM_dynamotunnel4_UXV,eM_dynamotunnel5_UXV,eM_dynamotunnel6_UXV,eM_dynamotunnel7_UXV, + eM_dynamotunnel9001, eM_energymulti4_IV, eM_energymulti16_IV, eM_energymulti64_IV, eM_energymulti4_LuV, eM_energymulti16_LuV, eM_energymulti64_LuV, @@ -68,7 +69,8 @@ public enum CustomItemList implements IItemContainer { eM_energytunnel1_UIV,eM_energytunnel2_UIV,eM_energytunnel3_UIV,eM_energytunnel4_UIV,eM_energytunnel5_UIV,eM_energytunnel6_UIV,eM_energytunnel7_UIV, eM_energytunnel1_UMV,eM_energytunnel2_UMV,eM_energytunnel3_UMV,eM_energytunnel4_UMV,eM_energytunnel5_UMV,eM_energytunnel6_UMV,eM_energytunnel7_UMV, eM_energytunnel1_UXV,eM_energytunnel2_UXV,eM_energytunnel3_UXV,eM_energytunnel4_UXV,eM_energytunnel5_UXV,eM_energytunnel6_UXV,eM_energytunnel7_UXV, - + eM_energytunnel9001, + eM_in_UV, eM_in_UHV, eM_in_UEV, eM_in_UIV, eM_in_UMV, eM_in_UXV, eM_out_UV, eM_out_UHV, eM_out_UEV, eM_out_UIV, eM_out_UMV, eM_out_UXV, eM_muffler_UV, eM_muffler_UHV, eM_muffler_UEV, eM_muffler_UIV, eM_muffler_UMV, eM_muffler_UXV, -- cgit From f0b34b9c8af88612299847e5facd59b33a5227cb Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 8 Jun 2019 10:38:29 +0200 Subject: Forgot to change id --- .../java/com/github/technus/tectech/loader/thing/MachineLoader.java | 2 +- src/main/java/com/github/technus/tectech/thing/CustomItemList.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java index 1a0cf069fe..3f4bab98f0 100644 --- a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java @@ -298,7 +298,7 @@ public class MachineLoader implements Runnable { eM_energytunnel7_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( 15198, "hatch.energytunnel7.tier.13", "UXV 1048576/t Laser Target Hatch", 13, 1048576).getStackForm(1L)); eM_energytunnel9001.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15198, "hatch.energytunnel.tier.14", "Legendary Laser Target Hatch", 14, (int)V[14]).getStackForm(1L)); + 15199, "hatch.energytunnel.tier.14", "Legendary Laser Target Hatch", 14, (int)V[14]).getStackForm(1L)); // =================================================================================================== // Multi AMP Power OUTPUTS diff --git a/src/main/java/com/github/technus/tectech/thing/CustomItemList.java b/src/main/java/com/github/technus/tectech/thing/CustomItemList.java index 9a50d33f2e..14f1bd1296 100644 --- a/src/main/java/com/github/technus/tectech/thing/CustomItemList.java +++ b/src/main/java/com/github/technus/tectech/thing/CustomItemList.java @@ -70,7 +70,7 @@ public enum CustomItemList implements IItemContainer { eM_energytunnel1_UMV,eM_energytunnel2_UMV,eM_energytunnel3_UMV,eM_energytunnel4_UMV,eM_energytunnel5_UMV,eM_energytunnel6_UMV,eM_energytunnel7_UMV, eM_energytunnel1_UXV,eM_energytunnel2_UXV,eM_energytunnel3_UXV,eM_energytunnel4_UXV,eM_energytunnel5_UXV,eM_energytunnel6_UXV,eM_energytunnel7_UXV, eM_energytunnel9001, - + eM_in_UV, eM_in_UHV, eM_in_UEV, eM_in_UIV, eM_in_UMV, eM_in_UXV, eM_out_UV, eM_out_UHV, eM_out_UEV, eM_out_UIV, eM_out_UMV, eM_out_UXV, eM_muffler_UV, eM_muffler_UHV, eM_muffler_UEV, eM_muffler_UIV, eM_muffler_UMV, eM_muffler_UXV, -- cgit From 419ab9e0b811dd267dc324d8e0c9735d8c62cceb Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 8 Jun 2019 11:21:17 +0200 Subject: Implement active pipes --- .../github/technus/tectech/loader/MainLoader.java | 3 +- .../multi/base/network/PipeActivityMessage.java | 134 +++++++++++++++++++++ .../base/network/PipeActivityPacketDispatcher.java | 21 ++++ .../pipe/GT_MetaTileEntity_Pipe_Data.java | 33 ++++- .../pipe/GT_MetaTileEntity_Pipe_EM.java | 33 ++++- .../pipe/GT_MetaTileEntity_Pipe_Energy.java | 33 ++++- .../thing/metaTileEntity/pipe/IActivePipe.java | 8 ++ 7 files changed, 246 insertions(+), 19 deletions(-) create mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/network/PipeActivityMessage.java create mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/network/PipeActivityPacketDispatcher.java create mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/IActivePipe.java diff --git a/src/main/java/com/github/technus/tectech/loader/MainLoader.java b/src/main/java/com/github/technus/tectech/loader/MainLoader.java index de53fb225f..3420298cfa 100644 --- a/src/main/java/com/github/technus/tectech/loader/MainLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/MainLoader.java @@ -17,6 +17,7 @@ import com.github.technus.tectech.loader.thing.ThingsLoader; import com.github.technus.tectech.thing.casing.TT_Container_Casings; import com.github.technus.tectech.thing.metaTileEntity.Textures; import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_collider; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.network.PipeActivityPacketDispatcher; import com.github.technus.tectech.thing.metaTileEntity.multi.base.network.RotationPacketDispatcher; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.ProgressManager; @@ -46,7 +47,6 @@ import static com.github.technus.tectech.compatibility.thaumcraft.elementalMatte import static com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi.EssentiaCompat.essentiaContainerCompat; import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.loader.gui.CreativeTabTecTech.creativeTabTecTech; -import static gregtech.api.enums.Dyes.*; import static gregtech.api.enums.GT_Values.W; public final class MainLoader { @@ -107,6 +107,7 @@ public final class MainLoader { progressBarLoad.step("Register Packet Dispatcher"); new RotationPacketDispatcher(); + new PipeActivityPacketDispatcher(); LOGGER.info("Packet Dispatcher registered"); progressBarLoad.step("Register GUI Handler"); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/network/PipeActivityMessage.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/network/PipeActivityMessage.java new file mode 100644 index 0000000000..35ca167d9d --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/network/PipeActivityMessage.java @@ -0,0 +1,134 @@ +package com.github.technus.tectech.thing.metaTileEntity.multi.base.network; + +import com.github.technus.tectech.thing.metaTileEntity.pipe.IActivePipe; +import cpw.mods.fml.common.network.ByteBufUtils; +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import cpw.mods.fml.common.network.simpleimpl.MessageContext; +import eu.usrv.yamcore.network.client.AbstractClientMessageHandler; +import eu.usrv.yamcore.network.server.AbstractServerMessageHandler; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import io.netty.buffer.ByteBuf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.DimensionManager; + +public class PipeActivityMessage implements IMessage { + int mPosX; + int mPosY; + int mPosZ; + int mPosD; + int mActive; + + public PipeActivityMessage() { + } + + private PipeActivityMessage(IActivePipe metaTile) { + IGregTechTileEntity base=metaTile.getBaseMetaTileEntity(); + mPosX=base.getXCoord(); + mPosY=base.getYCoord(); + mPosZ=base.getZCoord(); + mPosD=base.getWorld().provider.dimensionId; + mActive=metaTile.getActive()?1:0; + } + + private PipeActivityMessage(World world, int x, int y, int z, boolean active) { + mPosX=x; + mPosY=y; + mPosZ=z; + mPosD=world.provider.dimensionId; + mActive=active?1:0; + } + + @Override + public void fromBytes(ByteBuf pBuffer) { + NBTTagCompound tTag = ByteBufUtils.readTag(pBuffer); + mPosX = tTag.getInteger("posx"); + mPosY = tTag.getInteger("posy"); + mPosZ = tTag.getInteger("posz"); + mPosD = tTag.getInteger("posd"); + mActive = tTag.getInteger("active"); + } + + @Override + public void toBytes(ByteBuf pBuffer) { + NBTTagCompound tFXTag = new NBTTagCompound(); + tFXTag.setInteger("posx", mPosX); + tFXTag.setInteger("posy", mPosY); + tFXTag.setInteger("posz", mPosZ); + tFXTag.setInteger("posd", mPosD); + tFXTag.setInteger("active", mActive); + + ByteBufUtils.writeTag(pBuffer, tFXTag); + } + + public static class PipeActivityQuery extends PipeActivityMessage { + public PipeActivityQuery() { + } + + public PipeActivityQuery(IActivePipe metaTile) { + super(metaTile); + } + + public PipeActivityQuery(World world, int x,int y,int z, boolean active) { + super(world,x,y,z,active); + } + } + + public static class PipeActivityData extends PipeActivityMessage { + public PipeActivityData() { + } + + private PipeActivityData(PipeActivityQuery query){ + mPosX=query.mPosX; + mPosY=query.mPosY; + mPosZ=query.mPosZ; + mPosD=query.mPosD; + mActive=query.mActive; + } + + public PipeActivityData(IActivePipe metaTile) { + super(metaTile); + } + + public PipeActivityData(World world, int x,int y,int z, boolean active) { + super(world,x,y,z,active); + } + } + + public static class ClientHandler extends AbstractClientMessageHandler { + @Override + public IMessage handleClientMessage(EntityPlayer pPlayer, PipeActivityData pMessage, MessageContext pCtx) { + if(pPlayer.worldObj.provider.dimensionId==pMessage.mPosD){ + TileEntity te=pPlayer.worldObj.getTileEntity(pMessage.mPosX,pMessage.mPosY,pMessage.mPosZ); + if(te instanceof IGregTechTileEntity){ + IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity(); + if(meta instanceof IActivePipe){ + ((IActivePipe) meta).setActive((byte)pMessage.mActive==1); + } + } + } + return null; + } + } + + public static class ServerHandler extends AbstractServerMessageHandler { + @Override + public IMessage handleServerMessage(EntityPlayer pPlayer, PipeActivityQuery pMessage, MessageContext pCtx) { + World world= DimensionManager.getWorld(pMessage.mPosD); + if(world!=null) { + TileEntity te = world.getTileEntity(pMessage.mPosX, pMessage.mPosY, pMessage.mPosZ); + if (te instanceof IGregTechTileEntity) { + IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity(); + if (meta instanceof IActivePipe) { + pMessage.mActive=((IActivePipe) meta).getActive()?1:0; + return new PipeActivityData(pMessage); + } + } + } + return null; + } + } +} \ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/network/PipeActivityPacketDispatcher.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/network/PipeActivityPacketDispatcher.java new file mode 100644 index 0000000000..0cc5ab61ca --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/network/PipeActivityPacketDispatcher.java @@ -0,0 +1,21 @@ +package com.github.technus.tectech.thing.metaTileEntity.multi.base.network; + +import eu.usrv.yamcore.network.PacketDispatcher; + +import static com.github.technus.tectech.Reference.MODID; + +public class PipeActivityPacketDispatcher extends PacketDispatcher { + public static PipeActivityPacketDispatcher INSTANCE; + + public PipeActivityPacketDispatcher() { + super(MODID); + INSTANCE = this; + registerPackets(); + } + + @Override + public void registerPackets() { + registerMessage(PipeActivityMessage.ServerHandler.class, PipeActivityMessage.PipeActivityQuery.class); + registerMessage(PipeActivityMessage.ClientHandler.class, PipeActivityMessage.PipeActivityData.class); + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java index 826f75696a..6a7bbae256 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java @@ -2,6 +2,8 @@ package com.github.technus.tectech.thing.metaTileEntity.pipe; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.network.PipeActivityMessage; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.network.PipeActivityPacketDispatcher; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.GT_Mod; @@ -29,12 +31,12 @@ import static gregtech.api.enums.Dyes.MACHINE_METAL; /** * Created by Tec on 26.02.2017. */ -public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements IConnectsToDataPipe { +public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements IConnectsToDataPipe,IActivePipe { private static Textures.BlockIcons.CustomIcon EMpipe; private static Textures.BlockIcons.CustomIcon EMbar,EMbarActive; public byte connectionCount = 0; - private boolean activity; + private boolean activity,active; public GT_MetaTileEntity_Pipe_Data(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, 0); @@ -60,7 +62,7 @@ public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements IConn @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) { - return new ITexture[]{new GT_RenderedTexture(EMpipe), new GT_RenderedTexture(aBaseMetaTileEntity.isActive()?EMbarActive:EMbar, Dyes.getModulation(aColorIndex, MACHINE_METAL.getRGBA()))}; + return new ITexture[]{new GT_RenderedTexture(EMpipe), new GT_RenderedTexture(getActive()?EMbarActive:EMbar, Dyes.getModulation(aColorIndex, MACHINE_METAL.getRGBA()))}; } @Override @@ -113,12 +115,12 @@ public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements IConn if ((aTick & 31) == 31) { if(activity){ if(TecTech.RANDOM.nextInt(15)==0) { - aBaseMetaTileEntity.setActive(true); + setActive(true); } activity=false; - }else if(aBaseMetaTileEntity.isActive()){ + }else if(getActive()){ if(TecTech.RANDOM.nextInt(15)==0) { - aBaseMetaTileEntity.setActive(false); + setActive(false); } } mConnections = 0; @@ -255,4 +257,23 @@ public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements IConn public void markUsed() { this.activity = true; } + + @Override + public void setActive(boolean active) { + this.active=active; + IGregTechTileEntity base=getBaseMetaTileEntity(); + if(base.isServerSide()) { + PipeActivityPacketDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), + base.getWorld().provider.dimensionId, + base.getXCoord(), + base.getYCoord(), + base.getZCoord(), + 256); + } + } + + @Override + public boolean getActive() { + return active; + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java index ef17d9b688..c0c3396607 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java @@ -2,6 +2,8 @@ package com.github.technus.tectech.thing.metaTileEntity.pipe; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.network.PipeActivityMessage; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.network.PipeActivityPacketDispatcher; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.GT_Mod; @@ -30,12 +32,12 @@ import static gregtech.api.enums.Dyes.MACHINE_METAL; /** * Created by Tec on 26.02.2017. */ -public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements IConnectsToElementalPipe { +public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements IConnectsToElementalPipe,IActivePipe { private static Textures.BlockIcons.CustomIcon EMpipe; static Textures.BlockIcons.CustomIcon EMcandy,EMCandyActive; public byte connectionCount = 0; - private boolean activity; + private boolean activity,active; public GT_MetaTileEntity_Pipe_EM(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, 0); @@ -61,7 +63,7 @@ public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements IConnec @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) { - return new ITexture[]{new GT_RenderedTexture(EMpipe), new GT_RenderedTexture(aBaseMetaTileEntity.isActive()?EMCandyActive:EMcandy, Dyes.getModulation(aColorIndex, MACHINE_METAL.getRGBA()))}; + return new ITexture[]{new GT_RenderedTexture(EMpipe), new GT_RenderedTexture(getActive()?EMCandyActive:EMcandy, Dyes.getModulation(aColorIndex, MACHINE_METAL.getRGBA()))}; } @Override @@ -114,12 +116,12 @@ public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements IConnec if ((aTick & 31) == 31) { if(activity){ if(TecTech.RANDOM.nextInt(7)==0) { - aBaseMetaTileEntity.setActive(true); + setActive(true); } activity=false; - }else if(aBaseMetaTileEntity.isActive()){ + }else if(getActive()){ if(TecTech.RANDOM.nextInt(7)==0) { - aBaseMetaTileEntity.setActive(false); + setActive(false); } } mConnections = 0; @@ -220,4 +222,23 @@ public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements IConnec public void markUsed() { this.activity = true; } + + @Override + public void setActive(boolean active) { + this.active=active; + IGregTechTileEntity base=getBaseMetaTileEntity(); + if(base.isServerSide()) { + PipeActivityPacketDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), + base.getWorld().provider.dimensionId, + base.getXCoord(), + base.getYCoord(), + base.getZCoord(), + 256); + } + } + + @Override + public boolean getActive() { + return active; + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java index 3d49077c3a..fdbca746ef 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java @@ -2,6 +2,8 @@ package com.github.technus.tectech.thing.metaTileEntity.pipe; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.network.PipeActivityMessage; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.network.PipeActivityPacketDispatcher; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.GT_Mod; @@ -29,11 +31,11 @@ import static com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEn import static com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_EM.EMcandy; import static gregtech.api.enums.Dyes.MACHINE_METAL; -public class GT_MetaTileEntity_Pipe_Energy extends MetaPipeEntity implements IConnectsToEnergyTunnel { +public class GT_MetaTileEntity_Pipe_Energy extends MetaPipeEntity implements IConnectsToEnergyTunnel,IActivePipe { private static Textures.BlockIcons.CustomIcon EMpipe; public byte connectionCount = 0; - private boolean activity; + private boolean activity,active; public GT_MetaTileEntity_Pipe_Energy(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, 0); @@ -57,7 +59,7 @@ public class GT_MetaTileEntity_Pipe_Energy extends MetaPipeEntity implements ICo @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) { - return new ITexture[]{new GT_RenderedTexture(EMpipe), new GT_RenderedTexture(aBaseMetaTileEntity.isActive()?EMCandyActive:EMcandy, Dyes.getModulation(aColorIndex, MACHINE_METAL.getRGBA()))}; + return new ITexture[]{new GT_RenderedTexture(EMpipe), new GT_RenderedTexture(getActive()?EMCandyActive:EMcandy, Dyes.getModulation(aColorIndex, MACHINE_METAL.getRGBA()))}; } @Override @@ -110,12 +112,12 @@ public class GT_MetaTileEntity_Pipe_Energy extends MetaPipeEntity implements ICo if ((aTick & 31) == 31) { if(activity){ if(TecTech.RANDOM.nextInt(31)==0) { - aBaseMetaTileEntity.setActive(true); + setActive(true); } activity=false; - }else if(aBaseMetaTileEntity.isActive()){ + }else if(getActive()){ if(TecTech.RANDOM.nextInt(31)==0) { - aBaseMetaTileEntity.setActive(false); + setActive(false); } } mConnections = 0; @@ -161,6 +163,25 @@ public class GT_MetaTileEntity_Pipe_Energy extends MetaPipeEntity implements ICo } } + @Override + public void setActive(boolean state){ + this.active=state; + IGregTechTileEntity base=getBaseMetaTileEntity(); + if(base.isServerSide()) { + PipeActivityPacketDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), + base.getWorld().provider.dimensionId, + base.getXCoord(), + base.getYCoord(), + base.getZCoord(), + 256); + } + } + + @Override + public boolean getActive() { + return active; + } + @Override public boolean canConnect(byte side) { return true; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/IActivePipe.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/IActivePipe.java new file mode 100644 index 0000000000..d618826de7 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/IActivePipe.java @@ -0,0 +1,8 @@ +package com.github.technus.tectech.thing.metaTileEntity.pipe; + +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; + +public interface IActivePipe extends IMetaTileEntity { + void setActive(boolean active); + boolean getActive(); +} -- cgit From 5c143b9eb92bccd26d6134b028b8d81abb964b07 Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 8 Jun 2019 11:28:09 +0200 Subject: Optimize pipe data sending --- .../pipe/GT_MetaTileEntity_Pipe_Data.java | 23 ++++++++++-------- .../pipe/GT_MetaTileEntity_Pipe_EM.java | 27 +++++++++++++--------- .../pipe/GT_MetaTileEntity_Pipe_Energy.java | 27 +++++++++++++--------- 3 files changed, 46 insertions(+), 31 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java index 6a7bbae256..e888b32ef3 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java @@ -115,12 +115,22 @@ public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements IConn if ((aTick & 31) == 31) { if(activity){ if(TecTech.RANDOM.nextInt(15)==0) { - setActive(true); + PipeActivityPacketDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), + aBaseMetaTileEntity.getWorld().provider.dimensionId, + aBaseMetaTileEntity.getXCoord(), + aBaseMetaTileEntity.getYCoord(), + aBaseMetaTileEntity.getZCoord(), + 256); } activity=false; }else if(getActive()){ if(TecTech.RANDOM.nextInt(15)==0) { - setActive(false); + PipeActivityPacketDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), + aBaseMetaTileEntity.getWorld().provider.dimensionId, + aBaseMetaTileEntity.getXCoord(), + aBaseMetaTileEntity.getYCoord(), + aBaseMetaTileEntity.getZCoord(), + 256); } } mConnections = 0; @@ -262,13 +272,8 @@ public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements IConn public void setActive(boolean active) { this.active=active; IGregTechTileEntity base=getBaseMetaTileEntity(); - if(base.isServerSide()) { - PipeActivityPacketDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), - base.getWorld().provider.dimensionId, - base.getXCoord(), - base.getYCoord(), - base.getZCoord(), - 256); + if(getBaseMetaTileEntity().isClientSide()) { + base.issueTextureUpdate(); } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java index c0c3396607..d7dae937ed 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java @@ -115,13 +115,23 @@ public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements IConnec if (aBaseMetaTileEntity.isServerSide()) { if ((aTick & 31) == 31) { if(activity){ - if(TecTech.RANDOM.nextInt(7)==0) { - setActive(true); + if(TecTech.RANDOM.nextInt(15)==0) { + PipeActivityPacketDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), + aBaseMetaTileEntity.getWorld().provider.dimensionId, + aBaseMetaTileEntity.getXCoord(), + aBaseMetaTileEntity.getYCoord(), + aBaseMetaTileEntity.getZCoord(), + 256); } activity=false; }else if(getActive()){ - if(TecTech.RANDOM.nextInt(7)==0) { - setActive(false); + if(TecTech.RANDOM.nextInt(15)==0) { + PipeActivityPacketDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), + aBaseMetaTileEntity.getWorld().provider.dimensionId, + aBaseMetaTileEntity.getXCoord(), + aBaseMetaTileEntity.getYCoord(), + aBaseMetaTileEntity.getZCoord(), + 256); } } mConnections = 0; @@ -227,13 +237,8 @@ public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements IConnec public void setActive(boolean active) { this.active=active; IGregTechTileEntity base=getBaseMetaTileEntity(); - if(base.isServerSide()) { - PipeActivityPacketDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), - base.getWorld().provider.dimensionId, - base.getXCoord(), - base.getYCoord(), - base.getZCoord(), - 256); + if(getBaseMetaTileEntity().isClientSide()) { + base.issueTextureUpdate(); } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java index fdbca746ef..6d1a9529b4 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java @@ -111,13 +111,23 @@ public class GT_MetaTileEntity_Pipe_Energy extends MetaPipeEntity implements ICo if (aBaseMetaTileEntity.isServerSide()) { if ((aTick & 31) == 31) { if(activity){ - if(TecTech.RANDOM.nextInt(31)==0) { - setActive(true); + if(TecTech.RANDOM.nextInt(15)==0) { + PipeActivityPacketDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), + aBaseMetaTileEntity.getWorld().provider.dimensionId, + aBaseMetaTileEntity.getXCoord(), + aBaseMetaTileEntity.getYCoord(), + aBaseMetaTileEntity.getZCoord(), + 256); } activity=false; }else if(getActive()){ - if(TecTech.RANDOM.nextInt(31)==0) { - setActive(false); + if(TecTech.RANDOM.nextInt(15)==0) { + PipeActivityPacketDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), + aBaseMetaTileEntity.getWorld().provider.dimensionId, + aBaseMetaTileEntity.getXCoord(), + aBaseMetaTileEntity.getYCoord(), + aBaseMetaTileEntity.getZCoord(), + 256); } } mConnections = 0; @@ -167,13 +177,8 @@ public class GT_MetaTileEntity_Pipe_Energy extends MetaPipeEntity implements ICo public void setActive(boolean state){ this.active=state; IGregTechTileEntity base=getBaseMetaTileEntity(); - if(base.isServerSide()) { - PipeActivityPacketDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), - base.getWorld().provider.dimensionId, - base.getXCoord(), - base.getYCoord(), - base.getZCoord(), - 256); + if(getBaseMetaTileEntity().isClientSide()) { + base.issueTextureUpdate(); } } -- cgit From ad96b552ba8e013ca19675504de64933eaece74d Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 8 Jun 2019 11:31:54 +0200 Subject: Uptimize memory use of pipes --- .../pipe/GT_MetaTileEntity_Pipe_Data.java | 14 ++++++-------- .../pipe/GT_MetaTileEntity_Pipe_EM.java | 14 ++++++-------- .../pipe/GT_MetaTileEntity_Pipe_Energy.java | 20 +++++++++----------- .../thing/metaTileEntity/pipe/IActivePipe.java | 1 + 4 files changed, 22 insertions(+), 27 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java index e888b32ef3..5c0b459081 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java @@ -36,7 +36,7 @@ public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements IConn private static Textures.BlockIcons.CustomIcon EMbar,EMbarActive; public byte connectionCount = 0; - private boolean activity,active; + private boolean active; public GT_MetaTileEntity_Pipe_Data(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, 0); @@ -113,7 +113,7 @@ public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements IConn public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide()) { if ((aTick & 31) == 31) { - if(activity){ + if(active){ if(TecTech.RANDOM.nextInt(15)==0) { PipeActivityPacketDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), aBaseMetaTileEntity.getWorld().provider.dimensionId, @@ -122,7 +122,7 @@ public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements IConn aBaseMetaTileEntity.getZCoord(), 256); } - activity=false; + active=false; }else if(getActive()){ if(TecTech.RANDOM.nextInt(15)==0) { PipeActivityPacketDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), @@ -264,17 +264,15 @@ public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements IConn return getBaseMetaTileEntity().getColorization(); } + @Override public void markUsed() { - this.activity = true; + this.active = true; } @Override public void setActive(boolean active) { this.active=active; - IGregTechTileEntity base=getBaseMetaTileEntity(); - if(getBaseMetaTileEntity().isClientSide()) { - base.issueTextureUpdate(); - } + getBaseMetaTileEntity().issueTextureUpdate(); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java index d7dae937ed..2c2374dbac 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java @@ -37,7 +37,7 @@ public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements IConnec static Textures.BlockIcons.CustomIcon EMcandy,EMCandyActive; public byte connectionCount = 0; - private boolean activity,active; + private boolean active; public GT_MetaTileEntity_Pipe_EM(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, 0); @@ -114,7 +114,7 @@ public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements IConnec public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide()) { if ((aTick & 31) == 31) { - if(activity){ + if(active){ if(TecTech.RANDOM.nextInt(15)==0) { PipeActivityPacketDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), aBaseMetaTileEntity.getWorld().provider.dimensionId, @@ -123,7 +123,7 @@ public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements IConnec aBaseMetaTileEntity.getZCoord(), 256); } - activity=false; + active=false; }else if(getActive()){ if(TecTech.RANDOM.nextInt(15)==0) { PipeActivityPacketDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), @@ -229,17 +229,15 @@ public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements IConnec return 0.5f; } + @Override public void markUsed() { - this.activity = true; + this.active = true; } @Override public void setActive(boolean active) { this.active=active; - IGregTechTileEntity base=getBaseMetaTileEntity(); - if(getBaseMetaTileEntity().isClientSide()) { - base.issueTextureUpdate(); - } + getBaseMetaTileEntity().issueTextureUpdate(); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java index 6d1a9529b4..7f419a6f50 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java @@ -35,7 +35,7 @@ public class GT_MetaTileEntity_Pipe_Energy extends MetaPipeEntity implements ICo private static Textures.BlockIcons.CustomIcon EMpipe; public byte connectionCount = 0; - private boolean activity,active; + private boolean active; public GT_MetaTileEntity_Pipe_Energy(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, 0); @@ -110,7 +110,7 @@ public class GT_MetaTileEntity_Pipe_Energy extends MetaPipeEntity implements ICo public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide()) { if ((aTick & 31) == 31) { - if(activity){ + if(active){ if(TecTech.RANDOM.nextInt(15)==0) { PipeActivityPacketDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), aBaseMetaTileEntity.getWorld().provider.dimensionId, @@ -119,7 +119,7 @@ public class GT_MetaTileEntity_Pipe_Energy extends MetaPipeEntity implements ICo aBaseMetaTileEntity.getZCoord(), 256); } - activity=false; + active=false; }else if(getActive()){ if(TecTech.RANDOM.nextInt(15)==0) { PipeActivityPacketDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), @@ -176,10 +176,7 @@ public class GT_MetaTileEntity_Pipe_Energy extends MetaPipeEntity implements ICo @Override public void setActive(boolean state){ this.active=state; - IGregTechTileEntity base=getBaseMetaTileEntity(); - if(getBaseMetaTileEntity().isClientSide()) { - base.issueTextureUpdate(); - } + getBaseMetaTileEntity().issueTextureUpdate(); } @Override @@ -187,6 +184,11 @@ public class GT_MetaTileEntity_Pipe_Energy extends MetaPipeEntity implements ICo return active; } + @Override + public void markUsed() { + this.active = true; + } + @Override public boolean canConnect(byte side) { return true; @@ -239,8 +241,4 @@ public class GT_MetaTileEntity_Pipe_Energy extends MetaPipeEntity implements ICo } return 0.5f; } - - public void markUsed() { - this.activity = true; - } } \ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/IActivePipe.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/IActivePipe.java index d618826de7..5552992e56 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/IActivePipe.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/IActivePipe.java @@ -5,4 +5,5 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; public interface IActivePipe extends IMetaTileEntity { void setActive(boolean active); boolean getActive(); + void markUsed(); } -- cgit From 205a5286666d0111c9699675b1ef6e1ae6dd0d87 Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 8 Jun 2019 11:34:33 +0200 Subject: Change timing of pipe updates --- .../tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java | 4 ++-- .../thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java index 2c2374dbac..10054bfc4b 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java @@ -115,7 +115,7 @@ public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements IConnec if (aBaseMetaTileEntity.isServerSide()) { if ((aTick & 31) == 31) { if(active){ - if(TecTech.RANDOM.nextInt(15)==0) { + if(TecTech.RANDOM.nextInt(7)==0) { PipeActivityPacketDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), aBaseMetaTileEntity.getWorld().provider.dimensionId, aBaseMetaTileEntity.getXCoord(), @@ -125,7 +125,7 @@ public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements IConnec } active=false; }else if(getActive()){ - if(TecTech.RANDOM.nextInt(15)==0) { + if(TecTech.RANDOM.nextInt(7)==0) { PipeActivityPacketDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), aBaseMetaTileEntity.getWorld().provider.dimensionId, aBaseMetaTileEntity.getXCoord(), diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java index 7f419a6f50..65819710d6 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java @@ -111,7 +111,7 @@ public class GT_MetaTileEntity_Pipe_Energy extends MetaPipeEntity implements ICo if (aBaseMetaTileEntity.isServerSide()) { if ((aTick & 31) == 31) { if(active){ - if(TecTech.RANDOM.nextInt(15)==0) { + if(TecTech.RANDOM.nextInt(31)==0) { PipeActivityPacketDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), aBaseMetaTileEntity.getWorld().provider.dimensionId, aBaseMetaTileEntity.getXCoord(), @@ -121,7 +121,7 @@ public class GT_MetaTileEntity_Pipe_Energy extends MetaPipeEntity implements ICo } active=false; }else if(getActive()){ - if(TecTech.RANDOM.nextInt(15)==0) { + if(TecTech.RANDOM.nextInt(31)==0) { PipeActivityPacketDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), aBaseMetaTileEntity.getWorld().provider.dimensionId, aBaseMetaTileEntity.getXCoord(), -- cgit From ebb3eef61ca7bd5d9bf1250d65bf1d3769992924 Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 8 Jun 2019 11:48:49 +0200 Subject: Add persistance to pipe activity state --- .../thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java | 5 +++++ .../tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java | 5 +++++ .../thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java index 5c0b459081..adf8b1f127 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java @@ -77,10 +77,12 @@ public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements IConn @Override public void loadNBTData(NBTTagCompound nbtTagCompound) { + active=nbtTagCompound.getBoolean("eActive"); } @Override public void saveNBTData(NBTTagCompound nbtTagCompound) { + nbtTagCompound.setBoolean("eActive",active); } @Override @@ -106,6 +108,9 @@ public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements IConn @Override public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { + if(getBaseMetaTileEntity().isClientSide()){ + PipeActivityPacketDispatcher.INSTANCE.sendToServer(new PipeActivityMessage.PipeActivityQuery(this)); + } onPostTick(aBaseMetaTileEntity, 31); } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java index 10054bfc4b..151718db6c 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java @@ -78,10 +78,12 @@ public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements IConnec @Override public void loadNBTData(NBTTagCompound nbtTagCompound) { + active=nbtTagCompound.getBoolean("eActive"); } @Override public void saveNBTData(NBTTagCompound nbtTagCompound) { + nbtTagCompound.setBoolean("eActive",active); } @Override @@ -107,6 +109,9 @@ public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements IConnec @Override public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { + if(getBaseMetaTileEntity().isClientSide()){ + PipeActivityPacketDispatcher.INSTANCE.sendToServer(new PipeActivityMessage.PipeActivityQuery(this)); + } onPostTick(aBaseMetaTileEntity, 31); } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java index 65819710d6..b554e235ea 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java @@ -74,10 +74,12 @@ public class GT_MetaTileEntity_Pipe_Energy extends MetaPipeEntity implements ICo @Override public void loadNBTData(NBTTagCompound nbtTagCompound) { + active=nbtTagCompound.getBoolean("eActive"); } @Override public void saveNBTData(NBTTagCompound nbtTagCompound) { + nbtTagCompound.setBoolean("eActive",active); } @Override @@ -103,6 +105,9 @@ public class GT_MetaTileEntity_Pipe_Energy extends MetaPipeEntity implements ICo @Override public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { + if(getBaseMetaTileEntity().isClientSide()){ + PipeActivityPacketDispatcher.INSTANCE.sendToServer(new PipeActivityMessage.PipeActivityQuery(this)); + } onPostTick(aBaseMetaTileEntity, 31); } -- cgit From 5711d6064a7e5856ef53a6e272fd7d87bee44db9 Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 8 Jun 2019 11:54:21 +0200 Subject: Change upkeep to Amperes --- .../hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java | 10 +++------- .../hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java | 10 +++------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java index 46daa46729..42259edafa 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java @@ -21,17 +21,13 @@ import static com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ * Created by danie_000 on 16.12.2016. */ public class GT_MetaTileEntity_Hatch_DynamoTunnel extends GT_MetaTileEntity_Hatch_DynamoMulti implements IConnectsToEnergyTunnel { - private final long upkeep; - public GT_MetaTileEntity_Hatch_DynamoTunnel(int aID, String aName, String aNameRegional, int aTier, int aAmp) { super(aID, aName, aNameRegional, aTier, 0, "Energy extracting terminal for Multiblocks",aAmp); - upkeep=Math.max(V[mTier]/Amperes,V[4]); Util.setTier(aTier,this); } - public GT_MetaTileEntity_Hatch_DynamoTunnel(String aName, int aTier, int aAmp, long aUpkeep, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_DynamoTunnel(String aName, int aTier, int aAmp, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aAmp, aDescription, aTextures); - upkeep=aUpkeep; } @Override @@ -91,7 +87,7 @@ public class GT_MetaTileEntity_Hatch_DynamoTunnel extends GT_MetaTileEntity_Hatc @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_DynamoTunnel(mName, mTier, Amperes, upkeep, mDescription, mTextures); + return new GT_MetaTileEntity_Hatch_DynamoTunnel(mName, mTier, Amperes, mDescription, mTextures); } @Override @@ -119,7 +115,7 @@ public class GT_MetaTileEntity_Hatch_DynamoTunnel extends GT_MetaTileEntity_Hatc byte Tick = (byte) (aTick % 20); if (TRANSFER_AT == Tick) { if(aBaseMetaTileEntity.getStoredEU()>0){ - setEUVar(aBaseMetaTileEntity.getStoredEU()-upkeep); + setEUVar(aBaseMetaTileEntity.getStoredEU()-Amperes); if(aBaseMetaTileEntity.getStoredEU()<0){ setEUVar(0); } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java index 7241ba763b..e074f9dabb 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java @@ -19,17 +19,13 @@ import static com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ * Created by danie_000 on 16.12.2016. */ public class GT_MetaTileEntity_Hatch_EnergyTunnel extends GT_MetaTileEntity_Hatch_EnergyMulti implements IConnectsToEnergyTunnel { - private final long upkeep; - public GT_MetaTileEntity_Hatch_EnergyTunnel(int aID, String aName, String aNameRegional, int aTier, int aAmp) { super(aID, aName, aNameRegional, aTier, 0, "Energy injecting terminal for Multiblocks",aAmp); - upkeep=Math.max(V[mTier]/Amperes,V[4]); Util.setTier(aTier,this); } - public GT_MetaTileEntity_Hatch_EnergyTunnel(String aName, int aTier, int aAmp, long aUpkeep, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_EnergyTunnel(String aName, int aTier, int aAmp, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aAmp, aDescription, aTextures); - upkeep=aUpkeep; } @Override @@ -99,7 +95,7 @@ public class GT_MetaTileEntity_Hatch_EnergyTunnel extends GT_MetaTileEntity_Hatc @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_EnergyTunnel(mName, mTier, Amperes, upkeep, mDescription, mTextures); + return new GT_MetaTileEntity_Hatch_EnergyTunnel(mName, mTier, Amperes, mDescription, mTextures); } @Override @@ -132,7 +128,7 @@ public class GT_MetaTileEntity_Hatch_EnergyTunnel extends GT_MetaTileEntity_Hatc byte Tick = (byte) (aTick % 20); if (TRANSFER_AT == Tick) { if(aBaseMetaTileEntity.getStoredEU()>0){ - setEUVar(aBaseMetaTileEntity.getStoredEU()-upkeep); + setEUVar(aBaseMetaTileEntity.getStoredEU()-Amperes); if(aBaseMetaTileEntity.getStoredEU()<0){ setEUVar(0); } -- cgit From a4d529fdcfd3d1ca1a945874a1f7f8f07aa358e9 Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 8 Jun 2019 12:01:38 +0200 Subject: Change pipe logic --- .../metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java | 2 +- .../thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java index 42259edafa..2e1a62f46d 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java @@ -162,7 +162,7 @@ public class GT_MetaTileEntity_Hatch_DynamoTunnel extends GT_MetaTileEntity_Hatc } return; } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Pipe_Energy) { - if (((GT_MetaTileEntity_Pipe_Energy) aMetaTileEntity).connectionCount != 2) { + if (((GT_MetaTileEntity_Pipe_Energy) aMetaTileEntity).connectionCount < 2) { return; }else { ((GT_MetaTileEntity_Pipe_Energy) aMetaTileEntity).markUsed(); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java index b554e235ea..715e79ffbb 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java @@ -99,7 +99,7 @@ public class GT_MetaTileEntity_Pipe_Energy extends MetaPipeEntity implements ICo "Laser tunneling device.", EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Bright Vacuum!!!", EnumChatFormatting.AQUA + "Must be painted to work", - EnumChatFormatting.AQUA + "Do not cross,split or turn" + EnumChatFormatting.AQUA + "Do not split or turn" }; } -- cgit From e92fea4395720d186a17d7ca97882271b0fe6dd9 Mon Sep 17 00:00:00 2001 From: Спартак Date: Sat, 8 Jun 2019 13:16:13 +0300 Subject: Add recipe for Laser Vacuum Pipe (DreamCraft) --- .../tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java index b13f1b6ce1..ce5bdb0cdc 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java @@ -81,6 +81,13 @@ public class DreamCraftRecipeLoader implements Runnable { ItemList.Circuit_Quantummainframe.get(1) }, Materials.Osmium.getMolten(288), CustomItemList.EMpipe.get(1), 400, 500000); + //Laser + addAssemblerRecipeWithCleanroom(new ItemStack[]{ + CustomItemList.DATApipe.get(1), + GT_ModHandler.getIC2Item("reinforcedGlass", 1L), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Osmiridium, 2) + }, null, CustomItemList.LASERpipe.get(1), 100, 500000); + //endregoin //region casing -- cgit From 439019bc70105e80b6096b3b627fec4184442ac0 Mon Sep 17 00:00:00 2001 From: Спартак Date: Sat, 8 Jun 2019 13:24:05 +0300 Subject: Add recipe for Laser Vacuum Pipe (BloodyRecipe) --- .../github/technus/tectech/loader/recipe/BloodyRecipeLoader.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java b/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java index 7522a4928c..eece520cf3 100644 --- a/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java @@ -49,6 +49,13 @@ public class BloodyRecipeLoader implements Runnable { ItemList.Circuit_Quantummainframe.get(1) }, Materials.Osmium.getMolten(288), CustomItemList.EMpipe.get(1), 400, 491520); + //Laser + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.DATApipe.get(1), + GT_ModHandler.getIC2Item("reinforcedGlass", 1L), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Osmium, 2) + }, null, CustomItemList.LASERpipe.get(1), 100, 500000); + //endregoin -- cgit From ae0ea3b86ca6ac46a96d002078538d7cd12a7302 Mon Sep 17 00:00:00 2001 From: Спартак Date: Sat, 8 Jun 2019 15:07:54 +0300 Subject: Add recipe for Laser Hatches (DreamCraft) --- .../dreamcraft/DreamCraftRecipeLoader.java | 112 +++++++++++++++++++++ 1 file changed, 112 insertions(+) diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java index ce5bdb0cdc..18cae5010d 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java @@ -219,6 +219,118 @@ public class DreamCraftRecipeLoader implements Runnable { //GT_Values.RA.ADD_ASSEMBLER_RECIPE(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Transformer_UMV_UIV.get(1), CustomItemList.eM_energymulti4_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 4)}, Materials.Electrum.getMolten(8000), CustomItemList.eM_energymulti16_UIV.get(1), 200, 8000000); //GT_Values.RA.ADD_ASSEMBLER_RECIPE(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UMV_UIV.get(1), CustomItemList.eM_energymulti16_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 6)}, Materials.Tungsten.getMolten(8000), CustomItemList.eM_energymulti64_UIV.get(1), 400, 8000000); + //Laser Dynamo IV-UEV 256/t + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_IV.get(1), ItemList.Pump_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.TungstenSteel, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_IV.get(1), 1000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_LuV.get(1), ItemList.Pump_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.VanadiumGallium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_LuV.get(1), 1000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_ZPM.get(1), ItemList.Pump_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Naquadah, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_ZPM.get(1), 1000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_UV.get(1), ItemList.Pump_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.NaquadahAlloy, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_UV.get(1), 1000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_UHV.get(1), ItemList.Pump_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Bedrockium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_UHV.get(1), 1000, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_UEV.get(1), ItemList.Pump_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Draconium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_UEV.get(1), 1000, 8000000); + + //Laser Dynamo IV-UEV 1024/t + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_IV.get(2), ItemList.Pump_IV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_IV.get(1), 2000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_LuV.get(2), ItemList.Pump_LuV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.VanadiumGallium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_LuV.get(1), 2000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_ZPM.get(2), ItemList.Pump_ZPM.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Naquadah, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_ZPM.get(1), 2000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_UV.get(2), ItemList.Pump_UV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_UV.get(1), 2000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_UHV.get(2), ItemList.Pump_UHV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Bedrockium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_UHV.get(1), 2000, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_UEV.get(2), ItemList.Pump_UEV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Draconium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_UEV.get(1), 2000, 8000000); + + //Laser Dynamo IV-UEV 4096/t + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_IV.get(4), ItemList.Pump_IV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_IV.get(1), 4000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_LuV.get(4), ItemList.Pump_LuV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_LuV.get(1), 4000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_ZPM.get(4), ItemList.Pump_ZPM.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_ZPM.get(1), 4000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_UV.get(4), ItemList.Pump_UV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_UV.get(1), 4000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_UHV.get(4), ItemList.Pump_UHV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Bedrockium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_UHV.get(1), 4000, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_UEV.get(4), ItemList.Pump_UEV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_UEV.get(1), 4000, 8000000); + + //Laser Dynamo IV-UEV 16384/t + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_IV.get(8), ItemList.Pump_IV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_IV.get(1), 8000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_LuV.get(8), ItemList.Pump_LuV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_LuV.get(1), 8000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_ZPM.get(8), ItemList.Pump_ZPM.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_ZPM.get(1), 8000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_UV.get(8), ItemList.Pump_UV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_UV.get(1), 8000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_UHV.get(8), ItemList.Pump_UHV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Bedrockium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_UHV.get(1), 8000, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_UEV.get(8), ItemList.Pump_UEV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_UEV.get(1), 8000, 8000000); + + //Laser Dynamo IV-UEV 65536/t + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_IV.get(16), ItemList.Pump_IV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_IV.get(1), 16000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_LuV.get(16), ItemList.Pump_LuV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_LuV.get(1), 16000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_ZPM.get(16), ItemList.Pump_ZPM.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_ZPM.get(1), 16000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_UV.get(16), ItemList.Pump_UV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_UV.get(1), 16000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_UHV.get(16), ItemList.Pump_UHV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Bedrockium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_UHV.get(1), 16000, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_UEV.get(16), ItemList.Pump_UEV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_UEV.get(1), 16000, 8000000); + + //Laser Dynamo IV-UEV 262144/t + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_IV.get(32), ItemList.Pump_IV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_IV.get(1), 32000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_LuV.get(32), ItemList.Pump_LuV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_LuV.get(1), 32000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_ZPM.get(32), ItemList.Pump_ZPM.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_ZPM.get(1), 32000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_UV.get(32), ItemList.Pump_UV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_UV.get(1), 32000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_UHV.get(32), ItemList.Pump_UHV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Bedrockium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_UHV.get(1), 32000, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_UEV.get(32), ItemList.Pump_UEV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_UEV.get(1), 32000, 8000000); + + //Laser Dynamo IV-UEV 1048576/t + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_IV.get(64), ItemList.Pump_IV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_IV.get(1), 64000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_LuV.get(64), ItemList.Pump_LuV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.VanadiumGallium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_LuV.get(1), 64000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_ZPM.get(64), ItemList.Pump_ZPM.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Naquadah, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_ZPM.get(1), 64000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_UV.get(64), ItemList.Pump_UV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_UV.get(1), 64000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_UHV.get(64), ItemList.Pump_UHV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Bedrockium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_UHV.get(1), 64000, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_UEV.get(64), ItemList.Pump_UEV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Draconium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_UEV.get(1), 64000, 8000000); + + //Laser Target IV-UEV 256/t + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_IV.get(1), ItemList.Pump_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.TungstenSteel, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_IV.get(1), 1000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_LuV.get(1), ItemList.Pump_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.VanadiumGallium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_LuV.get(1), 1000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_ZPM.get(1), ItemList.Pump_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Naquadah, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_ZPM.get(1), 1000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_UV.get(1), ItemList.Pump_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.NaquadahAlloy, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_UV.get(1), 1000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_UHV.get(1), ItemList.Pump_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Bedrockium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_UHV.get(1), 1000, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_UEV.get(1), ItemList.Pump_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Draconium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_UEV.get(1), 1000, 8000000); + + //Laser Target IV-UEV 1024/t + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_IV.get(2), ItemList.Pump_IV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_IV.get(1), 2000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_LuV.get(2), ItemList.Pump_LuV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.VanadiumGallium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_LuV.get(1), 2000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_ZPM.get(2), ItemList.Pump_ZPM.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Naquadah, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_ZPM.get(1), 2000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_UV.get(2), ItemList.Pump_UV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_UV.get(1), 2000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_UHV.get(2), ItemList.Pump_UHV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Bedrockium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_UHV.get(1), 2000, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_UEV.get(2), ItemList.Pump_UEV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Draconium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_UEV.get(1), 2000, 8000000); + + //Laser Target IV-UEV 4096/t + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_IV.get(4), ItemList.Pump_IV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_IV.get(1), 4000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_LuV.get(4), ItemList.Pump_LuV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_LuV.get(1), 4000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_ZPM.get(4), ItemList.Pump_ZPM.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_ZPM.get(1), 4000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_UV.get(4), ItemList.Pump_UV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_UV.get(1), 4000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_UHV.get(4), ItemList.Pump_UHV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Bedrockium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_UHV.get(1), 4000, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_UEV.get(4), ItemList.Pump_UEV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_UEV.get(1), 4000, 8000000); + + //Laser Target IV-UEV 16384/t + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_IV.get(8), ItemList.Pump_IV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_IV.get(1), 8000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_LuV.get(8), ItemList.Pump_LuV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_LuV.get(1), 8000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_ZPM.get(8), ItemList.Pump_ZPM.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_ZPM.get(1), 8000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_UV.get(8), ItemList.Pump_UV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_UV.get(1), 8000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_UHV.get(8), ItemList.Pump_UHV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Bedrockium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_UHV.get(1), 8000, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_UEV.get(8), ItemList.Pump_UEV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_UEV.get(1), 8000, 8000000); + + //Laser Target IV-UEV 65536/t + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_IV.get(16), ItemList.Pump_IV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_IV.get(1), 16000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_LuV.get(16), ItemList.Pump_LuV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_LuV.get(1), 16000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_ZPM.get(16), ItemList.Pump_ZPM.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_ZPM.get(1), 16000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_UV.get(16), ItemList.Pump_UV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_UV.get(1), 16000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_UHV.get(16), ItemList.Pump_UHV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Bedrockium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_UHV.get(1), 16000, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_UEV.get(16), ItemList.Pump_UEV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_UEV.get(1), 16000, 8000000); + + //Laser Target IV-UEV 262144/t + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_IV.get(32), ItemList.Pump_IV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_IV.get(1), 32000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_LuV.get(32), ItemList.Pump_LuV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_LuV.get(1), 32000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_ZPM.get(32), ItemList.Pump_ZPM.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_ZPM.get(1), 32000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_UV.get(32), ItemList.Pump_UV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_UV.get(1), 32000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_UHV.get(32), ItemList.Pump_UHV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Bedrockium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_UHV.get(1), 32000, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_UEV.get(32), ItemList.Pump_UEV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_UEV.get(1), 32000, 8000000); + + //Laser Target IV-UEV 1048576/t + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_IV.get(64), ItemList.Pump_IV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_IV.get(1), 64000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_LuV.get(64), ItemList.Pump_LuV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.VanadiumGallium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_LuV.get(1), 64000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_ZPM.get(64), ItemList.Pump_ZPM.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Naquadah, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_ZPM.get(1), 64000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_UV.get(64), ItemList.Pump_UV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_UV.get(1), 64000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_UHV.get(64), ItemList.Pump_UHV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Bedrockium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_UHV.get(1), 64000, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_UEV.get(64), ItemList.Pump_UEV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Draconium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_UEV.get(1), 64000, 8000000); + //Data Input addAssemblerRecipeWithCleanroom(new ItemStack[]{ CustomItemList.eM_Computer_Casing.get(1), -- cgit From c43d1631c20870d8a8d0754d494c5ce8789c72f2 Mon Sep 17 00:00:00 2001 From: Спартак Date: Sat, 8 Jun 2019 15:10:37 +0300 Subject: Add recipe for Laser Hatches (BloodyRecipe) --- .../tectech/loader/recipe/BloodyRecipeLoader.java | 84 ++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java b/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java index eece520cf3..98b2345804 100644 --- a/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java @@ -372,6 +372,90 @@ public class BloodyRecipeLoader implements Runnable { Materials.Tungsten.getMolten(4608), CustomItemList.eM_energymulti64_UEV.get(1), 400, 2000000); + //Laser Dynamo IV-UV 256/t + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_IV.get(1), ItemList.Pump_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.TungstenSteel, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_IV.get(1), 1000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_LuV.get(1), ItemList.Pump_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.VanadiumGallium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_LuV.get(1), 1000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_ZPM.get(1), ItemList.Pump_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Naquadah, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_ZPM.get(1), 1000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_UV.get(1), ItemList.Pump_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.NaquadahAlloy, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_UV.get(1), 1000, 500000); + + //Laser Dynamo IV-UV 1024/t + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_IV.get(2), ItemList.Pump_IV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_IV.get(1), 2000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_LuV.get(2), ItemList.Pump_LuV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.VanadiumGallium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_LuV.get(1), 2000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_ZPM.get(2), ItemList.Pump_ZPM.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Naquadah, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_ZPM.get(1), 2000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_UV.get(2), ItemList.Pump_UV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_UV.get(1), 2000, 500000); + + //Laser Dynamo IV-UV 4096/t + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_IV.get(4), ItemList.Pump_IV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_IV.get(1), 4000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_LuV.get(4), ItemList.Pump_LuV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_LuV.get(1), 4000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_ZPM.get(4), ItemList.Pump_ZPM.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_ZPM.get(1), 4000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_UV.get(4), ItemList.Pump_UV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_UV.get(1), 4000, 500000); + + //Laser Dynamo IV-UV 16384/t + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_IV.get(8), ItemList.Pump_IV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_IV.get(1), 8000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_LuV.get(8), ItemList.Pump_LuV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_LuV.get(1), 8000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_ZPM.get(8), ItemList.Pump_ZPM.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_ZPM.get(1), 8000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_UV.get(8), ItemList.Pump_UV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_UV.get(1), 8000, 500000); + + //Laser Dynamo IV-UV 65536/t + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_IV.get(16), ItemList.Pump_IV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_IV.get(1), 16000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_LuV.get(16), ItemList.Pump_LuV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_LuV.get(1), 16000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_ZPM.get(16), ItemList.Pump_ZPM.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_ZPM.get(1), 16000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_UV.get(16), ItemList.Pump_UV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_UV.get(1), 16000, 500000); + + //Laser Dynamo IV-UV 262144/t + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_IV.get(32), ItemList.Pump_IV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_IV.get(1), 32000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_LuV.get(32), ItemList.Pump_LuV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_LuV.get(1), 32000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_ZPM.get(32), ItemList.Pump_ZPM.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_ZPM.get(1), 32000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_UV.get(32), ItemList.Pump_UV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_UV.get(1), 32000, 500000); + + //Laser Dynamo IV-UV 1048576/t + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_IV.get(64), ItemList.Pump_IV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_IV.get(1), 64000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_LuV.get(64), ItemList.Pump_LuV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.VanadiumGallium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_LuV.get(1), 64000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_ZPM.get(64), ItemList.Pump_ZPM.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Naquadah, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_ZPM.get(1), 64000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_UV.get(64), ItemList.Pump_UV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_UV.get(1), 64000, 500000); + + //Laser Target IV-UV 256/t + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_IV.get(1), ItemList.Pump_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.TungstenSteel, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_IV.get(1), 1000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_LuV.get(1), ItemList.Pump_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.VanadiumGallium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_LuV.get(1), 1000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_ZPM.get(1), ItemList.Pump_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Naquadah, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_ZPM.get(1), 1000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_UV.get(1), ItemList.Pump_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.NaquadahAlloy, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_UV.get(1), 1000, 500000); + + //Laser Target IV-UV 1024/t + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_IV.get(2), ItemList.Pump_IV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_IV.get(1), 2000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_LuV.get(2), ItemList.Pump_LuV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.VanadiumGallium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_LuV.get(1), 2000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_ZPM.get(2), ItemList.Pump_ZPM.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Naquadah, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_ZPM.get(1), 2000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_UV.get(2), ItemList.Pump_UV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_UV.get(1), 2000, 500000); + + //Laser Target IV-UV 4096/t + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_IV.get(4), ItemList.Pump_IV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_IV.get(1), 4000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_LuV.get(4), ItemList.Pump_LuV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_LuV.get(1), 4000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_ZPM.get(4), ItemList.Pump_ZPM.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_ZPM.get(1), 4000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_UV.get(4), ItemList.Pump_UV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_UV.get(1), 4000, 500000); + + //Laser Target IV-UV 16384/t + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_IV.get(8), ItemList.Pump_IV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_IV.get(1), 8000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_LuV.get(8), ItemList.Pump_LuV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_LuV.get(1), 8000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_ZPM.get(8), ItemList.Pump_ZPM.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_ZPM.get(1), 8000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_UV.get(8), ItemList.Pump_UV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_UV.get(1), 8000, 500000); + + //Laser Target IV-UV 65536/t + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_IV.get(16), ItemList.Pump_IV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_IV.get(1), 16000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_LuV.get(16), ItemList.Pump_LuV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_LuV.get(1), 16000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_ZPM.get(16), ItemList.Pump_ZPM.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_ZPM.get(1), 16000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_UV.get(16), ItemList.Pump_UV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_UV.get(1), 16000, 500000); + + //Laser Target IV-UV 262144/t + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_IV.get(32), ItemList.Pump_IV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_IV.get(1), 32000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_LuV.get(32), ItemList.Pump_LuV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_LuV.get(1), 32000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_ZPM.get(32), ItemList.Pump_ZPM.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_ZPM.get(1), 32000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_UV.get(32), ItemList.Pump_UV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_UV.get(1), 32000, 500000); + + //Laser Target IV-UV 1048576/t + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_IV.get(64), ItemList.Pump_IV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_IV.get(1), 64000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_LuV.get(64), ItemList.Pump_LuV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.VanadiumGallium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_LuV.get(1), 64000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_ZPM.get(64), ItemList.Pump_ZPM.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Naquadah, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_ZPM.get(1), 64000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_UV.get(64), ItemList.Pump_UV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_UV.get(1), 64000, 500000); + //Data Input GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ CustomItemList.eM_Computer_Casing.get(1), -- cgit From 5ad25c3250f5ef5cd7f33d571822ccda53a3295d Mon Sep 17 00:00:00 2001 From: Спартак Date: Sat, 8 Jun 2019 16:33:32 +0300 Subject: Add GT_Utility (DreamCraft) --- .../technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java index 18cae5010d..b5d12efd3f 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java @@ -14,6 +14,7 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.IItemContainer; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidRegistry; -- cgit From 06ae2f661965945a5c1aceb6838357f0176677ff Mon Sep 17 00:00:00 2001 From: Спартак Date: Sat, 8 Jun 2019 16:34:37 +0300 Subject: Add GT_Utility (BloodyRecipe) --- .../com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java b/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java index 98b2345804..566ac3de9e 100644 --- a/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java @@ -12,6 +12,7 @@ import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidRegistry; -- cgit From 4d28a03db4b06adfe2430630c7f6c1e25e8f10f0 Mon Sep 17 00:00:00 2001 From: Спартак Date: Sat, 8 Jun 2019 16:47:55 +0300 Subject: Fix Laser Hatch recipes (DreamCraft) --- .../dreamcraft/DreamCraftRecipeLoader.java | 168 ++++++++++----------- 1 file changed, 84 insertions(+), 84 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java index b5d12efd3f..773225380a 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java @@ -221,116 +221,116 @@ public class DreamCraftRecipeLoader implements Runnable { //GT_Values.RA.ADD_ASSEMBLER_RECIPE(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UMV_UIV.get(1), CustomItemList.eM_energymulti16_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 6)}, Materials.Tungsten.getMolten(8000), CustomItemList.eM_energymulti64_UIV.get(1), 400, 8000000); //Laser Dynamo IV-UEV 256/t - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_IV.get(1), ItemList.Pump_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.TungstenSteel, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_IV.get(1), 1000, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_LuV.get(1), ItemList.Pump_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.VanadiumGallium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_LuV.get(1), 1000, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_ZPM.get(1), ItemList.Pump_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Naquadah, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_ZPM.get(1), 1000, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_UV.get(1), ItemList.Pump_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.NaquadahAlloy, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_UV.get(1), 1000, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_UHV.get(1), ItemList.Pump_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Bedrockium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_UHV.get(1), 1000, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_UEV.get(1), ItemList.Pump_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Draconium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_UEV.get(1), 1000, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_IV.get(1), ItemList.Electric_Pump_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.TungstenSteel, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_IV.get(1), 1000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_LuV.get(1), ItemList.Electric_Pump_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.VanadiumGallium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_LuV.get(1), 1000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_ZPM.get(1), ItemList.Electric_Pump_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Naquadah, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_ZPM.get(1), 1000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_UV.get(1), ItemList.Electric_Pump_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.NaquadahAlloy, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_UV.get(1), 1000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_UHV.get(1), ItemList.Electric_Pump_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Bedrockium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_UHV.get(1), 1000, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_UEV.get(1), ItemList.Electric_Pump_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Draconium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_UEV.get(1), 1000, 8000000); //Laser Dynamo IV-UEV 1024/t - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_IV.get(2), ItemList.Pump_IV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_IV.get(1), 2000, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_LuV.get(2), ItemList.Pump_LuV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.VanadiumGallium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_LuV.get(1), 2000, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_ZPM.get(2), ItemList.Pump_ZPM.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Naquadah, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_ZPM.get(1), 2000, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_UV.get(2), ItemList.Pump_UV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_UV.get(1), 2000, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_UHV.get(2), ItemList.Pump_UHV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Bedrockium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_UHV.get(1), 2000, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_UEV.get(2), ItemList.Pump_UEV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Draconium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_UEV.get(1), 2000, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_IV.get(2), ItemList.Electric_Pump_IV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_IV.get(1), 2000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_LuV.get(2), ItemList.Electric_Pump_LuV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.VanadiumGallium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_LuV.get(1), 2000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_ZPM.get(2), ItemList.Electric_Pump_ZPM.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Naquadah, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_ZPM.get(1), 2000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_UV.get(2), ItemList.Electric_Pump_UV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_UV.get(1), 2000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_UHV.get(2), ItemList.Electric_Pump_UHV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Bedrockium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_UHV.get(1), 2000, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_UEV.get(2), ItemList.Electric_Pump_UEV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Draconium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_UEV.get(1), 2000, 8000000); //Laser Dynamo IV-UEV 4096/t - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_IV.get(4), ItemList.Pump_IV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_IV.get(1), 4000, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_LuV.get(4), ItemList.Pump_LuV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_LuV.get(1), 4000, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_ZPM.get(4), ItemList.Pump_ZPM.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_ZPM.get(1), 4000, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_UV.get(4), ItemList.Pump_UV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_UV.get(1), 4000, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_UHV.get(4), ItemList.Pump_UHV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Bedrockium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_UHV.get(1), 4000, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_UEV.get(4), ItemList.Pump_UEV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_UEV.get(1), 4000, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_IV.get(4), ItemList.Electric_Pump_IV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_IV.get(1), 4000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_LuV.get(4), ItemList.Electric_Pump_LuV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_LuV.get(1), 4000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_ZPM.get(4), ItemList.Electric_Pump_ZPM.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_ZPM.get(1), 4000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_UV.get(4), ItemList.Electric_Pump_UV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_UV.get(1), 4000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_UHV.get(4), ItemList.Electric_Pump_UHV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Bedrockium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_UHV.get(1), 4000, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_UEV.get(4), ItemList.Electric_Pump_UEV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_UEV.get(1), 4000, 8000000); //Laser Dynamo IV-UEV 16384/t - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_IV.get(8), ItemList.Pump_IV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_IV.get(1), 8000, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_LuV.get(8), ItemList.Pump_LuV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_LuV.get(1), 8000, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_ZPM.get(8), ItemList.Pump_ZPM.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_ZPM.get(1), 8000, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_UV.get(8), ItemList.Pump_UV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_UV.get(1), 8000, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_UHV.get(8), ItemList.Pump_UHV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Bedrockium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_UHV.get(1), 8000, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_UEV.get(8), ItemList.Pump_UEV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_UEV.get(1), 8000, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_IV.get(8), ItemList.Electric_Pump_IV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_IV.get(1), 8000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_LuV.get(8), ItemList.Electric_Pump_LuV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_LuV.get(1), 8000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_ZPM.get(8), ItemList.Electric_Pump_ZPM.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_ZPM.get(1), 8000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_UV.get(8), ItemList.Electric_Pump_UV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_UV.get(1), 8000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_UHV.get(8), ItemList.Electric_Pump_UHV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Bedrockium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_UHV.get(1), 8000, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_UEV.get(8), ItemList.Electric_Pump_UEV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_UEV.get(1), 8000, 8000000); //Laser Dynamo IV-UEV 65536/t - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_IV.get(16), ItemList.Pump_IV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_IV.get(1), 16000, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_LuV.get(16), ItemList.Pump_LuV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_LuV.get(1), 16000, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_ZPM.get(16), ItemList.Pump_ZPM.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_ZPM.get(1), 16000, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_UV.get(16), ItemList.Pump_UV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_UV.get(1), 16000, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_UHV.get(16), ItemList.Pump_UHV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Bedrockium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_UHV.get(1), 16000, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_UEV.get(16), ItemList.Pump_UEV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_UEV.get(1), 16000, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_IV.get(16), ItemList.Electric_Pump_IV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_IV.get(1), 16000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_LuV.get(16), ItemList.Electric_Pump_LuV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_LuV.get(1), 16000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_ZPM.get(16), ItemList.Electric_Pump_ZPM.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_ZPM.get(1), 16000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_UV.get(16), ItemList.Electric_Pump_UV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_UV.get(1), 16000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_UHV.get(16), ItemList.Electric_Pump_UHV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Bedrockium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_UHV.get(1), 16000, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_UEV.get(16), ItemList.Electric_Pump_UEV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_UEV.get(1), 16000, 8000000); //Laser Dynamo IV-UEV 262144/t - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_IV.get(32), ItemList.Pump_IV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_IV.get(1), 32000, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_LuV.get(32), ItemList.Pump_LuV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_LuV.get(1), 32000, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_ZPM.get(32), ItemList.Pump_ZPM.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_ZPM.get(1), 32000, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_UV.get(32), ItemList.Pump_UV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_UV.get(1), 32000, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_UHV.get(32), ItemList.Pump_UHV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Bedrockium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_UHV.get(1), 32000, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_UEV.get(32), ItemList.Pump_UEV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_UEV.get(1), 32000, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_IV.get(32), ItemList.Electric_Pump_IV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_IV.get(1), 32000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_LuV.get(32), ItemList.Electric_Pump_LuV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_LuV.get(1), 32000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_ZPM.get(32), ItemList.Electric_Pump_ZPM.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_ZPM.get(1), 32000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_UV.get(32), ItemList.Electric_Pump_UV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_UV.get(1), 32000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_UHV.get(32), ItemList.Electric_Pump_UHV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Bedrockium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_UHV.get(1), 32000, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_UEV.get(32), ItemList.Electric_Pump_UEV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_UEV.get(1), 32000, 8000000); //Laser Dynamo IV-UEV 1048576/t - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_IV.get(64), ItemList.Pump_IV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_IV.get(1), 64000, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_LuV.get(64), ItemList.Pump_LuV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.VanadiumGallium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_LuV.get(1), 64000, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_ZPM.get(64), ItemList.Pump_ZPM.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Naquadah, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_ZPM.get(1), 64000, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_UV.get(64), ItemList.Pump_UV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_UV.get(1), 64000, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_UHV.get(64), ItemList.Pump_UHV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Bedrockium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_UHV.get(1), 64000, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_UEV.get(64), ItemList.Pump_UEV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Draconium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_UEV.get(1), 64000, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_IV.get(64), ItemList.Electric_Pump_IV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_IV.get(1), 64000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_LuV.get(64), ItemList.Electric_Pump_LuV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.VanadiumGallium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_LuV.get(1), 64000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_ZPM.get(64), ItemList.Electric_Pump_ZPM.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Naquadah, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_ZPM.get(1), 64000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_UV.get(64), ItemList.Electric_Pump_UV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_UV.get(1), 64000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_UHV.get(64), ItemList.Electric_Pump_UHV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Bedrockium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_UHV.get(1), 64000, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_UEV.get(64), ItemList.Electric_Pump_UEV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Draconium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_UEV.get(1), 64000, 8000000); //Laser Target IV-UEV 256/t - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_IV.get(1), ItemList.Pump_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.TungstenSteel, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_IV.get(1), 1000, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_LuV.get(1), ItemList.Pump_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.VanadiumGallium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_LuV.get(1), 1000, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_ZPM.get(1), ItemList.Pump_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Naquadah, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_ZPM.get(1), 1000, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_UV.get(1), ItemList.Pump_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.NaquadahAlloy, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_UV.get(1), 1000, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_UHV.get(1), ItemList.Pump_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Bedrockium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_UHV.get(1), 1000, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_UEV.get(1), ItemList.Pump_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Draconium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_UEV.get(1), 1000, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_IV.get(1), ItemList.Electric_Pump_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.TungstenSteel, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_IV.get(1), 1000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_LuV.get(1), ItemList.Electric_Pump_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.VanadiumGallium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_LuV.get(1), 1000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_ZPM.get(1), ItemList.Electric_Pump_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Naquadah, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_ZPM.get(1), 1000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_UV.get(1), ItemList.Electric_Pump_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.NaquadahAlloy, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_UV.get(1), 1000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_UHV.get(1), ItemList.Electric_Pump_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Bedrockium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_UHV.get(1), 1000, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_UEV.get(1), ItemList.Electric_Electric_Pump_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Draconium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_UEV.get(1), 1000, 8000000); //Laser Target IV-UEV 1024/t - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_IV.get(2), ItemList.Pump_IV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_IV.get(1), 2000, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_LuV.get(2), ItemList.Pump_LuV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.VanadiumGallium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_LuV.get(1), 2000, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_ZPM.get(2), ItemList.Pump_ZPM.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Naquadah, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_ZPM.get(1), 2000, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_UV.get(2), ItemList.Pump_UV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_UV.get(1), 2000, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_UHV.get(2), ItemList.Pump_UHV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Bedrockium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_UHV.get(1), 2000, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_UEV.get(2), ItemList.Pump_UEV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Draconium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_UEV.get(1), 2000, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_IV.get(2), ItemList.Electric_Pump_IV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_IV.get(1), 2000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_LuV.get(2), ItemList.Electric_Pump_LuV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.VanadiumGallium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_LuV.get(1), 2000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_ZPM.get(2), ItemList.Electric_Pump_ZPM.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Naquadah, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_ZPM.get(1), 2000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_UV.get(2), ItemList.Electric_Pump_UV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_UV.get(1), 2000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_UHV.get(2), ItemList.Electric_Pump_UHV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Bedrockium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_UHV.get(1), 2000, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_UEV.get(2), ItemList.Electric_Pump_UEV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Draconium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_UEV.get(1), 2000, 8000000); //Laser Target IV-UEV 4096/t - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_IV.get(4), ItemList.Pump_IV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_IV.get(1), 4000, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_LuV.get(4), ItemList.Pump_LuV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_LuV.get(1), 4000, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_ZPM.get(4), ItemList.Pump_ZPM.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_ZPM.get(1), 4000, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_UV.get(4), ItemList.Pump_UV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_UV.get(1), 4000, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_UHV.get(4), ItemList.Pump_UHV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Bedrockium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_UHV.get(1), 4000, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_UEV.get(4), ItemList.Pump_UEV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_UEV.get(1), 4000, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_IV.get(4), ItemList.Electric_Pump_IV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_IV.get(1), 4000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_LuV.get(4), ItemList.Electric_Pump_LuV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_LuV.get(1), 4000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_ZPM.get(4), ItemList.Electric_Pump_ZPM.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_ZPM.get(1), 4000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_UV.get(4), ItemList.Electric_Pump_UV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_UV.get(1), 4000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_UHV.get(4), ItemList.Electric_Pump_UHV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Bedrockium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_UHV.get(1), 4000, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_UEV.get(4), ItemList.Electric_Pump_UEV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_UEV.get(1), 4000, 8000000); //Laser Target IV-UEV 16384/t - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_IV.get(8), ItemList.Pump_IV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_IV.get(1), 8000, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_LuV.get(8), ItemList.Pump_LuV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_LuV.get(1), 8000, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_ZPM.get(8), ItemList.Pump_ZPM.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_ZPM.get(1), 8000, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_UV.get(8), ItemList.Pump_UV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_UV.get(1), 8000, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_UHV.get(8), ItemList.Pump_UHV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Bedrockium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_UHV.get(1), 8000, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_UEV.get(8), ItemList.Pump_UEV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_UEV.get(1), 8000, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_IV.get(8), ItemList.Electric_Pump_IV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_IV.get(1), 8000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_LuV.get(8), ItemList.Electric_Pump_LuV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_LuV.get(1), 8000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_ZPM.get(8), ItemList.Electric_Pump_ZPM.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_ZPM.get(1), 8000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_UV.get(8), ItemList.Electric_Pump_UV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_UV.get(1), 8000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_UHV.get(8), ItemList.Electric_Pump_UHV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Bedrockium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_UHV.get(1), 8000, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_UEV.get(8), ItemList.Electric_Pump_UEV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_UEV.get(1), 8000, 8000000); //Laser Target IV-UEV 65536/t - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_IV.get(16), ItemList.Pump_IV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_IV.get(1), 16000, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_LuV.get(16), ItemList.Pump_LuV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_LuV.get(1), 16000, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_ZPM.get(16), ItemList.Pump_ZPM.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_ZPM.get(1), 16000, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_UV.get(16), ItemList.Pump_UV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_UV.get(1), 16000, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_UHV.get(16), ItemList.Pump_UHV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Bedrockium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_UHV.get(1), 16000, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_UEV.get(16), ItemList.Pump_UEV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_UEV.get(1), 16000, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_IV.get(16), ItemList.Electric_Pump_IV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_IV.get(1), 16000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_LuV.get(16), ItemList.Electric_Pump_LuV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_LuV.get(1), 16000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_ZPM.get(16), ItemList.Electric_Pump_ZPM.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_ZPM.get(1), 16000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_UV.get(16), ItemList.Electric_Pump_UV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_UV.get(1), 16000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_UHV.get(16), ItemList.Electric_Pump_UHV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Bedrockium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_UHV.get(1), 16000, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_UEV.get(16), ItemList.Electric_Pump_UEV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_UEV.get(1), 16000, 8000000); //Laser Target IV-UEV 262144/t - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_IV.get(32), ItemList.Pump_IV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_IV.get(1), 32000, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_LuV.get(32), ItemList.Pump_LuV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_LuV.get(1), 32000, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_ZPM.get(32), ItemList.Pump_ZPM.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_ZPM.get(1), 32000, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_UV.get(32), ItemList.Pump_UV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_UV.get(1), 32000, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_UHV.get(32), ItemList.Pump_UHV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Bedrockium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_UHV.get(1), 32000, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_UEV.get(32), ItemList.Pump_UEV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_UEV.get(1), 32000, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_IV.get(32), ItemList.Electric_Pump_IV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_IV.get(1), 32000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_LuV.get(32), ItemList.Electric_Pump_LuV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_LuV.get(1), 32000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_ZPM.get(32), ItemList.Electric_Pump_ZPM.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_ZPM.get(1), 32000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_UV.get(32), ItemList.Electric_Pump_UV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_UV.get(1), 32000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_UHV.get(32), ItemList.Electric_Pump_UHV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Bedrockium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_UHV.get(1), 32000, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_UEV.get(32), ItemList.Electric_Pump_UEV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_UEV.get(1), 32000, 8000000); //Laser Target IV-UEV 1048576/t - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_IV.get(64), ItemList.Pump_IV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_IV.get(1), 64000, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_LuV.get(64), ItemList.Pump_LuV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.VanadiumGallium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_LuV.get(1), 64000, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_ZPM.get(64), ItemList.Pump_ZPM.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Naquadah, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_ZPM.get(1), 64000, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_UV.get(64), ItemList.Pump_UV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_UV.get(1), 64000, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_UHV.get(64), ItemList.Pump_UHV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Bedrockium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_UHV.get(1), 64000, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_UEV.get(64), ItemList.Pump_UEV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Draconium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_UEV.get(1), 64000, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_IV.get(64), ItemList.Electric_Pump_IV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_IV.get(1), 64000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_LuV.get(64), ItemList.Electric_Pump_LuV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.VanadiumGallium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_LuV.get(1), 64000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_ZPM.get(64), ItemList.Electric_Pump_ZPM.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Naquadah, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_ZPM.get(1), 64000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_UV.get(64), ItemList.Electric_Pump_UV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_UV.get(1), 64000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_UHV.get(64), ItemList.Electric_Pump_UHV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Bedrockium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_UHV.get(1), 64000, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_UEV.get(64), ItemList.Electric_Pump_UEV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Draconium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_UEV.get(1), 64000, 8000000); //Data Input addAssemblerRecipeWithCleanroom(new ItemStack[]{ -- cgit From 4f72e6114e3a7e3128dd8a491f4b2cd6e2c24fa0 Mon Sep 17 00:00:00 2001 From: Спартак Date: Sat, 8 Jun 2019 16:54:51 +0300 Subject: Fix Laser Hatch recipes (BloodyRecipe) --- .../tectech/loader/recipe/BloodyRecipeLoader.java | 112 ++++++++++----------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java b/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java index 566ac3de9e..c4ab54694c 100644 --- a/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java @@ -374,88 +374,88 @@ public class BloodyRecipeLoader implements Runnable { CustomItemList.eM_energymulti64_UEV.get(1), 400, 2000000); //Laser Dynamo IV-UV 256/t - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_IV.get(1), ItemList.Pump_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.TungstenSteel, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_IV.get(1), 1000, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_LuV.get(1), ItemList.Pump_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.VanadiumGallium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_LuV.get(1), 1000, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_ZPM.get(1), ItemList.Pump_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Naquadah, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_ZPM.get(1), 1000, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_UV.get(1), ItemList.Pump_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.NaquadahAlloy, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_UV.get(1), 1000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_IV.get(1), ItemList.Electric_Pump_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.TungstenSteel, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_IV.get(1), 1000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_LuV.get(1), ItemList.Electric_Pump_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.VanadiumGallium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_LuV.get(1), 1000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_ZPM.get(1), ItemList.Electric_Pump_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Naquadah, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_ZPM.get(1), 1000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_UV.get(1), ItemList.Electric_Pump_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.NaquadahAlloy, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_UV.get(1), 1000, 500000); //Laser Dynamo IV-UV 1024/t - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_IV.get(2), ItemList.Pump_IV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_IV.get(1), 2000, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_LuV.get(2), ItemList.Pump_LuV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.VanadiumGallium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_LuV.get(1), 2000, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_ZPM.get(2), ItemList.Pump_ZPM.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Naquadah, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_ZPM.get(1), 2000, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_UV.get(2), ItemList.Pump_UV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_UV.get(1), 2000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_IV.get(2), ItemList.Electric_Pump_IV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_IV.get(1), 2000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_LuV.get(2), ItemList.Electric_Pump_LuV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.VanadiumGallium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_LuV.get(1), 2000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_ZPM.get(2), ItemList.Electric_Pump_ZPM.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Naquadah, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_ZPM.get(1), 2000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_UV.get(2), ItemList.Electric_Pump_UV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_UV.get(1), 2000, 500000); //Laser Dynamo IV-UV 4096/t - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_IV.get(4), ItemList.Pump_IV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_IV.get(1), 4000, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_LuV.get(4), ItemList.Pump_LuV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_LuV.get(1), 4000, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_ZPM.get(4), ItemList.Pump_ZPM.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_ZPM.get(1), 4000, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_UV.get(4), ItemList.Pump_UV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_UV.get(1), 4000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_IV.get(4), ItemList.Electric_Pump_IV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_IV.get(1), 4000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_LuV.get(4), ItemList.Electric_Pump_LuV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_LuV.get(1), 4000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_ZPM.get(4), ItemList.Electric_Pump_ZPM.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_ZPM.get(1), 4000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_UV.get(4), ItemList.Electric_Pump_UV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_UV.get(1), 4000, 500000); //Laser Dynamo IV-UV 16384/t - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_IV.get(8), ItemList.Pump_IV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_IV.get(1), 8000, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_LuV.get(8), ItemList.Pump_LuV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_LuV.get(1), 8000, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_ZPM.get(8), ItemList.Pump_ZPM.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_ZPM.get(1), 8000, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_UV.get(8), ItemList.Pump_UV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_UV.get(1), 8000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_IV.get(8), ItemList.Electric_Pump_IV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_IV.get(1), 8000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_LuV.get(8), ItemList.Electric_Pump_LuV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_LuV.get(1), 8000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_ZPM.get(8), ItemList.Electric_Pump_ZPM.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_ZPM.get(1), 8000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_UV.get(8), ItemList.Electric_Pump_UV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_UV.get(1), 8000, 500000); //Laser Dynamo IV-UV 65536/t - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_IV.get(16), ItemList.Pump_IV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_IV.get(1), 16000, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_LuV.get(16), ItemList.Pump_LuV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_LuV.get(1), 16000, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_ZPM.get(16), ItemList.Pump_ZPM.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_ZPM.get(1), 16000, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_UV.get(16), ItemList.Pump_UV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_UV.get(1), 16000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_IV.get(16), ItemList.Electric_Pump_IV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_IV.get(1), 16000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_LuV.get(16), ItemList.Electric_Pump_LuV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_LuV.get(1), 16000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_ZPM.get(16), ItemList.Electric_Pump_ZPM.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_ZPM.get(1), 16000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_UV.get(16), ItemList.Electric_Pump_UV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_UV.get(1), 16000, 500000); //Laser Dynamo IV-UV 262144/t - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_IV.get(32), ItemList.Pump_IV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_IV.get(1), 32000, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_LuV.get(32), ItemList.Pump_LuV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_LuV.get(1), 32000, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_ZPM.get(32), ItemList.Pump_ZPM.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_ZPM.get(1), 32000, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_UV.get(32), ItemList.Pump_UV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_UV.get(1), 32000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_IV.get(32), ItemList.Electric_Pump_IV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_IV.get(1), 32000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_LuV.get(32), ItemList.Electric_Pump_LuV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_LuV.get(1), 32000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_ZPM.get(32), ItemList.Electric_Pump_ZPM.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_ZPM.get(1), 32000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_UV.get(32), ItemList.Electric_Pump_UV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_UV.get(1), 32000, 500000); //Laser Dynamo IV-UV 1048576/t - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_IV.get(64), ItemList.Pump_IV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_IV.get(1), 64000, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_LuV.get(64), ItemList.Pump_LuV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.VanadiumGallium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_LuV.get(1), 64000, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_ZPM.get(64), ItemList.Pump_ZPM.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Naquadah, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_ZPM.get(1), 64000, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_UV.get(64), ItemList.Pump_UV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_UV.get(1), 64000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_IV.get(64), ItemList.Electric_Pump_IV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_IV.get(1), 64000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_LuV.get(64), ItemList.Electric_Pump_LuV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.VanadiumGallium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_LuV.get(1), 64000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_ZPM.get(64), ItemList.Electric_Pump_ZPM.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Naquadah, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_ZPM.get(1), 64000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_UV.get(64), ItemList.Electric_Pump_UV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_UV.get(1), 64000, 500000); //Laser Target IV-UV 256/t - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_IV.get(1), ItemList.Pump_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.TungstenSteel, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_IV.get(1), 1000, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_LuV.get(1), ItemList.Pump_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.VanadiumGallium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_LuV.get(1), 1000, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_ZPM.get(1), ItemList.Pump_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Naquadah, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_ZPM.get(1), 1000, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_UV.get(1), ItemList.Pump_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.NaquadahAlloy, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_UV.get(1), 1000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_IV.get(1), ItemList.Electric_Pump_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.TungstenSteel, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_IV.get(1), 1000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_LuV.get(1), ItemList.Electric_Pump_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.VanadiumGallium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_LuV.get(1), 1000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_ZPM.get(1), ItemList.Electric_Pump_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Naquadah, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_ZPM.get(1), 1000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_UV.get(1), ItemList.Electric_Pump_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.NaquadahAlloy, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_UV.get(1), 1000, 500000); //Laser Target IV-UV 1024/t - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_IV.get(2), ItemList.Pump_IV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_IV.get(1), 2000, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_LuV.get(2), ItemList.Pump_LuV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.VanadiumGallium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_LuV.get(1), 2000, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_ZPM.get(2), ItemList.Pump_ZPM.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Naquadah, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_ZPM.get(1), 2000, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_UV.get(2), ItemList.Pump_UV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_UV.get(1), 2000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_IV.get(2), ItemList.Electric_Pump_IV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_IV.get(1), 2000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_LuV.get(2), ItemList.Electric_Pump_LuV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.VanadiumGallium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_LuV.get(1), 2000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_ZPM.get(2), ItemList.Electric_Pump_ZPM.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Naquadah, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_ZPM.get(1), 2000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_UV.get(2), ItemList.Electric_Pump_UV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_UV.get(1), 2000, 500000); //Laser Target IV-UV 4096/t - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_IV.get(4), ItemList.Pump_IV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_IV.get(1), 4000, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_LuV.get(4), ItemList.Pump_LuV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_LuV.get(1), 4000, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_ZPM.get(4), ItemList.Pump_ZPM.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_ZPM.get(1), 4000, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_UV.get(4), ItemList.Pump_UV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_UV.get(1), 4000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_IV.get(4), ItemList.Electric_Pump_IV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_IV.get(1), 4000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_LuV.get(4), ItemList.Electric_Pump_LuV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_LuV.get(1), 4000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_ZPM.get(4), ItemList.Electric_Pump_ZPM.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_ZPM.get(1), 4000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_UV.get(4), ItemList.Electric_Pump_UV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_UV.get(1), 4000, 500000); //Laser Target IV-UV 16384/t - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_IV.get(8), ItemList.Pump_IV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_IV.get(1), 8000, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_LuV.get(8), ItemList.Pump_LuV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_LuV.get(1), 8000, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_ZPM.get(8), ItemList.Pump_ZPM.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_ZPM.get(1), 8000, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_UV.get(8), ItemList.Pump_UV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_UV.get(1), 8000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_IV.get(8), ItemList.Electric_Pump_IV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_IV.get(1), 8000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_LuV.get(8), ItemList.Electric_Pump_LuV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_LuV.get(1), 8000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_ZPM.get(8), ItemList.Electric_Pump_ZPM.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_ZPM.get(1), 8000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_UV.get(8), ItemList.Electric_Pump_UV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_UV.get(1), 8000, 500000); //Laser Target IV-UV 65536/t - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_IV.get(16), ItemList.Pump_IV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_IV.get(1), 16000, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_LuV.get(16), ItemList.Pump_LuV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_LuV.get(1), 16000, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_ZPM.get(16), ItemList.Pump_ZPM.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_ZPM.get(1), 16000, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_UV.get(16), ItemList.Pump_UV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_UV.get(1), 16000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_IV.get(16), ItemList.Electric_Pump_IV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_IV.get(1), 16000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_LuV.get(16), ItemList.Electric_Pump_LuV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_LuV.get(1), 16000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_ZPM.get(16), ItemList.Electric_Pump_ZPM.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_ZPM.get(1), 16000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_UV.get(16), ItemList.Electric_Pump_UV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_UV.get(1), 16000, 500000); //Laser Target IV-UV 262144/t - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_IV.get(32), ItemList.Pump_IV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_IV.get(1), 32000, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_LuV.get(32), ItemList.Pump_LuV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_LuV.get(1), 32000, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_ZPM.get(32), ItemList.Pump_ZPM.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_ZPM.get(1), 32000, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_UV.get(32), ItemList.Pump_UV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_UV.get(1), 32000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_IV.get(32), ItemList.Electric_Pump_IV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_IV.get(1), 32000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_LuV.get(32), ItemList.Electric_Pump_LuV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_LuV.get(1), 32000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_ZPM.get(32), ItemList.Electric_Pump_ZPM.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_ZPM.get(1), 32000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_UV.get(32), ItemList.Electric_Pump_UV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_UV.get(1), 32000, 500000); //Laser Target IV-UV 1048576/t - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_IV.get(64), ItemList.Pump_IV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_IV.get(1), 64000, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_LuV.get(64), ItemList.Pump_LuV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.VanadiumGallium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_LuV.get(1), 64000, 30720); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_ZPM.get(64), ItemList.Pump_ZPM.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Naquadah, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_ZPM.get(1), 64000, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_UV.get(64), ItemList.Pump_UV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_UV.get(1), 64000, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_IV.get(64), ItemList.Electric_Pump_IV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_IV.get(1), 64000, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_LuV.get(64), ItemList.Electric_Pump_LuV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.VanadiumGallium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_LuV.get(1), 64000, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_ZPM.get(64), ItemList.Electric_Pump_ZPM.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Naquadah, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_ZPM.get(1), 64000, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_UV.get(64), ItemList.Electric_Pump_UV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_UV.get(1), 64000, 500000); //Data Input GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ -- cgit From fe748282df17b7e9f663c6c88435bae4f751753c Mon Sep 17 00:00:00 2001 From: Спартак Date: Sat, 8 Jun 2019 17:04:01 +0300 Subject: Fix Laser Hatch recipes (DreamCraft) №2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dreamcraft/DreamCraftRecipeLoader.java | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java index 773225380a..dd3ad339af 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java @@ -226,7 +226,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_ZPM.get(1), ItemList.Electric_Pump_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Naquadah, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_ZPM.get(1), 1000, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_UV.get(1), ItemList.Electric_Pump_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.NaquadahAlloy, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_UV.get(1), 1000, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_UHV.get(1), ItemList.Electric_Pump_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Bedrockium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_UHV.get(1), 1000, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_UEV.get(1), ItemList.Electric_Pump_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Draconium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_UEV.get(1), 1000, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hull_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_UEV.get(1), ItemList.Electric_Pump_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Draconium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamotunnel1_UEV.get(1), 1000, 8000000); //Laser Dynamo IV-UEV 1024/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_IV.get(2), ItemList.Electric_Pump_IV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_IV.get(1), 2000, 7680); @@ -234,7 +234,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_ZPM.get(2), ItemList.Electric_Pump_ZPM.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Naquadah, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_ZPM.get(1), 2000, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_UV.get(2), ItemList.Electric_Pump_UV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_UV.get(1), 2000, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_UHV.get(2), ItemList.Electric_Pump_UHV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Bedrockium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_UHV.get(1), 2000, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_UEV.get(2), ItemList.Electric_Pump_UEV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Draconium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_UEV.get(1), 2000, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hull_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_UEV.get(2), ItemList.Electric_Pump_UEV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Draconium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamotunnel2_UEV.get(1), 2000, 8000000); //Laser Dynamo IV-UEV 4096/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_IV.get(4), ItemList.Electric_Pump_IV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_IV.get(1), 4000, 7680); @@ -242,7 +242,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_ZPM.get(4), ItemList.Electric_Pump_ZPM.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_ZPM.get(1), 4000, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_UV.get(4), ItemList.Electric_Pump_UV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_UV.get(1), 4000, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_UHV.get(4), ItemList.Electric_Pump_UHV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Bedrockium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_UHV.get(1), 4000, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_UEV.get(4), ItemList.Electric_Pump_UEV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_UEV.get(1), 4000, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hull_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_UEV.get(4), ItemList.Electric_Pump_UEV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamotunnel3_UEV.get(1), 4000, 8000000); //Laser Dynamo IV-UEV 16384/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_IV.get(8), ItemList.Electric_Pump_IV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_IV.get(1), 8000, 7680); @@ -250,7 +250,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_ZPM.get(8), ItemList.Electric_Pump_ZPM.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_ZPM.get(1), 8000, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_UV.get(8), ItemList.Electric_Pump_UV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_UV.get(1), 8000, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_UHV.get(8), ItemList.Electric_Pump_UHV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Bedrockium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_UHV.get(1), 8000, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_UEV.get(8), ItemList.Electric_Pump_UEV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_UEV.get(1), 8000, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hull_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_UEV.get(8), ItemList.Electric_Pump_UEV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamotunnel4_UEV.get(1), 8000, 8000000); //Laser Dynamo IV-UEV 65536/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_IV.get(16), ItemList.Electric_Pump_IV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_IV.get(1), 16000, 7680); @@ -258,7 +258,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_ZPM.get(16), ItemList.Electric_Pump_ZPM.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_ZPM.get(1), 16000, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_UV.get(16), ItemList.Electric_Pump_UV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_UV.get(1), 16000, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_UHV.get(16), ItemList.Electric_Pump_UHV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Bedrockium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_UHV.get(1), 16000, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_UEV.get(16), ItemList.Electric_Pump_UEV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_UEV.get(1), 16000, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hull_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_UEV.get(16), ItemList.Electric_Pump_UEV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamotunnel5_UEV.get(1), 16000, 8000000); //Laser Dynamo IV-UEV 262144/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_IV.get(32), ItemList.Electric_Pump_IV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_IV.get(1), 32000, 7680); @@ -266,7 +266,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_ZPM.get(32), ItemList.Electric_Pump_ZPM.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_ZPM.get(1), 32000, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_UV.get(32), ItemList.Electric_Pump_UV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_UV.get(1), 32000, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_UHV.get(32), ItemList.Electric_Pump_UHV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Bedrockium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_UHV.get(1), 32000, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_UEV.get(32), ItemList.Electric_Pump_UEV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_UEV.get(1), 32000, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hull_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_UEV.get(32), ItemList.Electric_Pump_UEV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamotunnel6_UEV.get(1), 32000, 8000000); //Laser Dynamo IV-UEV 1048576/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_IV.get(64), ItemList.Electric_Pump_IV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_IV.get(1), 64000, 7680); @@ -274,7 +274,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_ZPM.get(64), ItemList.Electric_Pump_ZPM.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Naquadah, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_ZPM.get(1), 64000, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_UV.get(64), ItemList.Electric_Pump_UV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_UV.get(1), 64000, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_UHV.get(64), ItemList.Electric_Pump_UHV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Bedrockium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_UHV.get(1), 64000, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_UEV.get(64), ItemList.Electric_Pump_UEV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Draconium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_UEV.get(1), 64000, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hull_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_UEV.get(64), ItemList.Electric_Pump_UEV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Draconium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamotunnel7_UEV.get(1), 64000, 8000000); //Laser Target IV-UEV 256/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_IV.get(1), ItemList.Electric_Pump_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.TungstenSteel, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_IV.get(1), 1000, 7680); @@ -282,7 +282,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_ZPM.get(1), ItemList.Electric_Pump_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Naquadah, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_ZPM.get(1), 1000, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_UV.get(1), ItemList.Electric_Pump_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.NaquadahAlloy, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_UV.get(1), 1000, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_UHV.get(1), ItemList.Electric_Pump_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Bedrockium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_UHV.get(1), 1000, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_UEV.get(1), ItemList.Electric_Electric_Pump_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Draconium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_UEV.get(1), 1000, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hull_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_UEV.get(1), ItemList.Electric_Pump_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Draconium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energytunnel1_UEV.get(1), 1000, 8000000); //Laser Target IV-UEV 1024/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_IV.get(2), ItemList.Electric_Pump_IV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_IV.get(1), 2000, 7680); @@ -290,7 +290,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_ZPM.get(2), ItemList.Electric_Pump_ZPM.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Naquadah, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_ZPM.get(1), 2000, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_UV.get(2), ItemList.Electric_Pump_UV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_UV.get(1), 2000, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_UHV.get(2), ItemList.Electric_Pump_UHV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Bedrockium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_UHV.get(1), 2000, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_UEV.get(2), ItemList.Electric_Pump_UEV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Draconium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_UEV.get(1), 2000, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hull_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_UEV.get(2), ItemList.Electric_Pump_UEV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Draconium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energytunnel2_UEV.get(1), 2000, 8000000); //Laser Target IV-UEV 4096/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_IV.get(4), ItemList.Electric_Pump_IV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_IV.get(1), 4000, 7680); @@ -298,7 +298,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_ZPM.get(4), ItemList.Electric_Pump_ZPM.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_ZPM.get(1), 4000, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_UV.get(4), ItemList.Electric_Pump_UV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_UV.get(1), 4000, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_UHV.get(4), ItemList.Electric_Pump_UHV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Bedrockium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_UHV.get(1), 4000, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_UEV.get(4), ItemList.Electric_Pump_UEV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_UEV.get(1), 4000, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hull_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_UEV.get(4), ItemList.Electric_Pump_UEV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energytunnel3_UEV.get(1), 4000, 8000000); //Laser Target IV-UEV 16384/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_IV.get(8), ItemList.Electric_Pump_IV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_IV.get(1), 8000, 7680); @@ -306,7 +306,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_ZPM.get(8), ItemList.Electric_Pump_ZPM.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_ZPM.get(1), 8000, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_UV.get(8), ItemList.Electric_Pump_UV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_UV.get(1), 8000, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_UHV.get(8), ItemList.Electric_Pump_UHV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Bedrockium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_UHV.get(1), 8000, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_UEV.get(8), ItemList.Electric_Pump_UEV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_UEV.get(1), 8000, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hull_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_UEV.get(8), ItemList.Electric_Pump_UEV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energytunnel4_UEV.get(1), 8000, 8000000); //Laser Target IV-UEV 65536/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_IV.get(16), ItemList.Electric_Pump_IV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_IV.get(1), 16000, 7680); @@ -314,7 +314,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_ZPM.get(16), ItemList.Electric_Pump_ZPM.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_ZPM.get(1), 16000, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_UV.get(16), ItemList.Electric_Pump_UV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_UV.get(1), 16000, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_UHV.get(16), ItemList.Electric_Pump_UHV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Bedrockium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_UHV.get(1), 16000, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_UEV.get(16), ItemList.Electric_Pump_UEV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_UEV.get(1), 16000, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hull_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_UEV.get(16), ItemList.Electric_Pump_UEV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energytunnel5_UEV.get(1), 16000, 8000000); //Laser Target IV-UEV 262144/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_IV.get(32), ItemList.Electric_Pump_IV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_IV.get(1), 32000, 7680); @@ -322,7 +322,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_ZPM.get(32), ItemList.Electric_Pump_ZPM.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_ZPM.get(1), 32000, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_UV.get(32), ItemList.Electric_Pump_UV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_UV.get(1), 32000, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_UHV.get(32), ItemList.Electric_Pump_UHV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Bedrockium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_UHV.get(1), 32000, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_UEV.get(32), ItemList.Electric_Pump_UEV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_UEV.get(1), 32000, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hull_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_UEV.get(32), ItemList.Electric_Pump_UEV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energytunnel6_UEV.get(1), 32000, 8000000); //Laser Target IV-UEV 1048576/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_IV.get(64), ItemList.Electric_Pump_IV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_IV.get(1), 64000, 7680); @@ -330,7 +330,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_ZPM.get(64), ItemList.Electric_Pump_ZPM.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Naquadah, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_ZPM.get(1), 64000, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_UV.get(64), ItemList.Electric_Pump_UV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_UV.get(1), 64000, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_UHV.get(64), ItemList.Electric_Pump_UHV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Bedrockium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_UHV.get(1), 64000, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_UEV.get(64), ItemList.Electric_Pump_UEV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Draconium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_UEV.get(1), 64000, 8000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hull_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_UEV.get(64), ItemList.Electric_Pump_UEV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Draconium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energytunnel7_UEV.get(1), 64000, 8000000); //Data Input addAssemblerRecipeWithCleanroom(new ItemStack[]{ -- cgit From 024af196f1fed56d8b52cc5729f5f6fc2c4f94a7 Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 9 Jun 2019 06:15:44 +0200 Subject: Update build files --- build.gradle | 6 +++--- build.properties | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index 3c33f9d9f7..0d563706a2 100644 --- a/build.gradle +++ b/build.gradle @@ -33,7 +33,7 @@ file "build.properties" withReader { } version = "${config.minecraft.version}-${config.tectech.version}" -group= "com.github.technus" +group = "com.github.technus" archivesBaseName = "TecTech" minecraft { @@ -108,7 +108,7 @@ processResources include 'mcmod.info' // replace version and mcversion - expand 'version':cleanVersion, 'mcversion':project.minecraft.version + expand 'version': cleanVersion, 'mcversion': project.minecraft.version } // copy everything else, thats not the mcmod.info @@ -117,7 +117,7 @@ processResources } } -task signJar(dependsOn: 'reobf'){ +task signJar(dependsOn: 'reobf') { doLast { ant.signjar( destDir: jar.destinationDir, diff --git a/build.properties b/build.properties index f8827f43d0..69cdaa724f 100644 --- a/build.properties +++ b/build.properties @@ -1,13 +1,13 @@ minecraft.version=1.7.10 forge.version=1.7.10-10.13.4.1614-1.7.10 -tectech.version=3.6.11 +tectech.version=3.6.10 ic2.version=2.2.790-experimental codechickenlib.version=1.1.3.140 codechickencore.version=1.0.7.47 nei.version=1.0.5.120 -gregtech.jenkinsbuild=293 -gregtech.version=5.09.33.14 +gregtech.jenkinsbuild=299 +gregtech.version=5.09.33.16 cofhcore.version=[1.7.10]3.1.4-329-dev cofhlib.version=[1.7.10]1.0.3-175-dev -- cgit From c09b079c451362c0bdf78eeed0bbdc4ff3307cfc Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 9 Jun 2019 09:13:16 +0200 Subject: Bug fix: merge network dispatchers --- .../github/technus/tectech/loader/MainLoader.java | 6 +- .../tectech/loader/network/NetworkDispatcher.java | 21 ++++ .../loader/network/PipeActivityMessage.java | 134 ++++++++++++++++++++ .../tectech/loader/network/RotationMessage.java | 140 +++++++++++++++++++++ .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 10 +- .../multi/base/network/PipeActivityMessage.java | 134 -------------------- .../base/network/PipeActivityPacketDispatcher.java | 21 ---- .../multi/base/network/RotationMessage.java | 140 --------------------- .../base/network/RotationPacketDispatcher.java | 21 ---- .../pipe/GT_MetaTileEntity_Pipe_Data.java | 10 +- .../pipe/GT_MetaTileEntity_Pipe_EM.java | 10 +- .../pipe/GT_MetaTileEntity_Pipe_Energy.java | 10 +- 12 files changed, 317 insertions(+), 340 deletions(-) create mode 100644 src/main/java/com/github/technus/tectech/loader/network/NetworkDispatcher.java create mode 100644 src/main/java/com/github/technus/tectech/loader/network/PipeActivityMessage.java create mode 100644 src/main/java/com/github/technus/tectech/loader/network/RotationMessage.java delete mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/network/PipeActivityMessage.java delete mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/network/PipeActivityPacketDispatcher.java delete mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/network/RotationMessage.java delete mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/network/RotationPacketDispatcher.java diff --git a/src/main/java/com/github/technus/tectech/loader/MainLoader.java b/src/main/java/com/github/technus/tectech/loader/MainLoader.java index 3420298cfa..b1a71afb2f 100644 --- a/src/main/java/com/github/technus/tectech/loader/MainLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/MainLoader.java @@ -10,6 +10,7 @@ import com.github.technus.tectech.loader.entity.EntityLoader; import com.github.technus.tectech.loader.gui.CreativeTabTecTech; import com.github.technus.tectech.loader.gui.ModGuiHandler; import com.github.technus.tectech.loader.mechanics.ElementalLoader; +import com.github.technus.tectech.loader.network.NetworkDispatcher; import com.github.technus.tectech.loader.recipe.RecipeLoader; import com.github.technus.tectech.loader.thing.ComponentLoader; import com.github.technus.tectech.loader.thing.MachineLoader; @@ -17,8 +18,6 @@ import com.github.technus.tectech.loader.thing.ThingsLoader; import com.github.technus.tectech.thing.casing.TT_Container_Casings; import com.github.technus.tectech.thing.metaTileEntity.Textures; import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_collider; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.network.PipeActivityPacketDispatcher; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.network.RotationPacketDispatcher; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.ProgressManager; import cpw.mods.fml.common.network.NetworkRegistry; @@ -106,8 +105,7 @@ public final class MainLoader { LOGGER.info("Damage types addition Done"); progressBarLoad.step("Register Packet Dispatcher"); - new RotationPacketDispatcher(); - new PipeActivityPacketDispatcher(); + new NetworkDispatcher(); LOGGER.info("Packet Dispatcher registered"); progressBarLoad.step("Register GUI Handler"); diff --git a/src/main/java/com/github/technus/tectech/loader/network/NetworkDispatcher.java b/src/main/java/com/github/technus/tectech/loader/network/NetworkDispatcher.java new file mode 100644 index 0000000000..2ee027ddc8 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/loader/network/NetworkDispatcher.java @@ -0,0 +1,21 @@ +package com.github.technus.tectech.loader.network; + +import static com.github.technus.tectech.Reference.MODID; + +public class NetworkDispatcher extends eu.usrv.yamcore.network.PacketDispatcher { + public static NetworkDispatcher INSTANCE; + + public NetworkDispatcher() { + super(MODID); + INSTANCE = this; + registerPackets(); + } + + @Override + public void registerPackets() { + registerMessage(PipeActivityMessage.ServerHandler.class, PipeActivityMessage.PipeActivityQuery.class); + registerMessage(PipeActivityMessage.ClientHandler.class, PipeActivityMessage.PipeActivityData.class); + registerMessage(RotationMessage.ServerHandler.class, RotationMessage.RotationQuery.class); + registerMessage(RotationMessage.ClientHandler.class, RotationMessage.RotationData.class); + } +} diff --git a/src/main/java/com/github/technus/tectech/loader/network/PipeActivityMessage.java b/src/main/java/com/github/technus/tectech/loader/network/PipeActivityMessage.java new file mode 100644 index 0000000000..0323f19428 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/loader/network/PipeActivityMessage.java @@ -0,0 +1,134 @@ +package com.github.technus.tectech.loader.network; + +import com.github.technus.tectech.thing.metaTileEntity.pipe.IActivePipe; +import cpw.mods.fml.common.network.ByteBufUtils; +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import cpw.mods.fml.common.network.simpleimpl.MessageContext; +import eu.usrv.yamcore.network.client.AbstractClientMessageHandler; +import eu.usrv.yamcore.network.server.AbstractServerMessageHandler; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import io.netty.buffer.ByteBuf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.DimensionManager; + +public class PipeActivityMessage implements IMessage { + int mPosX; + int mPosY; + int mPosZ; + int mPosD; + int mActive; + + public PipeActivityMessage() { + } + + private PipeActivityMessage(IActivePipe metaTile) { + IGregTechTileEntity base=metaTile.getBaseMetaTileEntity(); + mPosX=base.getXCoord(); + mPosY=base.getYCoord(); + mPosZ=base.getZCoord(); + mPosD=base.getWorld().provider.dimensionId; + mActive=metaTile.getActive()?1:0; + } + + private PipeActivityMessage(World world, int x, int y, int z, boolean active) { + mPosX=x; + mPosY=y; + mPosZ=z; + mPosD=world.provider.dimensionId; + mActive=active?1:0; + } + + @Override + public void fromBytes(ByteBuf pBuffer) { + NBTTagCompound tTag = ByteBufUtils.readTag(pBuffer); + mPosX = tTag.getInteger("posx"); + mPosY = tTag.getInteger("posy"); + mPosZ = tTag.getInteger("posz"); + mPosD = tTag.getInteger("posd"); + mActive = tTag.getInteger("active"); + } + + @Override + public void toBytes(ByteBuf pBuffer) { + NBTTagCompound tFXTag = new NBTTagCompound(); + tFXTag.setInteger("posx", mPosX); + tFXTag.setInteger("posy", mPosY); + tFXTag.setInteger("posz", mPosZ); + tFXTag.setInteger("posd", mPosD); + tFXTag.setInteger("active", mActive); + + ByteBufUtils.writeTag(pBuffer, tFXTag); + } + + public static class PipeActivityQuery extends PipeActivityMessage { + public PipeActivityQuery() { + } + + public PipeActivityQuery(IActivePipe metaTile) { + super(metaTile); + } + + public PipeActivityQuery(World world, int x,int y,int z, boolean active) { + super(world,x,y,z,active); + } + } + + public static class PipeActivityData extends PipeActivityMessage { + public PipeActivityData() { + } + + private PipeActivityData(PipeActivityQuery query){ + mPosX=query.mPosX; + mPosY=query.mPosY; + mPosZ=query.mPosZ; + mPosD=query.mPosD; + mActive=query.mActive; + } + + public PipeActivityData(IActivePipe metaTile) { + super(metaTile); + } + + public PipeActivityData(World world, int x,int y,int z, boolean active) { + super(world,x,y,z,active); + } + } + + public static class ClientHandler extends AbstractClientMessageHandler { + @Override + public IMessage handleClientMessage(EntityPlayer pPlayer, PipeActivityData pMessage, MessageContext pCtx) { + if(pPlayer.worldObj.provider.dimensionId==pMessage.mPosD){ + TileEntity te=pPlayer.worldObj.getTileEntity(pMessage.mPosX,pMessage.mPosY,pMessage.mPosZ); + if(te instanceof IGregTechTileEntity){ + IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity(); + if(meta instanceof IActivePipe){ + ((IActivePipe) meta).setActive((byte)pMessage.mActive==1); + } + } + } + return null; + } + } + + public static class ServerHandler extends AbstractServerMessageHandler { + @Override + public IMessage handleServerMessage(EntityPlayer pPlayer, PipeActivityQuery pMessage, MessageContext pCtx) { + World world= DimensionManager.getWorld(pMessage.mPosD); + if(world!=null) { + TileEntity te = world.getTileEntity(pMessage.mPosX, pMessage.mPosY, pMessage.mPosZ); + if (te instanceof IGregTechTileEntity) { + IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity(); + if (meta instanceof IActivePipe) { + pMessage.mActive=((IActivePipe) meta).getActive()?1:0; + return new PipeActivityData(pMessage); + } + } + } + return null; + } + } +} \ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/loader/network/RotationMessage.java b/src/main/java/com/github/technus/tectech/loader/network/RotationMessage.java new file mode 100644 index 0000000000..ec78021a60 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/loader/network/RotationMessage.java @@ -0,0 +1,140 @@ +package com.github.technus.tectech.loader.network; + +import com.github.technus.tectech.thing.metaTileEntity.IFrontRotation; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import cpw.mods.fml.common.network.ByteBufUtils; +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import cpw.mods.fml.common.network.simpleimpl.MessageContext; +import eu.usrv.yamcore.network.client.AbstractClientMessageHandler; +import eu.usrv.yamcore.network.server.AbstractServerMessageHandler; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import io.netty.buffer.ByteBuf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.DimensionManager; + +public class RotationMessage implements IMessage { + int mPosX; + int mPosY; + int mPosZ; + int mPosD; + int mRotF; + + public RotationMessage() { + } + + private RotationMessage(GT_MetaTileEntity_MultiblockBase_EM metaTile) { + IGregTechTileEntity base=metaTile.getBaseMetaTileEntity(); + mPosX=base.getXCoord(); + mPosY=base.getYCoord(); + mPosZ=base.getZCoord(); + mPosD=base.getWorld().provider.dimensionId; + mRotF=metaTile.getFrontRotation(); + } + + private RotationMessage(World world, int x,int y,int z, IFrontRotation front) { + mPosX=x; + mPosY=y; + mPosZ=z; + mPosD=world.provider.dimensionId; + mRotF=front.getFrontRotation(); + } + + @Override + public void fromBytes(ByteBuf pBuffer) { + NBTTagCompound tTag = ByteBufUtils.readTag(pBuffer); + mPosX = tTag.getInteger("posx"); + mPosY = tTag.getInteger("posy"); + mPosZ = tTag.getInteger("posz"); + mPosD = tTag.getInteger("posd"); + mRotF = tTag.getInteger("rotf"); + } + + @Override + public void toBytes(ByteBuf pBuffer) { + NBTTagCompound tFXTag = new NBTTagCompound(); + tFXTag.setInteger("posx", mPosX); + tFXTag.setInteger("posy", mPosY); + tFXTag.setInteger("posz", mPosZ); + tFXTag.setInteger("posd", mPosD); + tFXTag.setInteger("rotf", mRotF); + + ByteBufUtils.writeTag(pBuffer, tFXTag); + } + + public static class RotationQuery extends RotationMessage{ + public RotationQuery() { + } + + public RotationQuery(GT_MetaTileEntity_MultiblockBase_EM metaTile) { + super(metaTile); + } + + public RotationQuery(World world, int x,int y,int z, IFrontRotation front) { + super(world,x,y,z,front); + } + } + + public static class RotationData extends RotationMessage{ + public RotationData() { + } + + private RotationData(RotationQuery query){ + mPosX=query.mPosX; + mPosY=query.mPosY; + mPosZ=query.mPosZ; + mPosD=query.mPosD; + mRotF=query.mRotF; + } + + public RotationData(GT_MetaTileEntity_MultiblockBase_EM metaTile) { + super(metaTile); + } + + public RotationData(World world, int x,int y,int z, IFrontRotation front) { + super(world,x,y,z,front); + } + } + + public static class ClientHandler extends AbstractClientMessageHandler { + @Override + public IMessage handleClientMessage(EntityPlayer pPlayer, RotationData pMessage, MessageContext pCtx) { + if(pPlayer.worldObj.provider.dimensionId==pMessage.mPosD){ + TileEntity te=pPlayer.worldObj.getTileEntity(pMessage.mPosX,pMessage.mPosY,pMessage.mPosZ); + if(te instanceof IGregTechTileEntity){ + IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity(); + if(meta instanceof IFrontRotation){ + ((IFrontRotation) meta).forceSetRotationDoRender((byte)pMessage.mRotF); + } + }else if (te instanceof IFrontRotation){ + ((IFrontRotation) te).forceSetRotationDoRender((byte)pMessage.mRotF); + } + } + return null; + } + } + + public static class ServerHandler extends AbstractServerMessageHandler { + @Override + public IMessage handleServerMessage(EntityPlayer pPlayer, RotationQuery pMessage, MessageContext pCtx) { + World world= DimensionManager.getWorld(pMessage.mPosD); + if(world!=null) { + TileEntity te = world.getTileEntity(pMessage.mPosX, pMessage.mPosY, pMessage.mPosZ); + if (te instanceof IGregTechTileEntity) { + IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity(); + if (meta instanceof IFrontRotation) { + pMessage.mRotF=((IFrontRotation) meta).getFrontRotation(); + return new RotationData(pMessage); + } + } else if (te instanceof IFrontRotation) { + pMessage.mRotF=((IFrontRotation) te).getFrontRotation(); + return new RotationData(pMessage); + } + } + return null; + } + } +} \ No newline at end of file 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 53e1803615..3b7d4233f2 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 @@ -10,8 +10,8 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElement import com.github.technus.tectech.mechanics.elementalMatter.core.tElementalException; import com.github.technus.tectech.thing.metaTileEntity.IFrontRotation; import com.github.technus.tectech.thing.metaTileEntity.hatch.*; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.network.RotationMessage; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.network.RotationPacketDispatcher; +import com.github.technus.tectech.loader.network.RotationMessage; +import com.github.technus.tectech.loader.network.NetworkDispatcher; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -1127,14 +1127,14 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt frontRotation = rotation; IGregTechTileEntity base=getBaseMetaTileEntity(); if(base.isClientSide()) { - base.getWorld().markBlockRangeForRenderUpdate(base.getXCoord(), base.getYCoord(), base.getZCoord(), base.getXCoord(), base.getYCoord(), base.getZCoord()); + base.issueTextureUpdate(); } } protected final void updateRotationOnClients(){ if(getBaseMetaTileEntity().isServerSide()){ IGregTechTileEntity base=getBaseMetaTileEntity(); - RotationPacketDispatcher.INSTANCE.sendToAllAround(new RotationMessage.RotationData(this), + NetworkDispatcher.INSTANCE.sendToAllAround(new RotationMessage.RotationData(this), base.getWorld().provider.dimensionId, base.getXCoord(), base.getYCoord(), @@ -1229,7 +1229,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt public final void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { isFacingValid(aBaseMetaTileEntity.getFrontFacing()); if(getBaseMetaTileEntity().isClientSide()){ - RotationPacketDispatcher.INSTANCE.sendToServer(new RotationMessage.RotationQuery(this)); + NetworkDispatcher.INSTANCE.sendToServer(new RotationMessage.RotationQuery(this)); } onFirstTick_EM(aBaseMetaTileEntity); } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/network/PipeActivityMessage.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/network/PipeActivityMessage.java deleted file mode 100644 index 35ca167d9d..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/network/PipeActivityMessage.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.multi.base.network; - -import com.github.technus.tectech.thing.metaTileEntity.pipe.IActivePipe; -import cpw.mods.fml.common.network.ByteBufUtils; -import cpw.mods.fml.common.network.simpleimpl.IMessage; -import cpw.mods.fml.common.network.simpleimpl.MessageContext; -import eu.usrv.yamcore.network.client.AbstractClientMessageHandler; -import eu.usrv.yamcore.network.server.AbstractServerMessageHandler; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import io.netty.buffer.ByteBuf; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.DimensionManager; - -public class PipeActivityMessage implements IMessage { - int mPosX; - int mPosY; - int mPosZ; - int mPosD; - int mActive; - - public PipeActivityMessage() { - } - - private PipeActivityMessage(IActivePipe metaTile) { - IGregTechTileEntity base=metaTile.getBaseMetaTileEntity(); - mPosX=base.getXCoord(); - mPosY=base.getYCoord(); - mPosZ=base.getZCoord(); - mPosD=base.getWorld().provider.dimensionId; - mActive=metaTile.getActive()?1:0; - } - - private PipeActivityMessage(World world, int x, int y, int z, boolean active) { - mPosX=x; - mPosY=y; - mPosZ=z; - mPosD=world.provider.dimensionId; - mActive=active?1:0; - } - - @Override - public void fromBytes(ByteBuf pBuffer) { - NBTTagCompound tTag = ByteBufUtils.readTag(pBuffer); - mPosX = tTag.getInteger("posx"); - mPosY = tTag.getInteger("posy"); - mPosZ = tTag.getInteger("posz"); - mPosD = tTag.getInteger("posd"); - mActive = tTag.getInteger("active"); - } - - @Override - public void toBytes(ByteBuf pBuffer) { - NBTTagCompound tFXTag = new NBTTagCompound(); - tFXTag.setInteger("posx", mPosX); - tFXTag.setInteger("posy", mPosY); - tFXTag.setInteger("posz", mPosZ); - tFXTag.setInteger("posd", mPosD); - tFXTag.setInteger("active", mActive); - - ByteBufUtils.writeTag(pBuffer, tFXTag); - } - - public static class PipeActivityQuery extends PipeActivityMessage { - public PipeActivityQuery() { - } - - public PipeActivityQuery(IActivePipe metaTile) { - super(metaTile); - } - - public PipeActivityQuery(World world, int x,int y,int z, boolean active) { - super(world,x,y,z,active); - } - } - - public static class PipeActivityData extends PipeActivityMessage { - public PipeActivityData() { - } - - private PipeActivityData(PipeActivityQuery query){ - mPosX=query.mPosX; - mPosY=query.mPosY; - mPosZ=query.mPosZ; - mPosD=query.mPosD; - mActive=query.mActive; - } - - public PipeActivityData(IActivePipe metaTile) { - super(metaTile); - } - - public PipeActivityData(World world, int x,int y,int z, boolean active) { - super(world,x,y,z,active); - } - } - - public static class ClientHandler extends AbstractClientMessageHandler { - @Override - public IMessage handleClientMessage(EntityPlayer pPlayer, PipeActivityData pMessage, MessageContext pCtx) { - if(pPlayer.worldObj.provider.dimensionId==pMessage.mPosD){ - TileEntity te=pPlayer.worldObj.getTileEntity(pMessage.mPosX,pMessage.mPosY,pMessage.mPosZ); - if(te instanceof IGregTechTileEntity){ - IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity(); - if(meta instanceof IActivePipe){ - ((IActivePipe) meta).setActive((byte)pMessage.mActive==1); - } - } - } - return null; - } - } - - public static class ServerHandler extends AbstractServerMessageHandler { - @Override - public IMessage handleServerMessage(EntityPlayer pPlayer, PipeActivityQuery pMessage, MessageContext pCtx) { - World world= DimensionManager.getWorld(pMessage.mPosD); - if(world!=null) { - TileEntity te = world.getTileEntity(pMessage.mPosX, pMessage.mPosY, pMessage.mPosZ); - if (te instanceof IGregTechTileEntity) { - IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity(); - if (meta instanceof IActivePipe) { - pMessage.mActive=((IActivePipe) meta).getActive()?1:0; - return new PipeActivityData(pMessage); - } - } - } - return null; - } - } -} \ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/network/PipeActivityPacketDispatcher.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/network/PipeActivityPacketDispatcher.java deleted file mode 100644 index 0cc5ab61ca..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/network/PipeActivityPacketDispatcher.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.multi.base.network; - -import eu.usrv.yamcore.network.PacketDispatcher; - -import static com.github.technus.tectech.Reference.MODID; - -public class PipeActivityPacketDispatcher extends PacketDispatcher { - public static PipeActivityPacketDispatcher INSTANCE; - - public PipeActivityPacketDispatcher() { - super(MODID); - INSTANCE = this; - registerPackets(); - } - - @Override - public void registerPackets() { - registerMessage(PipeActivityMessage.ServerHandler.class, PipeActivityMessage.PipeActivityQuery.class); - registerMessage(PipeActivityMessage.ClientHandler.class, PipeActivityMessage.PipeActivityData.class); - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/network/RotationMessage.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/network/RotationMessage.java deleted file mode 100644 index 59b14c16ed..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/network/RotationMessage.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.multi.base.network; - -import com.github.technus.tectech.thing.metaTileEntity.IFrontRotation; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import cpw.mods.fml.common.network.ByteBufUtils; -import cpw.mods.fml.common.network.simpleimpl.IMessage; -import cpw.mods.fml.common.network.simpleimpl.MessageContext; -import eu.usrv.yamcore.network.client.AbstractClientMessageHandler; -import eu.usrv.yamcore.network.server.AbstractServerMessageHandler; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import io.netty.buffer.ByteBuf; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.DimensionManager; - -public class RotationMessage implements IMessage { - int mPosX; - int mPosY; - int mPosZ; - int mPosD; - int mRotF; - - public RotationMessage() { - } - - private RotationMessage(GT_MetaTileEntity_MultiblockBase_EM metaTile) { - IGregTechTileEntity base=metaTile.getBaseMetaTileEntity(); - mPosX=base.getXCoord(); - mPosY=base.getYCoord(); - mPosZ=base.getZCoord(); - mPosD=base.getWorld().provider.dimensionId; - mRotF=metaTile.getFrontRotation(); - } - - private RotationMessage(World world, int x,int y,int z, IFrontRotation front) { - mPosX=x; - mPosY=y; - mPosZ=z; - mPosD=world.provider.dimensionId; - mRotF=front.getFrontRotation(); - } - - @Override - public void fromBytes(ByteBuf pBuffer) { - NBTTagCompound tTag = ByteBufUtils.readTag(pBuffer); - mPosX = tTag.getInteger("posx"); - mPosY = tTag.getInteger("posy"); - mPosZ = tTag.getInteger("posz"); - mPosD = tTag.getInteger("posd"); - mRotF = tTag.getInteger("rotf"); - } - - @Override - public void toBytes(ByteBuf pBuffer) { - NBTTagCompound tFXTag = new NBTTagCompound(); - tFXTag.setInteger("posx", mPosX); - tFXTag.setInteger("posy", mPosY); - tFXTag.setInteger("posz", mPosZ); - tFXTag.setInteger("posd", mPosD); - tFXTag.setInteger("rotf", mRotF); - - ByteBufUtils.writeTag(pBuffer, tFXTag); - } - - public static class RotationQuery extends RotationMessage{ - public RotationQuery() { - } - - public RotationQuery(GT_MetaTileEntity_MultiblockBase_EM metaTile) { - super(metaTile); - } - - public RotationQuery(World world, int x,int y,int z, IFrontRotation front) { - super(world,x,y,z,front); - } - } - - public static class RotationData extends RotationMessage{ - public RotationData() { - } - - private RotationData(RotationQuery query){ - mPosX=query.mPosX; - mPosY=query.mPosY; - mPosZ=query.mPosZ; - mPosD=query.mPosD; - mRotF=query.mRotF; - } - - public RotationData(GT_MetaTileEntity_MultiblockBase_EM metaTile) { - super(metaTile); - } - - public RotationData(World world, int x,int y,int z, IFrontRotation front) { - super(world,x,y,z,front); - } - } - - public static class ClientHandler extends AbstractClientMessageHandler { - @Override - public IMessage handleClientMessage(EntityPlayer pPlayer, RotationData pMessage, MessageContext pCtx) { - if(pPlayer.worldObj.provider.dimensionId==pMessage.mPosD){ - TileEntity te=pPlayer.worldObj.getTileEntity(pMessage.mPosX,pMessage.mPosY,pMessage.mPosZ); - if(te instanceof IGregTechTileEntity){ - IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity(); - if(meta instanceof IFrontRotation){ - ((IFrontRotation) meta).forceSetRotationDoRender((byte)pMessage.mRotF); - } - }else if (te instanceof IFrontRotation){ - ((IFrontRotation) te).forceSetRotationDoRender((byte)pMessage.mRotF); - } - } - return null; - } - } - - public static class ServerHandler extends AbstractServerMessageHandler { - @Override - public IMessage handleServerMessage(EntityPlayer pPlayer, RotationQuery pMessage, MessageContext pCtx) { - World world= DimensionManager.getWorld(pMessage.mPosD); - if(world!=null) { - TileEntity te = world.getTileEntity(pMessage.mPosX, pMessage.mPosY, pMessage.mPosZ); - if (te instanceof IGregTechTileEntity) { - IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity(); - if (meta instanceof IFrontRotation) { - pMessage.mRotF=((IFrontRotation) meta).getFrontRotation(); - return new RotationData(pMessage); - } - } else if (te instanceof IFrontRotation) { - pMessage.mRotF=((IFrontRotation) te).getFrontRotation(); - return new RotationData(pMessage); - } - } - return null; - } - } -} \ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/network/RotationPacketDispatcher.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/network/RotationPacketDispatcher.java deleted file mode 100644 index 29a8f0bcf6..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/network/RotationPacketDispatcher.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.multi.base.network; - -import eu.usrv.yamcore.network.PacketDispatcher; - -import static com.github.technus.tectech.Reference.MODID; - -public class RotationPacketDispatcher extends PacketDispatcher { - public static RotationPacketDispatcher INSTANCE; - - public RotationPacketDispatcher() { - super(MODID); - INSTANCE = this; - registerPackets(); - } - - @Override - public void registerPackets() { - registerMessage(RotationMessage.ServerHandler.class, RotationMessage.RotationQuery.class); - registerMessage(RotationMessage.ClientHandler.class, RotationMessage.RotationData.class); - } -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java index adf8b1f127..4badeb2d7c 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java @@ -2,8 +2,8 @@ package com.github.technus.tectech.thing.metaTileEntity.pipe; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.network.PipeActivityMessage; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.network.PipeActivityPacketDispatcher; +import com.github.technus.tectech.loader.network.PipeActivityMessage; +import com.github.technus.tectech.loader.network.NetworkDispatcher; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.GT_Mod; @@ -109,7 +109,7 @@ public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements IConn @Override public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { if(getBaseMetaTileEntity().isClientSide()){ - PipeActivityPacketDispatcher.INSTANCE.sendToServer(new PipeActivityMessage.PipeActivityQuery(this)); + NetworkDispatcher.INSTANCE.sendToServer(new PipeActivityMessage.PipeActivityQuery(this)); } onPostTick(aBaseMetaTileEntity, 31); } @@ -120,7 +120,7 @@ public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements IConn if ((aTick & 31) == 31) { if(active){ if(TecTech.RANDOM.nextInt(15)==0) { - PipeActivityPacketDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), + NetworkDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), aBaseMetaTileEntity.getWorld().provider.dimensionId, aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), @@ -130,7 +130,7 @@ public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements IConn active=false; }else if(getActive()){ if(TecTech.RANDOM.nextInt(15)==0) { - PipeActivityPacketDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), + NetworkDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), aBaseMetaTileEntity.getWorld().provider.dimensionId, aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java index 151718db6c..f6c0724546 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java @@ -2,8 +2,8 @@ package com.github.technus.tectech.thing.metaTileEntity.pipe; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.network.PipeActivityMessage; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.network.PipeActivityPacketDispatcher; +import com.github.technus.tectech.loader.network.PipeActivityMessage; +import com.github.technus.tectech.loader.network.NetworkDispatcher; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.GT_Mod; @@ -110,7 +110,7 @@ public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements IConnec @Override public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { if(getBaseMetaTileEntity().isClientSide()){ - PipeActivityPacketDispatcher.INSTANCE.sendToServer(new PipeActivityMessage.PipeActivityQuery(this)); + NetworkDispatcher.INSTANCE.sendToServer(new PipeActivityMessage.PipeActivityQuery(this)); } onPostTick(aBaseMetaTileEntity, 31); } @@ -121,7 +121,7 @@ public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements IConnec if ((aTick & 31) == 31) { if(active){ if(TecTech.RANDOM.nextInt(7)==0) { - PipeActivityPacketDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), + NetworkDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), aBaseMetaTileEntity.getWorld().provider.dimensionId, aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), @@ -131,7 +131,7 @@ public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements IConnec active=false; }else if(getActive()){ if(TecTech.RANDOM.nextInt(7)==0) { - PipeActivityPacketDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), + NetworkDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), aBaseMetaTileEntity.getWorld().provider.dimensionId, aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java index 715e79ffbb..8ee90c6954 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java @@ -2,8 +2,8 @@ package com.github.technus.tectech.thing.metaTileEntity.pipe; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.network.PipeActivityMessage; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.network.PipeActivityPacketDispatcher; +import com.github.technus.tectech.loader.network.PipeActivityMessage; +import com.github.technus.tectech.loader.network.NetworkDispatcher; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.GT_Mod; @@ -106,7 +106,7 @@ public class GT_MetaTileEntity_Pipe_Energy extends MetaPipeEntity implements ICo @Override public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { if(getBaseMetaTileEntity().isClientSide()){ - PipeActivityPacketDispatcher.INSTANCE.sendToServer(new PipeActivityMessage.PipeActivityQuery(this)); + NetworkDispatcher.INSTANCE.sendToServer(new PipeActivityMessage.PipeActivityQuery(this)); } onPostTick(aBaseMetaTileEntity, 31); } @@ -117,7 +117,7 @@ public class GT_MetaTileEntity_Pipe_Energy extends MetaPipeEntity implements ICo if ((aTick & 31) == 31) { if(active){ if(TecTech.RANDOM.nextInt(31)==0) { - PipeActivityPacketDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), + NetworkDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), aBaseMetaTileEntity.getWorld().provider.dimensionId, aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), @@ -127,7 +127,7 @@ public class GT_MetaTileEntity_Pipe_Energy extends MetaPipeEntity implements ICo active=false; }else if(getActive()){ if(TecTech.RANDOM.nextInt(31)==0) { - PipeActivityPacketDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), + NetworkDispatcher.INSTANCE.sendToAllAround(new PipeActivityMessage.PipeActivityData(this), aBaseMetaTileEntity.getWorld().provider.dimensionId, aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), -- cgit From 1438d4ba8a02aa1dc570c9c599a3014ccec2a6ca Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 9 Jun 2019 20:56:23 +0200 Subject: Fix default paremeter setting --- .../technus/tectech/thing/metaTileEntity/multi/base/Parameters.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java index 33d4dd9899..1ecb17891e 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java @@ -165,12 +165,12 @@ public class Parameters { if (this.parameterOut[0] != null) { this.parameterOut[0].setDefault(); } else { - iParamsIn[hatchNo] = 0; + iParamsOut[hatchNo] = 0; } if (this.parameterOut[1] != null) { this.parameterOut[1].setDefault(); } else { - iParamsIn[hatchNo + 10] = 0; + iParamsOut[hatchNo + 10] = 0; } } } @@ -267,7 +267,7 @@ public class Parameters { if(paramID<0 || paramID>2){ throw new IllegalArgumentException("Parameter id must be in 0 to 1 range"); } - if(parameterOut[paramID]!=null){ + if(parameterIn[paramID]!=null){ throw new IllegalArgumentException("Parameter id already occupied"); } this.defaultValue=defaultValue; -- cgit From e2069e7e0392e81a2ccac6b96550c50a8034b7fc Mon Sep 17 00:00:00 2001 From: Tec Date: Wed, 26 Jun 2019 06:06:02 +0200 Subject: Drop power usage to IV --- .../thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java index b5f4d92872..880efbecb4 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java @@ -115,7 +115,7 @@ public class GT_MetaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockB @Override public boolean checkRecipe_EM(ItemStack itemStack) { if (eDataAccessHatches.size() > 0 && eStacksDataOutputs.size() > 0) { - mEUt = -(int) V[7]; + mEUt = -(int) V[5]; eAmpereFlow = 1 + (eStacksDataOutputs.size() >> 2) + eDataAccessHatches.size(); mMaxProgresstime = 20; mEfficiencyIncrease = 10000; -- cgit From 910ecf9a8ae8fc0970557e02e7177c66b25e3c8f Mon Sep 17 00:00:00 2001 From: Tec Date: Wed, 26 Jun 2019 06:12:59 +0200 Subject: Adjust power drain --- .../thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java index 880efbecb4..4112d242ab 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java @@ -115,8 +115,8 @@ public class GT_MetaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockB @Override public boolean checkRecipe_EM(ItemStack itemStack) { if (eDataAccessHatches.size() > 0 && eStacksDataOutputs.size() > 0) { - mEUt = -(int) V[5]; - eAmpereFlow = 1 + (eStacksDataOutputs.size() >> 2) + eDataAccessHatches.size(); + mEUt = -(int) Math.max(V[4],V[4] * eDataAccessHatches.size()); + eAmpereFlow = 1 + (eStacksDataOutputs.size() >> 2); mMaxProgresstime = 20; mEfficiencyIncrease = 10000; return true; -- cgit From 54166d50d38986c6bfe7c7c9cacdf3dba2e39f71 Mon Sep 17 00:00:00 2001 From: Tec Date: Wed, 26 Jun 2019 06:26:02 +0200 Subject: Adjust power drain --- .../thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java index 4112d242ab..3a92ae8671 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java @@ -115,8 +115,8 @@ public class GT_MetaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockB @Override public boolean checkRecipe_EM(ItemStack itemStack) { if (eDataAccessHatches.size() > 0 && eStacksDataOutputs.size() > 0) { - mEUt = -(int) Math.max(V[4],V[4] * eDataAccessHatches.size()); - eAmpereFlow = 1 + (eStacksDataOutputs.size() >> 2); + mEUt = -(int)V[4]; + eAmpereFlow = 1 + eStacksDataOutputs.size()*eDataAccessHatches.size(); mMaxProgresstime = 20; mEfficiencyIncrease = 10000; return true; -- cgit From ac8e488356636f6e3e6e0f11e8bd784598d5b1aa Mon Sep 17 00:00:00 2001 From: Tec Date: Wed, 26 Jun 2019 06:48:31 +0200 Subject: Probably fix for id lost on relogin? --- .../single/GT_MetaTileEntity_BuckConverter.java | 1 + .../metaTileEntity/single/GT_MetaTileEntity_DataReader.java | 11 +++-------- .../single/GT_MetaTileEntity_DebugPowerGenerator.java | 1 + .../single/GT_MetaTileEntity_DebugStructureWriter.java | 1 + .../single/GT_MetaTileEntity_OwnerDetector.java | 1 + .../single/GT_MetaTileEntity_WetTransformer.java | 1 + 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_BuckConverter.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_BuckConverter.java index f2648d2c2f..86c484059b 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_BuckConverter.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_BuckConverter.java @@ -35,6 +35,7 @@ public class GT_MetaTileEntity_BuckConverter extends GT_MetaTileEntity_TieredMac public GT_MetaTileEntity_BuckConverter(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, 0, aDescription, aTextures); + Util.setTier(aTier,this); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java index 758afa69b9..6aa742846b 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java @@ -47,6 +47,7 @@ public class GT_MetaTileEntity_DataReader extends GT_MetaTileEntity_BasicMachine public GT_MetaTileEntity_DataReader(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName,aTier,1,aDescription,aTextures,1,1,"dataReader.png",""); + Util.setTier(aTier,this); } @Override @@ -174,10 +175,7 @@ public class GT_MetaTileEntity_DataReader extends GT_MetaTileEntity_BasicMachine } public static void addDataRender(Util.ItemStack_NoNBT stack, DataRender render){ - ArrayList renders=RENDER_REGISTRY.get(stack); - if(renders==null){ - RENDER_REGISTRY.put(stack,renders=new ArrayList<>()); - } + ArrayList renders = RENDER_REGISTRY.computeIfAbsent(stack, k -> new ArrayList<>()); if(FMLCommonHandler.instance().getEffectiveSide().isClient()) { render.loadResources(); } @@ -298,10 +296,7 @@ public class GT_MetaTileEntity_DataReader extends GT_MetaTileEntity_BasicMachine @Override public boolean canRender(ItemStack itemStack,byte tier) { NBTTagCompound nbtTagCompound=itemStack.stackTagCompound; - if(nbtTagCompound!=null && nbtTagCompound.hasKey("output")){ - return true; - } - return false; + return nbtTagCompound != null && nbtTagCompound.hasKey("output"); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java index 92ac88b180..b809f18ab0 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java @@ -38,6 +38,7 @@ public class GT_MetaTileEntity_DebugPowerGenerator extends GT_MetaTileEntity_Tie public GT_MetaTileEntity_DebugPowerGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, 0, aDescription, aTextures); + Util.setTier(aTier,this); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java index 2e2e4f032a..28390e2a71 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java @@ -38,6 +38,7 @@ public class GT_MetaTileEntity_DebugStructureWriter extends GT_MetaTileEntity_Ti public GT_MetaTileEntity_DebugStructureWriter(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, 0, aDescription, aTextures); + Util.setTier(aTier,this); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_OwnerDetector.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_OwnerDetector.java index ca2ff72f20..7f44fb45ca 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_OwnerDetector.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_OwnerDetector.java @@ -36,6 +36,7 @@ public class GT_MetaTileEntity_OwnerDetector extends GT_MetaTileEntity_TieredMac public GT_MetaTileEntity_OwnerDetector(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, 0, aDescription, aTextures); + Util.setTier(aTier,this); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_WetTransformer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_WetTransformer.java index f32fc270e9..375e8ba655 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_WetTransformer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_WetTransformer.java @@ -19,6 +19,7 @@ public class GT_MetaTileEntity_WetTransformer extends GT_MetaTileEntity_Transfor public GT_MetaTileEntity_WetTransformer(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName,aTier,aDescription,aTextures); + Util.setTier(aTier,this); } @Override -- cgit From a77d155745ba329a0eff044ea01dc00141311b95 Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 13 Jul 2019 10:04:51 +0200 Subject: Anomaly work --- .../java/com/github/technus/tectech/TecTech.java | 8 +++ .../tectech/mechanics/anomaly/AnomalyHandler.java | 4 ++ .../mechanics/chunkData/ChunkDataHandler.java | 67 ++++++++++++++++++++++ .../mechanics/chunkData/ChunkMetaDataHandler.java | 10 ++++ .../github/technus/tectech/proxy/CommonProxy.java | 13 +++++ .../multi/GT_MetaTileEntity_EM_collider.java | 48 +++++++--------- 6 files changed, 123 insertions(+), 27 deletions(-) create mode 100644 src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkDataHandler.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkMetaDataHandler.java diff --git a/src/main/java/com/github/technus/tectech/TecTech.java b/src/main/java/com/github/technus/tectech/TecTech.java index 6f1c4fc7a0..e7dc6859dd 100644 --- a/src/main/java/com/github/technus/tectech/TecTech.java +++ b/src/main/java/com/github/technus/tectech/TecTech.java @@ -4,6 +4,7 @@ import com.github.technus.tectech.loader.MainLoader; import com.github.technus.tectech.loader.TecTechConfig; import com.github.technus.tectech.mechanics.ConvertFloat; import com.github.technus.tectech.mechanics.ConvertInteger; +import com.github.technus.tectech.mechanics.chunkData.ChunkDataHandler; import com.github.technus.tectech.mechanics.elementalMatter.core.commands.GiveEM; import com.github.technus.tectech.mechanics.elementalMatter.core.commands.ListEM; import com.github.technus.tectech.proxy.CommonProxy; @@ -34,6 +35,8 @@ public class TecTech { private static IngameErrorLog moduleAdminErrorLogs; public static TecTechConfig configTecTech; + public static ChunkDataHandler chunkDataHandler=new ChunkDataHandler();; + /** * For Loader.isModLoaded checks during the runtime */ @@ -93,4 +96,9 @@ public class TecTech { pEvent.registerServerCommand(new GiveEM()); } } + + @Mod.EventHandler + public void onServerStarting(FMLServerStartingEvent aEvent) { + chunkDataHandler.onServerStarting(); + } } diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java new file mode 100644 index 0000000000..8751a80dd9 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java @@ -0,0 +1,4 @@ +package com.github.technus.tectech.mechanics.anomaly; + +public class AnomalyHandler { +} diff --git a/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkDataHandler.java b/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkDataHandler.java new file mode 100644 index 0000000000..8bed59ae35 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkDataHandler.java @@ -0,0 +1,67 @@ +package com.github.technus.tectech.mechanics.chunkData; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraftforge.event.world.ChunkDataEvent; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Set; + +public class ChunkDataHandler { + private final String TEC_TAG="TecTechTag"; + private final HashMap> dimensionWiseChunkData=new HashMap<>(); + private final HashMap metaDataHandlerHashMap =new HashMap<>(); + + public void handleChunkSaveEvent(ChunkDataEvent.Save event) { + HashMap dimensionData=dimensionWiseChunkData.get(event.world.provider.dimensionId); + NBTChunk chunkData =dimensionData!=null?dimensionData.get(event.getChunk().getChunkCoordIntPair()):null; + if(chunkData==null) { + event.getData().removeTag(TEC_TAG); + } else { + event.getData().setTag(TEC_TAG,chunkData.getData()); + } + } + + public void handleChunkLoadEvent(ChunkDataEvent.Load event) { + HashMap dimensionData= + dimensionWiseChunkData.computeIfAbsent(event.world.provider.dimensionId,k->new HashMap<>(1024)); + ChunkCoordIntPair chunkCoordIntPair=event.getChunk().getChunkCoordIntPair(); + NBTChunk chunkData =dimensionData.get(chunkCoordIntPair); + if(chunkData==null) { + dimensionData.put(chunkCoordIntPair,new NBTChunk(event.getData().getCompoundTag(TEC_TAG),true)); + }else if(!chunkData.isLoaded) { + chunkData.isLoaded=true; + Set tags=new HashSet<>(); + tags.addAll(chunkData.getData().func_150296_c()); + tags.addAll(event.getData().func_150296_c()); + NBTTagCompound compound=new NBTTagCompound(); + } + } + + public void onServerStarting() { + dimensionWiseChunkData.clear(); + } + + public void registerChunkMetaDataHandler(ChunkMetaDataHandler handler){ + metaDataHandlerHashMap.put(handler.getTagName(),handler); + } + + public static class NBTChunk { + private final NBTTagCompound data; + private boolean isLoaded; + + private NBTChunk(NBTTagCompound data, boolean isLoaded) { + this.data = data; + this.isLoaded = isLoaded; + } + + public boolean isLoaded(){ + return isLoaded; + } + + public NBTTagCompound getData(){ + return data; + } + } +} diff --git a/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkMetaDataHandler.java b/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkMetaDataHandler.java new file mode 100644 index 0000000000..baa7bfba13 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkMetaDataHandler.java @@ -0,0 +1,10 @@ +package com.github.technus.tectech.mechanics.chunkData; + +import net.minecraft.nbt.NBTTagCompound; + +public interface ChunkMetaDataHandler { + String getTagName(); + void mergeData(NBTTagCompound inMemory,NBTTagCompound loaded,NBTTagCompound result); + NBTTagCompound createData(); +} + diff --git a/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java b/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java index 598a8b148f..9a9c644af9 100644 --- a/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java +++ b/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java @@ -1,5 +1,7 @@ package com.github.technus.tectech.proxy; +import com.github.technus.tectech.TecTech; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.network.IGuiHandler; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; @@ -9,6 +11,7 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ChatComponentText; import net.minecraft.world.World; import net.minecraft.world.WorldServer; +import net.minecraftforge.event.world.ChunkDataEvent; public class CommonProxy implements IGuiHandler { public void registerRenderInfo() {} @@ -81,4 +84,14 @@ public class CommonProxy implements IGuiHandler { } return false; } + + @SubscribeEvent + public void handleChunkSaveEvent(ChunkDataEvent.Save event) { + TecTech.chunkDataHandler.handleChunkSaveEvent(event); + } + + @SubscribeEvent + public void handleChunkLoadEvent(ChunkDataEvent.Load event) { + TecTech.chunkDataHandler.handleChunkLoadEvent(event); + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java index 06f1866826..b9b589c409 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java @@ -173,35 +173,29 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB } }); - PRIMITIVE_FUSE_HANDLERS.put(eQuarkDefinition.class.getName() + '\0' + eQuarkDefinition.class.getName(), new PrimitiveColliderHandler() { - @Override - public void collide(cElementalInstanceStack in1, cElementalInstanceStack in2, cElementalInstanceStackMap out) { - try { - cElementalMutableDefinitionStackMap defs=new cElementalMutableDefinitionStackMap(); - defs.putUnify(in1.definition.getStackForm(1)); - defs.putUnify(in2.definition.getStackForm(1)); - dHadronDefinition hadron = new dHadronDefinition(defs.toImmutable_optimized_unsafeLeavesExposedElementalTree()); - out.putUnify(new cElementalInstanceStack(hadron,Math.min(in1.amount,in2.amount))); - }catch (Exception e){ - out.putUnifyAll(in1,in2); - return; - } - if(in1.amount>in2.amount){ - out.putUnify(new cElementalInstanceStack(in1.definition,in1.amount-in2.amount)); - }else if (in2.amount>in1.amount){ - out.putUnify(new cElementalInstanceStack(in2.definition,in2.amount-in1.amount)); - } + PRIMITIVE_FUSE_HANDLERS.put(eQuarkDefinition.class.getName() + '\0' + eQuarkDefinition.class.getName(), (in1, in2, out) -> { + try { + cElementalMutableDefinitionStackMap defs=new cElementalMutableDefinitionStackMap(); + defs.putUnify(in1.definition.getStackForm(1)); + defs.putUnify(in2.definition.getStackForm(1)); + dHadronDefinition hadron = new dHadronDefinition(defs.toImmutable_optimized_unsafeLeavesExposedElementalTree()); + out.putUnify(new cElementalInstanceStack(hadron,Math.min(in1.amount,in2.amount))); + }catch (Exception e){ + out.putUnifyAll(in1,in2); + return; + } + if(in1.amount>in2.amount){ + out.putUnify(new cElementalInstanceStack(in1.definition,in1.amount-in2.amount)); + }else if (in2.amount>in1.amount){ + out.putUnify(new cElementalInstanceStack(in2.definition,in2.amount-in1.amount)); } }); - PRIMITIVE_FUSE_HANDLERS.put(ePrimalAspectDefinition.class.getName() + '\0' + ePrimalAspectDefinition.class.getName(), new PrimitiveColliderHandler() { - @Override - public void collide(cElementalInstanceStack in1, cElementalInstanceStack in2, cElementalInstanceStackMap out) { - if (fuseAspects(in1, in2, out)) return; - if(in1.amount>in2.amount){ - out.putUnify(new cElementalInstanceStack(in1.definition,in1.amount-in2.amount)); - }else if (in2.amount>in1.amount){ - out.putUnify(new cElementalInstanceStack(in2.definition,in2.amount-in1.amount)); - } + PRIMITIVE_FUSE_HANDLERS.put(ePrimalAspectDefinition.class.getName() + '\0' + ePrimalAspectDefinition.class.getName(), (in1, in2, out) -> { + if (fuseAspects(in1, in2, out)) return; + if(in1.amount>in2.amount){ + out.putUnify(new cElementalInstanceStack(in1.definition,in1.amount-in2.amount)); + }else if (in2.amount>in1.amount){ + out.putUnify(new cElementalInstanceStack(in2.definition,in2.amount-in1.amount)); } }); } -- cgit From f59ccc47d72842a731bd220c68b2faee8987aef4 Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 13 Jul 2019 11:12:00 +0200 Subject: Cleanup --- .../java/com/github/technus/tectech/TecTech.java | 2 +- src/main/java/com/github/technus/tectech/Util.java | 4 ++-- .../definitions/AspectDefinitionCompatEnabled.java | 2 +- .../github/technus/tectech/loader/MainLoader.java | 11 ++++----- .../tectech/loader/thing/MachineLoader.java | 1 - .../elementalMatter/core/cElementalDecay.java | 2 +- .../elementalMatter/core/cElementalStackMap.java | 4 ++-- .../elementalMatter/core/commands/GiveEM.java | 3 +-- .../elementalMatter/core/commands/ListEM.java | 2 +- .../elementalMatter/core/rElementalRecipe.java | 8 +------ .../elementalMatter/core/rElementalRecipeMap.java | 6 +---- .../core/templates/cElementalPrimitive.java | 8 +------ .../definitions/complex/atom/dAtomDefinition.java | 28 +++++++++------------- .../definitions/complex/atom/iaeaNuclide.java | 4 ++-- .../complex/hadron/dHadronDefinition.java | 2 +- .../tectech/nei/TT_NEI_ResearchHandler.java | 2 +- .../technus/tectech/nei/TT_NEI_ScannerHandler.java | 2 +- .../github/technus/tectech/recipe/TT_recipe.java | 4 ++-- .../technus/tectech/recipe/TT_recipeAdder.java | 2 +- .../GT_MetaTileEntity_Hatch_OverflowElemental.java | 4 ++-- .../multi/GT_MetaTileEntity_EM_quantizer.java | 4 ++-- .../multi/GT_MetaTileEntity_EM_research.java | 8 +++---- .../multi/GT_MetaTileEntity_TM_microwave.java | 2 -- .../multi/GT_MetaTileEntity_TM_teslaCoil.java | 2 +- 24 files changed, 44 insertions(+), 73 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/TecTech.java b/src/main/java/com/github/technus/tectech/TecTech.java index e7dc6859dd..337f493801 100644 --- a/src/main/java/com/github/technus/tectech/TecTech.java +++ b/src/main/java/com/github/technus/tectech/TecTech.java @@ -35,7 +35,7 @@ public class TecTech { private static IngameErrorLog moduleAdminErrorLogs; public static TecTechConfig configTecTech; - public static ChunkDataHandler chunkDataHandler=new ChunkDataHandler();; + public static ChunkDataHandler chunkDataHandler=new ChunkDataHandler(); /** * For Loader.isModLoaded checks during the runtime diff --git a/src/main/java/com/github/technus/tectech/Util.java b/src/main/java/com/github/technus/tectech/Util.java index c550203874..e333e70137 100644 --- a/src/main/java/com/github/technus/tectech/Util.java +++ b/src/main/java/com/github/technus/tectech/Util.java @@ -41,7 +41,7 @@ public final class Util { @SuppressWarnings("ComparatorMethodParameterNotUsed") public static > SortedSet> entriesSortedByValues(Map map) { - SortedSet> sortedEntries = new TreeSet>( + SortedSet> sortedEntries = new TreeSet<>( (e1, e2) -> { int res = e1.getValue().compareTo(e2.getValue()); return res != 0 ? res : 1; // Special fix to preserve items with equal values @@ -1159,7 +1159,7 @@ public final class Util { c++;//depth } output.add("}"); - return output.toArray(new String[output.size()]); + return output.toArray(new String[0]); } private static final Pattern matchE_ = Pattern.compile("(E,(E,)+)"); diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/AspectDefinitionCompatEnabled.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/AspectDefinitionCompatEnabled.java index 91523326db..da930a1d79 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/AspectDefinitionCompatEnabled.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/AspectDefinitionCompatEnabled.java @@ -30,7 +30,7 @@ public final class AspectDefinitionCompatEnabled extends AspectDefinitionCompat aspectToDef.put("perditio",magic_entropy); ArrayList list=Aspect.getCompoundAspects(); - Aspect[] array= list.toArray(new Aspect[list.size()]); + Aspect[] array= list.toArray(new Aspect[0]); while (!list.isEmpty()) { for (Aspect aspect : array) { if (list.contains(aspect)) { diff --git a/src/main/java/com/github/technus/tectech/loader/MainLoader.java b/src/main/java/com/github/technus/tectech/loader/MainLoader.java index b1a71afb2f..473045d665 100644 --- a/src/main/java/com/github/technus/tectech/loader/MainLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/MainLoader.java @@ -234,14 +234,11 @@ public final class MainLoader { } public static void addAfterGregTechPostLoadRunner() { - GregTech_API.sAfterGTPostload.add(new Runnable() { - @Override - public void run() { - if(TecTech.configTecTech.NERF_FUSION) { - FixBrokenFusionRecipes(); - } - GT_MetaTileEntity_EM_collider.setValues(getFuelValue(Materials.Helium.getPlasma(125))); + GregTech_API.sAfterGTPostload.add(() -> { + if(TecTech.configTecTech.NERF_FUSION) { + FixBrokenFusionRecipes(); } + GT_MetaTileEntity_EM_collider.setValues(getFuelValue(Materials.Helium.getPlasma(125))); }); } diff --git a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java index 3f4bab98f0..e734a4f8a3 100644 --- a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java @@ -17,7 +17,6 @@ import net.minecraft.item.ItemStack; import static com.github.technus.tectech.CommonValues.V; import static com.github.technus.tectech.thing.CustomItemList.*; -import static com.github.technus.tectech.thing.CustomItemList.eM_dynamotunnel9001; /** * Created by danie_000 on 16.11.2016. diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalDecay.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalDecay.java index 7f56ee8e5b..7d5e079876 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalDecay.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalDecay.java @@ -8,7 +8,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElem * Created by danie_000 on 22.10.2016. */ public final class cElementalDecay { - public static final cElementalDecay[] noDecay = (cElementalDecay[]) null; + public static final cElementalDecay[] noDecay = null; //DECAY IMPOSSIBLE!!! //Do not use regular NULL java will not make it work with varargs!!! //Or cast null into ARRAY type but this static is more convenient!!! diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalStackMap.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalStackMap.java index 19f5789804..fb6acec084 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalStackMap.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/cElementalStackMap.java @@ -48,12 +48,12 @@ abstract class cElementalStackMap implements Comparable { public final cElementalDefinitionStack[] values() { Collection var = map.values(); - return var.toArray(new cElementalDefinitionStack[var.size()]); + return var.toArray(new cElementalDefinitionStack[0]); } public final iElementalDefinition[] keys() { Set var = map.keySet(); - return var.toArray(new iElementalDefinition[var.size()]); + return var.toArray(new iElementalDefinition[0]); } public long getCountOfAllAmounts(){ diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/commands/GiveEM.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/commands/GiveEM.java index ad8d1ad8c8..333359949f 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/commands/GiveEM.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/commands/GiveEM.java @@ -45,8 +45,7 @@ public class GiveEM implements ICommand { }else{ TecTech.LOGGER.info("Spawninig EM for "+((EntityPlayerMP) sender).getDisplayName()+" - "+Arrays.toString(args)); - ArrayList list=new ArrayList<>(); - list.addAll(Arrays.asList(args)); + ArrayList list = new ArrayList<>(Arrays.asList(args)); String energy=list.remove(0); cElementalDefinitionStack def= getDefinitionStack(list); diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/commands/ListEM.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/commands/ListEM.java index 9e034f4655..20110c0b0d 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/commands/ListEM.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/commands/ListEM.java @@ -29,7 +29,7 @@ public class ListEM implements ICommand { sender.addChatMessage(new ChatComponentText(" Available Classes: tag - name")); Map binds= cElementalDefinition.getBindsComplex(); for (Map.Entry e:binds.entrySet()) { - sender.addChatMessage(new ChatComponentText(String.valueOf((char)e.getKey().byteValue())+" - "+e.getValue().getReturnType().getSimpleName())); + sender.addChatMessage(new ChatComponentText((char) e.getKey().byteValue() +" - "+e.getValue().getReturnType().getSimpleName())); } }else if(args.length==1){ sender.addChatMessage(new ChatComponentText(" Available Primitives: symbol - name")); diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/rElementalRecipe.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/rElementalRecipe.java index c2fd9a81d4..e191cc0e0a 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/rElementalRecipe.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/rElementalRecipe.java @@ -38,13 +38,7 @@ public class rElementalRecipe implements Comparable { if(compare!=0) { return compare; } - if(ID>o.ID) { - return 1; - } - if(ID r = recipes.get(in.inEM); - if (r == null) { - r = new HashMap<>(); - recipes.put(in.inEM, r); - } + HashMap r = recipes.computeIfAbsent(in.inEM, k -> new HashMap<>()); return r.put(in.ID, in);//IF THIS RETURN SHIT, it means that inputs are using the exact same types of matter as input - (non amount wise collision) //It is either bad, or unimportant if you use different id's } diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/templates/cElementalPrimitive.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/templates/cElementalPrimitive.java index bcd46c579a..749d5c687b 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/templates/cElementalPrimitive.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/templates/cElementalPrimitive.java @@ -251,13 +251,7 @@ public abstract class cElementalPrimitive extends cElementalDefinition { public final int compareTo(iElementalDefinition o) { if (getClassType() == o.getClassType()) { int oID = ((cElementalPrimitive) o).ID; - if (ID > oID) { - return 1; - } - if (ID < oID) { - return -1; - } - return 0; + return Integer.compare(ID, oID); } return compareClassID(o); } diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/atom/dAtomDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/atom/dAtomDefinition.java index 99e80b7be2..86d31bfb1b 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/atom/dAtomDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/atom/dAtomDefinition.java @@ -396,35 +396,35 @@ public final class dAtomDefinition extends cElementalDefinition { switch (decayMode) { case -2: if(TecTech.RANDOM.nextBoolean() && ElectronCapture(decaysList)) { - return decaysList.toArray(new cElementalDecay[decaysList.size()]); + return decaysList.toArray(new cElementalDecay[0]); } else if(PbetaDecay(decaysList)) { - return decaysList.toArray(new cElementalDecay[decaysList.size()]); + return decaysList.toArray(new cElementalDecay[0]); } break; case -1: if(Emmision(decaysList, dHadronDefinition.hadron_p1)) { - return decaysList.toArray(new cElementalDecay[decaysList.size()]); + return decaysList.toArray(new cElementalDecay[0]); } break; case 0: if(alphaDecay(decaysList)) { - return decaysList.toArray(new cElementalDecay[decaysList.size()]); + return decaysList.toArray(new cElementalDecay[0]); } break; case 1: if(Emmision(decaysList, dHadronDefinition.hadron_n1)) { - return decaysList.toArray(new cElementalDecay[decaysList.size()]); + return decaysList.toArray(new cElementalDecay[0]); } break; case 2: if(MbetaDecay(decaysList)) { - return decaysList.toArray(new cElementalDecay[decaysList.size()]); + return decaysList.toArray(new cElementalDecay[0]); } break; default: if(decayMode>8){ if(iaeaDecay(decaysList,0)) { - return decaysList.toArray(new cElementalDecay[decaysList.size()]); + return decaysList.toArray(new cElementalDecay[0]); } return getDecayArray(decaysList,decayMode- BYTE_OFFSET,false); } @@ -1167,7 +1167,7 @@ public final class dAtomDefinition extends cElementalDefinition { if (iaeaDefinitionExistsAndHasEnergyLevels) { ArrayList decays=new ArrayList<>(4); if(iaeaDecay(decays,energyLevel)){ - return decays.toArray(new cElementalDecay[decays.size()]); + return decays.toArray(new cElementalDecay[0]); } } if(energyLevel< Math.abs(charge)/3+neutralCount) { @@ -1257,7 +1257,7 @@ public final class dAtomDefinition extends cElementalDefinition { decaysInto.add(new cElementalDefinitionStack(boson_Y__, 2)); } } - return new cElementalDecay[]{new cElementalDecay(0.75F, decaysInto.toArray(new cElementalDefinitionStack[decaysInto.size()])), deadEnd}; + return new cElementalDecay[]{new cElementalDecay(0.75F, decaysInto.toArray(new cElementalDefinitionStack[0])), deadEnd}; } //@Override @@ -1357,10 +1357,7 @@ public final class dAtomDefinition extends cElementalDefinition { float rawLifeTime = calculateLifeTime(izoDiff, izoDiffAbs, element, isotope, false); iaeaNuclide nuclide = iaeaNuclide.get(element, isotope); if (rawLifeTime >= STABLE_RAW_LIFE_TIME || nuclide != null && nuclide.halfTime >= STABLE_RAW_LIFE_TIME) { - TreeSet isotopes = stableIsotopes.get(element); - if (isotopes == null) { - stableIsotopes.put(element, isotopes = new TreeSet<>()); - } + TreeSet isotopes = stableIsotopes.computeIfAbsent(element, k -> new TreeSet<>()); isotopes.add(isotope); } } @@ -1375,10 +1372,7 @@ public final class dAtomDefinition extends cElementalDefinition { int izoDiff = isotope - Isotope; int izoDiffAbs = Math.abs(izoDiff); float rawLifeTime = calculateLifeTime(izoDiff, izoDiffAbs, element, isotope, false); - TreeMap isotopes = mostStableUnstableIsotopes.get(element); - if (isotopes == null) { - mostStableUnstableIsotopes.put(element, isotopes = new TreeMap<>()); - } + TreeMap isotopes = mostStableUnstableIsotopes.computeIfAbsent(element, k -> new TreeMap<>()); isotopes.put(rawLifeTime, isotope); } } diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/atom/iaeaNuclide.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/atom/iaeaNuclide.java index 10c537ed55..ac44f9242e 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/atom/iaeaNuclide.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/atom/iaeaNuclide.java @@ -134,7 +134,7 @@ public final class iaeaNuclide { if(energeticStates==null || energeticStates.isEmpty()) { energeticStatesArray = empty; } else { - energeticStatesArray = energeticStates.values().toArray(new energeticState[energeticStates.size()]); + energeticStatesArray = energeticStates.values().toArray(new energeticState[0]); } } @@ -273,7 +273,7 @@ public final class iaeaNuclide { //if(DEBUG_MODE){ // System.out.println("INVALID SUM?\t"+normalization+"\t"+decay1+"\t"+chance1+"\t"+decay2+"\t"+chance2+"\t"+decay3+"\t"+chance3); //} - return decays.values().toArray(new iaeaDecay[decays.size()]); + return decays.values().toArray(new iaeaDecay[0]); } public static final class iaeaDecay{ diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/hadron/dHadronDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/hadron/dHadronDefinition.java index 6b98cd2a99..1d617fcdb9 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/hadron/dHadronDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/hadron/dHadronDefinition.java @@ -198,7 +198,7 @@ public final class dHadronDefinition extends cElementalDefinition {//TODO Optimi } } return new cElementalDecay[]{ - new cElementalDecay(0.75F, decaysInto.toArray(new cElementalDefinitionStack[decaysInto.size()])), + new cElementalDecay(0.75F, decaysInto.toArray(new cElementalDefinitionStack[0])), eBosonDefinition.deadEnd }; } diff --git a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java index a797a65d09..1c75dceec7 100644 --- a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java +++ b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java @@ -365,7 +365,7 @@ public class TT_NEI_ResearchHandler extends TemplateRecipeHandler { } } } - items = tDisplayStacks.toArray(new ItemStack[tDisplayStacks.size()]); + items = tDisplayStacks.toArray(new ItemStack[0]); if (items.length == 0) { items = new ItemStack[]{new ItemStack(Blocks.fire)}; } diff --git a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java index 8154816cfc..e9624f1b33 100644 --- a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java +++ b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java @@ -365,7 +365,7 @@ public class TT_NEI_ScannerHandler extends TemplateRecipeHandler { } } } - items = tDisplayStacks.toArray(new ItemStack[tDisplayStacks.size()]); + items = tDisplayStacks.toArray(new ItemStack[0]); if (items.length == 0) { items = new ItemStack[]{new ItemStack(Blocks.fire)}; } diff --git a/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java b/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java index 57d479a705..b5b5dd82b9 100644 --- a/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java +++ b/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java @@ -165,8 +165,8 @@ public class TT_recipe extends GT_Recipe { } public static class GT_Recipe_MapTT extends GT_Recipe.GT_Recipe_Map { - public static GT_Recipe_MapTT sResearchableFakeRecipes =new GT_Recipe_MapTT(new HashSet(32), "gt.recipe.researchStation", "Research station", (String)null, "gregtech:textures/gui/multimachines/ResearchFake", 1, 1,1,0,1,"", 1, "", true, false);//nei to false - using custom handler - public static GT_Recipe_MapTT sScannableFakeRecipes = new GT_Recipe_MapTT(new HashSet(32),"gt.recipe.em_scanner","EM Scanner Research",(String)null,"gregtech:textures/gui/multimachines/ResearchFake",1,1,1,0,1,"",1,"",true,false); + public static GT_Recipe_MapTT sResearchableFakeRecipes =new GT_Recipe_MapTT(new HashSet<>(32), "gt.recipe.researchStation", "Research station", null, "gregtech:textures/gui/multimachines/ResearchFake", 1, 1,1,0,1,"", 1, "", true, false);//nei to false - using custom handler + public static GT_Recipe_MapTT sScannableFakeRecipes = new GT_Recipe_MapTT(new HashSet<>(32),"gt.recipe.em_scanner","EM Scanner Research", null,"gregtech:textures/gui/multimachines/ResearchFake",1,1,1,0,1,"",1,"",true,false); public GT_Recipe_MapTT(Collection aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); diff --git a/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java b/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java index 4e352a7610..61efea1a0e 100644 --- a/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java +++ b/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java @@ -115,7 +115,7 @@ public class TT_recipeAdder extends GT_RecipeAdder { computationRequiredPerSec = Short.MAX_VALUE; } TT_recipe.GT_Recipe_MapTT.sResearchableFakeRecipes.addFakeRecipe(false, new ItemStack[]{aResearchItem}, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Writes Research result")}, null, null, totalComputationRequired, researchEUt, researchAmperage| computationRequiredPerSec<<16); - GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.addFakeRecipe(false,tInputs,new ItemStack[]{aOutput},new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Reads Research result", new Object[0])},aFluidInputs,null,assDuration,assEUt,0,tAlts,true); + GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.addFakeRecipe(false,tInputs,new ItemStack[]{aOutput},new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Reads Research result")},aFluidInputs,null,assDuration,assEUt,0,tAlts,true); GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.add(new GT_Recipe.GT_Recipe_AssemblyLine( CustomItemList.UnusedStuff.get(1), totalComputationRequired/computationRequiredPerSec, tInputs, aFluidInputs, aOutput, assDuration, assEUt, tAlts)); return true; } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OverflowElemental.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OverflowElemental.java index 867f814b63..63321a03a4 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OverflowElemental.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OverflowElemental.java @@ -40,7 +40,7 @@ public class GT_MetaTileEntity_Hatch_OverflowElemental extends GT_MetaTileEntity private static Textures.BlockIcons.CustomIcon EM_T_ACTIVE; private static Textures.BlockIcons.CustomIcon MufflerEM; private static Textures.BlockIcons.CustomIcon MufflerEMidle; - private float overflowMatter = 0f; + private float overflowMatter; public final float overflowMax; private final float overflowDisperse; @@ -195,7 +195,7 @@ public class GT_MetaTileEntity_Hatch_OverflowElemental extends GT_MetaTileEntity "Contained mass:", EnumChatFormatting.RED + Double.toString(overflowMatter) + EnumChatFormatting.RESET + " eV/c\u00b2 /", EnumChatFormatting.GREEN + Double.toString(overflowMax) + EnumChatFormatting.RESET + " eV/c\u00b2", - "Mass Disposal speed: " + EnumChatFormatting.BLUE + Double.toString(overflowDisperse) + EnumChatFormatting.RESET + " (eV/c\u00b2)/s" + "Mass Disposal speed: " + EnumChatFormatting.BLUE + overflowDisperse + EnumChatFormatting.RESET + " (eV/c\u00b2)/s" }; } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java index 381df4b893..d34acd1534 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java @@ -117,7 +117,7 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock public boolean checkRecipe_EM(ItemStack itemStack) {//TODO implement instance quantization if (GregTech_API.sPostloadFinished) { ArrayList storedInputs = getStoredInputs(); - ItemStack[] inI = storedInputs.toArray(new ItemStack[storedInputs.size()]); + ItemStack[] inI = storedInputs.toArray(new ItemStack[0]); if (inI.length > 0) { for (ItemStack is : inI) { //ITEM STACK quantization @@ -156,7 +156,7 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock } } ArrayList storedFluids = getStoredFluids(); - FluidStack[] inF = storedFluids.toArray(new FluidStack[storedFluids.size()]); + FluidStack[] inF = storedFluids.toArray(new FluidStack[0]); if (inF.length > 0) { for (FluidStack fs : inF) { aFluidQuantizationInfo aFQI = bTransformationInfo.fluidQuantization.get(fs.getFluid().getID()); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java index 88b24d11ae..e74cef7a34 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java @@ -515,20 +515,20 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB return new String[]{ "Energy Hatches:", EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET + " EU / " + - EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET + " EU", + EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU", (mEUt <= 0 ? "Probably uses: " : "Probably makes: ") + - EnumChatFormatting.RED + Integer.toString(Math.abs(mEUt)) + EnumChatFormatting.RESET + " EU/t at " + + EnumChatFormatting.RED + Math.abs(mEUt) + EnumChatFormatting.RESET + " EU/t at " + EnumChatFormatting.RED + eAmpereFlow + EnumChatFormatting.RESET + " A", "Tier Rating: " + EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier_EM()] + EnumChatFormatting.RESET + " / " + EnumChatFormatting.GREEN + VN[getMinEnergyInputTier_EM()] + EnumChatFormatting.RESET + " Amp Rating: " + EnumChatFormatting.GREEN + eMaxAmpereFlow + EnumChatFormatting.RESET + " A", "Problems: " + EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + - " Efficiency: " + EnumChatFormatting.YELLOW + Float.toString(mEfficiency / 100.0F) + EnumChatFormatting.RESET + " %", + " Efficiency: " + EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", "PowerPass: " + EnumChatFormatting.BLUE + ePowerPass + EnumChatFormatting.RESET + " SafeVoid: " + EnumChatFormatting.BLUE + eSafeVoid, "Computation Available: " + EnumChatFormatting.GREEN + eAvailableData + EnumChatFormatting.RESET, "Computation Remaining:", EnumChatFormatting.GREEN + Long.toString(computationRemaining / 20L) + EnumChatFormatting.RESET + " / " + - EnumChatFormatting.YELLOW + Long.toString(computationRequired / 20L) + EnumChatFormatting.YELLOW + computationRequired / 20L }; } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java index 7894a7fa37..7cb6bbab53 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java @@ -4,8 +4,6 @@ import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.Reference; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.*; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.NameFunction; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.StatusFunction; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java index 2c58006360..f62951bf48 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java @@ -288,7 +288,7 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock float yPos = mte.getYCoord() + 0.5f; float zPos = mte.getZCoord() + 0.5f; long reqSum = 0; - for (GT_MetaTileEntity_TM_teslaCoil Rx : eTeslaList.toArray(new GT_MetaTileEntity_TM_teslaCoil[eTeslaList.size()])) { + for (GT_MetaTileEntity_TM_teslaCoil Rx : eTeslaList.toArray(new GT_MetaTileEntity_TM_teslaCoil[0])) { try { reqSum += Rx.maxEUStore() - Rx.getEUVar(); } catch (Exception e) { -- cgit From 9d238f79f8caf9add7a7b8fb7ee026765d8ba94e Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 13 Jul 2019 13:07:04 +0200 Subject: Chunk data handler --- .../mechanics/chunkData/ChunkDataHandler.java | 105 ++++++++++++++++----- .../mechanics/chunkData/ChunkMetaDataHandler.java | 2 +- 2 files changed, 84 insertions(+), 23 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkDataHandler.java b/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkDataHandler.java index 8bed59ae35..8b5a7c870a 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkDataHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkDataHandler.java @@ -2,6 +2,8 @@ package com.github.technus.tectech.mechanics.chunkData; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; import net.minecraftforge.event.world.ChunkDataEvent; import java.util.HashMap; @@ -11,7 +13,8 @@ import java.util.Set; public class ChunkDataHandler { private final String TEC_TAG="TecTechTag"; private final HashMap> dimensionWiseChunkData=new HashMap<>(); - private final HashMap metaDataHandlerHashMap =new HashMap<>(); + private final HashMap>> dimensionWiseMetaChunkData=new HashMap<>(); + private final HashMap metaDataHandlerHashMap =new HashMap<>(); public void handleChunkSaveEvent(ChunkDataEvent.Save event) { HashMap dimensionData=dimensionWiseChunkData.get(event.world.provider.dimensionId); @@ -19,49 +22,107 @@ public class ChunkDataHandler { if(chunkData==null) { event.getData().removeTag(TEC_TAG); } else { - event.getData().setTag(TEC_TAG,chunkData.getData()); + chunkData.isLoaded=true; + event.getData().setTag(TEC_TAG,chunkData.data); } } public void handleChunkLoadEvent(ChunkDataEvent.Load event) { - HashMap dimensionData= - dimensionWiseChunkData.computeIfAbsent(event.world.provider.dimensionId,k->new HashMap<>(1024)); + NBTTagCompound loadedTag=event.getData().getCompoundTag(TEC_TAG); + if(loadedTag.hasNoTags()){ + return; + } + + int dimId=event.world.provider.dimensionId; + HashMap dimensionMemory= + dimensionWiseChunkData.computeIfAbsent(dimId,dim->{ + for (String meta : metaDataHandlerHashMap.keySet()) { + dimensionWiseMetaChunkData.get(meta).put(dim, new HashMap<>(1024)); + } + return new HashMap<>(1024); + }); + ChunkCoordIntPair chunkCoordIntPair=event.getChunk().getChunkCoordIntPair(); - NBTChunk chunkData =dimensionData.get(chunkCoordIntPair); - if(chunkData==null) { - dimensionData.put(chunkCoordIntPair,new NBTChunk(event.getData().getCompoundTag(TEC_TAG),true)); - }else if(!chunkData.isLoaded) { - chunkData.isLoaded=true; - Set tags=new HashSet<>(); - tags.addAll(chunkData.getData().func_150296_c()); - tags.addAll(event.getData().func_150296_c()); - NBTTagCompound compound=new NBTTagCompound(); + NBTChunk chunkMemory =dimensionMemory.get(chunkCoordIntPair); + Set loadedKeys=loadedTag.func_150296_c(); + + if(chunkMemory==null) { + chunkMemory=new NBTChunk(/*(NBTTagCompound)*/loadedTag/*.copy()*/,true); + for (String s :loadedKeys) { + if (metaDataHandlerHashMap.containsKey(s)) { + dimensionWiseMetaChunkData.get(s).get(dimId).put(chunkCoordIntPair,chunkMemory.data.getCompoundTag(s)); + } else { + throw new RuntimeException("Missing meta handler!" + s); + } + } + dimensionMemory.put(chunkCoordIntPair,chunkMemory); + }else if(!chunkMemory.isLoaded) { + chunkMemory.isLoaded=true; + + Set tagsDuplicated=new HashSet(loadedKeys); + tagsDuplicated.retainAll(chunkMemory.data.func_150296_c()); + + if (tagsDuplicated.isEmpty()) { + for (String s:loadedKeys) { + if (metaDataHandlerHashMap.containsKey(s)) { + chunkMemory.data.setTag(s,loadedTag.getTag(s)/*.copy()*/); + dimensionWiseMetaChunkData.get(s).get(dimId).put(chunkCoordIntPair,chunkMemory.data.getCompoundTag(s)); + } else { + throw new RuntimeException("Missing meta handler!" + s); + } + } + } else { + for (String s : loadedKeys) { + if(tagsDuplicated.contains(s)){ + ChunkMetaDataHandler metaDataHandler = metaDataHandlerHashMap.get(s); + if (metaDataHandler == null) { + throw new RuntimeException("Missing meta handler!" + s); + } else { + metaDataHandler.mergeData( + chunkMemory.data.getCompoundTag(s), + loadedTag.getCompoundTag(s)); + } + }else { + if (metaDataHandlerHashMap.containsKey(s)) { + chunkMemory.data.setTag(s,loadedTag.getTag(s)); + dimensionWiseMetaChunkData.get(s).get(dimId).put(chunkCoordIntPair,chunkMemory.data.getCompoundTag(s)); + } else { + throw new RuntimeException("Missing meta handler!" + s); + } + } + } + } } } public void onServerStarting() { dimensionWiseChunkData.clear(); + dimensionWiseMetaChunkData.clear(); } public void registerChunkMetaDataHandler(ChunkMetaDataHandler handler){ metaDataHandlerHashMap.put(handler.getTagName(),handler); + dimensionWiseMetaChunkData.put(handler.getTagName(),new HashMap<>()); } - public static class NBTChunk { + public NBTTagCompound getChunkData(ChunkMetaDataHandler handler, World world, Chunk chunk){ + return dimensionWiseMetaChunkData.get(handler.getTagName()).get(world.provider.dimensionId).get(chunk.getChunkCoordIntPair()); + } + + public NBTTagCompound getChunkData(ChunkMetaDataHandler handler, Integer world, ChunkCoordIntPair chunk){ + return dimensionWiseMetaChunkData.get(handler.getTagName()).get(world).get(chunk); + } + + private static class NBTChunk { private final NBTTagCompound data; private boolean isLoaded; private NBTChunk(NBTTagCompound data, boolean isLoaded) { + if(data==null){ + data=new NBTTagCompound(); + } this.data = data; this.isLoaded = isLoaded; } - - public boolean isLoaded(){ - return isLoaded; - } - - public NBTTagCompound getData(){ - return data; - } } } diff --git a/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkMetaDataHandler.java b/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkMetaDataHandler.java index baa7bfba13..369a623998 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkMetaDataHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkMetaDataHandler.java @@ -4,7 +4,7 @@ import net.minecraft.nbt.NBTTagCompound; public interface ChunkMetaDataHandler { String getTagName(); - void mergeData(NBTTagCompound inMemory,NBTTagCompound loaded,NBTTagCompound result); + void mergeData(NBTTagCompound target, NBTTagCompound loadedData); NBTTagCompound createData(); } -- cgit From a9500b54641cddefef8a3510a57a6172d48e0a03 Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 13 Jul 2019 13:57:19 +0200 Subject: Add wtf status --- .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 4 +-- .../thing/metaTileEntity/multi/base/LedStatus.java | 30 +++++++++++++--------- 2 files changed, 20 insertions(+), 14 deletions(-) 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 3b7d4233f2..c2d3ffcf06 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 @@ -441,7 +441,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt EnumChatFormatting.YELLOW+ ":" + EnumChatFormatting.AQUA+paramID + EnumChatFormatting.YELLOW+ ":"+ - EnumChatFormatting.AQUA+"I "+parametrization.getStatusIn(hatchNo, paramID).name); + EnumChatFormatting.AQUA+"I "+parametrization.getStatusIn(hatchNo, paramID).name.get()); list.add(EnumChatFormatting.WHITE+"Value: "+ EnumChatFormatting.AQUA+ Util.doubleToString(parametrization.getIn(hatchNo,paramID))); try{ @@ -465,7 +465,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt EnumChatFormatting.YELLOW+ ":" + EnumChatFormatting.AQUA+paramID + EnumChatFormatting.YELLOW+ ":"+ - EnumChatFormatting.AQUA+"O "+parametrization.getStatusOut(hatchNo, paramID).name); + EnumChatFormatting.AQUA+"O "+parametrization.getStatusOut(hatchNo, paramID).name.get()); list.add(EnumChatFormatting.WHITE+"Value: "+ EnumChatFormatting.AQUA+Util.doubleToString(parametrization.getOut(hatchNo,paramID))); try{ diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/LedStatus.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/LedStatus.java index f2eebe3f4b..5fce024cfc 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/LedStatus.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/LedStatus.java @@ -1,22 +1,28 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.base; +import com.github.technus.tectech.TecTech; import net.minecraft.util.EnumChatFormatting; +import java.util.function.Supplier; + public enum LedStatus { - STATUS_UNUSED(EnumChatFormatting.DARK_GRAY +"Unused",true),// - STATUS_TOO_LOW(EnumChatFormatting.BLUE+"Too Low",false),// - STATUS_LOW(EnumChatFormatting.AQUA+"Low",true),// - STATUS_WRONG(EnumChatFormatting.DARK_PURPLE+"Wrong",false),// - STATUS_OK(EnumChatFormatting.GREEN+"Valid",true),// - STATUS_TOO_HIGH(EnumChatFormatting.RED+"Too High",false),// - STATUS_HIGH(EnumChatFormatting.GOLD+"High",true),// - STATUS_UNDEFINED(EnumChatFormatting.GRAY+"Unknown",false), - STATUS_NEUTRAL(EnumChatFormatting.WHITE+"Neutral",true);// - - public final String name; + STATUS_UNUSED(()->EnumChatFormatting.DARK_GRAY +"Unused",true),// + STATUS_TOO_LOW(()->EnumChatFormatting.BLUE+"Too Low",false),// + STATUS_LOW(()->EnumChatFormatting.AQUA+"Low",true),// + STATUS_WRONG(()->EnumChatFormatting.DARK_PURPLE+"Wrong",false),// + STATUS_OK(()->EnumChatFormatting.GREEN+"Valid",true),// + STATUS_TOO_HIGH(()->EnumChatFormatting.RED+"Too High",false),// + STATUS_HIGH(()->EnumChatFormatting.GOLD+"High",true),// + STATUS_UNDEFINED(()->EnumChatFormatting.GRAY+"Unknown",false), + STATUS_NEUTRAL(()->EnumChatFormatting.WHITE+"Neutral",true),// + STATUS_WTF(()->{ + return LedStatus.values()[TecTech.RANDOM.nextInt(9)].name.get(); + },false);// + + public final Supplier name; public final boolean isOk; - LedStatus(String name,boolean ok){ + LedStatus(Supplier name, boolean ok){ this.name=name; this.isOk=ok; } -- cgit From d723e1e4fb87dd7e9230d532b30b85f59b86cb95 Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 13 Jul 2019 14:02:04 +0200 Subject: Tick handling for chunkdata --- .../tectech/mechanics/anomaly/AnomalyHandler.java | 30 +++++++++++++++++++++- .../mechanics/chunkData/ChunkDataHandler.java | 30 ++++++++++++++++++++-- .../mechanics/chunkData/ChunkMetaDataHandler.java | 5 ++++ .../github/technus/tectech/proxy/CommonProxy.java | 8 ++++++ 4 files changed, 70 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java index 8751a80dd9..aad1fbd4ee 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java @@ -1,4 +1,32 @@ package com.github.technus.tectech.mechanics.anomaly; -public class AnomalyHandler { +import com.github.technus.tectech.mechanics.chunkData.ChunkMetaDataHandler; +import cpw.mods.fml.common.gameevent.TickEvent; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.ChunkCoordIntPair; + +import java.util.HashMap; + +public class AnomalyHandler implements ChunkMetaDataHandler { + + @Override + public String getTagName() { + return "Anomaly"; + } + + @Override + public void mergeData(NBTTagCompound target, NBTTagCompound loadedData) { + target.setInteger("intensity", + target.getInteger("intensity")+loadedData.getInteger("intensity")); + } + + @Override + public NBTTagCompound createData() { + return new NBTTagCompound(); + } + + @Override + public void TickData(HashMap> data, TickEvent.ServerTickEvent event) { + + } } diff --git a/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkDataHandler.java b/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkDataHandler.java index 8b5a7c870a..22f776f311 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkDataHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkDataHandler.java @@ -1,5 +1,6 @@ package com.github.technus.tectech.mechanics.chunkData; +import cpw.mods.fml.common.gameevent.TickEvent; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.World; @@ -95,6 +96,10 @@ public class ChunkDataHandler { } } + public void tick(TickEvent.ServerTickEvent event){ + dimensionWiseMetaChunkData.forEach((k,v)-> metaDataHandlerHashMap.get(k).TickData(v,event)); + } + public void onServerStarting() { dimensionWiseChunkData.clear(); dimensionWiseMetaChunkData.clear(); @@ -106,13 +111,34 @@ public class ChunkDataHandler { } public NBTTagCompound getChunkData(ChunkMetaDataHandler handler, World world, Chunk chunk){ - return dimensionWiseMetaChunkData.get(handler.getTagName()).get(world.provider.dimensionId).get(chunk.getChunkCoordIntPair()); + return getChunkData(handler,world.provider.dimensionId,chunk.getChunkCoordIntPair()); } - public NBTTagCompound getChunkData(ChunkMetaDataHandler handler, Integer world, ChunkCoordIntPair chunk){ + public NBTTagCompound getChunkData(ChunkMetaDataHandler handler, int world, ChunkCoordIntPair chunk){ return dimensionWiseMetaChunkData.get(handler.getTagName()).get(world).get(chunk); } + public NBTTagCompound computeIfAbsentChunkData(ChunkMetaDataHandler handler, World world, Chunk chunk){ + return computeIfAbsentChunkData(handler,world.provider.dimensionId,chunk.getChunkCoordIntPair()); + } + + public NBTTagCompound computeIfAbsentChunkData(ChunkMetaDataHandler handler, int world, ChunkCoordIntPair chunk){ + return dimensionWiseMetaChunkData.get(handler.getTagName()).get(world) + .computeIfAbsent(chunk,chunkCoordIntPair -> handler.createData()); + } + + public HashMap> getChunkData(ChunkMetaDataHandler chunkMetaDataHandler){ + return dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()); + } + + public HashMap getChunkData(ChunkMetaDataHandler chunkMetaDataHandler,World world){ + return dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()).get(world.provider.dimensionId); + } + + public HashMap getChunkData(ChunkMetaDataHandler chunkMetaDataHandler,int world){ + return dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()).get(world); + } + private static class NBTChunk { private final NBTTagCompound data; private boolean isLoaded; diff --git a/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkMetaDataHandler.java b/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkMetaDataHandler.java index 369a623998..4ac4cd1b23 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkMetaDataHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkMetaDataHandler.java @@ -1,10 +1,15 @@ package com.github.technus.tectech.mechanics.chunkData; +import cpw.mods.fml.common.gameevent.TickEvent; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.ChunkCoordIntPair; + +import java.util.HashMap; public interface ChunkMetaDataHandler { String getTagName(); void mergeData(NBTTagCompound target, NBTTagCompound loadedData); NBTTagCompound createData(); + void TickData(HashMap> data, TickEvent.ServerTickEvent event); } diff --git a/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java b/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java index 9a9c644af9..2b965b4d60 100644 --- a/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java +++ b/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java @@ -2,6 +2,7 @@ package com.github.technus.tectech.proxy; import com.github.technus.tectech.TecTech; import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.TickEvent; import cpw.mods.fml.common.network.IGuiHandler; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; @@ -94,4 +95,11 @@ public class CommonProxy implements IGuiHandler { public void handleChunkLoadEvent(ChunkDataEvent.Load event) { TecTech.chunkDataHandler.handleChunkLoadEvent(event); } + + @SubscribeEvent + public void onServerTickEvent(TickEvent.ServerTickEvent aEvent) { + if(aEvent.phase== TickEvent.Phase.START){ + TecTech.chunkDataHandler.tick(aEvent); + } + } } -- cgit From 3463fd0c96c4cc99ae117cd1ef067c5be950a76c Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 13 Jul 2019 20:18:11 +0200 Subject: Chunk data should work now --- .../tectech/mechanics/anomaly/AnomalyHandler.java | 4 +- .../mechanics/chunkData/ChunkDataHandler.java | 169 +++++++++++++++------ .../mechanics/chunkData/ChunkMetaDataHandler.java | 3 +- .../github/technus/tectech/proxy/CommonProxy.java | 4 +- 4 files changed, 126 insertions(+), 54 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java index aad1fbd4ee..f0669431a9 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java @@ -1,9 +1,9 @@ package com.github.technus.tectech.mechanics.anomaly; +import com.github.technus.tectech.mechanics.chunkData.ChunkDataHandler; import com.github.technus.tectech.mechanics.chunkData.ChunkMetaDataHandler; import cpw.mods.fml.common.gameevent.TickEvent; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.ChunkCoordIntPair; import java.util.HashMap; @@ -26,7 +26,7 @@ public class AnomalyHandler implements ChunkMetaDataHandler { } @Override - public void TickData(HashMap> data, TickEvent.ServerTickEvent event) { + public void TickData(HashMap data, TickEvent.ServerTickEvent event) { } } diff --git a/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkDataHandler.java b/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkDataHandler.java index 22f776f311..50a92d6178 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkDataHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkDataHandler.java @@ -7,56 +7,45 @@ import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; import net.minecraftforge.event.world.ChunkDataEvent; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Set; +import java.util.*; public class ChunkDataHandler { - private final String TEC_TAG="TecTechTag"; - private final HashMap> dimensionWiseChunkData=new HashMap<>(); - private final HashMap>> dimensionWiseMetaChunkData=new HashMap<>(); + private final String BASE_TAG_NAME ="TecTechData"; + private final HashMap> dimensionWiseChunkData=new HashMap<>(); + private final HashMap> dimensionWiseMetaChunkData=new HashMap<>(); private final HashMap metaDataHandlerHashMap =new HashMap<>(); public void handleChunkSaveEvent(ChunkDataEvent.Save event) { HashMap dimensionData=dimensionWiseChunkData.get(event.world.provider.dimensionId); NBTChunk chunkData =dimensionData!=null?dimensionData.get(event.getChunk().getChunkCoordIntPair()):null; if(chunkData==null) { - event.getData().removeTag(TEC_TAG); + event.getData().removeTag(BASE_TAG_NAME); } else { chunkData.isLoaded=true; - event.getData().setTag(TEC_TAG,chunkData.data); + event.getData().setTag(BASE_TAG_NAME,chunkData.data); } } public void handleChunkLoadEvent(ChunkDataEvent.Load event) { - NBTTagCompound loadedTag=event.getData().getCompoundTag(TEC_TAG); + NBTTagCompound loadedTag=event.getData().getCompoundTag(BASE_TAG_NAME); if(loadedTag.hasNoTags()){ return; } int dimId=event.world.provider.dimensionId; HashMap dimensionMemory= - dimensionWiseChunkData.computeIfAbsent(dimId,dim->{ - for (String meta : metaDataHandlerHashMap.keySet()) { - dimensionWiseMetaChunkData.get(meta).put(dim, new HashMap<>(1024)); - } - return new HashMap<>(1024); - }); + dimensionWiseChunkData.computeIfAbsent(dimId, this::createDimensionData); ChunkCoordIntPair chunkCoordIntPair=event.getChunk().getChunkCoordIntPair(); NBTChunk chunkMemory =dimensionMemory.get(chunkCoordIntPair); Set loadedKeys=loadedTag.func_150296_c(); if(chunkMemory==null) { - chunkMemory=new NBTChunk(/*(NBTTagCompound)*/loadedTag/*.copy()*/,true); + chunkMemory=new NBTChunk(loadedTag,true); + dimensionMemory.put(chunkCoordIntPair,chunkMemory); for (String s :loadedKeys) { - if (metaDataHandlerHashMap.containsKey(s)) { - dimensionWiseMetaChunkData.get(s).get(dimId).put(chunkCoordIntPair,chunkMemory.data.getCompoundTag(s)); - } else { - throw new RuntimeException("Missing meta handler!" + s); - } + dimensionWiseMetaChunkData.get(s).get(dimId).putLoaded(chunkCoordIntPair, loadedTag.getCompoundTag(s)); } - dimensionMemory.put(chunkCoordIntPair,chunkMemory); }else if(!chunkMemory.isLoaded) { chunkMemory.isLoaded=true; @@ -65,39 +54,26 @@ public class ChunkDataHandler { if (tagsDuplicated.isEmpty()) { for (String s:loadedKeys) { - if (metaDataHandlerHashMap.containsKey(s)) { - chunkMemory.data.setTag(s,loadedTag.getTag(s)/*.copy()*/); - dimensionWiseMetaChunkData.get(s).get(dimId).put(chunkCoordIntPair,chunkMemory.data.getCompoundTag(s)); - } else { - throw new RuntimeException("Missing meta handler!" + s); - } + NBTTagCompound tag=loadedTag.getCompoundTag(s); + chunkMemory.data.setTag(s,tag); + dimensionWiseMetaChunkData.get(s).get(dimId).putLoaded(chunkCoordIntPair,tag); } } else { for (String s : loadedKeys) { + NBTTagCompound memory=chunkMemory.data.getCompoundTag(s); if(tagsDuplicated.contains(s)){ - ChunkMetaDataHandler metaDataHandler = metaDataHandlerHashMap.get(s); - if (metaDataHandler == null) { - throw new RuntimeException("Missing meta handler!" + s); - } else { - metaDataHandler.mergeData( - chunkMemory.data.getCompoundTag(s), - loadedTag.getCompoundTag(s)); - } + metaDataHandlerHashMap.get(s).mergeData(memory,loadedTag.getCompoundTag(s)); }else { - if (metaDataHandlerHashMap.containsKey(s)) { - chunkMemory.data.setTag(s,loadedTag.getTag(s)); - dimensionWiseMetaChunkData.get(s).get(dimId).put(chunkCoordIntPair,chunkMemory.data.getCompoundTag(s)); - } else { - throw new RuntimeException("Missing meta handler!" + s); - } + chunkMemory.data.setTag(s,loadedTag.getCompoundTag(s)); + dimensionWiseMetaChunkData.get(s).get(dimId).putLoaded(chunkCoordIntPair,memory); } } } } } - public void tick(TickEvent.ServerTickEvent event){ - dimensionWiseMetaChunkData.forEach((k,v)-> metaDataHandlerHashMap.get(k).TickData(v,event)); + public void tickData(TickEvent.ServerTickEvent event){ + dimensionWiseMetaChunkData.forEach((k, v) -> metaDataHandlerHashMap.get(k).TickData(v, event)); } public void onServerStarting() { @@ -127,18 +103,117 @@ public class ChunkDataHandler { .computeIfAbsent(chunk,chunkCoordIntPair -> handler.createData()); } - public HashMap> getChunkData(ChunkMetaDataHandler chunkMetaDataHandler){ + public HashMap getChunkData(ChunkMetaDataHandler chunkMetaDataHandler){ return dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()); } - public HashMap getChunkData(ChunkMetaDataHandler chunkMetaDataHandler,World world){ + public ChunkHashMap getChunkData(ChunkMetaDataHandler chunkMetaDataHandler,World world){ return dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()).get(world.provider.dimensionId); } - public HashMap getChunkData(ChunkMetaDataHandler chunkMetaDataHandler,int world){ + public ChunkHashMap getChunkData(ChunkMetaDataHandler chunkMetaDataHandler,int world){ return dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()).get(world); } + private HashMap createDimensionData(Integer dim) { + HashMap map = new HashMap<>(); + for (String meta : metaDataHandlerHashMap.keySet()) { + dimensionWiseMetaChunkData.get(meta).put(dim, new ChunkHashMap(meta, map)); + } + return map; + } + + public static class ChunkHashMap implements Map{ + private final HashMap storage; + private final HashMap storageMeta=new HashMap<>(1024); + private final String meta; + + private ChunkHashMap(String meta, HashMap storage) { + this.storage =storage; + this.meta=meta; + } + + private void putLoaded(ChunkCoordIntPair key, NBTTagCompound value) { + storageMeta.put(key, value); + } + + @Override + public NBTTagCompound remove(Object key) { + NBTTagCompound compound=storageMeta.remove(key); + if(compound!=null) { + NBTChunk chunk = storage.get(key); + chunk.data.removeTag(meta); + if(chunk.data.hasNoTags()){ + storage.remove(key); + } + } + return compound; + } + + @Override + public NBTTagCompound put(ChunkCoordIntPair key, NBTTagCompound value) { + NBTChunk chunk = storage.get(key); + if(chunk==null){ + NBTTagCompound base=new NBTTagCompound(); + base.setTag(meta,value); + storage.put(key,new NBTChunk(base,false)); + }else { + chunk.data.setTag(meta,value); + } + return storageMeta.put(key, value); + } + + @Override + public int size() { + return storageMeta.size(); + } + + @Override + public boolean isEmpty() { + return storageMeta.isEmpty(); + } + + @Override + public NBTTagCompound get(Object key) { + return storageMeta.get(key); + } + + @Override + public void clear() { + entrySet().forEach(this::remove); + } + + @Override + public void putAll(Map m) { + m.forEach(this::put); + } + + @Override + public boolean containsKey(Object key) { + return storageMeta.containsKey(key); + } + + @Override + public boolean containsValue(Object value) { + return storageMeta.containsValue(value); + } + + @Override + public Set keySet() { + return storageMeta.keySet(); + } + + @Override + public Collection values() { + return storageMeta.values(); + } + + @Override + public Set> entrySet() { + return storageMeta.entrySet(); + } + } + private static class NBTChunk { private final NBTTagCompound data; private boolean isLoaded; diff --git a/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkMetaDataHandler.java b/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkMetaDataHandler.java index 4ac4cd1b23..420f24f46d 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkMetaDataHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkMetaDataHandler.java @@ -2,7 +2,6 @@ package com.github.technus.tectech.mechanics.chunkData; import cpw.mods.fml.common.gameevent.TickEvent; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.ChunkCoordIntPair; import java.util.HashMap; @@ -10,6 +9,6 @@ public interface ChunkMetaDataHandler { String getTagName(); void mergeData(NBTTagCompound target, NBTTagCompound loadedData); NBTTagCompound createData(); - void TickData(HashMap> data, TickEvent.ServerTickEvent event); + void TickData(HashMap data, TickEvent.ServerTickEvent event); } diff --git a/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java b/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java index 2b965b4d60..31b1b1824c 100644 --- a/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java +++ b/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java @@ -98,8 +98,6 @@ public class CommonProxy implements IGuiHandler { @SubscribeEvent public void onServerTickEvent(TickEvent.ServerTickEvent aEvent) { - if(aEvent.phase== TickEvent.Phase.START){ - TecTech.chunkDataHandler.tick(aEvent); - } + TecTech.chunkDataHandler.tickData(aEvent); } } -- cgit From 99708323b391b108d035ba483da82f4aa2211b1c Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 13 Jul 2019 20:27:17 +0200 Subject: Add WTF led status properly --- .../multi/base/GT_GUIContainer_MultiMachineEM.java | 47 ++++++++++++++++------ 1 file changed, 35 insertions(+), 12 deletions(-) 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 dea5030fde..5f5ddf6e4a 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 @@ -1,12 +1,11 @@ package com.github.technus.tectech.thing.metaTileEntity.multi.base; -import gregtech.api.GregTech_API; +import com.github.technus.tectech.TecTech; import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.client.gui.FontRenderer; import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemDye; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; @@ -205,6 +204,30 @@ public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Mach private void LEDdrawP(int x, int y, int i, int j, LedStatus status) { int v = 192, su = 8, sv = 6, u = 11; switch (status) { + case STATUS_WTF: { + int c=counter; + if(c>4){ + c= TecTech.RANDOM.nextInt(5); + } + switch (c) { + case 0: + drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * j, su, sv);//BLUE + break; + case 1: + drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * (2 + j), su, sv);//cyan + break; + case 2: + drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * (4 + j), su, sv);//green + break; + case 3: + drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * (6 + j), su, sv);//orangeyello + break; + case 4: + drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * (8 + j), su, sv);//redd + break; + } + break; + } case STATUS_WRONG: //fallthrough if (counter < 2) { drawTexturedModalRect(x + su * i, y + sv * j, u + su * i, v + sv * j, su, sv);//blue @@ -254,16 +277,16 @@ public class GT_GUIContainer_MultiMachineEM extends GT_GUIContainerMetaTile_Mach break; case STATUS_UNUSED: default: - if (GregTech_API.sColoredGUI && this.mContainer.mTileEntity != null) { - int tColor = this.mContainer.mTileEntity.getColorization() & 15; - if (tColor < ItemDye.field_150922_c.length) { - tColor = ItemDye.field_150922_c[tColor]; - GL11.glColor4f((float)(tColor >> 16 & 255) / 255.0F, (float)(tColor >> 8 & 255) / 255.0F, (float)(tColor & 255) / 255.0F, 1F); - } - } - drawTexturedModalRect(x + su * i, y + sv * j, 212, 96, su+2, sv+2); - GL11.glColor4f(1f, 1f, 1f, 1f); - break; + //if (GregTech_API.sColoredGUI && this.mContainer.mTileEntity != null) { + // int tColor = this.mContainer.mTileEntity.getColorization() & 15; + // if (tColor < ItemDye.field_150922_c.length) { + // tColor = ItemDye.field_150922_c[tColor]; + // GL11.glColor4f((float)(tColor >> 16 & 255) / 255.0F, (float)(tColor >> 8 & 255) / 255.0F, (float)(tColor & 255) / 255.0F, 1F); + // } + //} + //drawTexturedModalRect(x + su * i, y + sv * j, 212, 96, su+2, sv+2); + //GL11.glColor4f(1f, 1f, 1f, 1f); + //break; } } -- cgit From 4224247331125631d9d89a5d38740c2273579bc7 Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 13 Jul 2019 20:46:56 +0200 Subject: Fix chunk data invalid cleanup --- src/main/java/com/github/technus/tectech/TecTech.java | 4 ++++ .../technus/tectech/mechanics/anomaly/AnomalyHandler.java | 5 +++-- .../tectech/mechanics/chunkData/ChunkDataHandler.java | 13 +++++-------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/TecTech.java b/src/main/java/com/github/technus/tectech/TecTech.java index 337f493801..84dbc204d5 100644 --- a/src/main/java/com/github/technus/tectech/TecTech.java +++ b/src/main/java/com/github/technus/tectech/TecTech.java @@ -4,6 +4,7 @@ import com.github.technus.tectech.loader.MainLoader; import com.github.technus.tectech.loader.TecTechConfig; import com.github.technus.tectech.mechanics.ConvertFloat; import com.github.technus.tectech.mechanics.ConvertInteger; +import com.github.technus.tectech.mechanics.anomaly.AnomalyHandler; import com.github.technus.tectech.mechanics.chunkData.ChunkDataHandler; import com.github.technus.tectech.mechanics.elementalMatter.core.commands.GiveEM; import com.github.technus.tectech.mechanics.elementalMatter.core.commands.ListEM; @@ -36,6 +37,7 @@ public class TecTech { public static TecTechConfig configTecTech; public static ChunkDataHandler chunkDataHandler=new ChunkDataHandler(); + public static AnomalyHandler anomalyHandler=new AnomalyHandler(); /** * For Loader.isModLoaded checks during the runtime @@ -85,6 +87,8 @@ public class TecTech { @Mod.EventHandler public void PostLoad(FMLPostInitializationEvent PostEvent) { MainLoader.postLoad(); + + chunkDataHandler.registerChunkMetaDataHandler(anomalyHandler); } @Mod.EventHandler diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java index f0669431a9..7d58d6b6ae 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java @@ -8,6 +8,7 @@ import net.minecraft.nbt.NBTTagCompound; import java.util.HashMap; public class AnomalyHandler implements ChunkMetaDataHandler { + private static final String INTENSITY="intensity"; @Override public String getTagName() { @@ -16,8 +17,8 @@ public class AnomalyHandler implements ChunkMetaDataHandler { @Override public void mergeData(NBTTagCompound target, NBTTagCompound loadedData) { - target.setInteger("intensity", - target.getInteger("intensity")+loadedData.getInteger("intensity")); + int intensity=target.getInteger(INTENSITY)+loadedData.getInteger(INTENSITY); + target.setInteger(INTENSITY,intensity); } @Override diff --git a/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkDataHandler.java b/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkDataHandler.java index 50a92d6178..8dc60248ef 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkDataHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkDataHandler.java @@ -31,15 +31,12 @@ public class ChunkDataHandler { if(loadedTag.hasNoTags()){ return; } - int dimId=event.world.provider.dimensionId; HashMap dimensionMemory= dimensionWiseChunkData.computeIfAbsent(dimId, this::createDimensionData); - ChunkCoordIntPair chunkCoordIntPair=event.getChunk().getChunkCoordIntPair(); - NBTChunk chunkMemory =dimensionMemory.get(chunkCoordIntPair); Set loadedKeys=loadedTag.func_150296_c(); - + NBTChunk chunkMemory =dimensionMemory.get(chunkCoordIntPair); if(chunkMemory==null) { chunkMemory=new NBTChunk(loadedTag,true); dimensionMemory.put(chunkCoordIntPair,chunkMemory); @@ -78,7 +75,7 @@ public class ChunkDataHandler { public void onServerStarting() { dimensionWiseChunkData.clear(); - dimensionWiseMetaChunkData.clear(); + dimensionWiseMetaChunkData.forEach((k,v)->v.clear()); } public void registerChunkMetaDataHandler(ChunkMetaDataHandler handler){ @@ -123,7 +120,7 @@ public class ChunkDataHandler { return map; } - public static class ChunkHashMap implements Map{ + public static final class ChunkHashMap implements Map{ private final HashMap storage; private final HashMap storageMeta=new HashMap<>(1024); private final String meta; @@ -180,7 +177,7 @@ public class ChunkDataHandler { @Override public void clear() { - entrySet().forEach(this::remove); + storageMeta.entrySet().forEach(this::remove); } @Override @@ -214,7 +211,7 @@ public class ChunkDataHandler { } } - private static class NBTChunk { + private static final class NBTChunk { private final NBTTagCompound data; private boolean isLoaded; -- cgit From 2c2adfa79ccd2db8a7bbe77563239ce1b92735d0 Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 13 Jul 2019 21:23:11 +0200 Subject: Whomstd've needs material loader... --- .../java/com/github/technus/tectech/TecTech.java | 105 ++++++++++++++++++++- .../technus/tectech/loader/TecTechConfig.java | 4 + .../tectech/mechanics/anomaly/AnomalyHandler.java | 2 +- .../github/technus/tectech/proxy/ClientProxy.java | 18 ++++ 4 files changed, 124 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/TecTech.java b/src/main/java/com/github/technus/tectech/TecTech.java index 84dbc204d5..5383b9cf62 100644 --- a/src/main/java/com/github/technus/tectech/TecTech.java +++ b/src/main/java/com/github/technus/tectech/TecTech.java @@ -18,6 +18,13 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.event.FMLServerStartingEvent; import eu.usrv.yamcore.auxiliary.IngameErrorLog; import eu.usrv.yamcore.auxiliary.LogHelper; +import gregtech.GT_Mod; +import gregtech.common.GT_Proxy; + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.Collection; +import java.util.Iterator; import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; @@ -36,8 +43,8 @@ public class TecTech { private static IngameErrorLog moduleAdminErrorLogs; public static TecTechConfig configTecTech; - public static ChunkDataHandler chunkDataHandler=new ChunkDataHandler(); - public static AnomalyHandler anomalyHandler=new AnomalyHandler(); + public static ChunkDataHandler chunkDataHandler; + public static AnomalyHandler anomalyHandler; /** * For Loader.isModLoaded checks during the runtime @@ -80,6 +87,96 @@ public class TecTech { public void Load(FMLInitializationEvent event) { hasCOFH = Loader.isModLoaded(Reference.COFHCORE); + + if(configTecTech.DISABLE_MATERIAL_LOADING_FFS){ + try { + Field field= GT_Proxy.class.getDeclaredField("mEvents"); + field.setAccessible(true); + Field modifiersField = Field.class.getDeclaredField( "modifiers" ); + modifiersField.setAccessible( true ); + modifiersField.setInt( field, field.getModifiers() & ~Modifier.FINAL ); + field.set(GT_Mod.gregtechproxy, new Collection() { + @Override + public int size() { + return 0; + } + + @Override + public boolean isEmpty() { + return true; + } + + @Override + public boolean contains(Object o) { + return false; + } + + @Override + public Iterator iterator() { + return new Iterator() { + @Override + public boolean hasNext() { + return false; + } + + @Override + public Object next() { + return null; + } + }; + } + + @Override + public Object[] toArray() { + return new Object[0]; + } + + @Override + public boolean add(Object o) { + return false; + } + + @Override + public boolean remove(Object o) { + return false; + } + + @Override + public boolean addAll(Collection c) { + return false; + } + + @Override + public void clear() { + + } + + @Override + public boolean retainAll(Collection c) { + return false; + } + + @Override + public boolean removeAll(Collection c) { + return false; + } + + @Override + public boolean containsAll(Collection c) { + return false; + } + + @Override + public Object[] toArray(Object[] a) { + return new Object[0]; + } + }); + } catch (NoSuchFieldException | IllegalAccessException e) { + LOGGER.error(Reference.MODID + " could not disable material loading!"); + } + + } + MainLoader.load(); MainLoader.addAfterGregTechPostLoadRunner(); } @@ -87,8 +184,8 @@ public class TecTech { @Mod.EventHandler public void PostLoad(FMLPostInitializationEvent PostEvent) { MainLoader.postLoad(); - - chunkDataHandler.registerChunkMetaDataHandler(anomalyHandler); + chunkDataHandler=new ChunkDataHandler(); + chunkDataHandler.registerChunkMetaDataHandler(anomalyHandler=new AnomalyHandler()); } @Mod.EventHandler diff --git a/src/main/java/com/github/technus/tectech/loader/TecTechConfig.java b/src/main/java/com/github/technus/tectech/loader/TecTechConfig.java index 468a0c909a..e7eb0c0945 100644 --- a/src/main/java/com/github/technus/tectech/loader/TecTechConfig.java +++ b/src/main/java/com/github/technus/tectech/loader/TecTechConfig.java @@ -17,6 +17,7 @@ public class TecTechConfig extends ConfigManager { public boolean EASY_SCAN; public boolean NERF_FUSION; public boolean ENABLE_TURRET_EXPLOSIONS; + public boolean DISABLE_MATERIAL_LOADING_FFS; public float TURRET_DAMAGE_FACTOR; public float TURRET_EXPLOSION_FACTOR; @@ -30,6 +31,7 @@ public class TecTechConfig extends ConfigManager { BOOM_ENABLE = true; NERF_FUSION = false; ENABLE_TURRET_EXPLOSIONS = true; + DISABLE_MATERIAL_LOADING_FFS=false; TURRET_DAMAGE_FACTOR = 10; TURRET_EXPLOSION_FACTOR = 1; } @@ -56,6 +58,8 @@ public class TecTechConfig extends ConfigManager { "Damage is multiplied by this number"); TURRET_EXPLOSION_FACTOR = _mainConfig.getFloat("TurretExplosionFactor", "Features", TURRET_EXPLOSION_FACTOR, 0, Short.MAX_VALUE, "Explosion strength is multiplied by this number"); + DISABLE_MATERIAL_LOADING_FFS = _mainConfig.getBoolean("DisableMaterialLoading", "Debug", DISABLE_MATERIAL_LOADING_FFS, + "Set to true to disable gregtech material processing"); } /** diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java index 7d58d6b6ae..29d3ff663a 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java @@ -12,7 +12,7 @@ public class AnomalyHandler implements ChunkMetaDataHandler { @Override public String getTagName() { - return "Anomaly"; + return "anomaly"; } @Override diff --git a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java index 255cf56e96..8299f815e0 100644 --- a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java +++ b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java @@ -11,6 +11,8 @@ import com.github.technus.tectech.thing.block.QuantumStuffRender; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.TickEvent; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; @@ -23,6 +25,7 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ChatComponentText; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.event.world.ChunkDataEvent; import org.lwjgl.opengl.GL11; public class ClientProxy extends CommonProxy { @@ -138,4 +141,19 @@ public class ClientProxy extends CommonProxy { public void renderAABB(AxisAlignedBB box) { renderAABB(Minecraft.getMinecraft().theWorld,box); } + + @SubscribeEvent + public void handleChunkSaveEvent(ChunkDataEvent.Save event) { + super.handleChunkSaveEvent(event); + } + + @SubscribeEvent + public void handleChunkLoadEvent(ChunkDataEvent.Load event) { + super.handleChunkLoadEvent(event); + } + + @SubscribeEvent + public void onServerTickEvent(TickEvent.ServerTickEvent aEvent) { + super.onServerTickEvent(aEvent); + } } -- cgit From 830aa335beda244bb5199e2cbcfd9072d1570066 Mon Sep 17 00:00:00 2001 From: Tec Date: Sat, 13 Jul 2019 23:02:46 +0200 Subject: Cleanup chunk data tick handler --- .../java/com/github/technus/tectech/TecTech.java | 18 +++--- .../tectech/mechanics/anomaly/AnomalyHandler.java | 2 +- .../mechanics/chunkData/ChunkDataHandler.java | 71 +++++++++++++++++++++- .../mechanics/chunkData/ChunkMetaDataHandler.java | 6 +- .../github/technus/tectech/proxy/ClientProxy.java | 18 ------ .../github/technus/tectech/proxy/CommonProxy.java | 19 ------ 6 files changed, 84 insertions(+), 50 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/TecTech.java b/src/main/java/com/github/technus/tectech/TecTech.java index 5383b9cf62..0e6e5ecf5c 100644 --- a/src/main/java/com/github/technus/tectech/TecTech.java +++ b/src/main/java/com/github/technus/tectech/TecTech.java @@ -9,17 +9,16 @@ import com.github.technus.tectech.mechanics.chunkData.ChunkDataHandler; import com.github.technus.tectech.mechanics.elementalMatter.core.commands.GiveEM; import com.github.technus.tectech.mechanics.elementalMatter.core.commands.ListEM; import com.github.technus.tectech.proxy.CommonProxy; +import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; +import cpw.mods.fml.common.event.*; import eu.usrv.yamcore.auxiliary.IngameErrorLog; import eu.usrv.yamcore.auxiliary.LogHelper; import gregtech.GT_Mod; import gregtech.common.GT_Proxy; +import net.minecraftforge.common.MinecraftForge; import java.lang.reflect.Field; import java.lang.reflect.Modifier; @@ -80,6 +79,11 @@ public class TecTech { moduleAdminErrorLogs = new IngameErrorLog(); } + chunkDataHandler=new ChunkDataHandler(); + chunkDataHandler.registerChunkMetaDataHandler(anomalyHandler=new AnomalyHandler()); + FMLCommonHandler.instance().bus().register(chunkDataHandler); + MinecraftForge.EVENT_BUS.register(chunkDataHandler); + MainLoader.preLoad(); } @@ -184,8 +188,6 @@ public class TecTech { @Mod.EventHandler public void PostLoad(FMLPostInitializationEvent PostEvent) { MainLoader.postLoad(); - chunkDataHandler=new ChunkDataHandler(); - chunkDataHandler.registerChunkMetaDataHandler(anomalyHandler=new AnomalyHandler()); } @Mod.EventHandler @@ -199,7 +201,7 @@ public class TecTech { } @Mod.EventHandler - public void onServerStarting(FMLServerStartingEvent aEvent) { - chunkDataHandler.onServerStarting(); + public void onServerAboutToStart(FMLServerAboutToStartEvent aEvent) { + chunkDataHandler.clearData(); } } diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java index 29d3ff663a..c5060c8709 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java @@ -27,7 +27,7 @@ public class AnomalyHandler implements ChunkMetaDataHandler { } @Override - public void TickData(HashMap data, TickEvent.ServerTickEvent event) { + public void tickServer(HashMap data, TickEvent.ServerTickEvent event) { } } diff --git a/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkDataHandler.java b/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkDataHandler.java index 8dc60248ef..f0a1c5488c 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkDataHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkDataHandler.java @@ -1,5 +1,6 @@ package com.github.technus.tectech.mechanics.chunkData; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.ChunkCoordIntPair; @@ -14,7 +15,13 @@ public class ChunkDataHandler { private final HashMap> dimensionWiseChunkData=new HashMap<>(); private final HashMap> dimensionWiseMetaChunkData=new HashMap<>(); private final HashMap metaDataHandlerHashMap =new HashMap<>(); + private final ArrayList serverHandlers=new ArrayList<>(); + private final ArrayList clientHandlers=new ArrayList<>(); + private final ArrayList worldHandlers=new ArrayList<>(); + private final ArrayList playerHandlers=new ArrayList<>(); + private final ArrayList renderHandlers=new ArrayList<>(); + @SubscribeEvent public void handleChunkSaveEvent(ChunkDataEvent.Save event) { HashMap dimensionData=dimensionWiseChunkData.get(event.world.provider.dimensionId); NBTChunk chunkData =dimensionData!=null?dimensionData.get(event.getChunk().getChunkCoordIntPair()):null; @@ -26,6 +33,7 @@ public class ChunkDataHandler { } } + @SubscribeEvent public void handleChunkLoadEvent(ChunkDataEvent.Load event) { NBTTagCompound loadedTag=event.getData().getCompoundTag(BASE_TAG_NAME); if(loadedTag.hasNoTags()){ @@ -69,11 +77,48 @@ public class ChunkDataHandler { } } - public void tickData(TickEvent.ServerTickEvent event){ - dimensionWiseMetaChunkData.forEach((k, v) -> metaDataHandlerHashMap.get(k).TickData(v, event)); + @SubscribeEvent + public void onClientTickEvent(TickEvent.ClientTickEvent aEvent) { + clientHandlers.forEach(chunkMetaDataHandler -> + chunkMetaDataHandler.tickClient( + dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), + aEvent)); } - public void onServerStarting() { + @SubscribeEvent + public void onServerTickEvent(TickEvent.ServerTickEvent aEvent) { + serverHandlers.forEach(chunkMetaDataHandler -> + chunkMetaDataHandler.tickServer( + dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), + aEvent)); + } + + @SubscribeEvent + public void onWorldTickEvent(TickEvent.WorldTickEvent aEvent) { + worldHandlers.forEach(chunkMetaDataHandler -> + chunkMetaDataHandler.tickWorld( + dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), + aEvent)); + } + + @SubscribeEvent + public void onPlayerTickEvent(TickEvent.PlayerTickEvent aEvent) { + playerHandlers.forEach(chunkMetaDataHandler -> + chunkMetaDataHandler.tickPlayer( + dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), + aEvent)); + } + + @SubscribeEvent + public void onRenderTickEvent(TickEvent.RenderTickEvent aEvent) { + renderHandlers.forEach(chunkMetaDataHandler -> + chunkMetaDataHandler.tickRender( + dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), + aEvent)); + } + + + public void clearData() { dimensionWiseChunkData.clear(); dimensionWiseMetaChunkData.forEach((k,v)->v.clear()); } @@ -81,6 +126,26 @@ public class ChunkDataHandler { public void registerChunkMetaDataHandler(ChunkMetaDataHandler handler){ metaDataHandlerHashMap.put(handler.getTagName(),handler); dimensionWiseMetaChunkData.put(handler.getTagName(),new HashMap<>()); + try { + Class clazz=handler.getClass(); + if(clazz.getMethod("tickClient", HashMap.class, TickEvent.ClientTickEvent.class).getDeclaringClass()!=ChunkMetaDataHandler.class){ + clientHandlers.add(handler); + } + if(clazz.getMethod("tickServer", HashMap.class, TickEvent.ServerTickEvent.class).getDeclaringClass()!=ChunkMetaDataHandler.class){ + serverHandlers.add(handler); + } + if(clazz.getMethod("tickWorld", HashMap.class, TickEvent.WorldTickEvent.class).getDeclaringClass()!=ChunkMetaDataHandler.class){ + worldHandlers.add(handler); + } + if(clazz.getMethod("tickPlayer", HashMap.class, TickEvent.PlayerTickEvent.class).getDeclaringClass()!=ChunkMetaDataHandler.class){ + playerHandlers.add(handler); + } + if(clazz.getMethod("tickRender", HashMap.class, TickEvent.RenderTickEvent.class).getDeclaringClass()!=ChunkMetaDataHandler.class){ + renderHandlers.add(handler); + } + } catch (NoSuchMethodException e) { + throw new RuntimeException("Cannot register event handlers!"); + } } public NBTTagCompound getChunkData(ChunkMetaDataHandler handler, World world, Chunk chunk){ diff --git a/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkMetaDataHandler.java b/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkMetaDataHandler.java index 420f24f46d..e16f19b681 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkMetaDataHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkMetaDataHandler.java @@ -9,6 +9,10 @@ public interface ChunkMetaDataHandler { String getTagName(); void mergeData(NBTTagCompound target, NBTTagCompound loadedData); NBTTagCompound createData(); - void TickData(HashMap data, TickEvent.ServerTickEvent event); + default void tickClient(HashMap data, TickEvent.ClientTickEvent aEvent){} + default void tickServer(HashMap data, TickEvent.ServerTickEvent event){} + default void tickWorld(HashMap data, TickEvent.WorldTickEvent aEvent){} + default void tickPlayer(HashMap data, TickEvent.PlayerTickEvent aEvent){} + default void tickRender(HashMap data, TickEvent.RenderTickEvent aEvent){} } diff --git a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java index 8299f815e0..255cf56e96 100644 --- a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java +++ b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java @@ -11,8 +11,6 @@ import com.github.technus.tectech.thing.block.QuantumStuffRender; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; @@ -25,7 +23,6 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ChatComponentText; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.event.world.ChunkDataEvent; import org.lwjgl.opengl.GL11; public class ClientProxy extends CommonProxy { @@ -141,19 +138,4 @@ public class ClientProxy extends CommonProxy { public void renderAABB(AxisAlignedBB box) { renderAABB(Minecraft.getMinecraft().theWorld,box); } - - @SubscribeEvent - public void handleChunkSaveEvent(ChunkDataEvent.Save event) { - super.handleChunkSaveEvent(event); - } - - @SubscribeEvent - public void handleChunkLoadEvent(ChunkDataEvent.Load event) { - super.handleChunkLoadEvent(event); - } - - @SubscribeEvent - public void onServerTickEvent(TickEvent.ServerTickEvent aEvent) { - super.onServerTickEvent(aEvent); - } } diff --git a/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java b/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java index 31b1b1824c..598a8b148f 100644 --- a/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java +++ b/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java @@ -1,8 +1,5 @@ package com.github.technus.tectech.proxy; -import com.github.technus.tectech.TecTech; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent; import cpw.mods.fml.common.network.IGuiHandler; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; @@ -12,7 +9,6 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ChatComponentText; import net.minecraft.world.World; import net.minecraft.world.WorldServer; -import net.minecraftforge.event.world.ChunkDataEvent; public class CommonProxy implements IGuiHandler { public void registerRenderInfo() {} @@ -85,19 +81,4 @@ public class CommonProxy implements IGuiHandler { } return false; } - - @SubscribeEvent - public void handleChunkSaveEvent(ChunkDataEvent.Save event) { - TecTech.chunkDataHandler.handleChunkSaveEvent(event); - } - - @SubscribeEvent - public void handleChunkLoadEvent(ChunkDataEvent.Load event) { - TecTech.chunkDataHandler.handleChunkLoadEvent(event); - } - - @SubscribeEvent - public void onServerTickEvent(TickEvent.ServerTickEvent aEvent) { - TecTech.chunkDataHandler.tickData(aEvent); - } } -- cgit From e522d6463b002731ecb656dcdcf39e2773f33aa7 Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 14 Jul 2019 09:17:57 +0200 Subject: Implement data syncing --- .../java/com/github/technus/tectech/TecTech.java | 6 +- src/main/java/com/github/technus/tectech/Util.java | 7 + .../tectech/chunkData/ChunkDataHandler.java | 318 +++++++++++++++++++++ .../tectech/chunkData/ChunkMetaDataHandler.java | 27 ++ .../tectech/loader/network/ChunkDataMessage.java | 101 +++++++ .../tectech/loader/network/NetworkDispatcher.java | 2 + .../tectech/mechanics/anomaly/AnomalyHandler.java | 53 +++- .../mechanics/chunkData/ChunkDataHandler.java | 291 ------------------- .../mechanics/chunkData/ChunkMetaDataHandler.java | 18 -- 9 files changed, 507 insertions(+), 316 deletions(-) create mode 100644 src/main/java/com/github/technus/tectech/chunkData/ChunkDataHandler.java create mode 100644 src/main/java/com/github/technus/tectech/chunkData/ChunkMetaDataHandler.java create mode 100644 src/main/java/com/github/technus/tectech/loader/network/ChunkDataMessage.java delete mode 100644 src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkDataHandler.java delete mode 100644 src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkMetaDataHandler.java diff --git a/src/main/java/com/github/technus/tectech/TecTech.java b/src/main/java/com/github/technus/tectech/TecTech.java index 0e6e5ecf5c..cfe8662a21 100644 --- a/src/main/java/com/github/technus/tectech/TecTech.java +++ b/src/main/java/com/github/technus/tectech/TecTech.java @@ -5,7 +5,7 @@ import com.github.technus.tectech.loader.TecTechConfig; import com.github.technus.tectech.mechanics.ConvertFloat; import com.github.technus.tectech.mechanics.ConvertInteger; import com.github.technus.tectech.mechanics.anomaly.AnomalyHandler; -import com.github.technus.tectech.mechanics.chunkData.ChunkDataHandler; +import com.github.technus.tectech.chunkData.ChunkDataHandler; import com.github.technus.tectech.mechanics.elementalMatter.core.commands.GiveEM; import com.github.technus.tectech.mechanics.elementalMatter.core.commands.ListEM; import com.github.technus.tectech.proxy.CommonProxy; @@ -94,10 +94,10 @@ public class TecTech { if(configTecTech.DISABLE_MATERIAL_LOADING_FFS){ try { - Field field= GT_Proxy.class.getDeclaredField("mEvents"); - field.setAccessible(true); Field modifiersField = Field.class.getDeclaredField( "modifiers" ); modifiersField.setAccessible( true ); + Field field= GT_Proxy.class.getDeclaredField("mEvents"); + field.setAccessible(true); modifiersField.setInt( field, field.getModifiers() & ~Modifier.FINAL ); field.set(GT_Mod.gregtechproxy, new Collection() { @Override diff --git a/src/main/java/com/github/technus/tectech/Util.java b/src/main/java/com/github/technus/tectech/Util.java index e333e70137..7746d8dd41 100644 --- a/src/main/java/com/github/technus/tectech/Util.java +++ b/src/main/java/com/github/technus/tectech/Util.java @@ -20,6 +20,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; import org.apache.commons.lang3.StringUtils; @@ -1450,4 +1451,10 @@ public final class Util { } return Double.toString(value); } + + public static boolean checkChunkExist(World world, ChunkCoordIntPair chunk){ + int x=chunk.getCenterXPos(); + int z=chunk.getCenterZPosition(); + return world.checkChunksExist(x, 0, z, x, 0, z); + } } diff --git a/src/main/java/com/github/technus/tectech/chunkData/ChunkDataHandler.java b/src/main/java/com/github/technus/tectech/chunkData/ChunkDataHandler.java new file mode 100644 index 0000000000..cd6002e7fc --- /dev/null +++ b/src/main/java/com/github/technus/tectech/chunkData/ChunkDataHandler.java @@ -0,0 +1,318 @@ +package com.github.technus.tectech.chunkData; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.TickEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraftforge.event.world.ChunkDataEvent; +import net.minecraftforge.event.world.ChunkEvent; + +import java.util.*; + +public class ChunkDataHandler { + private final String BASE_TAG_NAME ="TecTechData"; + private final HashMap> dimensionWiseChunkData=new HashMap<>(); + private final HashMap> dimensionWiseMetaChunkData=new HashMap<>(); + private final HashMap metaDataHandlerHashMap =new HashMap<>(); + private final ArrayList serverHandlers=new ArrayList<>(); + private final ArrayList worldHandlers=new ArrayList<>(); + private final ArrayList playerHandlers=new ArrayList<>(); + @SideOnly(Side.CLIENT) + private final ArrayList clientHandlers=new ArrayList<>(); + @SideOnly(Side.CLIENT) + private final ArrayList renderHandlers=new ArrayList<>(); + @SideOnly(Side.CLIENT) + private final ArrayList clientSyncHandlers =new ArrayList<>(); + + @SideOnly(Side.SERVER) + @SubscribeEvent + public void handleChunkSaveEvent(ChunkDataEvent.Save event) { + HashMap dimensionData = dimensionWiseChunkData.get(event.world.provider.dimensionId); + NBTChunk chunkData = dimensionData != null ? dimensionData.get(event.getChunk().getChunkCoordIntPair()) : null; + if (chunkData == null) { + event.getData().removeTag(BASE_TAG_NAME); + } else { + chunkData.isLoaded = true; + event.getData().setTag(BASE_TAG_NAME, chunkData.data); + } + } + + @SideOnly(Side.SERVER) + @SubscribeEvent + public void handleChunkLoadEvent(ChunkDataEvent.Load event) { + NBTTagCompound loadedTag = event.getData().getCompoundTag(BASE_TAG_NAME); + if (loadedTag.hasNoTags()) { + return; + } + int dimId = event.world.provider.dimensionId; + HashMap dimensionMemory = + dimensionWiseChunkData.computeIfAbsent(dimId, this::createDimensionData); + ChunkCoordIntPair chunkCoordIntPair = event.getChunk().getChunkCoordIntPair(); + Set loadedKeys = loadedTag.func_150296_c(); + NBTChunk chunkMemory = dimensionMemory.get(chunkCoordIntPair); + if (chunkMemory == null) { + chunkMemory = new NBTChunk(loadedTag, true); + dimensionMemory.put(chunkCoordIntPair, chunkMemory); + for (String s : loadedKeys) { + dimensionWiseMetaChunkData.get(s).get(dimId).putLoaded(chunkCoordIntPair, loadedTag.getCompoundTag(s)); + } + } else if (!chunkMemory.isLoaded) { + chunkMemory.isLoaded = true; + + Set tagsDuplicated = new HashSet(loadedKeys); + tagsDuplicated.retainAll(chunkMemory.data.func_150296_c()); + + if (tagsDuplicated.isEmpty()) { + for (String s : loadedKeys) { + NBTTagCompound tag = loadedTag.getCompoundTag(s); + chunkMemory.data.setTag(s, tag); + dimensionWiseMetaChunkData.get(s).get(dimId).putLoaded(chunkCoordIntPair, tag); + } + } else { + for (String s : loadedKeys) { + NBTTagCompound memory = chunkMemory.data.getCompoundTag(s); + if (tagsDuplicated.contains(s)) { + metaDataHandlerHashMap.get(s).mergeData(memory, loadedTag.getCompoundTag(s)); + } else { + chunkMemory.data.setTag(s, loadedTag.getCompoundTag(s)); + dimensionWiseMetaChunkData.get(s).get(dimId).putLoaded(chunkCoordIntPair, memory); + } + } + } + } + } + + @SideOnly(Side.CLIENT) + @SubscribeEvent + public void onLoadChunk(ChunkEvent.Load aEvent){ + clientSyncHandlers.forEach(chunkMetaDataHandler -> chunkMetaDataHandler.requestData(aEvent)); + } + + @SideOnly(Side.CLIENT) + @SubscribeEvent + public void onUnLoadChunk(ChunkEvent.Unload aEvent){ + clientSyncHandlers.forEach(chunkMetaDataHandler -> dimensionWiseMetaChunkData + .get(chunkMetaDataHandler.getTagName()) + .get(aEvent.world.provider.dimensionId) + .remove(aEvent.getChunk().getChunkCoordIntPair())); + } + + @SideOnly(Side.CLIENT) + @SubscribeEvent + public void onClientTickEvent(TickEvent.ClientTickEvent aEvent) { + clientHandlers.forEach(chunkMetaDataHandler -> + chunkMetaDataHandler.tickClient( + dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), aEvent)); + } + + @SideOnly(Side.CLIENT) + @SubscribeEvent + public void onRenderTickEvent(TickEvent.RenderTickEvent aEvent) { + renderHandlers.forEach(chunkMetaDataHandler -> + chunkMetaDataHandler.tickRender( + dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), aEvent)); + } + + @SubscribeEvent + public void onServerTickEvent(TickEvent.ServerTickEvent aEvent) { + serverHandlers.forEach(chunkMetaDataHandler -> + chunkMetaDataHandler.tickServer( + dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), aEvent)); + } + + @SubscribeEvent + public void onWorldTickEvent(TickEvent.WorldTickEvent aEvent) { + worldHandlers.forEach(chunkMetaDataHandler -> + chunkMetaDataHandler.tickWorld( + dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), aEvent)); + } + + @SubscribeEvent + public void onPlayerTickEvent(TickEvent.PlayerTickEvent aEvent) { + playerHandlers.forEach(chunkMetaDataHandler -> + chunkMetaDataHandler.tickPlayer( + dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), aEvent)); + } + + + public void clearData() { + dimensionWiseChunkData.clear(); + dimensionWiseMetaChunkData.forEach((k,v)->v.clear()); + } + + public ChunkMetaDataHandler getChunkMetaDataHandler(String s){ + return metaDataHandlerHashMap.get(s); + } + + public void registerChunkMetaDataHandler(ChunkMetaDataHandler handler){ + metaDataHandlerHashMap.put(handler.getTagName(),handler); + dimensionWiseMetaChunkData.put(handler.getTagName(),new HashMap<>()); + Class clazz=handler.getClass(); + try { + if(clazz.getMethod("tickServer", HashMap.class, TickEvent.ServerTickEvent.class).getDeclaringClass()!=ChunkMetaDataHandler.class){ + serverHandlers.add(handler); + } + if(clazz.getMethod("tickWorld", HashMap.class, TickEvent.WorldTickEvent.class).getDeclaringClass()!=ChunkMetaDataHandler.class){ + worldHandlers.add(handler); + } + if(clazz.getMethod("tickPlayer", HashMap.class, TickEvent.PlayerTickEvent.class).getDeclaringClass()!=ChunkMetaDataHandler.class){ + playerHandlers.add(handler); + } + } catch (NoSuchMethodException e) { + throw new RuntimeException("Cannot register common event handlers!"); + } + if(FMLCommonHandler.instance().getEffectiveSide().isClient()) { + try { + if (clazz.getMethod("tickClient", HashMap.class, TickEvent.ClientTickEvent.class).getDeclaringClass() != ChunkMetaDataHandler.class) { + clientHandlers.add(handler); + } + if (clazz.getMethod("tickRender", HashMap.class, TickEvent.RenderTickEvent.class).getDeclaringClass() != ChunkMetaDataHandler.class) { + renderHandlers.add(handler); + } + if (clazz.getMethod("requestData", int.class, ChunkCoordIntPair.class).getDeclaringClass() != ChunkMetaDataHandler.class) { + clientSyncHandlers.add(handler); + } + } catch (NoSuchMethodException e) { + throw new RuntimeException("Cannot register client event handlers!"); + } + } + } + + public NBTTagCompound getChunkData(ChunkMetaDataHandler handler, int world, ChunkCoordIntPair chunk){ + return dimensionWiseMetaChunkData.get(handler.getTagName()).get(world).get(chunk); + } + + public NBTTagCompound putChunkData(ChunkMetaDataHandler handler, int world, ChunkCoordIntPair chunk,NBTTagCompound data){ + return dimensionWiseMetaChunkData.get(handler.getTagName()).get(world).put(chunk,data); + } + public NBTTagCompound createIfAbsentChunkData(ChunkMetaDataHandler handler, int world, ChunkCoordIntPair chunk){ + return dimensionWiseMetaChunkData.get(handler.getTagName()).get(world) + .computeIfAbsent(chunk,chunkCoordIntPair -> handler.createData()); + } + + public HashMap getChunkData(ChunkMetaDataHandler chunkMetaDataHandler){ + return dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()); + } + + public ChunkHashMap getChunkData(ChunkMetaDataHandler chunkMetaDataHandler,int world){ + return dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()).get(world); + } + + private HashMap createDimensionData(Integer dim) { + HashMap map = new HashMap<>(); + for (String meta : metaDataHandlerHashMap.keySet()) { + dimensionWiseMetaChunkData.get(meta).put(dim, new ChunkHashMap(meta, map)); + } + return map; + } + + public static final class ChunkHashMap implements Map{ + private final HashMap storage; + private final HashMap storageMeta=new HashMap<>(1024); + private final String meta; + + private ChunkHashMap(String meta, HashMap storage) { + this.storage =storage; + this.meta=meta; + } + + private void putLoaded(ChunkCoordIntPair key, NBTTagCompound value) { + storageMeta.put(key, value); + } + + @Override + public NBTTagCompound remove(Object key) { + NBTTagCompound compound=storageMeta.remove(key); + if(compound!=null) { + NBTChunk chunk = storage.get(key); + chunk.data.removeTag(meta); + if(chunk.data.hasNoTags()){ + storage.remove(key); + } + } + return compound; + } + + @Override + public NBTTagCompound put(ChunkCoordIntPair key, NBTTagCompound value) { + if(value==null){ + return remove(key); + } + NBTChunk chunk = storage.get(key); + if(chunk==null){ + NBTTagCompound base=new NBTTagCompound(); + base.setTag(meta,value); + storage.put(key,new NBTChunk(base,false)); + }else { + chunk.data.setTag(meta,value); + } + return storageMeta.put(key, value); + } + + @Override + public int size() { + return storageMeta.size(); + } + + @Override + public boolean isEmpty() { + return storageMeta.isEmpty(); + } + + @Override + public NBTTagCompound get(Object key) { + return storageMeta.get(key); + } + + @Override + public void clear() { + storageMeta.entrySet().forEach(this::remove); + } + + @Override + public void putAll(Map m) { + m.forEach(this::put); + } + + @Override + public boolean containsKey(Object key) { + return storageMeta.containsKey(key); + } + + @Override + public boolean containsValue(Object value) { + return storageMeta.containsValue(value); + } + + @Override + public Set keySet() { + return storageMeta.keySet(); + } + + @Override + public Collection values() { + return storageMeta.values(); + } + + @Override + public Set> entrySet() { + return storageMeta.entrySet(); + } + } + + private static final class NBTChunk { + private final NBTTagCompound data; + private boolean isLoaded; + + private NBTChunk(NBTTagCompound data, boolean isLoaded) { + if(data==null){ + data=new NBTTagCompound(); + } + this.data = data; + this.isLoaded = isLoaded; + } + } +} diff --git a/src/main/java/com/github/technus/tectech/chunkData/ChunkMetaDataHandler.java b/src/main/java/com/github/technus/tectech/chunkData/ChunkMetaDataHandler.java new file mode 100644 index 0000000000..479f8ddb37 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/chunkData/ChunkMetaDataHandler.java @@ -0,0 +1,27 @@ +package com.github.technus.tectech.chunkData; + +import cpw.mods.fml.common.gameevent.TickEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraftforge.event.world.ChunkEvent; + +import java.util.HashMap; + +public interface ChunkMetaDataHandler { + String getTagName(); + void mergeData(NBTTagCompound target, NBTTagCompound loadedData); + NBTTagCompound createData(); + @SideOnly(Side.CLIENT) + default void requestData(ChunkEvent.Load aEvent){} + default void pushData(int world, ChunkCoordIntPair chunk){} + @SideOnly(Side.CLIENT) + default void tickRender(HashMap data, TickEvent.RenderTickEvent aEvent){} + @SideOnly(Side.CLIENT) + default void tickClient(HashMap data, TickEvent.ClientTickEvent aEvent){} + default void tickServer(HashMap data, TickEvent.ServerTickEvent event){} + default void tickWorld(HashMap data, TickEvent.WorldTickEvent aEvent){} + default void tickPlayer(HashMap data, TickEvent.PlayerTickEvent aEvent){} +} + diff --git a/src/main/java/com/github/technus/tectech/loader/network/ChunkDataMessage.java b/src/main/java/com/github/technus/tectech/loader/network/ChunkDataMessage.java new file mode 100644 index 0000000000..daa6195944 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/loader/network/ChunkDataMessage.java @@ -0,0 +1,101 @@ +package com.github.technus.tectech.loader.network; + +import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.Util; +import com.github.technus.tectech.chunkData.ChunkMetaDataHandler; +import cpw.mods.fml.common.network.ByteBufUtils; +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import cpw.mods.fml.common.network.simpleimpl.MessageContext; +import eu.usrv.yamcore.network.client.AbstractClientMessageHandler; +import eu.usrv.yamcore.network.server.AbstractServerMessageHandler; +import io.netty.buffer.ByteBuf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraftforge.event.world.ChunkEvent; + +public class ChunkDataMessage implements IMessage { + int worldId; + ChunkCoordIntPair chunk; + NBTTagCompound data; + ChunkMetaDataHandler handler; + + public ChunkDataMessage(){} + + @Override + public void fromBytes(ByteBuf pBuffer) { + NBTTagCompound tag = ByteBufUtils.readTag(pBuffer); + worldId = tag.getInteger("wId"); + chunk=new ChunkCoordIntPair( + tag.getInteger("posx"), + tag.getInteger("posz")); + handler = TecTech.chunkDataHandler.getChunkMetaDataHandler( + tag.getString("handle")); + if(tag.hasKey("data")){ + data=tag.getCompoundTag("data"); + } + } + + @Override + public void toBytes(ByteBuf pBuffer) { + NBTTagCompound tag = new NBTTagCompound(); + tag.setInteger("wId",worldId); + tag.setInteger("posx",chunk.chunkXPos); + tag.setInteger("posz",chunk.chunkZPos); + tag.setString("handle",handler.getTagName()); + if(data!=null){ + tag.setTag("data",data); + } + ByteBufUtils.writeTag(pBuffer, tag); + } + + public static class ChunkDataQuery extends ChunkDataMessage { + public ChunkDataQuery() { + } + public ChunkDataQuery(ChunkEvent.Load aEvent,ChunkMetaDataHandler handler) { + worldId=aEvent.world.provider.dimensionId; + chunk=aEvent.getChunk().getChunkCoordIntPair(); + this.handler=handler; + } + } + + public static class ChunkDataData extends ChunkDataMessage { + public ChunkDataData() { + } + + public ChunkDataData(int worldId,ChunkCoordIntPair chunk,ChunkMetaDataHandler handler){ + this.worldId=worldId; + this.chunk=chunk; + this.handler=handler; + this.data=TecTech.chunkDataHandler.getChunkData(handler,worldId,chunk); + } + + public ChunkDataData(ChunkDataQuery query){ + worldId=query.worldId; + chunk=query.chunk; + handler=query.handler; + data=TecTech.chunkDataHandler.getChunkData(handler,worldId,chunk); + } + } + + public static class ClientHandler extends AbstractClientMessageHandler { + @Override + public IMessage handleClientMessage(EntityPlayer pPlayer, ChunkDataData pMessage, MessageContext pCtx) { + if(Util.checkChunkExist(pPlayer.worldObj,pMessage.chunk)){ + TecTech.chunkDataHandler.putChunkData(pMessage.handler, pMessage.worldId,pMessage.chunk, pMessage.data); + } + return null; + } + } + + public static class ServerHandler extends AbstractServerMessageHandler { + @Override + public IMessage handleServerMessage(EntityPlayer pPlayer, ChunkDataQuery pMessage, MessageContext pCtx) { + if(pPlayer instanceof EntityPlayerMP){ + NetworkDispatcher.INSTANCE.sendTo(new ChunkDataData(pMessage),(EntityPlayerMP) pPlayer); + } + return null; + } + } +} diff --git a/src/main/java/com/github/technus/tectech/loader/network/NetworkDispatcher.java b/src/main/java/com/github/technus/tectech/loader/network/NetworkDispatcher.java index 2ee027ddc8..56455a13c4 100644 --- a/src/main/java/com/github/technus/tectech/loader/network/NetworkDispatcher.java +++ b/src/main/java/com/github/technus/tectech/loader/network/NetworkDispatcher.java @@ -17,5 +17,7 @@ public class NetworkDispatcher extends eu.usrv.yamcore.network.PacketDispatcher registerMessage(PipeActivityMessage.ClientHandler.class, PipeActivityMessage.PipeActivityData.class); registerMessage(RotationMessage.ServerHandler.class, RotationMessage.RotationQuery.class); registerMessage(RotationMessage.ClientHandler.class, RotationMessage.RotationData.class); + registerMessage(ChunkDataMessage.ServerHandler.class, ChunkDataMessage.ChunkDataQuery.class); + registerMessage(ChunkDataMessage.ClientHandler.class, ChunkDataMessage.ChunkDataData.class); } } diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java index c5060c8709..b69fa5f76e 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java @@ -1,9 +1,16 @@ package com.github.technus.tectech.mechanics.anomaly; -import com.github.technus.tectech.mechanics.chunkData.ChunkDataHandler; -import com.github.technus.tectech.mechanics.chunkData.ChunkMetaDataHandler; +import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.loader.network.ChunkDataMessage; +import com.github.technus.tectech.loader.network.NetworkDispatcher; +import com.github.technus.tectech.chunkData.ChunkDataHandler; +import com.github.technus.tectech.chunkData.ChunkMetaDataHandler; import cpw.mods.fml.common.gameevent.TickEvent; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; +import net.minecraftforge.event.world.ChunkEvent; import java.util.HashMap; @@ -17,8 +24,8 @@ public class AnomalyHandler implements ChunkMetaDataHandler { @Override public void mergeData(NBTTagCompound target, NBTTagCompound loadedData) { - int intensity=target.getInteger(INTENSITY)+loadedData.getInteger(INTENSITY); - target.setInteger(INTENSITY,intensity); + double intensity=target.getDouble(INTENSITY)+loadedData.getDouble(INTENSITY); + target.setDouble(INTENSITY,intensity); } @Override @@ -30,4 +37,42 @@ public class AnomalyHandler implements ChunkMetaDataHandler { public void tickServer(HashMap data, TickEvent.ServerTickEvent event) { } + + @Override + public void tickClient(HashMap data, TickEvent.ClientTickEvent aEvent) { + + } + + @Override + public void requestData(ChunkEvent.Load aEvent) { + NetworkDispatcher.INSTANCE.sendToServer(new ChunkDataMessage.ChunkDataQuery(aEvent,this)); + } + + @Override + public void pushData(int world, ChunkCoordIntPair chunk) { + NetworkDispatcher.INSTANCE.sendToDimension(new ChunkDataMessage.ChunkDataData(world,chunk,this),world); + } + + public void addAnomaly(IGregTechTileEntity iGregTechTileEntity, double amount) { + World w=iGregTechTileEntity.getWorld(); + addAnomaly(w.provider.dimensionId, + w.getChunkFromBlockCoords( + iGregTechTileEntity.getXCoord(), + iGregTechTileEntity.getZCoord()) + .getChunkCoordIntPair(), + amount); + } + + public void addAnomaly(int world, ChunkCoordIntPair chunk,double amount) { + NBTTagCompound old=TecTech.chunkDataHandler.getChunkData(this,world,chunk); + if(old==null){ + NBTTagCompound data=new NBTTagCompound(); + data.setDouble(INTENSITY,amount); + TecTech.chunkDataHandler.putChunkData(this,world,chunk,data); + //todo update client on threshold reach + }else { + old.setDouble(INTENSITY,old.getDouble(INTENSITY)+amount); + //todo update client on threshold change + } + } } diff --git a/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkDataHandler.java b/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkDataHandler.java deleted file mode 100644 index f0a1c5488c..0000000000 --- a/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkDataHandler.java +++ /dev/null @@ -1,291 +0,0 @@ -package com.github.technus.tectech.mechanics.chunkData; - -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.ChunkCoordIntPair; -import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; -import net.minecraftforge.event.world.ChunkDataEvent; - -import java.util.*; - -public class ChunkDataHandler { - private final String BASE_TAG_NAME ="TecTechData"; - private final HashMap> dimensionWiseChunkData=new HashMap<>(); - private final HashMap> dimensionWiseMetaChunkData=new HashMap<>(); - private final HashMap metaDataHandlerHashMap =new HashMap<>(); - private final ArrayList serverHandlers=new ArrayList<>(); - private final ArrayList clientHandlers=new ArrayList<>(); - private final ArrayList worldHandlers=new ArrayList<>(); - private final ArrayList playerHandlers=new ArrayList<>(); - private final ArrayList renderHandlers=new ArrayList<>(); - - @SubscribeEvent - public void handleChunkSaveEvent(ChunkDataEvent.Save event) { - HashMap dimensionData=dimensionWiseChunkData.get(event.world.provider.dimensionId); - NBTChunk chunkData =dimensionData!=null?dimensionData.get(event.getChunk().getChunkCoordIntPair()):null; - if(chunkData==null) { - event.getData().removeTag(BASE_TAG_NAME); - } else { - chunkData.isLoaded=true; - event.getData().setTag(BASE_TAG_NAME,chunkData.data); - } - } - - @SubscribeEvent - public void handleChunkLoadEvent(ChunkDataEvent.Load event) { - NBTTagCompound loadedTag=event.getData().getCompoundTag(BASE_TAG_NAME); - if(loadedTag.hasNoTags()){ - return; - } - int dimId=event.world.provider.dimensionId; - HashMap dimensionMemory= - dimensionWiseChunkData.computeIfAbsent(dimId, this::createDimensionData); - ChunkCoordIntPair chunkCoordIntPair=event.getChunk().getChunkCoordIntPair(); - Set loadedKeys=loadedTag.func_150296_c(); - NBTChunk chunkMemory =dimensionMemory.get(chunkCoordIntPair); - if(chunkMemory==null) { - chunkMemory=new NBTChunk(loadedTag,true); - dimensionMemory.put(chunkCoordIntPair,chunkMemory); - for (String s :loadedKeys) { - dimensionWiseMetaChunkData.get(s).get(dimId).putLoaded(chunkCoordIntPair, loadedTag.getCompoundTag(s)); - } - }else if(!chunkMemory.isLoaded) { - chunkMemory.isLoaded=true; - - Set tagsDuplicated=new HashSet(loadedKeys); - tagsDuplicated.retainAll(chunkMemory.data.func_150296_c()); - - if (tagsDuplicated.isEmpty()) { - for (String s:loadedKeys) { - NBTTagCompound tag=loadedTag.getCompoundTag(s); - chunkMemory.data.setTag(s,tag); - dimensionWiseMetaChunkData.get(s).get(dimId).putLoaded(chunkCoordIntPair,tag); - } - } else { - for (String s : loadedKeys) { - NBTTagCompound memory=chunkMemory.data.getCompoundTag(s); - if(tagsDuplicated.contains(s)){ - metaDataHandlerHashMap.get(s).mergeData(memory,loadedTag.getCompoundTag(s)); - }else { - chunkMemory.data.setTag(s,loadedTag.getCompoundTag(s)); - dimensionWiseMetaChunkData.get(s).get(dimId).putLoaded(chunkCoordIntPair,memory); - } - } - } - } - } - - @SubscribeEvent - public void onClientTickEvent(TickEvent.ClientTickEvent aEvent) { - clientHandlers.forEach(chunkMetaDataHandler -> - chunkMetaDataHandler.tickClient( - dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), - aEvent)); - } - - @SubscribeEvent - public void onServerTickEvent(TickEvent.ServerTickEvent aEvent) { - serverHandlers.forEach(chunkMetaDataHandler -> - chunkMetaDataHandler.tickServer( - dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), - aEvent)); - } - - @SubscribeEvent - public void onWorldTickEvent(TickEvent.WorldTickEvent aEvent) { - worldHandlers.forEach(chunkMetaDataHandler -> - chunkMetaDataHandler.tickWorld( - dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), - aEvent)); - } - - @SubscribeEvent - public void onPlayerTickEvent(TickEvent.PlayerTickEvent aEvent) { - playerHandlers.forEach(chunkMetaDataHandler -> - chunkMetaDataHandler.tickPlayer( - dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), - aEvent)); - } - - @SubscribeEvent - public void onRenderTickEvent(TickEvent.RenderTickEvent aEvent) { - renderHandlers.forEach(chunkMetaDataHandler -> - chunkMetaDataHandler.tickRender( - dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), - aEvent)); - } - - - public void clearData() { - dimensionWiseChunkData.clear(); - dimensionWiseMetaChunkData.forEach((k,v)->v.clear()); - } - - public void registerChunkMetaDataHandler(ChunkMetaDataHandler handler){ - metaDataHandlerHashMap.put(handler.getTagName(),handler); - dimensionWiseMetaChunkData.put(handler.getTagName(),new HashMap<>()); - try { - Class clazz=handler.getClass(); - if(clazz.getMethod("tickClient", HashMap.class, TickEvent.ClientTickEvent.class).getDeclaringClass()!=ChunkMetaDataHandler.class){ - clientHandlers.add(handler); - } - if(clazz.getMethod("tickServer", HashMap.class, TickEvent.ServerTickEvent.class).getDeclaringClass()!=ChunkMetaDataHandler.class){ - serverHandlers.add(handler); - } - if(clazz.getMethod("tickWorld", HashMap.class, TickEvent.WorldTickEvent.class).getDeclaringClass()!=ChunkMetaDataHandler.class){ - worldHandlers.add(handler); - } - if(clazz.getMethod("tickPlayer", HashMap.class, TickEvent.PlayerTickEvent.class).getDeclaringClass()!=ChunkMetaDataHandler.class){ - playerHandlers.add(handler); - } - if(clazz.getMethod("tickRender", HashMap.class, TickEvent.RenderTickEvent.class).getDeclaringClass()!=ChunkMetaDataHandler.class){ - renderHandlers.add(handler); - } - } catch (NoSuchMethodException e) { - throw new RuntimeException("Cannot register event handlers!"); - } - } - - public NBTTagCompound getChunkData(ChunkMetaDataHandler handler, World world, Chunk chunk){ - return getChunkData(handler,world.provider.dimensionId,chunk.getChunkCoordIntPair()); - } - - public NBTTagCompound getChunkData(ChunkMetaDataHandler handler, int world, ChunkCoordIntPair chunk){ - return dimensionWiseMetaChunkData.get(handler.getTagName()).get(world).get(chunk); - } - - public NBTTagCompound computeIfAbsentChunkData(ChunkMetaDataHandler handler, World world, Chunk chunk){ - return computeIfAbsentChunkData(handler,world.provider.dimensionId,chunk.getChunkCoordIntPair()); - } - - public NBTTagCompound computeIfAbsentChunkData(ChunkMetaDataHandler handler, int world, ChunkCoordIntPair chunk){ - return dimensionWiseMetaChunkData.get(handler.getTagName()).get(world) - .computeIfAbsent(chunk,chunkCoordIntPair -> handler.createData()); - } - - public HashMap getChunkData(ChunkMetaDataHandler chunkMetaDataHandler){ - return dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()); - } - - public ChunkHashMap getChunkData(ChunkMetaDataHandler chunkMetaDataHandler,World world){ - return dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()).get(world.provider.dimensionId); - } - - public ChunkHashMap getChunkData(ChunkMetaDataHandler chunkMetaDataHandler,int world){ - return dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()).get(world); - } - - private HashMap createDimensionData(Integer dim) { - HashMap map = new HashMap<>(); - for (String meta : metaDataHandlerHashMap.keySet()) { - dimensionWiseMetaChunkData.get(meta).put(dim, new ChunkHashMap(meta, map)); - } - return map; - } - - public static final class ChunkHashMap implements Map{ - private final HashMap storage; - private final HashMap storageMeta=new HashMap<>(1024); - private final String meta; - - private ChunkHashMap(String meta, HashMap storage) { - this.storage =storage; - this.meta=meta; - } - - private void putLoaded(ChunkCoordIntPair key, NBTTagCompound value) { - storageMeta.put(key, value); - } - - @Override - public NBTTagCompound remove(Object key) { - NBTTagCompound compound=storageMeta.remove(key); - if(compound!=null) { - NBTChunk chunk = storage.get(key); - chunk.data.removeTag(meta); - if(chunk.data.hasNoTags()){ - storage.remove(key); - } - } - return compound; - } - - @Override - public NBTTagCompound put(ChunkCoordIntPair key, NBTTagCompound value) { - NBTChunk chunk = storage.get(key); - if(chunk==null){ - NBTTagCompound base=new NBTTagCompound(); - base.setTag(meta,value); - storage.put(key,new NBTChunk(base,false)); - }else { - chunk.data.setTag(meta,value); - } - return storageMeta.put(key, value); - } - - @Override - public int size() { - return storageMeta.size(); - } - - @Override - public boolean isEmpty() { - return storageMeta.isEmpty(); - } - - @Override - public NBTTagCompound get(Object key) { - return storageMeta.get(key); - } - - @Override - public void clear() { - storageMeta.entrySet().forEach(this::remove); - } - - @Override - public void putAll(Map m) { - m.forEach(this::put); - } - - @Override - public boolean containsKey(Object key) { - return storageMeta.containsKey(key); - } - - @Override - public boolean containsValue(Object value) { - return storageMeta.containsValue(value); - } - - @Override - public Set keySet() { - return storageMeta.keySet(); - } - - @Override - public Collection values() { - return storageMeta.values(); - } - - @Override - public Set> entrySet() { - return storageMeta.entrySet(); - } - } - - private static final class NBTChunk { - private final NBTTagCompound data; - private boolean isLoaded; - - private NBTChunk(NBTTagCompound data, boolean isLoaded) { - if(data==null){ - data=new NBTTagCompound(); - } - this.data = data; - this.isLoaded = isLoaded; - } - } -} diff --git a/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkMetaDataHandler.java b/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkMetaDataHandler.java deleted file mode 100644 index e16f19b681..0000000000 --- a/src/main/java/com/github/technus/tectech/mechanics/chunkData/ChunkMetaDataHandler.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.github.technus.tectech.mechanics.chunkData; - -import cpw.mods.fml.common.gameevent.TickEvent; -import net.minecraft.nbt.NBTTagCompound; - -import java.util.HashMap; - -public interface ChunkMetaDataHandler { - String getTagName(); - void mergeData(NBTTagCompound target, NBTTagCompound loadedData); - NBTTagCompound createData(); - default void tickClient(HashMap data, TickEvent.ClientTickEvent aEvent){} - default void tickServer(HashMap data, TickEvent.ServerTickEvent event){} - default void tickWorld(HashMap data, TickEvent.WorldTickEvent aEvent){} - default void tickPlayer(HashMap data, TickEvent.PlayerTickEvent aEvent){} - default void tickRender(HashMap data, TickEvent.RenderTickEvent aEvent){} -} - -- cgit From fc5f458c69519ae0d314873c68779a8c503fb176 Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 14 Jul 2019 11:19:43 +0200 Subject: Add most of pollution injections --- .../tectech/chunkData/ChunkDataHandler.java | 32 ++++++---- .../dreamcraft/DreamCraftRecipeLoader.java | 10 ++++ .../github/technus/tectech/loader/MainLoader.java | 3 +- .../tectech/loader/recipe/BloodyRecipeLoader.java | 68 +++++++++++++++------- .../tectech/mechanics/anomaly/AnomalyHandler.java | 16 ++--- .../core/iElementalInstanceContainer.java | 2 +- .../tectech/thing/block/QuantumGlassBlock.java | 1 + ...GT_MetaTileEntity_Hatch_ElementalContainer.java | 22 ++++--- .../GT_MetaTileEntity_Hatch_OverflowElemental.java | 5 +- .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 57 ++++-------------- .../multi/em_machine/Behaviour_Recycler.java | 21 +++++-- .../em_machine/GT_MetaTileEntity_EM_machine.java | 1 + .../pipe/GT_MetaTileEntity_Pipe_EM.java | 7 +++ src/main/resources/assets/tectech/lang/en_US.lang | 5 +- 14 files changed, 145 insertions(+), 105 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/chunkData/ChunkDataHandler.java b/src/main/java/com/github/technus/tectech/chunkData/ChunkDataHandler.java index cd6002e7fc..157a1a7057 100644 --- a/src/main/java/com/github/technus/tectech/chunkData/ChunkDataHandler.java +++ b/src/main/java/com/github/technus/tectech/chunkData/ChunkDataHandler.java @@ -9,6 +9,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.ChunkCoordIntPair; import net.minecraftforge.event.world.ChunkDataEvent; import net.minecraftforge.event.world.ChunkEvent; +import net.minecraftforge.event.world.WorldEvent; import java.util.*; @@ -27,6 +28,24 @@ public class ChunkDataHandler { @SideOnly(Side.CLIENT) private final ArrayList clientSyncHandlers =new ArrayList<>(); + @SubscribeEvent + public void onWorldLoad(WorldEvent.Load event){ + int dim=event.world.provider.dimensionId; + dimensionWiseChunkData.computeIfAbsent(dim, m->{ + HashMap map = new HashMap<>(); + for (String meta : metaDataHandlerHashMap.keySet()) { + dimensionWiseMetaChunkData.get(meta).put(dim, new ChunkHashMap(meta, map)); + } + return map; + }); + } + + @SubscribeEvent + public void onWorldUnload(WorldEvent.Unload event){ + dimensionWiseChunkData.remove(event.world.provider.dimensionId); + dimensionWiseMetaChunkData.forEach((k,v)->v.remove(event.world.provider.dimensionId)); + } + @SideOnly(Side.SERVER) @SubscribeEvent public void handleChunkSaveEvent(ChunkDataEvent.Save event) { @@ -48,8 +67,7 @@ public class ChunkDataHandler { return; } int dimId = event.world.provider.dimensionId; - HashMap dimensionMemory = - dimensionWiseChunkData.computeIfAbsent(dimId, this::createDimensionData); + HashMap dimensionMemory = dimensionWiseChunkData.get(dimId); ChunkCoordIntPair chunkCoordIntPair = event.getChunk().getChunkCoordIntPair(); Set loadedKeys = loadedTag.func_150296_c(); NBTChunk chunkMemory = dimensionMemory.get(chunkCoordIntPair); @@ -172,7 +190,7 @@ public class ChunkDataHandler { if (clazz.getMethod("tickRender", HashMap.class, TickEvent.RenderTickEvent.class).getDeclaringClass() != ChunkMetaDataHandler.class) { renderHandlers.add(handler); } - if (clazz.getMethod("requestData", int.class, ChunkCoordIntPair.class).getDeclaringClass() != ChunkMetaDataHandler.class) { + if (clazz.getMethod("requestData", ChunkEvent.Load.class).getDeclaringClass() != ChunkMetaDataHandler.class) { clientSyncHandlers.add(handler); } } catch (NoSuchMethodException e) { @@ -201,14 +219,6 @@ public class ChunkDataHandler { return dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()).get(world); } - private HashMap createDimensionData(Integer dim) { - HashMap map = new HashMap<>(); - for (String meta : metaDataHandlerHashMap.keySet()) { - dimensionWiseMetaChunkData.get(meta).put(dim, new ChunkHashMap(meta, map)); - } - return map; - } - public static final class ChunkHashMap implements Map{ private final HashMap storage; private final HashMap storageMeta=new HashMap<>(1024); diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java index dd3ad339af..16636d67cf 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java @@ -5,6 +5,7 @@ import com.github.technus.tectech.thing.CustomItemList; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.Behaviour_Centrifuge; import com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.Behaviour_ElectromagneticSeparator; +import com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.Behaviour_Recycler; import com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.GT_MetaTileEntity_EM_machine; import cpw.mods.fml.common.Loader; import gregtech.api.enums.GT_Values; @@ -1111,5 +1112,14 @@ public class DreamCraftRecipeLoader implements Runnable { GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(10),getItemContainer("ElectromagneticSeparatorUEV").get(1)); GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(11),getItemContainer("ElectromagneticSeparatorUIV").get(1)); GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(12),getItemContainer("ElectromagneticSeparatorUMV").get(1)); + + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(5),ItemList.Machine_IV_Recycler.get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(6),getItemContainer("RecyclerLuV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(7),getItemContainer("RecyclerZPM").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(8),getItemContainer("RecyclerUV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(9),getItemContainer("RecyclerUHV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(10),getItemContainer("RecyclerUEV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(11),getItemContainer("RecyclerUIV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(12),getItemContainer("RecyclerUMV").get(1)); } } diff --git a/src/main/java/com/github/technus/tectech/loader/MainLoader.java b/src/main/java/com/github/technus/tectech/loader/MainLoader.java index 473045d665..2272733d5a 100644 --- a/src/main/java/com/github/technus/tectech/loader/MainLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/MainLoader.java @@ -49,7 +49,7 @@ import static com.github.technus.tectech.loader.gui.CreativeTabTecTech.creativeT import static gregtech.api.enums.GT_Values.W; public final class MainLoader { - public static DamageSource microwaving, elementalPollution; + public static DamageSource microwaving, elementalPollution,subspace; private MainLoader(){} @@ -102,6 +102,7 @@ public final class MainLoader { progressBarLoad.step("Add damage types"); microwaving =new DamageSource("microwaving").setDamageBypassesArmor(); elementalPollution =new DamageSource("elementalPollution").setDamageBypassesArmor(); + subspace =new DamageSource("subspace").setDamageBypassesArmor().setDamageIsAbsolute(); LOGGER.info("Damage types addition Done"); progressBarLoad.step("Register Packet Dispatcher"); diff --git a/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java b/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java index c4ab54694c..bfe015749c 100644 --- a/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java @@ -5,6 +5,7 @@ import com.github.technus.tectech.thing.CustomItemList; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.Behaviour_Centrifuge; import com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.Behaviour_ElectromagneticSeparator; +import com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.Behaviour_Recycler; import com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.GT_MetaTileEntity_EM_machine; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; @@ -719,38 +720,61 @@ public class BloodyRecipeLoader implements Runnable { } private void register_machine_EM_behaviours(){ - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(6),ItemList.Machine_IV_Centrifuge.get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(5),ItemList.Machine_IV_Centrifuge.get(1)); try { - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(7),ItemList.valueOf("Machine_LuV_Centrifuge").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(8),ItemList.valueOf("Machine_ZPM_Centrifuge").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(9),ItemList.valueOf("Machine_UV_Centrifuge").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(10),ItemList.valueOf("Machine_UV_Centrifuge").get(4)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(11),ItemList.valueOf("Machine_UV_Centrifuge").get(16)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(6),ItemList.valueOf("Machine_LuV_Centrifuge").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(7),ItemList.valueOf("Machine_ZPM_Centrifuge").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(8),ItemList.valueOf("Machine_UV_Centrifuge").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(9),ItemList.valueOf("Machine_UV_Centrifuge").get(4)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(10),ItemList.valueOf("Machine_UV_Centrifuge").get(16)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(11),ItemList.valueOf("Machine_UV_Centrifuge").get(40)); GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(12),ItemList.valueOf("Machine_UV_Centrifuge").get(64)); }catch (IllegalArgumentException|NullPointerException e){ - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(7),ItemList.Machine_IV_Centrifuge.get(2)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(8),ItemList.Machine_IV_Centrifuge.get(4)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(9),ItemList.Machine_IV_Centrifuge.get(8)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(10),ItemList.Machine_IV_Centrifuge.get(16)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(11),ItemList.Machine_IV_Centrifuge.get(32)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(6),ItemList.Machine_IV_Centrifuge.get(2)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(7),ItemList.Machine_IV_Centrifuge.get(4)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(8),ItemList.Machine_IV_Centrifuge.get(8)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(9),ItemList.Machine_IV_Centrifuge.get(16)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(10),ItemList.Machine_IV_Centrifuge.get(32)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(11),ItemList.Machine_IV_Centrifuge.get(48)); GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(12),ItemList.Machine_IV_Centrifuge.get(64)); } - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(6),ItemList.Machine_IV_ElectromagneticSeparator.get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(5),ItemList.Machine_IV_ElectromagneticSeparator.get(1)); try { - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(7),ItemList.valueOf("Machine_LuV_ElectromagneticSeparator").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(8),ItemList.valueOf("Machine_ZPM_ElectromagneticSeparator").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(9),ItemList.valueOf("Machine_UV_ElectromagneticSeparator").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(10),ItemList.valueOf("Machine_UV_ElectromagneticSeparator").get(4)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(11),ItemList.valueOf("Machine_UV_ElectromagneticSeparator").get(16)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(6),ItemList.valueOf("Machine_LuV_ElectromagneticSeparator").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(7),ItemList.valueOf("Machine_ZPM_ElectromagneticSeparator").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(8),ItemList.valueOf("Machine_UV_ElectromagneticSeparator").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(9),ItemList.valueOf("Machine_UV_ElectromagneticSeparator").get(4)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(10),ItemList.valueOf("Machine_UV_ElectromagneticSeparator").get(16)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(11),ItemList.valueOf("Machine_UV_ElectromagneticSeparator").get(40)); GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(12),ItemList.valueOf("Machine_UV_ElectromagneticSeparator").get(64)); }catch (IllegalArgumentException|NullPointerException e){ - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(7),ItemList.Machine_IV_ElectromagneticSeparator.get(2)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(8),ItemList.Machine_IV_ElectromagneticSeparator.get(4)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(9),ItemList.Machine_IV_ElectromagneticSeparator.get(8)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(10),ItemList.Machine_IV_ElectromagneticSeparator.get(16)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(11),ItemList.Machine_IV_ElectromagneticSeparator.get(32)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(6),ItemList.Machine_IV_ElectromagneticSeparator.get(2)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(7),ItemList.Machine_IV_ElectromagneticSeparator.get(4)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(8),ItemList.Machine_IV_ElectromagneticSeparator.get(8)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(9),ItemList.Machine_IV_ElectromagneticSeparator.get(16)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(10),ItemList.Machine_IV_ElectromagneticSeparator.get(32)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(11),ItemList.Machine_IV_ElectromagneticSeparator.get(48)); GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(12),ItemList.Machine_IV_ElectromagneticSeparator.get(64)); } + + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(5),ItemList.Machine_IV_Recycler.get(1)); + try { + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(6),ItemList.valueOf("Machine_LuV_Recycler").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(7),ItemList.valueOf("Machine_ZPM_Recycler").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(8),ItemList.valueOf("Machine_UV_Recycler").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(9),ItemList.valueOf("Machine_UV_Recycler").get(4)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(10),ItemList.valueOf("Machine_UV_Recycler").get(16)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(11),ItemList.valueOf("Machine_UV_Recycler").get(40)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(12),ItemList.valueOf("Machine_UV_Recycler").get(64)); + }catch (IllegalArgumentException|NullPointerException e){ + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(6),ItemList.Machine_IV_Recycler.get(2)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(7),ItemList.Machine_IV_Recycler.get(4)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(8),ItemList.Machine_IV_Recycler.get(8)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(9),ItemList.Machine_IV_Recycler.get(16)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(10),ItemList.Machine_IV_Recycler.get(32)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(11),ItemList.Machine_IV_Recycler.get(48)); + GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(12),ItemList.Machine_IV_Recycler.get(64)); + } } } diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java index b69fa5f76e..69585e29b0 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java @@ -54,13 +54,15 @@ public class AnomalyHandler implements ChunkMetaDataHandler { } public void addAnomaly(IGregTechTileEntity iGregTechTileEntity, double amount) { - World w=iGregTechTileEntity.getWorld(); - addAnomaly(w.provider.dimensionId, - w.getChunkFromBlockCoords( - iGregTechTileEntity.getXCoord(), - iGregTechTileEntity.getZCoord()) - .getChunkCoordIntPair(), - amount); + if(iGregTechTileEntity.isServerSide()) { + World w = iGregTechTileEntity.getWorld(); + addAnomaly(w.provider.dimensionId, + w.getChunkFromBlockCoords( + iGregTechTileEntity.getXCoord(), + iGregTechTileEntity.getZCoord()) + .getChunkCoordIntPair(), + amount); + } } public void addAnomaly(int world, ChunkCoordIntPair chunk,double amount) { diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/iElementalInstanceContainer.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/iElementalInstanceContainer.java index 5244676643..20fe1ffc5b 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/iElementalInstanceContainer.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/iElementalInstanceContainer.java @@ -6,5 +6,5 @@ package com.github.technus.tectech.mechanics.elementalMatter.core; public interface iElementalInstanceContainer extends Cloneable { cElementalInstanceStackMap getContainerHandler(); - float purgeOverflow(); + void purgeOverflow(); } diff --git a/src/main/java/com/github/technus/tectech/thing/block/QuantumGlassBlock.java b/src/main/java/com/github/technus/tectech/thing/block/QuantumGlassBlock.java index ef903cbf38..1a08bdbeec 100644 --- a/src/main/java/com/github/technus/tectech/thing/block/QuantumGlassBlock.java +++ b/src/main/java/com/github/technus/tectech/thing/block/QuantumGlassBlock.java @@ -100,6 +100,7 @@ public final class QuantumGlassBlock extends BlockBase { if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); } + } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java index c84057c121..066bcaa166 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java @@ -124,7 +124,8 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta if (TecTech.configTecTech.BOOM_ENABLE) { tGTTileEntity.doExplosion(V[14]); } else { - TecTech.proxy.broadcast("Container1 BOOM! " + getBaseMetaTileEntity().getXCoord() + ' ' + getBaseMetaTileEntity().getYCoord() + ' ' + getBaseMetaTileEntity().getZCoord()); + TecTech.anomalyHandler.addAnomaly(aBaseMetaTileEntity,overflowMatter*32D); + TecTech.proxy.broadcast("Container1 BOOM! " +aBaseMetaTileEntity.getXCoord() + ' ' + aBaseMetaTileEntity.getYCoord() + ' ' + aBaseMetaTileEntity.getZCoord()); } } deathDelay = 3;//needed in some cases like repetitive failures. Should be 4 since there is -- at end but meh... @@ -132,11 +133,12 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta } } else if (deathDelay < 1) { if (TecTech.configTecTech.BOOM_ENABLE) { - getBaseMetaTileEntity().doExplosion(V[14]); + aBaseMetaTileEntity.doExplosion(V[14]); } else { + TecTech.anomalyHandler.addAnomaly(aBaseMetaTileEntity,overflowMatter*32D); deathDelay=3; overflowMatter=0; - TecTech.proxy.broadcast("Container0 BOOM! " + getBaseMetaTileEntity().getXCoord() + ' ' + getBaseMetaTileEntity().getYCoord() + ' ' + getBaseMetaTileEntity().getZCoord()); + TecTech.proxy.broadcast("Container0 BOOM! " + aBaseMetaTileEntity.getXCoord() + ' ' + aBaseMetaTileEntity.getYCoord() + ' ' + aBaseMetaTileEntity.getZCoord()); } } deathDelay--; @@ -207,8 +209,8 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta } @Override - public float purgeOverflow() { - return overflowMatter += content.removeOverflow(getMaxStacksCount(), getMaxStackSize()); + public void purgeOverflow() { + overflowMatter += content.removeOverflow(getMaxStacksCount(), getMaxStackSize()); } @Override @@ -248,8 +250,8 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta } } - public float updateSlots() { - return purgeOverflow(); + public void updateSlots() { + purgeOverflow(); } @Override @@ -271,10 +273,12 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta @Override public void onRemoval() { if (isValidMetaTileEntity(this) && getBaseMetaTileEntity().isActive()) { + TecTech.anomalyHandler.addAnomaly(getBaseMetaTileEntity(),(overflowMatter+content.getMass())*16D); + IGregTechTileEntity base=getBaseMetaTileEntity(); if (TecTech.configTecTech.BOOM_ENABLE) { - getBaseMetaTileEntity().doExplosion(V[15]); + base.doExplosion(V[15]); } else { - TecTech.proxy.broadcast("BOOM! " + getBaseMetaTileEntity().getXCoord() + ' ' + getBaseMetaTileEntity().getYCoord() + ' ' + getBaseMetaTileEntity().getZCoord()); + TecTech.proxy.broadcast("BOOM! " +base.getXCoord() + ' ' + base.getYCoord() + ' ' + base.getZCoord()); } } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OverflowElemental.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OverflowElemental.java index 63321a03a4..e3dc732c99 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OverflowElemental.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OverflowElemental.java @@ -142,10 +142,10 @@ public class GT_MetaTileEntity_Hatch_OverflowElemental extends GT_MetaTileEntity if (aBaseMetaTileEntity.isServerSide() && aTick % 20 == DISPERSE_AT) { if (aBaseMetaTileEntity.isActive()) { if (overflowMatter > overflowDisperse) { - //todo add full dose of dispersed pollution (reduced by tier, or make recycler machine only capable of reduction?) + TecTech.anomalyHandler.addAnomaly(aBaseMetaTileEntity,overflowDisperse); overflowMatter -= overflowDisperse; } else { - //todo add partial dose of dispersed pollution (reduced by tier, or make recycler machine only capable of reduction?) + TecTech.anomalyHandler.addAnomaly(aBaseMetaTileEntity,overflowMatter); overflowMatter = 0; aBaseMetaTileEntity.setActive(false); aBaseMetaTileEntity.setLightValue((byte) 0); @@ -202,6 +202,7 @@ public class GT_MetaTileEntity_Hatch_OverflowElemental extends GT_MetaTileEntity @Override public void onRemoval() { if (isValidMetaTileEntity(this) && getBaseMetaTileEntity().isActive()) { + TecTech.anomalyHandler.addAnomaly(getBaseMetaTileEntity(),overflowMatter*8D); if (TecTech.configTecTech.BOOM_ENABLE) { getBaseMetaTileEntity().doExplosion(V[15]); } else { 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 c2d3ffcf06..10bad33830 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 @@ -39,8 +39,7 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; import static com.github.technus.tectech.CommonValues.*; -import static com.github.technus.tectech.Util.StructureCheckerExtreme; -import static com.github.technus.tectech.Util.getTier; +import static com.github.technus.tectech.Util.*; import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; @@ -675,16 +674,10 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt hatch.getBaseMetaTileEntity().setActive(false); } } + cleanOutputEM_EM(); if (ePowerPass && getEUVar()>V[3] || eDismantleBoom && mMaxProgresstime > 0 && areChunksAroundLoaded_EM()) { explodeMultiblock(); } - if (outputEM != null) { - for (cElementalInstanceStackMap output : outputEM) { - if (output != null && output.hasStacks()) { - explodeMultiblock(); - } - } - } } catch (Exception e) { if (DEBUG_MODE) { e.printStackTrace(); @@ -1985,35 +1978,14 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt mass += tHatch.overflowMatter; tHatch.overflowMatter = 0; } - if (mass > 0) { - if (eMufflerHatches.size() < 1) { - explodeMultiblock(); - } - mass /= eMufflerHatches.size(); - for (GT_MetaTileEntity_Hatch_OverflowElemental dump : eMufflerHatches) { - if (dump.addOverflowMatter(mass)) { - explodeMultiblock(); - } - } - } + cleanMassEM_EM(mass); } public void cleanHatchContentEM_EM(GT_MetaTileEntity_Hatch_ElementalContainer target) { if (target == null) { return; } - float mass = target.getContainerHandler().getMass(); - if (mass > 0) { - if (eMufflerHatches.size() < 1) { - explodeMultiblock(); - } - mass /= eMufflerHatches.size(); - for (GT_MetaTileEntity_Hatch_OverflowElemental dump : eMufflerHatches) { - if (dump.addOverflowMatter(mass)) { - explodeMultiblock(); - } - } - } + cleanMassEM_EM(target.getContainerHandler().getMass()); } public void cleanStackEM_EM(cElementalInstanceStack target) { @@ -2026,14 +1998,20 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt public void cleanMassEM_EM(float mass) { if (mass > 0) { if (eMufflerHatches.size() < 1) { + TecTech.anomalyHandler.addAnomaly(getBaseMetaTileEntity(),mass); explodeMultiblock(); + return; } mass /= eMufflerHatches.size(); + boolean shouldExplode=false; for (GT_MetaTileEntity_Hatch_OverflowElemental dump : eMufflerHatches) { if (dump.addOverflowMatter(mass)) { - explodeMultiblock(); + shouldExplode=true; } } + if(shouldExplode){ + explodeMultiblock(); + } } } @@ -2047,19 +2025,8 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt mass += map.getMass(); } } - - if (mass > 0) { - if (eMufflerHatches.size() < 1) { - explodeMultiblock(); - } - mass /= eMufflerHatches.size(); - for (GT_MetaTileEntity_Hatch_OverflowElemental dump : eMufflerHatches) { - if (dump.addOverflowMatter(mass)) { - explodeMultiblock(); - } - } - } outputEM = null; + cleanMassEM_EM(mass); } //endregion diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Recycler.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Recycler.java index e30fdf111b..f94ff3f326 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Recycler.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Recycler.java @@ -4,27 +4,36 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInsta import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockControl; import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; +import static com.github.technus.tectech.CommonValues.V; + /** * Created by danie_000 on 24.12.2017. */ public class Behaviour_Recycler implements GT_MetaTileEntity_EM_machine.Behaviour { - final int tier; + private final int tier; + private final float coeff; public Behaviour_Recycler(int tier){ this.tier=tier; + coeff=(float)(1/Math.pow(2,tier-4)); } @Override - public void parametersInstantiation(GT_MetaTileEntity_EM_machine te, Parameters parameters) { - - } + public void parametersInstantiation(GT_MetaTileEntity_EM_machine te, Parameters parameters) {} @Override public boolean checkParametersInAndSetStatuses(GT_MetaTileEntity_EM_machine te, Parameters parameters) { - return false; + return true; } @Override public MultiblockControl process(cElementalInstanceStackMap[] inputs, GT_MetaTileEntity_EM_machine te, Parameters parameters) { - return null; + float mass=0; + for (int i = 0; i < inputs.length; i++) { + if(inputs[i]!=null) { + mass+=inputs[i].getMass(); + } + } + return new MultiblockControl<>(null,(int)V[tier], 4, + 0,10000,20, 0,mass*coeff); } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java index fc8a6c914e..197347f891 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java @@ -293,6 +293,7 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa } else { currentBehaviour=null; } + return true; } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java index f6c0724546..caccee07c4 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java @@ -249,4 +249,11 @@ public class GT_MetaTileEntity_Pipe_EM extends MetaPipeEntity implements IConnec public boolean getActive() { return active; } + + @Override + public void onRemoval() { + if(getActive()){ + TecTech.anomalyHandler.addAnomaly(getBaseMetaTileEntity(),1e10f); + } + } } diff --git a/src/main/resources/assets/tectech/lang/en_US.lang b/src/main/resources/assets/tectech/lang/en_US.lang index ccb17a8a0c..59a0d720de 100644 --- a/src/main/resources/assets/tectech/lang/en_US.lang +++ b/src/main/resources/assets/tectech/lang/en_US.lang @@ -13,4 +13,7 @@ death.attack.microwaving=%1$s was dehydrated by radiation. death.attack.microwaving.player=%1$s was dehydrated by radiation while fighting %2$s. death.attack.elementalPollution=%1$s was vaping from the wrong hole. -death.attack.elementalPollution.player=%1$s was vaping from the wrong hole while fighting %2$s. \ No newline at end of file +death.attack.elementalPollution.player=%1$s was vaping from the wrong hole while fighting %2$s. + +death.attack.subspace=%1$s was N-th dimensionally displeased. +death.attack.subspace.player=%1$s N-th dimensionally displeased while fighting %2$s. \ No newline at end of file -- cgit From 1bbbbcaea14966d113a3f0230228e3f5ccb9d053 Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 14 Jul 2019 15:32:35 +0200 Subject: Implement some auto updates --- .../java/com/github/technus/tectech/TecTech.java | 3 +- .../tectech/chunkData/ChunkDataHandler.java | 43 +++++++++++++++++++--- .../tectech/chunkData/ChunkMetaDataHandler.java | 7 ++++ .../tectech/mechanics/anomaly/AnomalyHandler.java | 23 +++++++++--- 4 files changed, 65 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/TecTech.java b/src/main/java/com/github/technus/tectech/TecTech.java index cfe8662a21..9d3273f10e 100644 --- a/src/main/java/com/github/technus/tectech/TecTech.java +++ b/src/main/java/com/github/technus/tectech/TecTech.java @@ -80,7 +80,6 @@ public class TecTech { } chunkDataHandler=new ChunkDataHandler(); - chunkDataHandler.registerChunkMetaDataHandler(anomalyHandler=new AnomalyHandler()); FMLCommonHandler.instance().bus().register(chunkDataHandler); MinecraftForge.EVENT_BUS.register(chunkDataHandler); @@ -188,6 +187,8 @@ public class TecTech { @Mod.EventHandler public void PostLoad(FMLPostInitializationEvent PostEvent) { MainLoader.postLoad(); + + chunkDataHandler.registerChunkMetaDataHandler(anomalyHandler=new AnomalyHandler()); } @Mod.EventHandler diff --git a/src/main/java/com/github/technus/tectech/chunkData/ChunkDataHandler.java b/src/main/java/com/github/technus/tectech/chunkData/ChunkDataHandler.java index 157a1a7057..c3818009a4 100644 --- a/src/main/java/com/github/technus/tectech/chunkData/ChunkDataHandler.java +++ b/src/main/java/com/github/technus/tectech/chunkData/ChunkDataHandler.java @@ -18,6 +18,7 @@ public class ChunkDataHandler { private final HashMap> dimensionWiseChunkData=new HashMap<>(); private final HashMap> dimensionWiseMetaChunkData=new HashMap<>(); private final HashMap metaDataHandlerHashMap =new HashMap<>(); + private final ArrayList clientSyncHandlers =new ArrayList<>(); private final ArrayList serverHandlers=new ArrayList<>(); private final ArrayList worldHandlers=new ArrayList<>(); private final ArrayList playerHandlers=new ArrayList<>(); @@ -25,8 +26,6 @@ public class ChunkDataHandler { private final ArrayList clientHandlers=new ArrayList<>(); @SideOnly(Side.CLIENT) private final ArrayList renderHandlers=new ArrayList<>(); - @SideOnly(Side.CLIENT) - private final ArrayList clientSyncHandlers =new ArrayList<>(); @SubscribeEvent public void onWorldLoad(WorldEvent.Load event){ @@ -143,6 +142,34 @@ public class ChunkDataHandler { @SubscribeEvent public void onWorldTickEvent(TickEvent.WorldTickEvent aEvent) { + if(aEvent.side.isServer()){ + int dim=aEvent.world.provider.dimensionId; + clientSyncHandlers.forEach(chunkMetaDataHandler -> { + ChunkHashMap data=dimensionWiseMetaChunkData + .get(chunkMetaDataHandler.getTagName()).get(dim); + int cycle=chunkMetaDataHandler.pushPayloadSpreadPeriod(); + int epoch=(int)(aEvent.world.getTotalWorldTime()%cycle); + ArrayList work; + if(epoch==0){ + int per=data.dirtyBoys.size()/cycle; + int mod=data.dirtyBoys.size()%cycle; + Iterator iter=data.dirtyBoys.iterator(); + for (int periodWork = 0; periodWork < cycle; periodWork++) { + work=data.workLoad.get(periodWork); + for (int i = 0; i < per; i++) { + work.add(iter.next()); + } + if(periodWork chunkMetaDataHandler.tickWorld( dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), aEvent)); @@ -179,6 +206,9 @@ public class ChunkDataHandler { if(clazz.getMethod("tickPlayer", HashMap.class, TickEvent.PlayerTickEvent.class).getDeclaringClass()!=ChunkMetaDataHandler.class){ playerHandlers.add(handler); } + if (clazz.getMethod("requestData", ChunkEvent.Load.class).getDeclaringClass() != ChunkMetaDataHandler.class) { + clientSyncHandlers.add(handler); + } } catch (NoSuchMethodException e) { throw new RuntimeException("Cannot register common event handlers!"); } @@ -190,9 +220,6 @@ public class ChunkDataHandler { if (clazz.getMethod("tickRender", HashMap.class, TickEvent.RenderTickEvent.class).getDeclaringClass() != ChunkMetaDataHandler.class) { renderHandlers.add(handler); } - if (clazz.getMethod("requestData", ChunkEvent.Load.class).getDeclaringClass() != ChunkMetaDataHandler.class) { - clientSyncHandlers.add(handler); - } } catch (NoSuchMethodException e) { throw new RuntimeException("Cannot register client event handlers!"); } @@ -222,6 +249,8 @@ public class ChunkDataHandler { public static final class ChunkHashMap implements Map{ private final HashMap storage; private final HashMap storageMeta=new HashMap<>(1024); + private final HashSet dirtyBoys=new HashSet<>(1024); + private final ArrayList> workLoad=new ArrayList<>(); private final String meta; private ChunkHashMap(String meta, HashMap storage) { @@ -229,6 +258,10 @@ public class ChunkDataHandler { this.meta=meta; } + public void markForTransmissionToClient(ChunkCoordIntPair chunk){ + dirtyBoys.add(chunk); + } + private void putLoaded(ChunkCoordIntPair key, NBTTagCompound value) { storageMeta.put(key, value); } diff --git a/src/main/java/com/github/technus/tectech/chunkData/ChunkMetaDataHandler.java b/src/main/java/com/github/technus/tectech/chunkData/ChunkMetaDataHandler.java index 479f8ddb37..543fb080a5 100644 --- a/src/main/java/com/github/technus/tectech/chunkData/ChunkMetaDataHandler.java +++ b/src/main/java/com/github/technus/tectech/chunkData/ChunkMetaDataHandler.java @@ -7,6 +7,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.ChunkCoordIntPair; import net.minecraftforge.event.world.ChunkEvent; +import java.util.ArrayList; import java.util.HashMap; public interface ChunkMetaDataHandler { @@ -16,6 +17,12 @@ public interface ChunkMetaDataHandler { @SideOnly(Side.CLIENT) default void requestData(ChunkEvent.Load aEvent){} default void pushData(int world, ChunkCoordIntPair chunk){} + default void pushPayload(int world, ArrayList chunk){ + chunk.forEach(chunkCoordIntPair -> pushData(world,chunkCoordIntPair)); + } + default int pushPayloadSpreadPeriod(){ + return 20; + } @SideOnly(Side.CLIENT) default void tickRender(HashMap data, TickEvent.RenderTickEvent aEvent){} @SideOnly(Side.CLIENT) diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java index 69585e29b0..8ef33e7c3f 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java @@ -1,10 +1,11 @@ package com.github.technus.tectech.mechanics.anomaly; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.loader.network.ChunkDataMessage; -import com.github.technus.tectech.loader.network.NetworkDispatcher; import com.github.technus.tectech.chunkData.ChunkDataHandler; import com.github.technus.tectech.chunkData.ChunkMetaDataHandler; +import com.github.technus.tectech.loader.network.ChunkDataMessage; +import com.github.technus.tectech.loader.network.NetworkDispatcher; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.dAtomDefinition; import cpw.mods.fml.common.gameevent.TickEvent; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.nbt.NBTTagCompound; @@ -15,6 +16,8 @@ import net.minecraftforge.event.world.ChunkEvent; import java.util.HashMap; public class AnomalyHandler implements ChunkMetaDataHandler { + private static final double MIN_POLLUTION= dAtomDefinition.getSomethingHeavy().getMass()*10000D; + private static final String INTENSITY="intensity"; @Override @@ -53,6 +56,11 @@ public class AnomalyHandler implements ChunkMetaDataHandler { NetworkDispatcher.INSTANCE.sendToDimension(new ChunkDataMessage.ChunkDataData(world,chunk,this),world); } + @Override + public int pushPayloadSpreadPeriod() { + return 100; + } + public void addAnomaly(IGregTechTileEntity iGregTechTileEntity, double amount) { if(iGregTechTileEntity.isServerSide()) { World w = iGregTechTileEntity.getWorld(); @@ -71,10 +79,15 @@ public class AnomalyHandler implements ChunkMetaDataHandler { NBTTagCompound data=new NBTTagCompound(); data.setDouble(INTENSITY,amount); TecTech.chunkDataHandler.putChunkData(this,world,chunk,data); - //todo update client on threshold reach + if(amount>MIN_POLLUTION){ + + } }else { - old.setDouble(INTENSITY,old.getDouble(INTENSITY)+amount); - //todo update client on threshold change + double newAmount=old.getDouble(INTENSITY)+amount; + old.setDouble(INTENSITY,newAmount); + if(newAmount>MIN_POLLUTION){ + + } } } } -- cgit From c3388bf4fb0acad4ebdda64d178453edcc3cfeb8 Mon Sep 17 00:00:00 2001 From: Tec Date: Sun, 14 Jul 2019 22:24:16 +0200 Subject: Pollution works? --- src/main/java/com/github/technus/tectech/Util.java | 4 +- .../tectech/chunkData/ChunkDataHandler.java | 127 ++++++++++---------- .../tectech/chunkData/ChunkMetaDataHandler.java | 34 ------ .../tectech/chunkData/IChunkMetaDataHandler.java | 37 ++++++ .../technus/tectech/chunkData/WorldData.java | 52 ++++++++ .../GT_MetaTileEntity_EM_essentiaDequantizer.java | 4 +- .../GT_MetaTileEntity_EM_essentiaQuantizer.java | 4 +- .../tectech/loader/network/ChunkDataMessage.java | 8 +- .../tectech/mechanics/anomaly/AnomalyHandler.java | 131 ++++++++++++++++----- .../github/technus/tectech/recipe/TT_recipe.java | 10 +- .../technus/tectech/recipe/TT_recipeAdder.java | 6 +- .../thing/item/ConstructableTriggerItem.java | 10 +- .../multi/GT_MetaTileEntity_EM_annihilation.java | 4 +- .../multi/GT_MetaTileEntity_EM_bhg.java | 4 +- .../multi/GT_MetaTileEntity_EM_collider.java | 38 +++--- .../multi/GT_MetaTileEntity_EM_computer.java | 24 ++-- .../multi/GT_MetaTileEntity_EM_crafting.java | 4 +- .../multi/GT_MetaTileEntity_EM_dataBank.java | 4 +- .../multi/GT_MetaTileEntity_EM_decay.java | 12 +- .../multi/GT_MetaTileEntity_EM_dequantizer.java | 4 +- .../multi/GT_MetaTileEntity_EM_infuser.java | 4 +- .../multi/GT_MetaTileEntity_EM_junction.java | 14 +-- .../multi/GT_MetaTileEntity_EM_quantizer.java | 4 +- .../multi/GT_MetaTileEntity_EM_research.java | 4 +- .../multi/GT_MetaTileEntity_EM_scanner.java | 12 +- .../multi/GT_MetaTileEntity_EM_stabilizer.java | 4 +- .../multi/GT_MetaTileEntity_EM_switch.java | 14 +-- .../multi/GT_MetaTileEntity_EM_transformer.java | 4 +- .../multi/GT_MetaTileEntity_EM_wormhole.java | 4 +- .../multi/GT_MetaTileEntity_TM_microwave.java | 14 +-- .../multi/GT_MetaTileEntity_TM_teslaCoil.java | 4 +- .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 2 +- .../metaTileEntity/multi/base/HatchAdder.java | 8 -- .../metaTileEntity/multi/base/IHatchAdder.java | 8 ++ .../metaTileEntity/multi/base/INameFunction.java | 5 + .../metaTileEntity/multi/base/IStatusFunction.java | 5 + .../metaTileEntity/multi/base/NameFunction.java | 5 - .../metaTileEntity/multi/base/Parameters.java | 20 ++-- .../metaTileEntity/multi/base/StatusFunction.java | 5 - .../multi/em_machine/Behaviour_Centrifuge.java | 14 +-- .../multi/em_machine/Behaviour_Electrolyzer.java | 2 +- .../Behaviour_ElectromagneticSeparator.java | 18 +-- .../multi/em_machine/Behaviour_PrecisionLaser.java | 2 +- .../multi/em_machine/Behaviour_Recycler.java | 2 +- .../multi/em_machine/Behaviour_Scanner.java | 2 +- .../em_machine/GT_MetaTileEntity_EM_machine.java | 18 +-- .../single/GT_MetaTileEntity_DataReader.java | 16 +-- .../single/gui/GT_GUIContainer_DataReader.java | 12 +- 48 files changed, 436 insertions(+), 311 deletions(-) delete mode 100644 src/main/java/com/github/technus/tectech/chunkData/ChunkMetaDataHandler.java create mode 100644 src/main/java/com/github/technus/tectech/chunkData/IChunkMetaDataHandler.java create mode 100644 src/main/java/com/github/technus/tectech/chunkData/WorldData.java delete mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/HatchAdder.java create mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/IHatchAdder.java create mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/INameFunction.java create mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/IStatusFunction.java delete mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/NameFunction.java delete mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/StatusFunction.java diff --git a/src/main/java/com/github/technus/tectech/Util.java b/src/main/java/com/github/technus/tectech/Util.java index 7746d8dd41..53e9627187 100644 --- a/src/main/java/com/github/technus/tectech/Util.java +++ b/src/main/java/com/github/technus/tectech/Util.java @@ -2,7 +2,7 @@ package com.github.technus.tectech; import com.github.technus.tectech.thing.casing.TT_Container_Casings; import com.github.technus.tectech.thing.metaTileEntity.IFrontRotation; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -396,7 +396,7 @@ public final class Util { String[][] structure,//0-9 casing, +- air no air, A... ignore 'A'-CHAR-1 blocks Block[] blockType,//use numbers 0-9 for casing types byte[] blockMeta,//use numbers 0-9 for casing types - HatchAdder[] addingMethods, + IHatchAdder[] addingMethods, short[] casingTextures, Block[] blockTypeFallback,//use numbers 0-9 for casing types byte[] blockMetaFallback,//use numbers 0-9 for casing types diff --git a/src/main/java/com/github/technus/tectech/chunkData/ChunkDataHandler.java b/src/main/java/com/github/technus/tectech/chunkData/ChunkDataHandler.java index c3818009a4..f7b3895a80 100644 --- a/src/main/java/com/github/technus/tectech/chunkData/ChunkDataHandler.java +++ b/src/main/java/com/github/technus/tectech/chunkData/ChunkDataHandler.java @@ -17,35 +17,26 @@ public class ChunkDataHandler { private final String BASE_TAG_NAME ="TecTechData"; private final HashMap> dimensionWiseChunkData=new HashMap<>(); private final HashMap> dimensionWiseMetaChunkData=new HashMap<>(); - private final HashMap metaDataHandlerHashMap =new HashMap<>(); - private final ArrayList clientSyncHandlers =new ArrayList<>(); - private final ArrayList serverHandlers=new ArrayList<>(); - private final ArrayList worldHandlers=new ArrayList<>(); - private final ArrayList playerHandlers=new ArrayList<>(); - @SideOnly(Side.CLIENT) - private final ArrayList clientHandlers=new ArrayList<>(); - @SideOnly(Side.CLIENT) - private final ArrayList renderHandlers=new ArrayList<>(); + private final HashMap metaDataHandlerHashMap =new HashMap<>(); + private final ArrayList clientSyncHandlers =new ArrayList<>(); + private final ArrayList serverHandlers=new ArrayList<>(); + private final ArrayList worldHandlers=new ArrayList<>(); + private final ArrayList playerHandlers=new ArrayList<>(); + private final ArrayList clientHandlers=new ArrayList<>(); + private final ArrayList renderHandlers=new ArrayList<>(); @SubscribeEvent public void onWorldLoad(WorldEvent.Load event){ int dim=event.world.provider.dimensionId; dimensionWiseChunkData.computeIfAbsent(dim, m->{ HashMap map = new HashMap<>(); - for (String meta : metaDataHandlerHashMap.keySet()) { - dimensionWiseMetaChunkData.get(meta).put(dim, new ChunkHashMap(meta, map)); + for (Map.Entry meta : metaDataHandlerHashMap.entrySet()) { + dimensionWiseMetaChunkData.get(meta.getKey()).put(dim, new ChunkHashMap(meta.getValue(), map)); } return map; }); } - @SubscribeEvent - public void onWorldUnload(WorldEvent.Unload event){ - dimensionWiseChunkData.remove(event.world.provider.dimensionId); - dimensionWiseMetaChunkData.forEach((k,v)->v.remove(event.world.provider.dimensionId)); - } - - @SideOnly(Side.SERVER) @SubscribeEvent public void handleChunkSaveEvent(ChunkDataEvent.Save event) { HashMap dimensionData = dimensionWiseChunkData.get(event.world.provider.dimensionId); @@ -58,7 +49,6 @@ public class ChunkDataHandler { } } - @SideOnly(Side.SERVER) @SubscribeEvent public void handleChunkLoadEvent(ChunkDataEvent.Load event) { NBTTagCompound loadedTag = event.getData().getCompoundTag(BASE_TAG_NAME); @@ -140,36 +130,35 @@ public class ChunkDataHandler { dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), aEvent)); } + @SideOnly(Side.SERVER) @SubscribeEvent public void onWorldTickEvent(TickEvent.WorldTickEvent aEvent) { - if(aEvent.side.isServer()){ - int dim=aEvent.world.provider.dimensionId; - clientSyncHandlers.forEach(chunkMetaDataHandler -> { - ChunkHashMap data=dimensionWiseMetaChunkData - .get(chunkMetaDataHandler.getTagName()).get(dim); - int cycle=chunkMetaDataHandler.pushPayloadSpreadPeriod(); - int epoch=(int)(aEvent.world.getTotalWorldTime()%cycle); - ArrayList work; - if(epoch==0){ - int per=data.dirtyBoys.size()/cycle; - int mod=data.dirtyBoys.size()%cycle; - Iterator iter=data.dirtyBoys.iterator(); - for (int periodWork = 0; periodWork < cycle; periodWork++) { - work=data.workLoad.get(periodWork); - for (int i = 0; i < per; i++) { - work.add(iter.next()); - } - if(periodWork { + ChunkHashMap data=dimensionWiseMetaChunkData + .get(chunkMetaDataHandler.getTagName()).get(dim); + int cycle=chunkMetaDataHandler.pushPayloadSpreadPeriod(); + int epoch=(int)(aEvent.world.getTotalWorldTime()%cycle); + ArrayList work; + if(epoch==0){ + int per=data.dirtyBoys.size()/cycle; + int mod=data.dirtyBoys.size()%cycle; + Iterator iter=data.dirtyBoys.iterator(); + for (int periodWork = 0; periodWork < cycle; periodWork++) { + work=data.workLoad.get(periodWork); + for (int i = 0; i < per; i++) { + work.add(iter.next()); + } + if(periodWork chunkMetaDataHandler.tickWorld( dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), aEvent)); @@ -188,36 +177,42 @@ public class ChunkDataHandler { dimensionWiseMetaChunkData.forEach((k,v)->v.clear()); } - public ChunkMetaDataHandler getChunkMetaDataHandler(String s){ + public IChunkMetaDataHandler getChunkMetaDataHandler(String s){ return metaDataHandlerHashMap.get(s); } - public void registerChunkMetaDataHandler(ChunkMetaDataHandler handler){ + public void registerChunkMetaDataHandler(IChunkMetaDataHandler handler){ metaDataHandlerHashMap.put(handler.getTagName(),handler); dimensionWiseMetaChunkData.put(handler.getTagName(),new HashMap<>()); Class clazz=handler.getClass(); try { - if(clazz.getMethod("tickServer", HashMap.class, TickEvent.ServerTickEvent.class).getDeclaringClass()!=ChunkMetaDataHandler.class){ + if(clazz.getMethod("tickServer", HashMap.class, TickEvent.ServerTickEvent.class).getDeclaringClass()!= IChunkMetaDataHandler.class){ serverHandlers.add(handler); } - if(clazz.getMethod("tickWorld", HashMap.class, TickEvent.WorldTickEvent.class).getDeclaringClass()!=ChunkMetaDataHandler.class){ - worldHandlers.add(handler); - } - if(clazz.getMethod("tickPlayer", HashMap.class, TickEvent.PlayerTickEvent.class).getDeclaringClass()!=ChunkMetaDataHandler.class){ + if(clazz.getMethod("tickPlayer", HashMap.class, TickEvent.PlayerTickEvent.class).getDeclaringClass()!= IChunkMetaDataHandler.class){ playerHandlers.add(handler); } - if (clazz.getMethod("requestData", ChunkEvent.Load.class).getDeclaringClass() != ChunkMetaDataHandler.class) { + if (clazz.getMethod("requestData", ChunkEvent.Load.class).getDeclaringClass() != IChunkMetaDataHandler.class) { clientSyncHandlers.add(handler); } } catch (NoSuchMethodException e) { throw new RuntimeException("Cannot register common event handlers!"); } + if(FMLCommonHandler.instance().getEffectiveSide().isServer()) { + try { + if(clazz.getMethod("tickWorld", HashMap.class, TickEvent.WorldTickEvent.class).getDeclaringClass()!= IChunkMetaDataHandler.class){ + worldHandlers.add(handler); + } + } catch (NoSuchMethodException e) { + throw new RuntimeException("Cannot register client event handlers!"); + } + } if(FMLCommonHandler.instance().getEffectiveSide().isClient()) { try { - if (clazz.getMethod("tickClient", HashMap.class, TickEvent.ClientTickEvent.class).getDeclaringClass() != ChunkMetaDataHandler.class) { + if (clazz.getMethod("tickClient", HashMap.class, TickEvent.ClientTickEvent.class).getDeclaringClass() != IChunkMetaDataHandler.class) { clientHandlers.add(handler); } - if (clazz.getMethod("tickRender", HashMap.class, TickEvent.RenderTickEvent.class).getDeclaringClass() != ChunkMetaDataHandler.class) { + if (clazz.getMethod("tickRender", HashMap.class, TickEvent.RenderTickEvent.class).getDeclaringClass() != IChunkMetaDataHandler.class) { renderHandlers.add(handler); } } catch (NoSuchMethodException e) { @@ -226,23 +221,28 @@ public class ChunkDataHandler { } } - public NBTTagCompound getChunkData(ChunkMetaDataHandler handler, int world, ChunkCoordIntPair chunk){ + public NBTTagCompound removeChunkData(IChunkMetaDataHandler handler, int world, ChunkCoordIntPair chunk){ + return dimensionWiseMetaChunkData.get(handler.getTagName()).get(world).remove(chunk); + } + + public NBTTagCompound getChunkData(IChunkMetaDataHandler handler, int world, ChunkCoordIntPair chunk){ return dimensionWiseMetaChunkData.get(handler.getTagName()).get(world).get(chunk); } - public NBTTagCompound putChunkData(ChunkMetaDataHandler handler, int world, ChunkCoordIntPair chunk,NBTTagCompound data){ + public NBTTagCompound putChunkData(IChunkMetaDataHandler handler, int world, ChunkCoordIntPair chunk, NBTTagCompound data){ return dimensionWiseMetaChunkData.get(handler.getTagName()).get(world).put(chunk,data); } - public NBTTagCompound createIfAbsentChunkData(ChunkMetaDataHandler handler, int world, ChunkCoordIntPair chunk){ + + public NBTTagCompound createIfAbsentChunkData(IChunkMetaDataHandler handler, int world, ChunkCoordIntPair chunk){ return dimensionWiseMetaChunkData.get(handler.getTagName()).get(world) .computeIfAbsent(chunk,chunkCoordIntPair -> handler.createData()); } - public HashMap getChunkData(ChunkMetaDataHandler chunkMetaDataHandler){ + public HashMap getChunkData(IChunkMetaDataHandler chunkMetaDataHandler){ return dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()); } - public ChunkHashMap getChunkData(ChunkMetaDataHandler chunkMetaDataHandler,int world){ + public ChunkHashMap getChunkData(IChunkMetaDataHandler chunkMetaDataHandler, int world){ return dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()).get(world); } @@ -253,9 +253,12 @@ public class ChunkDataHandler { private final ArrayList> workLoad=new ArrayList<>(); private final String meta; - private ChunkHashMap(String meta, HashMap storage) { + private ChunkHashMap(IChunkMetaDataHandler meta, HashMap storage) { this.storage =storage; - this.meta=meta; + this.meta=meta.getTagName(); + for (int i = 0; i < meta.pushPayloadSpreadPeriod(); i++) { + workLoad.add(new ArrayList<>(128)); + } } public void markForTransmissionToClient(ChunkCoordIntPair chunk){ diff --git a/src/main/java/com/github/technus/tectech/chunkData/ChunkMetaDataHandler.java b/src/main/java/com/github/technus/tectech/chunkData/ChunkMetaDataHandler.java deleted file mode 100644 index 543fb080a5..0000000000 --- a/src/main/java/com/github/technus/tectech/chunkData/ChunkMetaDataHandler.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.github.technus.tectech.chunkData; - -import cpw.mods.fml.common.gameevent.TickEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.ChunkCoordIntPair; -import net.minecraftforge.event.world.ChunkEvent; - -import java.util.ArrayList; -import java.util.HashMap; - -public interface ChunkMetaDataHandler { - String getTagName(); - void mergeData(NBTTagCompound target, NBTTagCompound loadedData); - NBTTagCompound createData(); - @SideOnly(Side.CLIENT) - default void requestData(ChunkEvent.Load aEvent){} - default void pushData(int world, ChunkCoordIntPair chunk){} - default void pushPayload(int world, ArrayList chunk){ - chunk.forEach(chunkCoordIntPair -> pushData(world,chunkCoordIntPair)); - } - default int pushPayloadSpreadPeriod(){ - return 20; - } - @SideOnly(Side.CLIENT) - default void tickRender(HashMap data, TickEvent.RenderTickEvent aEvent){} - @SideOnly(Side.CLIENT) - default void tickClient(HashMap data, TickEvent.ClientTickEvent aEvent){} - default void tickServer(HashMap data, TickEvent.ServerTickEvent event){} - default void tickWorld(HashMap data, TickEvent.WorldTickEvent aEvent){} - default void tickPlayer(HashMap data, TickEvent.PlayerTickEvent aEvent){} -} - diff --git a/src/main/java/com/github/technus/tectech/chunkData/IChunkMetaDataHandler.java b/src/main/java/com/github/technus/tectech/chunkData/IChunkMetaDataHandler.java new file mode 100644 index 0000000000..b904f09f33 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/chunkData/IChunkMetaDataHandler.java @@ -0,0 +1,37 @@ +package com.github.technus.tectech.chunkData; + +import cpw.mods.fml.common.gameevent.TickEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraftforge.event.world.ChunkEvent; + +import java.util.ArrayList; +import java.util.HashMap; + +public interface IChunkMetaDataHandler { + String getTagName(); + void mergeData(NBTTagCompound target, NBTTagCompound loadedData); + NBTTagCompound createData(); + @SideOnly(Side.CLIENT) + default void requestData(ChunkEvent.Load aEvent){} + @SideOnly(Side.SERVER) + default void pushData(int world, ChunkCoordIntPair chunk){} + @SideOnly(Side.SERVER) + default void pushPayload(int world, ArrayList chunk){ + chunk.forEach(chunkCoordIntPair -> pushData(world,chunkCoordIntPair)); + } + default int pushPayloadSpreadPeriod(){ + return 20; + } + @SideOnly(Side.CLIENT) + default void tickRender(HashMap data, TickEvent.RenderTickEvent aEvent){} + @SideOnly(Side.CLIENT) + default void tickClient(HashMap data, TickEvent.ClientTickEvent aEvent){} + default void tickServer(HashMap data, TickEvent.ServerTickEvent event){} + @SideOnly(Side.SERVER) + default void tickWorld(HashMap data, TickEvent.WorldTickEvent aEvent){} + default void tickPlayer(HashMap data, TickEvent.PlayerTickEvent aEvent){} +} + diff --git a/src/main/java/com/github/technus/tectech/chunkData/WorldData.java b/src/main/java/com/github/technus/tectech/chunkData/WorldData.java new file mode 100644 index 0000000000..42641a015e --- /dev/null +++ b/src/main/java/com/github/technus/tectech/chunkData/WorldData.java @@ -0,0 +1,52 @@ +package com.github.technus.tectech.chunkData; + +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; + +import java.util.Objects; + +public final class WorldData { + private final World world; + private final Chunk chunk; + private final ChunkCoordIntPair coordIntPair; + + public WorldData(World world, Chunk data) { + this.world = world; + this.chunk = data; + coordIntPair=data.getChunkCoordIntPair(); + } + + public WorldData(World world, ChunkCoordIntPair data) { + this.world = world; + this.coordIntPair = data; + chunk= world.getChunkFromChunkCoords(data.chunkXPos,data.chunkZPos); + } + + public World getWorld() { + return world; + } + + public Chunk getChunk() { + return chunk; + } + + public ChunkCoordIntPair getCoordIntPair() { + return coordIntPair; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + WorldData worldData = (WorldData) o; + return world.provider.dimensionId==worldData.world.provider.dimensionId && + coordIntPair.chunkXPos==worldData.coordIntPair.chunkXPos && + coordIntPair.chunkZPos==worldData.coordIntPair.chunkXPos; + } + + @Override + public int hashCode() { + return Objects.hash(world.provider.dimensionId, coordIntPair); + } +} diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java index 6cec48c41f..3d64ceee62 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java @@ -10,7 +10,7 @@ import com.github.technus.tectech.thing.casing.TT_Container_Casings; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_quantizer; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -46,7 +46,7 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_ }; private static final Block[] blockType = new Block[]{QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{0,0,4,8}; - private final HatchAdder[] addingMethods = new HatchAdder[]{ + private final IHatchAdder[] addingMethods = new IHatchAdder[]{ this::addClassicToMachineList, this::addElementalInputToMachineList, this::addElementalMufflerToMachineList}; diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java index fd56305d5f..9bd16c959b 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java @@ -10,7 +10,7 @@ import com.github.technus.tectech.thing.casing.TT_Container_Casings; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_quantizer; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -46,7 +46,7 @@ public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_Mu }; private static final Block[] blockType = new Block[]{QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{0,4,0,8}; - private final HatchAdder[] addingMethods = new HatchAdder[]{ + private final IHatchAdder[] addingMethods = new IHatchAdder[]{ this::addClassicToMachineList, this::addElementalOutputToMachineList, this::addElementalMufflerToMachineList}; diff --git a/src/main/java/com/github/technus/tectech/loader/network/ChunkDataMessage.java b/src/main/java/com/github/technus/tectech/loader/network/ChunkDataMessage.java index daa6195944..15c936191a 100644 --- a/src/main/java/com/github/technus/tectech/loader/network/ChunkDataMessage.java +++ b/src/main/java/com/github/technus/tectech/loader/network/ChunkDataMessage.java @@ -2,7 +2,7 @@ package com.github.technus.tectech.loader.network; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.Util; -import com.github.technus.tectech.chunkData.ChunkMetaDataHandler; +import com.github.technus.tectech.chunkData.IChunkMetaDataHandler; import cpw.mods.fml.common.network.ByteBufUtils; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.MessageContext; @@ -19,7 +19,7 @@ public class ChunkDataMessage implements IMessage { int worldId; ChunkCoordIntPair chunk; NBTTagCompound data; - ChunkMetaDataHandler handler; + IChunkMetaDataHandler handler; public ChunkDataMessage(){} @@ -53,7 +53,7 @@ public class ChunkDataMessage implements IMessage { public static class ChunkDataQuery extends ChunkDataMessage { public ChunkDataQuery() { } - public ChunkDataQuery(ChunkEvent.Load aEvent,ChunkMetaDataHandler handler) { + public ChunkDataQuery(ChunkEvent.Load aEvent, IChunkMetaDataHandler handler) { worldId=aEvent.world.provider.dimensionId; chunk=aEvent.getChunk().getChunkCoordIntPair(); this.handler=handler; @@ -64,7 +64,7 @@ public class ChunkDataMessage implements IMessage { public ChunkDataData() { } - public ChunkDataData(int worldId,ChunkCoordIntPair chunk,ChunkMetaDataHandler handler){ + public ChunkDataData(int worldId, ChunkCoordIntPair chunk, IChunkMetaDataHandler handler){ this.worldId=worldId; this.chunk=chunk; this.handler=handler; diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java index 8ef33e7c3f..f45d3a5df5 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java @@ -2,23 +2,27 @@ package com.github.technus.tectech.mechanics.anomaly; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.chunkData.ChunkDataHandler; -import com.github.technus.tectech.chunkData.ChunkMetaDataHandler; +import com.github.technus.tectech.chunkData.IChunkMetaDataHandler; import com.github.technus.tectech.loader.network.ChunkDataMessage; import com.github.technus.tectech.loader.network.NetworkDispatcher; import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.dAtomDefinition; import cpw.mods.fml.common.gameevent.TickEvent; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.block.Block; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; import net.minecraftforge.event.world.ChunkEvent; +import java.util.ArrayList; import java.util.HashMap; -public class AnomalyHandler implements ChunkMetaDataHandler { - private static final double MIN_POLLUTION= dAtomDefinition.getSomethingHeavy().getMass()*10000D; - - private static final String INTENSITY="intensity"; +public class AnomalyHandler implements IChunkMetaDataHandler { + private static final double SWAP_THRESHOLD = dAtomDefinition.getSomethingHeavy().getMass() * 10000D; + private static final double PER_PARTICLE=SWAP_THRESHOLD/64; + private static final String INTENSITY = "intensity"; + private static final int MEAN_DELAY =50; @Override public String getTagName() { @@ -27,8 +31,8 @@ public class AnomalyHandler implements ChunkMetaDataHandler { @Override public void mergeData(NBTTagCompound target, NBTTagCompound loadedData) { - double intensity=target.getDouble(INTENSITY)+loadedData.getDouble(INTENSITY); - target.setDouble(INTENSITY,intensity); + double intensity = target.getDouble(INTENSITY) + loadedData.getDouble(INTENSITY); + target.setDouble(INTENSITY, intensity); } @Override @@ -37,23 +41,93 @@ public class AnomalyHandler implements ChunkMetaDataHandler { } @Override - public void tickServer(HashMap data, TickEvent.ServerTickEvent event) { - + public void tickWorld(HashMap data, TickEvent.WorldTickEvent aEvent) { + if(TecTech.RANDOM.nextInt(MEAN_DELAY)==0) { + int dim=aEvent.world.provider.dimensionId; + ArrayList worldDataArrayList =new ArrayList<>(1024); + data.get(dim).forEach((chunkCoordIntPair, compound) -> { + if (compound.getDouble(INTENSITY) >= SWAP_THRESHOLD) { + Chunk chunk=aEvent.world.getChunkFromChunkCoords(chunkCoordIntPair.chunkXPos,chunkCoordIntPair.chunkZPos); + if(chunk.isChunkLoaded){ + worldDataArrayList.add(chunk); + } + } + }); + if(worldDataArrayList.size()>=2) { + Chunk a = worldDataArrayList.remove(TecTech.RANDOM.nextInt(worldDataArrayList.size())); + Chunk b = worldDataArrayList.remove(TecTech.RANDOM.nextInt(worldDataArrayList.size())); + data.get(dim).get(a.getChunkCoordIntPair()).setDouble(INTENSITY,SWAP_THRESHOLD*TecTech.RANDOM.nextFloat()*0.25F); + data.get(dim).get(b.getChunkCoordIntPair()).setDouble(INTENSITY,SWAP_THRESHOLD*TecTech.RANDOM.nextFloat()*0.25F); + data.get(dim).markForTransmissionToClient(a.getChunkCoordIntPair()); + data.get(dim).markForTransmissionToClient(b.getChunkCoordIntPair()); + swapSomething(a,b); + } + } + } + + private void swapSomething(Chunk a,Chunk b){ + for(int i=0;i<128;i++){ + int x=TecTech.RANDOM.nextInt(16); + int y=TecTech.RANDOM.nextInt(a.worldObj.getActualHeight()); + int z=TecTech.RANDOM.nextInt(16); + Block aBlock=a.getBlock(x,y,z); + Block bBlock=a.getBlock(x,y,z); + int aMeta=a.getBlockMetadata(x,y,z); + int bMeta=a.getBlockMetadata(x,y,z); + if(a.getTileEntityUnsafe(x,y,z)==null&&b.getTileEntityUnsafe(x,y,z)==null){ + a.worldObj.setBlock((a.xPosition<<4)+x,y,(a.zPosition<<4)+z,bBlock,bMeta,3); + b.worldObj.setBlock((b.xPosition<<4)+x,y,(b.zPosition<<4)+z,aBlock,aMeta,3); + }else if(a.getTileEntityUnsafe(x,y,z)==null){ + a.worldObj.setBlockToAir((a.xPosition<<4)+x,y,(a.zPosition<<4)+z); + b.worldObj.setBlock((b.xPosition<<4)+x,y,(b.zPosition<<4)+z,aBlock,aMeta,3); + }else if(b.getTileEntityUnsafe(x,y,z)==null){ + a.worldObj.setBlock((a.xPosition<<4)+x,y,(a.zPosition<<4)+z,bBlock,bMeta,3); + b.worldObj.setBlockToAir((b.xPosition<<4)+x,y,(b.zPosition<<4)+z); + }else{ + a.worldObj.setBlockToAir((a.xPosition<<4)+x,y,(a.zPosition<<4)+z); + b.worldObj.setBlockToAir((b.xPosition<<4)+x,y,(b.zPosition<<4)+z); + } + } } @Override - public void tickClient(HashMap data, TickEvent.ClientTickEvent aEvent) { + public void tickServer(HashMap data, TickEvent.ServerTickEvent event) { + + } + @Override + public void tickPlayer(HashMap data, TickEvent.PlayerTickEvent aEvent) { + ChunkCoordIntPair pair=new ChunkCoordIntPair(aEvent.player.chunkCoordX,aEvent.player.chunkCoordZ); + NBTTagCompound compound=data.get(aEvent.player.worldObj.provider.dimensionId).get(pair); + if(compound!=null) { + double intensity = compound.getDouble(INTENSITY); + if (aEvent.side.isClient()) { + for (int i = 0; i < intensity / PER_PARTICLE; i++) { + TecTech.proxy.em_particle(aEvent.player.worldObj, + aEvent.player.posX - 32D + TecTech.RANDOM.nextFloat() * 64D, + aEvent.player.posY - 32D + TecTech.RANDOM.nextFloat() * 64D, + aEvent.player.posZ - 32D + TecTech.RANDOM.nextFloat() * 64D); + } + } + } + data.get(aEvent.player.worldObj.provider.dimensionId).forEach((chunkCoordIntPair, dat) -> { + for (int i = 0,pow=(int)(dat.getDouble(INTENSITY)/PER_PARTICLE); i < pow; i++) { + TecTech.proxy.em_particle(aEvent.player.worldObj, + (chunkCoordIntPair.chunkXPos<<4)+TecTech.RANDOM.nextFloat() * 48D-16D, + aEvent.player.posY+TecTech.RANDOM.nextFloat() * 128D-64D, + (chunkCoordIntPair.chunkZPos<<4)+TecTech.RANDOM.nextFloat() * 48D-16D); + } + }); } @Override public void requestData(ChunkEvent.Load aEvent) { - NetworkDispatcher.INSTANCE.sendToServer(new ChunkDataMessage.ChunkDataQuery(aEvent,this)); + NetworkDispatcher.INSTANCE.sendToServer(new ChunkDataMessage.ChunkDataQuery(aEvent, this)); } @Override public void pushData(int world, ChunkCoordIntPair chunk) { - NetworkDispatcher.INSTANCE.sendToDimension(new ChunkDataMessage.ChunkDataData(world,chunk,this),world); + NetworkDispatcher.INSTANCE.sendToDimension(new ChunkDataMessage.ChunkDataData(world, chunk, this), world); } @Override @@ -62,32 +136,25 @@ public class AnomalyHandler implements ChunkMetaDataHandler { } public void addAnomaly(IGregTechTileEntity iGregTechTileEntity, double amount) { - if(iGregTechTileEntity.isServerSide()) { + if (iGregTechTileEntity.isServerSide()) { World w = iGregTechTileEntity.getWorld(); addAnomaly(w.provider.dimensionId, - w.getChunkFromBlockCoords( - iGregTechTileEntity.getXCoord(), - iGregTechTileEntity.getZCoord()) - .getChunkCoordIntPair(), + new ChunkCoordIntPair( + iGregTechTileEntity.getXCoord() >> 4, + iGregTechTileEntity.getZCoord() >> 4), amount); } } - public void addAnomaly(int world, ChunkCoordIntPair chunk,double amount) { - NBTTagCompound old=TecTech.chunkDataHandler.getChunkData(this,world,chunk); - if(old==null){ - NBTTagCompound data=new NBTTagCompound(); - data.setDouble(INTENSITY,amount); - TecTech.chunkDataHandler.putChunkData(this,world,chunk,data); - if(amount>MIN_POLLUTION){ - - } - }else { - double newAmount=old.getDouble(INTENSITY)+amount; - old.setDouble(INTENSITY,newAmount); - if(newAmount>MIN_POLLUTION){ - - } + public void addAnomaly(int world, ChunkCoordIntPair chunk, double amount) { + NBTTagCompound old = TecTech.chunkDataHandler.getChunkData(this, world, chunk); + if (old == null) { + NBTTagCompound data = new NBTTagCompound(); + data.setDouble(INTENSITY, amount); + TecTech.chunkDataHandler.putChunkData(this, world, chunk, data); + } else { + old.setDouble(INTENSITY, old.getDouble(INTENSITY) + amount); } + TecTech.chunkDataHandler.getChunkData(this, world).markForTransmissionToClient(chunk); } } diff --git a/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java b/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java index b5b5dd82b9..b4dc5775d7 100644 --- a/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java +++ b/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java @@ -20,12 +20,12 @@ public class TT_recipe extends GT_Recipe { public final cElementalDefinitionStackMap[] input; public final cElementalDefinitionStackMap[] output; public final cElementalDefinitionStackMap[] eCatalyst; - public final AdditionalCheck additionalCheck; + public final IAdditionalCheck additionalCheck; public TT_recipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue, - cElementalDefinitionStackMap[] in, cElementalDefinitionStackMap[] out, cElementalDefinitionStackMap[] catalyst, AdditionalCheck check){ + cElementalDefinitionStackMap[] in, cElementalDefinitionStackMap[] out, cElementalDefinitionStackMap[] catalyst, IAdditionalCheck check){ super(aOptimize,aInputs,aOutputs,aSpecialItems,aChances,aFluidInputs,aFluidOutputs,aDuration,aEUt,aSpecialValue); input=in; output=out; @@ -127,7 +127,7 @@ public class TT_recipe extends GT_Recipe { return super.isRecipeInputEqual(consume, doNotCheckStackSizes, fluidStacks, itemStacks); } - public interface AdditionalCheck { + public interface IAdditionalCheck { boolean check(TT_recipe thisRecipe, boolean consume, boolean doNotCheckStackSizes, ItemStack[] itemStacks, FluidStack[] fluidStacks, cElementalInstanceStackMap[] in, cElementalInstanceStackMap[] e); boolean check(TT_recipe thisRecipe, boolean consume, boolean doNotCheckStackSizes, ItemStack[] itemStacks, FluidStack[] fluidStacks, cElementalInstanceStackMap in, cElementalInstanceStackMap[] e); } @@ -179,7 +179,7 @@ public class TT_recipe extends GT_Recipe { public TT_assLineRecipe(boolean aOptimize, ItemStack researchItem, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, FluidStack[] aFluidInputs, int aDuration, int aEUt, int aSpecialValue, - cElementalDefinitionStackMap[] in, cElementalDefinitionStackMap[] out, cElementalDefinitionStackMap[] catalyst, AdditionalCheck check) { + cElementalDefinitionStackMap[] in, cElementalDefinitionStackMap[] out, cElementalDefinitionStackMap[] catalyst, IAdditionalCheck check) { super(aOptimize, aInputs, aOutputs, aSpecialItems, null, aFluidInputs, null, aDuration, aEUt, aSpecialValue, in, out, catalyst, check); mResearchItem=researchItem; } @@ -199,7 +199,7 @@ public class TT_recipe extends GT_Recipe { public TT_EMRecipe(boolean aOptimize, GT_Recipe scannerRecipe, iElementalDefinition researchEM, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, FluidStack[] aFluidInputs, int aDuration, int aEUt, int aSpecialValue, - cElementalDefinitionStackMap[] in, cElementalDefinitionStackMap[] out, cElementalDefinitionStackMap[] catalyst, AdditionalCheck check) { + cElementalDefinitionStackMap[] in, cElementalDefinitionStackMap[] out, cElementalDefinitionStackMap[] catalyst, IAdditionalCheck check) { super(aOptimize, aInputs, aOutputs, aSpecialItems, null, aFluidInputs, null, aDuration, aEUt, aSpecialValue, in, out, catalyst, check); mResearchEM=researchEM; this.scannerRecipe=scannerRecipe; diff --git a/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java b/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java index 61efea1a0e..6fd4d7edaa 100644 --- a/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java +++ b/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java @@ -124,7 +124,7 @@ public class TT_recipeAdder extends GT_RecipeAdder { (boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue, - cElementalDefinitionStackMap[] in, cElementalDefinitionStackMap[] out, cElementalDefinitionStackMap[] catalyst, AdditionalCheck check) + cElementalDefinitionStackMap[] in, cElementalDefinitionStackMap[] out, cElementalDefinitionStackMap[] catalyst, IAdditionalCheck check) */ public static boolean addResearchableEMmachineRecipe( @@ -163,7 +163,7 @@ public class TT_recipeAdder extends GT_RecipeAdder { public static boolean addResearchableEMcrafterRecipe( ItemStack aResearchItem, int totalComputationRequired, int computationRequiredPerSec, int researchEUt, int researchAmperage, - cElementalDefinitionStackMap[] eInputs, cElementalDefinitionStackMap[] catalyst, TT_recipe.AdditionalCheck check, + cElementalDefinitionStackMap[] eInputs, cElementalDefinitionStackMap[] catalyst, TT_recipe.IAdditionalCheck check, ItemStack aOutput, int crafterDuration, int crafterEUt, int crafterAmperage) { if (aResearchItem==null || totalComputationRequired<=0 || aOutput == null) { return false; @@ -222,7 +222,7 @@ public class TT_recipeAdder extends GT_RecipeAdder { public static boolean addScannableEMcrafterRecipe( iElementalDefinition aResearchEM, int totalComputationRequired, int computationRequiredPerSec, int researchEUt, int researchAmperage, - cElementalDefinitionStackMap[] eInputs, cElementalDefinitionStackMap[] catalyst, TT_recipe.AdditionalCheck check, + cElementalDefinitionStackMap[] eInputs, cElementalDefinitionStackMap[] catalyst, TT_recipe.IAdditionalCheck check, ItemStack aOutput, int crafterDuration, int crafterEUt, int crafterAmperage) { if (aResearchEM==null || totalComputationRequired<=0 || aOutput == null) { return false; diff --git a/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java b/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java index efb9e6d644..f63f35e7f8 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java @@ -33,7 +33,7 @@ import static gregtech.api.GregTech_API.sBlockCasings1; public final class ConstructableTriggerItem extends Item { public static ConstructableTriggerItem INSTANCE; - private static HashMap multiblockMap= new HashMap<>(); + private static HashMap multiblockMap= new HashMap<>(); private ConstructableTriggerItem() { setUnlocalizedName("em.constructable"); @@ -121,7 +121,7 @@ public final class ConstructableTriggerItem extends Item { INSTANCE = new ConstructableTriggerItem(); GameRegistry.registerItem(INSTANCE, INSTANCE.getUnlocalizedName()); - registerMetaClass(GT_MetaTileEntity_ElectricBlastFurnace.class, new MultiblockInfoContainer() { + registerMetaClass(GT_MetaTileEntity_ElectricBlastFurnace.class, new IMultiblockInfoContainer() { //region Structure private final String[][] shape = new String[][]{ {"000","\"\"\"","\"\"\""," . ",}, @@ -150,17 +150,17 @@ public final class ConstructableTriggerItem extends Item { }); } - public interface MultiblockInfoContainer { + public interface IMultiblockInfoContainer { void construct(int stackSize, boolean hintsOnly, TileEntity tileEntity, int aSide); @SideOnly(Side.CLIENT) String[] getDescription(int stackSize); } - public static void registerTileClass(Class clazz,MultiblockInfoContainer info){ + public static void registerTileClass(Class clazz, IMultiblockInfoContainer info){ multiblockMap.put(clazz.getCanonicalName(),info); } - public static void registerMetaClass(Class clazz,MultiblockInfoContainer info){ + public static void registerMetaClass(Class clazz, IMultiblockInfoContainer info){ multiblockMap.put(clazz.getCanonicalName(),info); } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java index 2ee110be4c..ece8c6ba82 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java @@ -4,7 +4,7 @@ import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -45,7 +45,7 @@ public class GT_MetaTileEntity_EM_annihilation extends GT_MetaTileEntity_Multibl }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT ,sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{4, 5, 12, 6, 0, 10}; - private final HatchAdder[] addingMethods = new HatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; + private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java index 7b662814a6..30ee7c4d64 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java @@ -4,7 +4,7 @@ import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -74,7 +74,7 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E }; private static final Block[] blockType = new Block[]{sBlockCasingsTT,sBlockCasingsTT,sBlockCasingsTT,sBlockCasingsTT,sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{12, 13, 14, 10, 11}; - private final HatchAdder[] addingMethods = new HatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; + private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java index b9b589c409..166ab90ff1 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java @@ -16,10 +16,10 @@ import com.github.technus.tectech.thing.casing.TT_Container_Casings; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.NameFunction; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.StatusFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.INameFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IStatusFunction; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -64,16 +64,16 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB } //region collision handlers - public static final HashMap FUSE_HANDLERS =new HashMap<>(); - public static final HashMap PRIMITIVE_FUSE_HANDLERS =new HashMap<>(); - public interface PrimitiveColliderHandler { + public static final HashMap FUSE_HANDLERS =new HashMap<>(); + public static final HashMap PRIMITIVE_FUSE_HANDLERS =new HashMap<>(); + public interface IPrimitiveColliderHandler { void collide(cElementalInstanceStack in1, cElementalInstanceStack in2, cElementalInstanceStackMap out); } - public interface ColliderHandler extends PrimitiveColliderHandler { + public interface IColliderHandler extends IPrimitiveColliderHandler { byte getRequiredTier(); } static { - FUSE_HANDLERS.put((dAtomDefinition.getClassTypeStatic() << 16) | dAtomDefinition.getClassTypeStatic(), new ColliderHandler() { + FUSE_HANDLERS.put((dAtomDefinition.getClassTypeStatic() << 16) | dAtomDefinition.getClassTypeStatic(), new IColliderHandler() { @Override public void collide(cElementalInstanceStack in1, cElementalInstanceStack in2, cElementalInstanceStackMap out) { try { @@ -102,7 +102,7 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB registerSimpleAtomFuse(dComplexAspectDefinition.getClassTypeStatic()); registerSimpleAtomFuse(cElementalPrimitive.getClassTypeStatic()); - FUSE_HANDLERS.put((dHadronDefinition.getClassTypeStatic() << 16) | dHadronDefinition.getClassTypeStatic(), new ColliderHandler() { + FUSE_HANDLERS.put((dHadronDefinition.getClassTypeStatic() << 16) | dHadronDefinition.getClassTypeStatic(), new IColliderHandler() { @Override public void collide(cElementalInstanceStack in1, cElementalInstanceStack in2, cElementalInstanceStackMap out) { try { @@ -127,7 +127,7 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB return 2; } }); - FUSE_HANDLERS.put((dHadronDefinition.getClassTypeStatic() << 16) | cElementalPrimitive.getClassTypeStatic(), new ColliderHandler() { + FUSE_HANDLERS.put((dHadronDefinition.getClassTypeStatic() << 16) | cElementalPrimitive.getClassTypeStatic(), new IColliderHandler() { @Override public void collide(cElementalInstanceStack in1, cElementalInstanceStack in2, cElementalInstanceStackMap out) { try { @@ -156,10 +156,10 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB registerSimpleAspectFuse(dComplexAspectDefinition.getClassTypeStatic()); registerSimpleAspectFuse(cElementalPrimitive.getClassTypeStatic()); - FUSE_HANDLERS.put((cElementalPrimitive.getClassTypeStatic() << 16) | cElementalPrimitive.getClassTypeStatic(), new ColliderHandler() { + FUSE_HANDLERS.put((cElementalPrimitive.getClassTypeStatic() << 16) | cElementalPrimitive.getClassTypeStatic(), new IColliderHandler() { @Override public void collide(cElementalInstanceStack in1, cElementalInstanceStack in2, cElementalInstanceStackMap out) { - PrimitiveColliderHandler collisionHandler= PRIMITIVE_FUSE_HANDLERS.get(in1.definition.getClass().getName()+'\0'+in2.definition.getClass().getName()); + IPrimitiveColliderHandler collisionHandler= PRIMITIVE_FUSE_HANDLERS.get(in1.definition.getClass().getName()+'\0'+in2.definition.getClass().getName()); if (collisionHandler != null) { collisionHandler.collide(in2, in1, out); } else { @@ -215,7 +215,7 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB } private static void registerSimpleAspectFuse(byte classTypeStatic) { - FUSE_HANDLERS.put((dComplexAspectDefinition.getClassTypeStatic() << 16) | classTypeStatic, new ColliderHandler() { + FUSE_HANDLERS.put((dComplexAspectDefinition.getClassTypeStatic() << 16) | classTypeStatic, new IColliderHandler() { @Override public void collide(cElementalInstanceStack in1, cElementalInstanceStack in2, cElementalInstanceStackMap out) { if (fuseAspects(in1, in2, out)) return; @@ -234,7 +234,7 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB } private static void registerSimpleAtomFuse(byte classTypeStatic) { - FUSE_HANDLERS.put((dAtomDefinition.getClassTypeStatic() << 16) | classTypeStatic, new ColliderHandler() { + FUSE_HANDLERS.put((dAtomDefinition.getClassTypeStatic() << 16) | classTypeStatic, new IColliderHandler() { @Override public void collide(cElementalInstanceStack in1, cElementalInstanceStack in2, cElementalInstanceStackMap out) { try { @@ -268,7 +268,7 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB //region parameters protected Parameters.Group.ParameterIn mode; - private static final StatusFunction MODE_STATUS = (base_EM, p)->{ + private static final IStatusFunction MODE_STATUS = (base_EM, p)->{ if(base_EM.isMaster()){ double mode=p.get(); if (mode == FUSE_MODE || mode == COLLIDE_MODE) { @@ -282,7 +282,7 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB } return STATUS_UNUSED; }; - private static final NameFunction MODE_NAME = (base_EM, p)->{ + private static final INameFunction MODE_NAME = (base_EM, p)->{ if(base_EM.isMaster()){ double mode=p.get(); if(mode==FUSE_MODE){ @@ -333,7 +333,7 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB }; private static final byte[] blockMeta1 = new byte[]{4, 7, 4, 0, 4, 8}; private static final byte[] blockMeta2 = new byte[]{4, 7, 5, 0, 6, 9}; - private final HatchAdder[] addingMethods = new HatchAdder[]{ + private final IHatchAdder[] addingMethods = new IHatchAdder[]{ this::addClassicToMachineList, this::addElementalInputToMachineList, this::addElementalOutputToMachineList, @@ -534,7 +534,7 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB //System.out.println("preMass = " + preMass); cElementalInstanceStackMap map = new cElementalInstanceStackMap(); - ColliderHandler colliderHandler; + IColliderHandler colliderHandler; if (stack2.definition.getClassType() > stack.definition.getClassType()) {//always bigger first colliderHandler = FUSE_HANDLERS.get((stack2.definition.getClassType() << 16) | stack.definition.getClassType()); if (handleRecipe(stack2, map, colliderHandler)) return 0; @@ -557,7 +557,7 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB return 0; } - private boolean handleRecipe(cElementalInstanceStack stack2, cElementalInstanceStackMap map, ColliderHandler colliderHandler) { + private boolean handleRecipe(cElementalInstanceStack stack2, cElementalInstanceStackMap map, IColliderHandler colliderHandler) { if (colliderHandler != null && eTier>= colliderHandler.getRequiredTier()) { colliderHandler.collide(stack2, stack, map); } else { diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java index cf5b3bcd80..0facf9e949 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java @@ -10,11 +10,11 @@ import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_H import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OutputData; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Rack; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus; import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.NameFunction; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.StatusFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.INameFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IStatusFunction; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -50,17 +50,17 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB //region parameters protected Parameters.Group.ParameterIn overclock,overvolt; protected Parameters.Group.ParameterOut maxCurrentTemp,availableData; - private static final NameFunction OC_NAME = (base, p)-> "Overclock ratio"; - private static final NameFunction OV_NAME = (base,p)-> "Overvoltage ratio"; - private static final NameFunction MAX_TEMP_NAME = (base,p)-> "Current max. heat"; - private static final NameFunction COMPUTE_NAME = (base,p)-> "Produced computation"; - private static final StatusFunction OC_STATUS= + private static final INameFunction OC_NAME = (base, p)-> "Overclock ratio"; + private static final INameFunction OV_NAME = (base, p)-> "Overvoltage ratio"; + private static final INameFunction MAX_TEMP_NAME = (base, p)-> "Current max. heat"; + private static final INameFunction COMPUTE_NAME = (base, p)-> "Produced computation"; + private static final IStatusFunction OC_STATUS= (base,p)->LedStatus.fromLimitsInclusiveOuterBoundary(p.get(),0,1,1,3); - private static final StatusFunction OV_STATUS= + private static final IStatusFunction OV_STATUS= (base,p)->LedStatus.fromLimitsInclusiveOuterBoundary(p.get(),.7,.8,1.2,2); - private static final StatusFunction MAX_TEMP_STATUS= + private static final IStatusFunction MAX_TEMP_STATUS= (base,p)->LedStatus.fromLimitsInclusiveOuterBoundary(p.get(),-10000,0,0,5000); - private static final StatusFunction COMPUTE_STATUS=(base,p)->{ + private static final IStatusFunction COMPUTE_STATUS=(base, p)->{ if(base.eAvailableData<0){ return STATUS_TOO_LOW; } @@ -80,7 +80,7 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB private static final String[][] slice = new String[][]{{"-01", "A!2", "A!2", "-01",},}; private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{2, 1, 3}; - private final HatchAdder[] addingMethods = new HatchAdder[]{this::addToMachineList, this::addRackToMachineList}; + private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addToMachineList, this::addRackToMachineList}; private static final short[] casingTextures = new short[]{textureOffset + 1, textureOffset + 3}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{1, 3}; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafting.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafting.java index fc152140fa..a72740e84f 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafting.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafting.java @@ -4,7 +4,7 @@ import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -46,7 +46,7 @@ public class GT_MetaTileEntity_EM_crafting extends GT_MetaTileEntity_MultiblockB }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT , QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{4, 10, 5, 0, 6, 9}; - private final HatchAdder[] addingMethods = new HatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; + private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java index 3a92ae8671..258a8719e8 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java @@ -9,7 +9,7 @@ import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_H import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -45,7 +45,7 @@ public class GT_MetaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockB }; private static final Block[] blockType = new Block[]{sBlockCasingsTT,sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{2,1}; - private final HatchAdder[] addingMethods = new HatchAdder[]{this::addClassicToMachineList,this::addDataBankHatchToMachineList}; + private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList,this::addDataBankHatchToMachineList}; private static final short[] casingTextures = new short[]{textureOffset,textureOffset+1}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT,sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0,1}; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java index 14bebc4caa..9a4b8021c1 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java @@ -7,10 +7,10 @@ import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.NameFunction; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.StatusFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.INameFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IStatusFunction; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -48,8 +48,8 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase //region parameters protected Parameters.Group.ParameterIn ampereFlow; - private static final NameFunction FLOW_NAME= (base, p)->"Ampere divider"; - private static final StatusFunction FLOW_STATUS= (base, p)->{ + private static final INameFunction FLOW_NAME= (base, p)->"Ampere divider"; + private static final IStatusFunction FLOW_STATUS= (base, p)->{ if(base.eAmpereFlow<=0){ return STATUS_TOO_LOW; } @@ -71,7 +71,7 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT ,sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{4, 5, 8, 6}; - private final HatchAdder[] addingMethods = new HatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; + private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java index a837c6a0a2..d379502540 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java @@ -10,7 +10,7 @@ import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -47,7 +47,7 @@ public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_Multiblo }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, QuantumGlassBlock.INSTANCE}; private static final byte[] blockMeta = new byte[]{0, 4, 0}; - private final HatchAdder[] addingMethods = new HatchAdder[]{ + private final IHatchAdder[] addingMethods = new IHatchAdder[]{ this::addClassicToMachineList, this::addElementalInputToMachineList, this::addElementalMufflerToMachineList}; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java index 54d14ded92..d0b5b4ff35 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java @@ -8,7 +8,7 @@ import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -40,7 +40,7 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{7, 4}; - private final HatchAdder[] addingMethods = new HatchAdder[]{this::addClassicToMachineList}; + private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList}; private static final short[] casingTextures = new short[]{textureOffset}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0}; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java index c1248820b3..337afd4f32 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java @@ -5,10 +5,10 @@ import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OutputElemental; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.NameFunction; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.StatusFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.INameFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IStatusFunction; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Utility; @@ -44,7 +44,7 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB }; private static final Block[] blockType = new Block[]{sBlockCasingsTT,sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{4,5}; - private final HatchAdder[] addingMethods = new HatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; + private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; @@ -56,9 +56,9 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB //endregion //region parameters - private static final NameFunction ROUTE_NAME= + private static final INameFunction ROUTE_NAME= (base,p)->(p.parameterId()==0?"Source ":"Destination ")+p.hatchId(); - private static final StatusFunction SRC_STATUS = + private static final IStatusFunction SRC_STATUS = (base,p)-> { double v = p.get(); if (Double.isNaN(v)) return STATUS_WRONG; @@ -68,7 +68,7 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB if (v >= base.eInputHatches.size()) return STATUS_TOO_HIGH; return STATUS_OK; }; - private static final StatusFunction DST_STATUS = + private static final IStatusFunction DST_STATUS = (base,p)->{ if(base.src[p.hatchId()].getStatus(false)== STATUS_OK){ double v = p.get(); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java index d34acd1534..1d3d40666f 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java @@ -13,7 +13,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.transformations import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; @@ -53,7 +53,7 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, QuantumGlassBlock.INSTANCE}; private static final byte[] blockMeta = new byte[]{4, 0, 0}; - private final HatchAdder[] addingMethods = new HatchAdder[]{ + private final IHatchAdder[] addingMethods = new IHatchAdder[]{ this::addClassicToMachineList, this::addElementalOutputToMachineList, this::addElementalMufflerToMachineList}; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java index e74cef7a34..11be32f9a5 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java @@ -6,7 +6,7 @@ import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Holder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.ItemList; @@ -66,7 +66,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{1, 3, 2}; - private final HatchAdder[] addingMethods = new HatchAdder[]{this::addClassicToMachineList, this::addHolderToMachineList}; + private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList, this::addHolderToMachineList}; private static final short[] casingTextures = new short[]{textureOffset + 1, textureOffset + 3}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, Blocks.air}; private static final byte[] blockMetaFallback = new byte[]{1, 0}; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java index 33de4aa1cc..96132a889e 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java @@ -14,11 +14,11 @@ import com.github.technus.tectech.thing.item.ElementalDefinitionScanStorage_EM; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus; import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.NameFunction; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.StatusFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.INameFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IStatusFunction; import gregtech.api.enums.ItemList; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -63,9 +63,9 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa private int[] scanComplexity; //region parameters - private static final NameFunction CONFIG_NAME= + private static final INameFunction CONFIG_NAME= (base,p)->"Config at Depth: "+(p.hatchId()*2+p.parameterId()); - private static final StatusFunction CONFIG_STATUS= + private static final IStatusFunction CONFIG_STATUS= (base,p)->{ double v=p.get(); if(Double.isNaN(v)){ @@ -93,7 +93,7 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{4, 0, 0}; - private final HatchAdder[] addingMethods = new HatchAdder[]{ + private final IHatchAdder[] addingMethods = new IHatchAdder[]{ this::addClassicToMachineList, this::addElementalInputToMachineList, this::addElementalOutputToMachineList, diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java index 2386619e7e..30794ca47e 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java @@ -4,7 +4,7 @@ import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; @@ -29,7 +29,7 @@ public class GT_MetaTileEntity_EM_stabilizer extends GT_MetaTileEntity_Multibloc }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT ,sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{4, 0, 5, 6, 9}; - private final HatchAdder[] addingMethods = new HatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; + private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java index 276d0f2f74..1c5d1bccdd 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java @@ -8,10 +8,10 @@ import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputData; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OutputData; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.NameFunction; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.StatusFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.INameFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IStatusFunction; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -43,7 +43,7 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas }; private static final Block[] blockType = new Block[]{sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{3}; - private final HatchAdder[] addingMethods = new HatchAdder[]{this::addClassicToMachineList}; + private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList}; private static final short[] casingTextures = new short[]{textureOffset+1}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{1}; @@ -54,9 +54,9 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas //endregion //region parameters - private static final NameFunction ROUTE_NAME= + private static final INameFunction ROUTE_NAME= (base,p)->(p.parameterId()==0?"Destination ":"Weight ")+p.hatchId(); - private static final StatusFunction WEI_STATUS = + private static final IStatusFunction WEI_STATUS = (base,p)-> { double v=p.get(); if (Double.isNaN(v)) return STATUS_WRONG; @@ -65,7 +65,7 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas if(Double.isInfinite(v)) return STATUS_HIGH; return STATUS_OK; }; - private static final StatusFunction DST_STATUS = + private static final IStatusFunction DST_STATUS = (base,p)->{ if(base.weight[p.hatchId()].getStatus(false).isOk) { double v = p.get(); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java index 65f2301e41..e384a8d7e2 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java @@ -6,7 +6,7 @@ import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_Container_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -38,7 +38,7 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo }; private static final Block[] blockType = new Block[]{sBlockCasings1}; private static final byte[] blockMeta = new byte[]{15}; - private final HatchAdder[] addingMethods = new HatchAdder[]{this::addEnergyIOToMachineList}; + private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addEnergyIOToMachineList}; private static final short[] casingTextures = new short[]{textureOffset}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0}; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java index 50070972ca..7f69f459f9 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java @@ -4,7 +4,7 @@ import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -46,7 +46,7 @@ public class GT_MetaTileEntity_EM_wormhole extends GT_MetaTileEntity_MultiblockB }; private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, QuantumGlassBlock.INSTANCE ,sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{12, 10, 0, 5, 11}; - private final HatchAdder[] addingMethods = new HatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; + private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java index 7cb6bbab53..520dbf94fa 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java @@ -46,7 +46,7 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock private static final Block[] blockType = new Block[]{sBlockCasings4}; private static final byte[] blockMeta = new byte[]{1}; - private final HatchAdder[] addingMethods = new HatchAdder[]{this::addClassicToMachineList}; + private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList}; private static final short[] casingTextures = new short[]{49}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasings4}; private static final byte[] blockMetaFallback = new byte[]{1}; @@ -60,13 +60,13 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock //region parameters protected Parameters.Group.ParameterIn powerSetting,timerSetting; protected Parameters.Group.ParameterOut timerValue,remainingTime; - private static final NameFunction POWER_NAME = (base, p)-> "Power setting"; - private static final NameFunction TIMER_SETTING_NAME = (base, p)-> "Timer setting"; - private static final NameFunction TIMER_REMAINING_NAME = (base, p)-> "Timer remaining"; - private static final NameFunction TIMER_VALUE_NAME = (base,p)-> "Timer value"; - private static final StatusFunction POWER_STATUS= + private static final INameFunction POWER_NAME = (base, p)-> "Power setting"; + private static final INameFunction TIMER_SETTING_NAME = (base, p)-> "Timer setting"; + private static final INameFunction TIMER_REMAINING_NAME = (base, p)-> "Timer remaining"; + private static final INameFunction TIMER_VALUE_NAME = (base, p)-> "Timer value"; + private static final IStatusFunction POWER_STATUS= (base,p)-> LedStatus.fromLimitsInclusiveOuterBoundary(p.get(),300,1000,1000,Double.POSITIVE_INFINITY); - private static final StatusFunction TIMER_STATUS=(base,p)->{ + private static final IStatusFunction TIMER_STATUS=(base, p)->{ double value=p.get(); if(Double.isNaN(value)) return STATUS_WRONG; value=(int)value; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java index f62951bf48..bbef798982 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java @@ -6,7 +6,7 @@ import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_H import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.HatchAdder; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -88,7 +88,7 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock private static final byte[] blockMetaT1 = new byte[]{15, 1, 13, 0}; private static final byte[] blockMetaT2 = new byte[]{15, 2, 13, 0}; private static final byte[][] blockMetas = new byte[][]{blockMetaT0,blockMetaT1,blockMetaT2}; - private final HatchAdder[] addingMethods = new HatchAdder[]{this::addCapacitorToMachineList, this::addFrameToMachineList}; + private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addCapacitorToMachineList, this::addFrameToMachineList}; private static final short[] casingTextures = new short[]{29, 0}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasings2, null}; private static final byte[] blockMetaFallback = new byte[]{13, 0}; 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 10bad33830..2ba49d0849 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 @@ -363,7 +363,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt String[][] structure,//0-9 casing, +- air no air, a-z ignore Block[] blockType,//use numbers 0-9 for casing types byte[] blockMeta,//use numbers 0-9 for casing types - HatchAdder[] addingMethods, + IHatchAdder[] addingMethods, short[] casingTextures, Block[] blockTypeFallback,//use numbers 0-9 for casing types byte[] blockMetaFallback,//use numbers 0-9 for casing types diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/HatchAdder.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/HatchAdder.java deleted file mode 100644 index 177f8b2cfb..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/HatchAdder.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.multi.base; - - -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; - -public interface HatchAdder{ - Boolean apply(IGregTechTileEntity iGregTechTileEntity, Short aShort); -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/IHatchAdder.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/IHatchAdder.java new file mode 100644 index 0000000000..b695472012 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/IHatchAdder.java @@ -0,0 +1,8 @@ +package com.github.technus.tectech.thing.metaTileEntity.multi.base; + + +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; + +public interface IHatchAdder { + Boolean apply(IGregTechTileEntity iGregTechTileEntity, Short aShort); +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/INameFunction.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/INameFunction.java new file mode 100644 index 0000000000..1c2a8bd477 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/INameFunction.java @@ -0,0 +1,5 @@ +package com.github.technus.tectech.thing.metaTileEntity.multi.base; + +public interface INameFunction{ + String apply(T t, Parameters.IParameter iParameter); +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/IStatusFunction.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/IStatusFunction.java new file mode 100644 index 0000000000..0c7616093a --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/IStatusFunction.java @@ -0,0 +1,5 @@ +package com.github.technus.tectech.thing.metaTileEntity.multi.base; + +public interface IStatusFunction{ + LedStatus apply(T t, Parameters.IParameter iParameter); +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/NameFunction.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/NameFunction.java deleted file mode 100644 index a296600abf..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/NameFunction.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.multi.base; - -public interface NameFunction{ - String apply(T t, Parameters.IParameter iParameter); -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java index 1ecb17891e..23250a5b02 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/Parameters.java @@ -6,8 +6,8 @@ import java.util.ArrayList; * Instantiate parameters as field in parametersInstantiation_EM(); */ public class Parameters { - private static final StatusFunction LED_STATUS_FUNCTION_DEFAULT = (b,p)->LedStatus.STATUS_UNDEFINED; - private static final NameFunction NAME_FUNCTION_DEFAULT= (b,p)->"Undefined"; + private static final IStatusFunction LED_STATUS_FUNCTION_DEFAULT = (b, p)->LedStatus.STATUS_UNDEFINED; + private static final INameFunction NAME_FUNCTION_DEFAULT= (b, p)->"Undefined"; final Group[] groups = new Group[10]; @@ -140,11 +140,11 @@ public class Parameters { groups[hatchNo]=this; } - public ParameterIn makeInParameter(int paramID, double defaultValue, NameFunction name, StatusFunction status){ + public ParameterIn makeInParameter(int paramID, double defaultValue, INameFunction name, IStatusFunction status){ return new ParameterIn(paramID, defaultValue,name, status); } - public ParameterOut makeOutParameter(int paramID, double defaultValue, NameFunction name, StatusFunction status){ + public ParameterOut makeOutParameter(int paramID, double defaultValue, INameFunction name, IStatusFunction status){ return new ParameterOut(paramID, defaultValue, name, status); } @@ -181,10 +181,10 @@ public class Parameters { public class ParameterOut implements IParameter { public final int id; public final double defaultValue; - StatusFunction status; - NameFunction name; + IStatusFunction status; + INameFunction name; - private ParameterOut(int paramID, double defaultValue, NameFunction name, StatusFunction status){ + private ParameterOut(int paramID, double defaultValue, INameFunction name, IStatusFunction status){ this.name= name==null?NAME_FUNCTION_DEFAULT:name; if(paramID<0 || paramID>2){ throw new IllegalArgumentException("Parameter id must be in 0 to 1 range"); @@ -258,10 +258,10 @@ public class Parameters { public class ParameterIn implements IParameter { public final int id; public final double defaultValue; - StatusFunction status; - NameFunction name; + IStatusFunction status; + INameFunction name; - private ParameterIn(int paramID, double defaultValue, NameFunction name, StatusFunction status){ + private ParameterIn(int paramID, double defaultValue, INameFunction name, IStatusFunction status){ this.name= name==null?NAME_FUNCTION_DEFAULT:name; this.id=hatchNo+10*paramID; if(paramID<0 || paramID>2){ diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/StatusFunction.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/StatusFunction.java deleted file mode 100644 index e285c75344..0000000000 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/StatusFunction.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.github.technus.tectech.thing.metaTileEntity.multi.base; - -public interface StatusFunction{ - LedStatus apply(T t, Parameters.IParameter iParameter); -} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java index 5f072b3196..56f535f32a 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java @@ -5,9 +5,9 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInsta import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.dAtomDefinition; import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockControl; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.NameFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.INameFunction; import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.StatusFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IStatusFunction; import java.util.Arrays; @@ -18,12 +18,12 @@ import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStat /** * Created by danie_000 on 24.12.2017. */ -public class Behaviour_Centrifuge implements GT_MetaTileEntity_EM_machine.Behaviour { +public class Behaviour_Centrifuge implements GT_MetaTileEntity_EM_machine.IBehaviour { private final byte tier; private float radius, maxRPM, maxRCF, maxForce, maxCapacity; private Parameters.Group.ParameterIn settingRPM, settingFraction; - private final static NameFunction rpmName= (gt_metaTileEntity_em_machine, iParameter) -> "RPM Setting"; - private final StatusFunction rpmStatus= (gt_metaTileEntity_em_machine, iParameter) -> { + private final static INameFunction rpmName= (gt_metaTileEntity_em_machine, iParameter) -> "RPM Setting"; + private final IStatusFunction rpmStatus= (gt_metaTileEntity_em_machine, iParameter) -> { double v=iParameter.get(); if(Double.isNaN(v)){ return STATUS_WRONG; @@ -35,8 +35,8 @@ public class Behaviour_Centrifuge implements GT_MetaTileEntity_EM_machine.Behavi } return STATUS_OK; }; - private final static NameFunction fractionName= (gt_metaTileEntity_em_machine, iParameter) -> "Fraction Count"; - private static final StatusFunction fractionStatus= (gt_metaTileEntity_em_machine, iParameter) -> { + private final static INameFunction fractionName= (gt_metaTileEntity_em_machine, iParameter) -> "Fraction Count"; + private static final IStatusFunction fractionStatus= (gt_metaTileEntity_em_machine, iParameter) -> { double v=iParameter.get(); if(Double.isNaN(v)){ return STATUS_WRONG; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Electrolyzer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Electrolyzer.java index 42b41a5ae3..df21feb9f2 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Electrolyzer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Electrolyzer.java @@ -7,7 +7,7 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; /** * Created by danie_000 on 24.12.2017. */ -public class Behaviour_Electrolyzer implements GT_MetaTileEntity_EM_machine.Behaviour { +public class Behaviour_Electrolyzer implements GT_MetaTileEntity_EM_machine.IBehaviour { final int tier; public Behaviour_Electrolyzer(int tier){ this.tier=tier; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java index d2b08f0960..6d95900af0 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_ElectromagneticSeparator.java @@ -5,9 +5,9 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInsta import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack; import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.dAtomDefinition; import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockControl; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.NameFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.INameFunction; import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.StatusFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.IStatusFunction; import static com.github.technus.tectech.CommonValues.V; import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*; @@ -15,7 +15,7 @@ import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStat /** * Created by danie_000 on 24.12.2017. */ -public class Behaviour_ElectromagneticSeparator implements GT_MetaTileEntity_EM_machine.Behaviour { +public class Behaviour_ElectromagneticSeparator implements GT_MetaTileEntity_EM_machine.IBehaviour { private final byte tier; private int ticks; private byte precisionFull,precisionMinimal; @@ -23,8 +23,8 @@ public class Behaviour_ElectromagneticSeparator implements GT_MetaTileEntity_EM_ private long maxCharge; private int offsetMax; private Parameters.Group.ParameterIn fullSetting,minimalSetting,offsetSetting; - private final static NameFunction fullName= (gt_metaTileEntity_em_machine, iParameter) -> "Full Precision Input [e/3]"; - private final StatusFunction fullStatus= (gt_metaTileEntity_em_machine, iParameter) -> { + private final static INameFunction fullName= (gt_metaTileEntity_em_machine, iParameter) -> "Full Precision Input [e/3]"; + private final IStatusFunction fullStatus= (gt_metaTileEntity_em_machine, iParameter) -> { double v=iParameter.get(); if(Double.isNaN(v)){ return STATUS_WRONG; @@ -39,8 +39,8 @@ public class Behaviour_ElectromagneticSeparator implements GT_MetaTileEntity_EM_ } return STATUS_OK; }; - private final static NameFunction minimalName= (gt_metaTileEntity_em_machine, iParameter) -> "Minimal Precision Input [e/3]"; - private final StatusFunction minimalStatus= (gt_metaTileEntity_em_machine, iParameter) -> { + private final static INameFunction minimalName= (gt_metaTileEntity_em_machine, iParameter) -> "Minimal Precision Input [e/3]"; + private final IStatusFunction minimalStatus= (gt_metaTileEntity_em_machine, iParameter) -> { double minimal=iParameter.get(); double full=fullSetting.get(); if(Double.isInfinite(minimal) && minimal>0) { @@ -63,8 +63,8 @@ public class Behaviour_ElectromagneticSeparator implements GT_MetaTileEntity_EM_ return STATUS_WRONG; } }; - private final static NameFunction offsetName= (gt_metaTileEntity_em_machine, iParameter) -> "Offset Input [e/3]"; - private final StatusFunction offsetStatus= (gt_metaTileEntity_em_machine, iParameter) -> { + private final static INameFunction offsetName= (gt_metaTileEntity_em_machine, iParameter) -> "Offset Input [e/3]"; + private final IStatusFunction offsetStatus= (gt_metaTileEntity_em_machine, iParameter) -> { double offset=iParameter.get(); if(offset>offsetMax){ return STATUS_TOO_HIGH; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_PrecisionLaser.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_PrecisionLaser.java index 02ddecbdc6..cd6f637d61 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_PrecisionLaser.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_PrecisionLaser.java @@ -7,7 +7,7 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; /** * Created by danie_000 on 24.12.2017. */ -public class Behaviour_PrecisionLaser implements GT_MetaTileEntity_EM_machine.Behaviour { +public class Behaviour_PrecisionLaser implements GT_MetaTileEntity_EM_machine.IBehaviour { final int tier; public Behaviour_PrecisionLaser(int tier){ this.tier=tier; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Recycler.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Recycler.java index f94ff3f326..6742f99e99 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Recycler.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Recycler.java @@ -9,7 +9,7 @@ import static com.github.technus.tectech.CommonValues.V; /** * Created by danie_000 on 24.12.2017. */ -public class Behaviour_Recycler implements GT_MetaTileEntity_EM_machine.Behaviour { +public class Behaviour_Recycler implements GT_MetaTileEntity_EM_machine.IBehaviour { private final int tier; private final float coeff; public Behaviour_Recycler(int tier){ diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Scanner.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Scanner.java index 627f713a22..95bb8dce40 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Scanner.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Scanner.java @@ -7,7 +7,7 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; /** * Created by danie_000 on 24.12.2017. */ -public class Behaviour_Scanner implements GT_MetaTileEntity_EM_machine.Behaviour { +public class Behaviour_Scanner implements GT_MetaTileEntity_EM_machine.IBehaviour { final int tier; public Behaviour_Scanner(int tier){ this.tier=tier; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java index 197347f891..39871910d9 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java @@ -33,7 +33,7 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa public static final String machine = "EM Machinery"; private ItemStack loadedMachine; - private Behaviour currentBehaviour; + private IBehaviour currentBehaviour; //region structure private static final String[][] shape = new String[][]{ @@ -46,7 +46,7 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa {"B0", "A!!!", "0!!!0", "A!!!", "B0",},}; private static final Block[] blockType = new Block[]{sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{4, 0, 5, 6}; - private final HatchAdder[] addingMethods = new HatchAdder[]{this::addClassicToMachineList,this::addElementalToMachineList}; + private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList,this::addElementalToMachineList}; private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; @@ -59,7 +59,7 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa //region parameters protected Parameters.Group.ParameterIn[] inputMux; protected Parameters.Group.ParameterIn[] outputMux; - private static final StatusFunction SRC_STATUS = + private static final IStatusFunction SRC_STATUS = (base,p)-> { double v = p.get(); if (Double.isNaN(v)) return STATUS_WRONG; @@ -69,7 +69,7 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa if (v >= base.eInputHatches.size()) return STATUS_TOO_HIGH; return STATUS_OK; }; - private static final StatusFunction DST_STATUS = + private static final IStatusFunction DST_STATUS = (base,p)->{ if(base.inputMux[p.hatchId()].getStatus(false)== STATUS_OK){ double v = p.get(); @@ -82,7 +82,7 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa } return STATUS_NEUTRAL; }; - private static final NameFunction ROUTE_NAME= + private static final INameFunction ROUTE_NAME= (base,p)->(p.parameterId()==0?"Source ":"Destination ")+p.hatchId(); //endregion @@ -275,7 +275,7 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa return false; } loadedMachine=newMachine; - Supplier behaviourSupplier=GT_MetaTileEntity_EM_machine.BEHAVIOUR_MAP.get(new Util.ItemStack_NoNBT(newMachine)); + Supplier behaviourSupplier=GT_MetaTileEntity_EM_machine.BEHAVIOUR_MAP.get(new Util.ItemStack_NoNBT(newMachine)); if(currentBehaviour==null && behaviourSupplier==null) { return false; } @@ -297,14 +297,14 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa return true; } - private static final HashMap> BEHAVIOUR_MAP = new HashMap<>(); + private static final HashMap> BEHAVIOUR_MAP = new HashMap<>(); - public static void registerBehaviour(Supplier behaviour, ItemStack is) { + public static void registerBehaviour(Supplier behaviour, ItemStack is) { BEHAVIOUR_MAP.put(new Util.ItemStack_NoNBT(is), behaviour); TecTech.LOGGER.info("Registered EM machine behaviour "+behaviour.get().getClass().getSimpleName()+' '+new Util.ItemStack_NoNBT(is).toString()); } - public interface Behaviour { + public interface IBehaviour { /** * instantiate parameters, u can also check machine tier here * @param te diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java index 6aa742846b..86dd48a877 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java @@ -37,7 +37,7 @@ import static com.github.technus.tectech.Reference.MODID; * Created by Tec on 23.03.2017. */ public class GT_MetaTileEntity_DataReader extends GT_MetaTileEntity_BasicMachine { - private static final HashMap> RENDER_REGISTRY =new HashMap<>(); + private static final HashMap> RENDER_REGISTRY =new HashMap<>(); private static GT_RenderedTexture READER_ONLINE, READER_OFFLINE; public GT_MetaTileEntity_DataReader(int aID, String aName, String aNameRegional, int aTier) { @@ -90,8 +90,8 @@ public class GT_MetaTileEntity_DataReader extends GT_MetaTileEntity_BasicMachine return DID_NOT_FIND_RECIPE; } ItemStack input=getInputAt(0); - ArrayList renders=getRenders(new Util.ItemStack_NoNBT(input)); - for(DataRender render:renders){ + ArrayList renders=getRenders(new Util.ItemStack_NoNBT(input)); + for(IDataRender render:renders){ if(render.canRender(input,mTier)){ mOutputItems[0]=input.copy(); input.stackSize-=1; @@ -174,19 +174,19 @@ public class GT_MetaTileEntity_DataReader extends GT_MetaTileEntity_BasicMachine return maxEUInput()*4L; } - public static void addDataRender(Util.ItemStack_NoNBT stack, DataRender render){ - ArrayList renders = RENDER_REGISTRY.computeIfAbsent(stack, k -> new ArrayList<>()); + public static void addDataRender(Util.ItemStack_NoNBT stack, IDataRender render){ + ArrayList renders = RENDER_REGISTRY.computeIfAbsent(stack, k -> new ArrayList<>()); if(FMLCommonHandler.instance().getEffectiveSide().isClient()) { render.loadResources(); } renders.add(render); } - public static ArrayList getRenders(Util.ItemStack_NoNBT stack){ + public static ArrayList getRenders(Util.ItemStack_NoNBT stack){ return RENDER_REGISTRY.get(stack); } - public interface DataRender{ + public interface IDataRender { @SideOnly(Side.CLIENT) void loadResources(); @SideOnly(Side.CLIENT) @@ -203,7 +203,7 @@ public class GT_MetaTileEntity_DataReader extends GT_MetaTileEntity_BasicMachine } public static void run(){ - addDataRender(new Util.ItemStack_NoNBT(ItemList.Tool_DataStick.get(1)),new DataRender() { + addDataRender(new Util.ItemStack_NoNBT(ItemList.Tool_DataStick.get(1)),new IDataRender() { @SideOnly(Side.CLIENT) private ResourceLocation bg; @SideOnly(Side.CLIENT) diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DataReader.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DataReader.java index 022247b541..eb2c2e4112 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DataReader.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DataReader.java @@ -115,8 +115,8 @@ public class GT_GUIContainer_DataReader extends GT_GUIContainerMetaTile_Machine private void renderDataBG(ItemStack thing, int mouseX, int mouseY, int x, int y, byte mTier) { if (thing != null) { - ArrayList renders = GT_MetaTileEntity_DataReader.getRenders(new Util.ItemStack_NoNBT(thing)); - for (GT_MetaTileEntity_DataReader.DataRender render : renders) { + ArrayList renders = GT_MetaTileEntity_DataReader.getRenders(new Util.ItemStack_NoNBT(thing)); + for (GT_MetaTileEntity_DataReader.IDataRender render : renders) { if (render.canRender(thing, mTier)) { if (!GT_Utility.areStacksEqual(stack, thing, false)) { render.initRender(thing); @@ -133,8 +133,8 @@ public class GT_GUIContainer_DataReader extends GT_GUIContainerMetaTile_Machine if(stack==null){ return false; } - ArrayList renders = GT_MetaTileEntity_DataReader.getRenders(new Util.ItemStack_NoNBT(stack)); - for (GT_MetaTileEntity_DataReader.DataRender render : renders) { + ArrayList renders = GT_MetaTileEntity_DataReader.getRenders(new Util.ItemStack_NoNBT(stack)); + for (GT_MetaTileEntity_DataReader.IDataRender render : renders) { if (render.canRender(stack, mTier)) { render.renderForeground(stack, mouseX, mouseY, this, fontRendererObj); return true; @@ -147,8 +147,8 @@ public class GT_GUIContainer_DataReader extends GT_GUIContainerMetaTile_Machine if(stack==null){ return false; } - ArrayList renders = GT_MetaTileEntity_DataReader.getRenders(new Util.ItemStack_NoNBT(stack)); - for (GT_MetaTileEntity_DataReader.DataRender render : renders) { + ArrayList renders = GT_MetaTileEntity_DataReader.getRenders(new Util.ItemStack_NoNBT(stack)); + for (GT_MetaTileEntity_DataReader.IDataRender render : renders) { if (render.canRender(stack, mTier)) { render.renderTooltips(stack, mouseX, mouseY, this); return true; -- cgit From 1febaef9d798cce07687ed3a7723e5b9619e9ede Mon Sep 17 00:00:00 2001 From: Tec Date: Mon, 15 Jul 2019 08:12:28 +0200 Subject: Pollution! --- .../tectech/chunkData/ChunkDataHandler.java | 63 +++++---- .../tectech/chunkData/IChunkMetaDataHandler.java | 3 - .../tectech/loader/thing/MachineLoader.java | 1 + .../tectech/mechanics/anomaly/AnomalyHandler.java | 69 ++++----- .../technus/tectech/thing/CustomItemList.java | 2 +- .../GT_MetaTileEntity_Hatch_OverflowElemental.java | 8 +- .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 4 +- .../pipe/GT_MetaTileEntity_Pipe_Data.java | 2 +- .../single/GT_MetaTileEntity_DebugPollutor.java | 156 +++++++++++++++++++++ .../single/gui/GT_Container_DebugPollutor.java | 145 +++++++++++++++++++ .../single/gui/GT_GUIContainer_DebugPollutor.java | 31 ++++ .../gregtech/textures/blocks/iconsets/POLLUTOR.png | Bin 0 -> 849 bytes 12 files changed, 409 insertions(+), 75 deletions(-) create mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java create mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPollutor.java create mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugPollutor.java create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/POLLUTOR.png diff --git a/src/main/java/com/github/technus/tectech/chunkData/ChunkDataHandler.java b/src/main/java/com/github/technus/tectech/chunkData/ChunkDataHandler.java index f7b3895a80..c924099375 100644 --- a/src/main/java/com/github/technus/tectech/chunkData/ChunkDataHandler.java +++ b/src/main/java/com/github/technus/tectech/chunkData/ChunkDataHandler.java @@ -130,38 +130,39 @@ public class ChunkDataHandler { dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), aEvent)); } - @SideOnly(Side.SERVER) @SubscribeEvent public void onWorldTickEvent(TickEvent.WorldTickEvent aEvent) { - int dim=aEvent.world.provider.dimensionId; - clientSyncHandlers.forEach(chunkMetaDataHandler -> { - ChunkHashMap data=dimensionWiseMetaChunkData - .get(chunkMetaDataHandler.getTagName()).get(dim); - int cycle=chunkMetaDataHandler.pushPayloadSpreadPeriod(); - int epoch=(int)(aEvent.world.getTotalWorldTime()%cycle); - ArrayList work; - if(epoch==0){ - int per=data.dirtyBoys.size()/cycle; - int mod=data.dirtyBoys.size()%cycle; - Iterator iter=data.dirtyBoys.iterator(); - for (int periodWork = 0; periodWork < cycle; periodWork++) { - work=data.workLoad.get(periodWork); - for (int i = 0; i < per; i++) { - work.add(iter.next()); - } - if(periodWork { + ChunkHashMap data = dimensionWiseMetaChunkData + .get(chunkMetaDataHandler.getTagName()).get(dim); + int cycle = chunkMetaDataHandler.pushPayloadSpreadPeriod(); + int epoch = (int) (aEvent.world.getTotalWorldTime() % cycle); + ArrayList work; + if (epoch == 0) { + int per = data.dirtyBoys.size() / cycle; + int mod = data.dirtyBoys.size() % cycle; + Iterator iter = data.dirtyBoys.iterator(); + for (int periodWork = 0; periodWork < cycle; periodWork++) { + work = data.workLoad.get(periodWork); + for (int i = 0; i < per; i++) { + work.add(iter.next()); + } + if (periodWork < mod) { + work.add(iter.next()); + } } + data.dirtyBoys.clear(); } - data.dirtyBoys.clear(); - } - work=data.workLoad.get(epoch); - chunkMetaDataHandler.pushPayload(dim,work); - work.clear(); - }); - worldHandlers.forEach(chunkMetaDataHandler -> - chunkMetaDataHandler.tickWorld( - dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), aEvent)); + work = data.workLoad.get(epoch); + chunkMetaDataHandler.pushPayload(dim, work); + work.clear(); + }); + worldHandlers.forEach(chunkMetaDataHandler -> + chunkMetaDataHandler.tickWorld( + dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), aEvent)); + } } @SubscribeEvent @@ -196,7 +197,7 @@ public class ChunkDataHandler { clientSyncHandlers.add(handler); } } catch (NoSuchMethodException e) { - throw new RuntimeException("Cannot register common event handlers!"); + throw new RuntimeException("Cannot register common event handlers!",e); } if(FMLCommonHandler.instance().getEffectiveSide().isServer()) { try { @@ -204,7 +205,7 @@ public class ChunkDataHandler { worldHandlers.add(handler); } } catch (NoSuchMethodException e) { - throw new RuntimeException("Cannot register client event handlers!"); + throw new RuntimeException("Cannot register server event handlers!",e); } } if(FMLCommonHandler.instance().getEffectiveSide().isClient()) { @@ -216,7 +217,7 @@ public class ChunkDataHandler { renderHandlers.add(handler); } } catch (NoSuchMethodException e) { - throw new RuntimeException("Cannot register client event handlers!"); + throw new RuntimeException("Cannot register client event handlers!",e); } } } diff --git a/src/main/java/com/github/technus/tectech/chunkData/IChunkMetaDataHandler.java b/src/main/java/com/github/technus/tectech/chunkData/IChunkMetaDataHandler.java index b904f09f33..920d09c26a 100644 --- a/src/main/java/com/github/technus/tectech/chunkData/IChunkMetaDataHandler.java +++ b/src/main/java/com/github/technus/tectech/chunkData/IChunkMetaDataHandler.java @@ -16,9 +16,7 @@ public interface IChunkMetaDataHandler { NBTTagCompound createData(); @SideOnly(Side.CLIENT) default void requestData(ChunkEvent.Load aEvent){} - @SideOnly(Side.SERVER) default void pushData(int world, ChunkCoordIntPair chunk){} - @SideOnly(Side.SERVER) default void pushPayload(int world, ArrayList chunk){ chunk.forEach(chunkCoordIntPair -> pushData(world,chunkCoordIntPair)); } @@ -30,7 +28,6 @@ public interface IChunkMetaDataHandler { @SideOnly(Side.CLIENT) default void tickClient(HashMap data, TickEvent.ClientTickEvent aEvent){} default void tickServer(HashMap data, TickEvent.ServerTickEvent event){} - @SideOnly(Side.SERVER) default void tickWorld(HashMap data, TickEvent.WorldTickEvent aEvent){} default void tickPlayer(HashMap data, TickEvent.PlayerTickEvent aEvent){} } diff --git a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java index e734a4f8a3..e9fe5cfb19 100644 --- a/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java @@ -595,6 +595,7 @@ public class MachineLoader implements Runnable { // =================================================================================================== // Debug Stuff // =================================================================================================== + Machine_DebugPollutor.set(new GT_MetaTileEntity_DebugPollutor(15495,"debug.tt.pollutor","Debug Pollution Generator",15).getStackForm(1)); hatch_CreativeData.set(new GT_MetaTileEntity_Hatch_CreativeData(15496,"debug.tt.data","Debug Data Hatch",15).getStackForm(1)); hatch_CreativeMaitenance.set(new GT_MetaTileEntity_Hatch_CreativeMaintenance(15497, "debug.tt.maintenance", "Debug Maintenance Hatch", 15).getStackForm(1L)); Machine_DebugGenny.set(new GT_MetaTileEntity_DebugPowerGenerator(15498, "debug.tt.genny", "Debug Power Generator", 15).getStackForm(1L)); diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java index f45d3a5df5..c52ffc185f 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java @@ -20,7 +20,7 @@ import java.util.HashMap; public class AnomalyHandler implements IChunkMetaDataHandler { private static final double SWAP_THRESHOLD = dAtomDefinition.getSomethingHeavy().getMass() * 10000D; - private static final double PER_PARTICLE=SWAP_THRESHOLD/64; + private static final double PER_PARTICLE=SWAP_THRESHOLD/32; private static final String INTENSITY = "intensity"; private static final int MEAN_DELAY =50; @@ -42,27 +42,27 @@ public class AnomalyHandler implements IChunkMetaDataHandler { @Override public void tickWorld(HashMap data, TickEvent.WorldTickEvent aEvent) { - if(TecTech.RANDOM.nextInt(MEAN_DELAY)==0) { - int dim=aEvent.world.provider.dimensionId; - ArrayList worldDataArrayList =new ArrayList<>(1024); - data.get(dim).forEach((chunkCoordIntPair, compound) -> { - if (compound.getDouble(INTENSITY) >= SWAP_THRESHOLD) { - Chunk chunk=aEvent.world.getChunkFromChunkCoords(chunkCoordIntPair.chunkXPos,chunkCoordIntPair.chunkZPos); - if(chunk.isChunkLoaded){ - worldDataArrayList.add(chunk); - } + if (TecTech.RANDOM.nextInt(MEAN_DELAY) == 0) { + int dim = aEvent.world.provider.dimensionId; + ArrayList worldDataArrayList = new ArrayList<>(1024); + data.get(dim).forEach((chunkCoordIntPair, compound) -> { + if (compound.getDouble(INTENSITY) >= SWAP_THRESHOLD) { + Chunk chunk = aEvent.world.getChunkFromChunkCoords(chunkCoordIntPair.chunkXPos, chunkCoordIntPair.chunkZPos); + if (chunk.isChunkLoaded) { + worldDataArrayList.add(chunk); } - }); - if(worldDataArrayList.size()>=2) { - Chunk a = worldDataArrayList.remove(TecTech.RANDOM.nextInt(worldDataArrayList.size())); - Chunk b = worldDataArrayList.remove(TecTech.RANDOM.nextInt(worldDataArrayList.size())); - data.get(dim).get(a.getChunkCoordIntPair()).setDouble(INTENSITY,SWAP_THRESHOLD*TecTech.RANDOM.nextFloat()*0.25F); - data.get(dim).get(b.getChunkCoordIntPair()).setDouble(INTENSITY,SWAP_THRESHOLD*TecTech.RANDOM.nextFloat()*0.25F); - data.get(dim).markForTransmissionToClient(a.getChunkCoordIntPair()); - data.get(dim).markForTransmissionToClient(b.getChunkCoordIntPair()); - swapSomething(a,b); } + }); + if (worldDataArrayList.size() >= 2) { + Chunk a = worldDataArrayList.remove(TecTech.RANDOM.nextInt(worldDataArrayList.size())); + Chunk b = worldDataArrayList.remove(TecTech.RANDOM.nextInt(worldDataArrayList.size())); + data.get(dim).get(a.getChunkCoordIntPair()).setDouble(INTENSITY, SWAP_THRESHOLD * TecTech.RANDOM.nextFloat() * 0.25F); + data.get(dim).get(b.getChunkCoordIntPair()).setDouble(INTENSITY, SWAP_THRESHOLD * TecTech.RANDOM.nextFloat() * 0.25F); + data.get(dim).markForTransmissionToClient(a.getChunkCoordIntPair()); + data.get(dim).markForTransmissionToClient(b.getChunkCoordIntPair()); + swapSomething(a, b); } + } } private void swapSomething(Chunk a,Chunk b){ @@ -97,27 +97,29 @@ public class AnomalyHandler implements IChunkMetaDataHandler { @Override public void tickPlayer(HashMap data, TickEvent.PlayerTickEvent aEvent) { - ChunkCoordIntPair pair=new ChunkCoordIntPair(aEvent.player.chunkCoordX,aEvent.player.chunkCoordZ); - NBTTagCompound compound=data.get(aEvent.player.worldObj.provider.dimensionId).get(pair); - if(compound!=null) { - double intensity = compound.getDouble(INTENSITY); - if (aEvent.side.isClient()) { - for (int i = 0; i < intensity / PER_PARTICLE; i++) { + if (aEvent.side.isClient()) { + ChunkCoordIntPair pair = new ChunkCoordIntPair(aEvent.player.chunkCoordX, aEvent.player.chunkCoordZ); + NBTTagCompound compound = data.get(aEvent.player.worldObj.provider.dimensionId).get(pair); + if (compound != null) { + for (int i = 0, pow = (int)Math.min(32,compound.getDouble(INTENSITY) / PER_PARTICLE); i < pow; i++) { TecTech.proxy.em_particle(aEvent.player.worldObj, aEvent.player.posX - 32D + TecTech.RANDOM.nextFloat() * 64D, aEvent.player.posY - 32D + TecTech.RANDOM.nextFloat() * 64D, aEvent.player.posZ - 32D + TecTech.RANDOM.nextFloat() * 64D); } } + + data.get(aEvent.player.worldObj.provider.dimensionId).forEach((chunkCoordIntPair, dat) -> { + if (Math.abs(chunkCoordIntPair.getCenterXPos() - aEvent.player.posX) + Math.abs(chunkCoordIntPair.getCenterZPosition() - aEvent.player.posZ) < 256) { + for (int i = 0, pow = (int)Math.min(32,dat.getDouble(INTENSITY) / PER_PARTICLE); i < pow; i++) { + TecTech.proxy.em_particle(aEvent.player.worldObj, + (chunkCoordIntPair.chunkXPos << 4) + TecTech.RANDOM.nextFloat() * 48D - 16D, + aEvent.player.posY + TecTech.RANDOM.nextFloat() * 128D - 64D, + (chunkCoordIntPair.chunkZPos << 4) + TecTech.RANDOM.nextFloat() * 48D - 16D); + } + } + }); } - data.get(aEvent.player.worldObj.provider.dimensionId).forEach((chunkCoordIntPair, dat) -> { - for (int i = 0,pow=(int)(dat.getDouble(INTENSITY)/PER_PARTICLE); i < pow; i++) { - TecTech.proxy.em_particle(aEvent.player.worldObj, - (chunkCoordIntPair.chunkXPos<<4)+TecTech.RANDOM.nextFloat() * 48D-16D, - aEvent.player.posY+TecTech.RANDOM.nextFloat() * 128D-64D, - (chunkCoordIntPair.chunkZPos<<4)+TecTech.RANDOM.nextFloat() * 48D-16D); - } - }); } @Override @@ -147,6 +149,7 @@ public class AnomalyHandler implements IChunkMetaDataHandler { } public void addAnomaly(int world, ChunkCoordIntPair chunk, double amount) { + amount=Math.abs(amount); NBTTagCompound old = TecTech.chunkDataHandler.getChunkData(this, world, chunk); if (old == null) { NBTTagCompound data = new NBTTagCompound(); diff --git a/src/main/java/com/github/technus/tectech/thing/CustomItemList.java b/src/main/java/com/github/technus/tectech/thing/CustomItemList.java index 14f1bd1296..cd3d1cccd8 100644 --- a/src/main/java/com/github/technus/tectech/thing/CustomItemList.java +++ b/src/main/java/com/github/technus/tectech/thing/CustomItemList.java @@ -28,7 +28,7 @@ public enum CustomItemList implements IItemContainer { Machine_BuckConverter_IV,Machine_BuckConverter_LuV,Machine_BuckConverter_ZPM, Machine_BuckConverter_UV,Machine_BuckConverter_UHV,Machine_BuckConverter_UEV, Machine_BuckConverter_UIV,Machine_BuckConverter_UMV, Machine_BuckConverter_UXV, - Machine_DebugWriter,Machine_DebugGenny,UnusedStuff, + Machine_DebugWriter,Machine_DebugGenny,UnusedStuff, Machine_DebugPollutor, EMpipe, DATApipe, LASERpipe, rack_Hatch, holder_Hatch, capacitor_Hatch, eM_dynamomulti4_IV, eM_dynamomulti16_IV, eM_dynamomulti64_IV, diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OverflowElemental.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OverflowElemental.java index e3dc732c99..18eb8b8c72 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OverflowElemental.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OverflowElemental.java @@ -38,8 +38,8 @@ import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Mult public class GT_MetaTileEntity_Hatch_OverflowElemental extends GT_MetaTileEntity_Hatch { private static Textures.BlockIcons.CustomIcon EM_T_SIDES; private static Textures.BlockIcons.CustomIcon EM_T_ACTIVE; - private static Textures.BlockIcons.CustomIcon MufflerEM; - private static Textures.BlockIcons.CustomIcon MufflerEMidle; + public static Textures.BlockIcons.CustomIcon MufflerEM; + public static Textures.BlockIcons.CustomIcon MufflerEMidle; private float overflowMatter; public final float overflowMax; private final float overflowDisperse; @@ -159,8 +159,8 @@ public class GT_MetaTileEntity_Hatch_OverflowElemental extends GT_MetaTileEntity aBaseMetaTileEntity.getWorld().updateLightByType(EnumSkyBlock.Block, aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord()); } } - } else if (aBaseMetaTileEntity.isClientSide() && getBaseMetaTileEntity().isActive()) { - TecTech.proxy.em_particle(getBaseMetaTileEntity(), getBaseMetaTileEntity().getFrontFacing()); + } else if (aBaseMetaTileEntity.isClientSide() && aBaseMetaTileEntity.isActive()) { + TecTech.proxy.em_particle(aBaseMetaTileEntity, aBaseMetaTileEntity.getFrontFacing()); } super.onPostTick(aBaseMetaTileEntity, aTick); //DOES NOT CHECK FOR TOO MUCH, it is done only while putting stuff in (OPTIMIZATION!!!) 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 2ba49d0849..90e69c4fb7 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 @@ -1307,8 +1307,8 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt eOutputData.clear(); eInputData.clear(); - if (getBaseMetaTileEntity() instanceof BaseTileEntity) { - ((BaseTileEntity) getBaseMetaTileEntity()).ignoreUnloadedChunks = mMachine; + if (aBaseMetaTileEntity instanceof BaseTileEntity) { + ((BaseTileEntity) aBaseMetaTileEntity).ignoreUnloadedChunks = mMachine; } mMachine = checkMachine(aBaseMetaTileEntity, mInventory[1]); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java index 4badeb2d7c..3331430cb9 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java @@ -108,7 +108,7 @@ public class GT_MetaTileEntity_Pipe_Data extends MetaPipeEntity implements IConn @Override public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { - if(getBaseMetaTileEntity().isClientSide()){ + if(aBaseMetaTileEntity.isClientSide()){ NetworkDispatcher.INSTANCE.sendToServer(new PipeActivityMessage.PipeActivityQuery(this)); } onPostTick(aBaseMetaTileEntity, 31); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java new file mode 100644 index 0000000000..d3b6b3aff8 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java @@ -0,0 +1,156 @@ +package com.github.technus.tectech.thing.metaTileEntity.single; + +import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.Util; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OverflowElemental; +import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_Container_DebugPollutor; +import com.github.technus.tectech.thing.metaTileEntity.single.gui.GT_GUIContainer_DebugPollutor; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.common.GT_Pollution; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; + +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; + +/** + * Created by Tec on 23.03.2017. + */ +public class GT_MetaTileEntity_DebugPollutor extends GT_MetaTileEntity_TieredMachineBlock { + private static GT_RenderedTexture POLLUTOR; + public int pollution=0; + public float anomaly=0; + + public GT_MetaTileEntity_DebugPollutor(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 0, "Shit genny broke!"); + Util.setTier(aTier,this); + } + + public GT_MetaTileEntity_DebugPollutor(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 0, aDescription, aTextures); + Util.setTier(aTier,this); + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_DebugPollutor(mName, mTier, mDescription, mTextures); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister aBlockIconRegister) { + super.registerIcons(aBlockIconRegister); + POLLUTOR = new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("iconsets/POLLUTOR")); + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + return new ITexture[]{MACHINE_CASINGS[mTier][aColorIndex + 1], aSide != aFacing ? aActive? new GT_RenderedTexture(GT_MetaTileEntity_Hatch_OverflowElemental.MufflerEM): new GT_RenderedTexture(GT_MetaTileEntity_Hatch_OverflowElemental.MufflerEMidle) : POLLUTOR}; + } + + @Override + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + return null; + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_DebugPollutor(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_DebugPollutor(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public boolean allowPutStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { + return false; + } + + @Override + public boolean allowPullStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { + return false; + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setInteger("ePollution",pollution); + aNBT.setFloat("eAnomaly",anomaly); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + pollution=aNBT.getInteger("ePollution"); + anomaly=aNBT.getFloat("eAnomaly"); + getBaseMetaTileEntity().setActive(anomaly>0||pollution>0); + } + + @Override + public boolean isSimpleMachine() { + return false; + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide()) { + aBaseMetaTileEntity.setActive(anomaly>0||pollution>0); + if (anomaly > 0) { + TecTech.anomalyHandler.addAnomaly(aBaseMetaTileEntity,anomaly); + } + if (pollution > 0) { + GT_Pollution.addPollution(aBaseMetaTileEntity, pollution); + } + } else if (aBaseMetaTileEntity.isClientSide() && aBaseMetaTileEntity.isActive()) { + for(byte i=0;i<6;i++){ + if(i!=aBaseMetaTileEntity.getFrontFacing()){ + TecTech.proxy.em_particle(aBaseMetaTileEntity, i); + } + } + } + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) { + return true; + } + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + + @Override + public boolean isFacingValid(byte aFacing) { + return true; + } + + @Override + public boolean isAccessAllowed(EntityPlayer aPlayer) { + return true; + } + + @Override + public String[] getDescription() { + return new String[]{ + CommonValues.TEC_MARK_GENERAL, mDescription, + EnumChatFormatting.BLUE + "Infinite Producer/Consumer", + EnumChatFormatting.BLUE + "Since i wanted one..." + }; + } + + @Override + public boolean isElectric() { + return false; + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPollutor.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPollutor.java new file mode 100644 index 0000000000..8db50abd96 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPollutor.java @@ -0,0 +1,145 @@ +package com.github.technus.tectech.thing.metaTileEntity.single.gui; + +import com.github.technus.tectech.Util; +import com.github.technus.tectech.thing.metaTileEntity.single.GT_MetaTileEntity_DebugPollutor; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.gui.GT_ContainerMetaTile_Machine; +import gregtech.api.gui.GT_Slot_Holo; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class GT_Container_DebugPollutor + extends GT_ContainerMetaTile_Machine { + public int pollution =0; + public float anomaly =0; + + public GT_Container_DebugPollutor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(aInventoryPlayer, aTileEntity); + } + + @Override + public void addSlots(InventoryPlayer aInventoryPlayer) { + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 5, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 23, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 41, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 59, false, false, 1)); + + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 5, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 23, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 41, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 59, false, false, 1)); + + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 5, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 23, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 41, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 59, false, false, 1)); + + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 5, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 23, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 41, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 59, false, false, 1)); + } + + @Override + public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { + if (aSlotIndex < 0) { + return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); + } + Slot tSlot = (Slot) inventorySlots.get(aSlotIndex); + if (tSlot != null && mTileEntity.getMetaTileEntity() != null) { + GT_MetaTileEntity_DebugPollutor dpg = (GT_MetaTileEntity_DebugPollutor) mTileEntity.getMetaTileEntity(); + switch (aSlotIndex) { + case 0: + dpg.pollution -= aShifthold == 1 ? 512 : 64; + break; + case 1: + dpg.pollution /= aShifthold == 1 ? 512 : 64; + break; + case 2: + dpg.anomaly -= aShifthold == 1 ? 512 : 64; + break; + case 3: + dpg.anomaly /= aShifthold == 1 ? 512 : 64; + break; + case 4: + dpg.pollution -= aShifthold == 1 ? 16 : 1; + break; + case 5: + dpg.pollution /= aShifthold == 1 ? 16 : 2; + break; + case 6: + dpg.anomaly -= aShifthold == 1 ? 16 : 1; + break; + case 7: + dpg.anomaly /= aShifthold == 1 ? 16 : 2; + break; + case 8: + dpg.pollution += aShifthold == 1 ? 512 : 64; + break; + case 9: + dpg.pollution *= aShifthold == 1 ? 512 : 64; + break; + case 10: + dpg.anomaly += aShifthold == 1 ? 512 : 64; + break; + case 11: + dpg.anomaly *= aShifthold == 1 ? 512 : 64; + break; + case 12: + dpg.pollution += aShifthold == 1 ? 16 : 1; + break; + case 13: + dpg.pollution *= aShifthold == 1 ? 16 : 2; + break; + case 14: + dpg.anomaly += aShifthold == 1 ? 16 : 1; + break; + case 15: + dpg.anomaly *= aShifthold == 1 ? 16 : 2; + break; + default: return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); + } + return null; + } + return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); + } + + @Override + public void detectAndSendChanges() { + super.detectAndSendChanges(); + if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) { + return; + } + + GT_MetaTileEntity_DebugPollutor dpg = (GT_MetaTileEntity_DebugPollutor) mTileEntity.getMetaTileEntity(); + pollution =dpg.pollution; + anomaly =dpg.anomaly; + + for (Object crafter : crafters) { + ICrafting var1 = (ICrafting) crafter; + Util.sendInteger(pollution,this,var1,100); + Util.sendFloat(anomaly,this,var1,102); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void updateProgressBar(int par1, int par2) { + super.updateProgressBar(par1, par2); + switch (par1) { + case 100: + case 101: + pollution = Util.receiveInteger(pollution,100,par1,par2); + break; + case 102: + case 103: + anomaly = Util.receiveFloat(anomaly,102,par1,par2); + break; + } + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugPollutor.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugPollutor.java new file mode 100644 index 0000000000..39c67f1b50 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_GUIContainer_DebugPollutor.java @@ -0,0 +1,31 @@ +package com.github.technus.tectech.thing.metaTileEntity.single.gui; + +import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.entity.player.InventoryPlayer; + +import static gregtech.api.enums.GT_Values.RES_PATH_GUI; + +public class GT_GUIContainer_DebugPollutor extends GT_GUIContainerMetaTile_Machine { + public GT_GUIContainer_DebugPollutor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(new GT_Container_DebugPollutor(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "Teleporter.png"); + } + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + fontRendererObj.drawString("Pollutor", 46, 8, 16448255); + if (mContainer != null) { + GT_Container_DebugPollutor dpg = (GT_Container_DebugPollutor) mContainer; + fontRendererObj.drawString("Pollution: " + dpg.pollution, 46, 24, 16448255); + fontRendererObj.drawString("Anomaly: " + dpg.anomaly, 46, 32, 16448255); + } + } + + @Override + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + super.drawGuiContainerBackgroundLayer(par1, par2, par3); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + } +} diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/POLLUTOR.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/POLLUTOR.png new file mode 100644 index 0000000000..c8c32d0ab4 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/POLLUTOR.png differ -- cgit From 2e6cad60a78241c08596ae5a722862dd08583f48 Mon Sep 17 00:00:00 2001 From: Tec Date: Mon, 15 Jul 2019 09:10:26 +0200 Subject: Tweaking numbers --- .../tectech/chunkData/ChunkDataHandler.java | 28 ++++++++++------------ .../tectech/chunkData/IChunkMetaDataHandler.java | 2 +- .../tectech/mechanics/anomaly/AnomalyHandler.java | 8 ++++--- .../single/GT_MetaTileEntity_DebugPollutor.java | 28 ++++++++++++++++++++++ .../single/gui/GT_Container_DebugPollutor.java | 7 +++++- 5 files changed, 53 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/chunkData/ChunkDataHandler.java b/src/main/java/com/github/technus/tectech/chunkData/ChunkDataHandler.java index c924099375..191011d959 100644 --- a/src/main/java/com/github/technus/tectech/chunkData/ChunkDataHandler.java +++ b/src/main/java/com/github/technus/tectech/chunkData/ChunkDataHandler.java @@ -18,7 +18,8 @@ public class ChunkDataHandler { private final HashMap> dimensionWiseChunkData=new HashMap<>(); private final HashMap> dimensionWiseMetaChunkData=new HashMap<>(); private final HashMap metaDataHandlerHashMap =new HashMap<>(); - private final ArrayList clientSyncHandlers =new ArrayList<>(); + private final ArrayList pushSyncHandlers =new ArrayList<>(); + private final ArrayList pullSyncHandlers =new ArrayList<>(); private final ArrayList serverHandlers=new ArrayList<>(); private final ArrayList worldHandlers=new ArrayList<>(); private final ArrayList playerHandlers=new ArrayList<>(); @@ -95,13 +96,13 @@ public class ChunkDataHandler { @SideOnly(Side.CLIENT) @SubscribeEvent public void onLoadChunk(ChunkEvent.Load aEvent){ - clientSyncHandlers.forEach(chunkMetaDataHandler -> chunkMetaDataHandler.requestData(aEvent)); + pullSyncHandlers.forEach(chunkMetaDataHandler -> chunkMetaDataHandler.pullData(aEvent)); } @SideOnly(Side.CLIENT) @SubscribeEvent public void onUnLoadChunk(ChunkEvent.Unload aEvent){ - clientSyncHandlers.forEach(chunkMetaDataHandler -> dimensionWiseMetaChunkData + pushSyncHandlers.forEach(chunkMetaDataHandler -> dimensionWiseMetaChunkData .get(chunkMetaDataHandler.getTagName()) .get(aEvent.world.provider.dimensionId) .remove(aEvent.getChunk().getChunkCoordIntPair())); @@ -134,7 +135,7 @@ public class ChunkDataHandler { public void onWorldTickEvent(TickEvent.WorldTickEvent aEvent) { if(aEvent.side.isServer()) { int dim = aEvent.world.provider.dimensionId; - clientSyncHandlers.forEach(chunkMetaDataHandler -> { + pushSyncHandlers.forEach(chunkMetaDataHandler -> { ChunkHashMap data = dimensionWiseMetaChunkData .get(chunkMetaDataHandler.getTagName()).get(dim); int cycle = chunkMetaDataHandler.pushPayloadSpreadPeriod(); @@ -193,23 +194,20 @@ public class ChunkDataHandler { if(clazz.getMethod("tickPlayer", HashMap.class, TickEvent.PlayerTickEvent.class).getDeclaringClass()!= IChunkMetaDataHandler.class){ playerHandlers.add(handler); } - if (clazz.getMethod("requestData", ChunkEvent.Load.class).getDeclaringClass() != IChunkMetaDataHandler.class) { - clientSyncHandlers.add(handler); + if (clazz.getMethod("pushData", int.class, ChunkCoordIntPair.class).getDeclaringClass()!=IChunkMetaDataHandler.class) { + pushSyncHandlers.add(handler); + } + if(clazz.getMethod("tickWorld", HashMap.class, TickEvent.WorldTickEvent.class).getDeclaringClass()!= IChunkMetaDataHandler.class){ + worldHandlers.add(handler); } } catch (NoSuchMethodException e) { throw new RuntimeException("Cannot register common event handlers!",e); } - if(FMLCommonHandler.instance().getEffectiveSide().isServer()) { - try { - if(clazz.getMethod("tickWorld", HashMap.class, TickEvent.WorldTickEvent.class).getDeclaringClass()!= IChunkMetaDataHandler.class){ - worldHandlers.add(handler); - } - } catch (NoSuchMethodException e) { - throw new RuntimeException("Cannot register server event handlers!",e); - } - } if(FMLCommonHandler.instance().getEffectiveSide().isClient()) { try { + if (clazz.getMethod("pullData", ChunkEvent.Load.class).getDeclaringClass() != IChunkMetaDataHandler.class) { + pullSyncHandlers.add(handler); + } if (clazz.getMethod("tickClient", HashMap.class, TickEvent.ClientTickEvent.class).getDeclaringClass() != IChunkMetaDataHandler.class) { clientHandlers.add(handler); } diff --git a/src/main/java/com/github/technus/tectech/chunkData/IChunkMetaDataHandler.java b/src/main/java/com/github/technus/tectech/chunkData/IChunkMetaDataHandler.java index 920d09c26a..b5c79a4628 100644 --- a/src/main/java/com/github/technus/tectech/chunkData/IChunkMetaDataHandler.java +++ b/src/main/java/com/github/technus/tectech/chunkData/IChunkMetaDataHandler.java @@ -15,7 +15,7 @@ public interface IChunkMetaDataHandler { void mergeData(NBTTagCompound target, NBTTagCompound loadedData); NBTTagCompound createData(); @SideOnly(Side.CLIENT) - default void requestData(ChunkEvent.Load aEvent){} + default void pullData(ChunkEvent.Load aEvent){} default void pushData(int world, ChunkCoordIntPair chunk){} default void pushPayload(int world, ArrayList chunk){ chunk.forEach(chunkCoordIntPair -> pushData(world,chunkCoordIntPair)); diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java index c52ffc185f..3100fd38fe 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java @@ -56,8 +56,10 @@ public class AnomalyHandler implements IChunkMetaDataHandler { if (worldDataArrayList.size() >= 2) { Chunk a = worldDataArrayList.remove(TecTech.RANDOM.nextInt(worldDataArrayList.size())); Chunk b = worldDataArrayList.remove(TecTech.RANDOM.nextInt(worldDataArrayList.size())); - data.get(dim).get(a.getChunkCoordIntPair()).setDouble(INTENSITY, SWAP_THRESHOLD * TecTech.RANDOM.nextFloat() * 0.25F); - data.get(dim).get(b.getChunkCoordIntPair()).setDouble(INTENSITY, SWAP_THRESHOLD * TecTech.RANDOM.nextFloat() * 0.25F); + double avg=.5* (data.get(dim).get(a.getChunkCoordIntPair()).getDouble(INTENSITY)+ + data.get(dim).get(b.getChunkCoordIntPair()).getDouble(INTENSITY)); + data.get(dim).get(a.getChunkCoordIntPair()).setDouble(INTENSITY, Math.min(SWAP_THRESHOLD,avg * (TecTech.RANDOM.nextFloat()+.5F) * 0.5F)); + data.get(dim).get(b.getChunkCoordIntPair()).setDouble(INTENSITY, Math.min(SWAP_THRESHOLD,avg * (TecTech.RANDOM.nextFloat()+.5F) * 0.5F)); data.get(dim).markForTransmissionToClient(a.getChunkCoordIntPair()); data.get(dim).markForTransmissionToClient(b.getChunkCoordIntPair()); swapSomething(a, b); @@ -123,7 +125,7 @@ public class AnomalyHandler implements IChunkMetaDataHandler { } @Override - public void requestData(ChunkEvent.Load aEvent) { + public void pullData(ChunkEvent.Load aEvent) { NetworkDispatcher.INSTANCE.sendToServer(new ChunkDataMessage.ChunkDataQuery(aEvent, this)); } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java index d3b6b3aff8..ab68393dee 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java @@ -21,6 +21,8 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; @@ -116,6 +118,7 @@ public class GT_MetaTileEntity_DebugPollutor extends GT_MetaTileEntity_TieredMac for(byte i=0;i<6;i++){ if(i!=aBaseMetaTileEntity.getFrontFacing()){ TecTech.proxy.em_particle(aBaseMetaTileEntity, i); + pollutionParticles(aBaseMetaTileEntity.getWorld(),"largesmoke",i); } } } @@ -153,4 +156,29 @@ public class GT_MetaTileEntity_DebugPollutor extends GT_MetaTileEntity_TieredMac public boolean isElectric() { return false; } + + @SideOnly(Side.CLIENT) + public void pollutionParticles(World aWorld, String name,byte face) { + IGregTechTileEntity aMuffler = this.getBaseMetaTileEntity(); + ForgeDirection aDir = ForgeDirection.getOrientation(face); + float xPos = aDir.offsetX * 0.76F + aMuffler.getXCoord() + 0.25F; + float yPos = aDir.offsetY * 0.76F + aMuffler.getYCoord() + 0.25F; + float zPos = aDir.offsetZ * 0.76F + aMuffler.getZCoord() + 0.25F; + + float ySpd = aDir.offsetY * 0.1F + 0.2F + 0.1F * TecTech.RANDOM.nextFloat(); + float xSpd; + float zSpd; + + if (aDir.offsetY == -1) { + float temp = TecTech.RANDOM.nextFloat() * 2 * (float) Math.PI; + xSpd = (float) Math.sin(temp) * 0.1F; + zSpd = (float) Math.cos(temp) * 0.1F; + } else { + xSpd = aDir.offsetX * (0.1F + 0.2F * TecTech.RANDOM.nextFloat()); + zSpd = aDir.offsetZ * (0.1F + 0.2F * TecTech.RANDOM.nextFloat()); + } + aWorld.spawnParticle(name, xPos + TecTech.RANDOM.nextFloat() * 0.5F, yPos + TecTech.RANDOM.nextFloat() * 0.5F, zPos + TecTech.RANDOM.nextFloat() * 0.5F, xSpd, ySpd, zSpd); + aWorld.spawnParticle(name, xPos + TecTech.RANDOM.nextFloat() * 0.5F, yPos + TecTech.RANDOM.nextFloat() * 0.5F, zPos + TecTech.RANDOM.nextFloat() * 0.5F, xSpd, ySpd, zSpd); + aWorld.spawnParticle(name, xPos + TecTech.RANDOM.nextFloat() * 0.5F, yPos + TecTech.RANDOM.nextFloat() * 0.5F, zPos + TecTech.RANDOM.nextFloat() * 0.5F, xSpd, ySpd, zSpd); + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPollutor.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPollutor.java index 8db50abd96..3374d874d4 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPollutor.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPollutor.java @@ -104,6 +104,11 @@ public class GT_Container_DebugPollutor break; default: return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); } + if(dpg.anomaly==Float.POSITIVE_INFINITY){ + dpg.anomaly=Float.MAX_VALUE; + }else if (dpg.anomaly==Float.NEGATIVE_INFINITY){ + dpg.anomaly=-Float.MAX_VALUE; + } return null; } return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); @@ -119,7 +124,7 @@ public class GT_Container_DebugPollutor GT_MetaTileEntity_DebugPollutor dpg = (GT_MetaTileEntity_DebugPollutor) mTileEntity.getMetaTileEntity(); pollution =dpg.pollution; anomaly =dpg.anomaly; - + for (Object crafter : crafters) { ICrafting var1 = (ICrafting) crafter; Util.sendInteger(pollution,this,var1,100); -- cgit From 150f34aebae02b71ffc6eba115c3910c69f37885 Mon Sep 17 00:00:00 2001 From: Tec Date: Mon, 15 Jul 2019 09:39:39 +0200 Subject: Use properlist --- .../java/com/github/technus/tectech/chunkData/ChunkDataHandler.java | 2 +- .../com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/chunkData/ChunkDataHandler.java b/src/main/java/com/github/technus/tectech/chunkData/ChunkDataHandler.java index 191011d959..108e762af0 100644 --- a/src/main/java/com/github/technus/tectech/chunkData/ChunkDataHandler.java +++ b/src/main/java/com/github/technus/tectech/chunkData/ChunkDataHandler.java @@ -102,7 +102,7 @@ public class ChunkDataHandler { @SideOnly(Side.CLIENT) @SubscribeEvent public void onUnLoadChunk(ChunkEvent.Unload aEvent){ - pushSyncHandlers.forEach(chunkMetaDataHandler -> dimensionWiseMetaChunkData + pullSyncHandlers.forEach(chunkMetaDataHandler -> dimensionWiseMetaChunkData .get(chunkMetaDataHandler.getTagName()) .get(aEvent.world.provider.dimensionId) .remove(aEvent.getChunk().getChunkCoordIntPair())); diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java index 3100fd38fe..df6bfa7801 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java @@ -92,11 +92,6 @@ public class AnomalyHandler implements IChunkMetaDataHandler { } } - @Override - public void tickServer(HashMap data, TickEvent.ServerTickEvent event) { - - } - @Override public void tickPlayer(HashMap data, TickEvent.PlayerTickEvent aEvent) { if (aEvent.side.isClient()) { -- cgit From cf618db325bceec9b90887ec2b37db800ea7704f Mon Sep 17 00:00:00 2001 From: Tec Date: Mon, 15 Jul 2019 09:54:07 +0200 Subject: Spawn particles only around ThePlayer not all --- .../tectech/mechanics/anomaly/AnomalyHandler.java | 65 ++++++++++++++++++---- 1 file changed, 55 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java index df6bfa7801..ce79c42003 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java @@ -6,17 +6,31 @@ import com.github.technus.tectech.chunkData.IChunkMetaDataHandler; import com.github.technus.tectech.loader.network.ChunkDataMessage; import com.github.technus.tectech.loader.network.NetworkDispatcher; import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.dAtomDefinition; +import cpw.mods.fml.common.eventhandler.EventPriority; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; +import crazypants.util.BaublesUtil; +import crazypants.util.GalacticraftUtil; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; +import net.minecraftforge.common.util.FakePlayer; +import net.minecraftforge.event.entity.player.PlayerDropsEvent; +import net.minecraftforge.event.entity.player.PlayerEvent; import net.minecraftforge.event.world.ChunkEvent; import java.util.ArrayList; import java.util.HashMap; +import java.util.ListIterator; public class AnomalyHandler implements IChunkMetaDataHandler { private static final double SWAP_THRESHOLD = dAtomDefinition.getSomethingHeavy().getMass() * 10000D; @@ -95,23 +109,24 @@ public class AnomalyHandler implements IChunkMetaDataHandler { @Override public void tickPlayer(HashMap data, TickEvent.PlayerTickEvent aEvent) { if (aEvent.side.isClient()) { - ChunkCoordIntPair pair = new ChunkCoordIntPair(aEvent.player.chunkCoordX, aEvent.player.chunkCoordZ); - NBTTagCompound compound = data.get(aEvent.player.worldObj.provider.dimensionId).get(pair); + EntityClientPlayerMP player=Minecraft.getMinecraft().thePlayer; + ChunkCoordIntPair pair = new ChunkCoordIntPair(player.chunkCoordX, player.chunkCoordZ); + NBTTagCompound compound = data.get(player.worldObj.provider.dimensionId).get(pair); if (compound != null) { for (int i = 0, pow = (int)Math.min(32,compound.getDouble(INTENSITY) / PER_PARTICLE); i < pow; i++) { - TecTech.proxy.em_particle(aEvent.player.worldObj, - aEvent.player.posX - 32D + TecTech.RANDOM.nextFloat() * 64D, - aEvent.player.posY - 32D + TecTech.RANDOM.nextFloat() * 64D, - aEvent.player.posZ - 32D + TecTech.RANDOM.nextFloat() * 64D); + TecTech.proxy.em_particle(player.worldObj, + player.posX - 32D + TecTech.RANDOM.nextFloat() * 64D, + player.posY - 32D + TecTech.RANDOM.nextFloat() * 64D, + player.posZ - 32D + TecTech.RANDOM.nextFloat() * 64D); } } - data.get(aEvent.player.worldObj.provider.dimensionId).forEach((chunkCoordIntPair, dat) -> { - if (Math.abs(chunkCoordIntPair.getCenterXPos() - aEvent.player.posX) + Math.abs(chunkCoordIntPair.getCenterZPosition() - aEvent.player.posZ) < 256) { + data.get(player.worldObj.provider.dimensionId).forEach((chunkCoordIntPair, dat) -> { + if (Math.abs(chunkCoordIntPair.getCenterXPos() - player.posX) + Math.abs(chunkCoordIntPair.getCenterZPosition() - player.posZ) < 256) { for (int i = 0, pow = (int)Math.min(32,dat.getDouble(INTENSITY) / PER_PARTICLE); i < pow; i++) { - TecTech.proxy.em_particle(aEvent.player.worldObj, + TecTech.proxy.em_particle(player.worldObj, (chunkCoordIntPair.chunkXPos << 4) + TecTech.RANDOM.nextFloat() * 48D - 16D, - aEvent.player.posY + TecTech.RANDOM.nextFloat() * 128D - 64D, + player.posY + TecTech.RANDOM.nextFloat() * 128D - 64D, (chunkCoordIntPair.chunkZPos << 4) + TecTech.RANDOM.nextFloat() * 48D - 16D); } } @@ -119,6 +134,13 @@ public class AnomalyHandler implements IChunkMetaDataHandler { } } + @Override + public void tickServer(HashMap data, TickEvent.ServerTickEvent event) { + if(event.side.isServer()){ + + } + } + @Override public void pullData(ChunkEvent.Load aEvent) { NetworkDispatcher.INSTANCE.sendToServer(new ChunkDataMessage.ChunkDataQuery(aEvent, this)); @@ -157,4 +179,27 @@ public class AnomalyHandler implements IChunkMetaDataHandler { } TecTech.chunkDataHandler.getChunkData(this, world).markForTransmissionToClient(chunk); } + + @SubscribeEvent + public void onPlayerClone(PlayerEvent.Clone evt) { + if (evt.wasDeath && !evt.isCanceled()) { + if (evt.original != null && evt.entityPlayer != null && !(evt.entityPlayer instanceof FakePlayer)) { + int i; + ItemStack item; + for (i = 0; i < evt.original.field_71071_by.field_70462_a.length; ++i) { + item = evt.original.field_71071_by.field_70462_a[i]; + if (this.isSoulBound(item) && this.addToPlayerInventory(evt.entityPlayer, item)) { + evt.original.field_71071_by.field_70462_a[i] = null; + } + } + + for (i = 0; i < evt.original.field_71071_by.field_70460_b.length; ++i) { + item = evt.original.field_71071_by.field_70460_b[i]; + if (this.isSoulBound(item) && this.addToPlayerInventory(evt.entityPlayer, item)) { + evt.original.field_71071_by.field_70460_b[i] = null; + } + } + } + } + } } -- cgit From 99462bdb945778faf1ddf41a59040cfe2c4840d7 Mon Sep 17 00:00:00 2001 From: Tec Date: Mon, 15 Jul 2019 11:19:30 +0200 Subject: Implement player data persistence --- .../java/com/github/technus/tectech/TecTech.java | 4 + src/main/java/com/github/technus/tectech/Util.java | 100 +++++++++++++++++++++ .../tectech/mechanics/PlayerPersistence.java | 42 +++++++++ .../tectech/mechanics/anomaly/AnomalyHandler.java | 45 +++------- 4 files changed, 156 insertions(+), 35 deletions(-) create mode 100644 src/main/java/com/github/technus/tectech/mechanics/PlayerPersistence.java diff --git a/src/main/java/com/github/technus/tectech/TecTech.java b/src/main/java/com/github/technus/tectech/TecTech.java index 9d3273f10e..76cdc56060 100644 --- a/src/main/java/com/github/technus/tectech/TecTech.java +++ b/src/main/java/com/github/technus/tectech/TecTech.java @@ -4,6 +4,7 @@ import com.github.technus.tectech.loader.MainLoader; import com.github.technus.tectech.loader.TecTechConfig; import com.github.technus.tectech.mechanics.ConvertFloat; import com.github.technus.tectech.mechanics.ConvertInteger; +import com.github.technus.tectech.mechanics.PlayerPersistence; import com.github.technus.tectech.mechanics.anomaly.AnomalyHandler; import com.github.technus.tectech.chunkData.ChunkDataHandler; import com.github.technus.tectech.mechanics.elementalMatter.core.commands.GiveEM; @@ -44,6 +45,7 @@ public class TecTech { public static ChunkDataHandler chunkDataHandler; public static AnomalyHandler anomalyHandler; + public static PlayerPersistence playerPersistence; /** * For Loader.isModLoaded checks during the runtime @@ -189,6 +191,8 @@ public class TecTech { MainLoader.postLoad(); chunkDataHandler.registerChunkMetaDataHandler(anomalyHandler=new AnomalyHandler()); + + playerPersistence=new PlayerPersistence("tec"); } @Mod.EventHandler diff --git a/src/main/java/com/github/technus/tectech/Util.java b/src/main/java/com/github/technus/tectech/Util.java index 53e9627187..6a8ab2d57e 100644 --- a/src/main/java/com/github/technus/tectech/Util.java +++ b/src/main/java/com/github/technus/tectech/Util.java @@ -3,6 +3,8 @@ package com.github.technus.tectech; import com.github.technus.tectech.thing.casing.TT_Container_Casings; import com.github.technus.tectech.thing.metaTileEntity.IFrontRotation; import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.ObfuscationReflectionHelper; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -12,19 +14,27 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.inventory.Container; import net.minecraft.inventory.ICrafting; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.CompressedStreamTools; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.World; +import net.minecraft.world.storage.IPlayerFileData; +import net.minecraft.world.storage.SaveHandler; import net.minecraftforge.fluids.FluidStack; import org.apache.commons.lang3.StringUtils; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; import java.lang.reflect.Field; import java.util.*; import java.util.regex.Matcher; @@ -1457,4 +1467,94 @@ public final class Util { int z=chunk.getCenterZPosition(); return world.checkChunksExist(x, 0, z, x, 0, z); } + + public static NBTTagCompound getPlayerData(EntityPlayer player,String extension) { + try { + if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { + if (player != null) { + IPlayerFileData playerNBTManagerObj = MinecraftServer.getServer().worldServerForDimension(0).getSaveHandler().getSaveHandler(); + SaveHandler sh = (SaveHandler)playerNBTManagerObj; + File dir = ObfuscationReflectionHelper.getPrivateValue(SaveHandler.class, sh, new String[]{"playersDirectory", "field_75771_c"}); + String id1=player.getUniqueID().toString(); + NBTTagCompound tagCompound=read(new File(dir, id1 + "."+extension)); + if(tagCompound!=null){ + return tagCompound; + } + tagCompound=readBackup(new File(dir, id1 + "."+extension+"_bak")); + if(tagCompound!=null){ + return tagCompound; + } + String id2=UUID.nameUUIDFromBytes(player.getCommandSenderName().getBytes()).toString(); + tagCompound=read(new File(dir, id2 + "."+extension)); + if(tagCompound!=null){ + return tagCompound; + } + tagCompound=readBackup(new File(dir, id2 + "."+extension+"_bak")); + if(tagCompound!=null){ + return tagCompound; + } + } + } + } catch (Exception var9) { + TecTech.LOGGER.fatal("Error reading data for: "+player.getCommandSenderName()); + } + return new NBTTagCompound(); + } + + public static void savePlayerFile(EntityPlayer player,String extension, NBTTagCompound data) { + try { + if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { + if (player != null) { + IPlayerFileData playerNBTManagerObj = MinecraftServer.getServer().worldServerForDimension(0).getSaveHandler().getSaveHandler(); + SaveHandler sh = (SaveHandler)playerNBTManagerObj; + File dir = ObfuscationReflectionHelper.getPrivateValue(SaveHandler.class, sh, new String[]{"playersDirectory", "field_75771_c"}); + String id1=player.getUniqueID().toString(); + write(new File(dir, id1 + "."+extension),data); + write(new File(dir, id1 + "."+extension+"_bak"),data); + String id2=UUID.nameUUIDFromBytes(player.getCommandSenderName().getBytes()).toString(); + write(new File(dir, id2 + "."+extension),data); + write(new File(dir, id2 + "."+extension+"_bak"),data); + } + } + } catch (Exception var10) { + TecTech.LOGGER.fatal("Error saving data for: "+player.getCommandSenderName()); + } + } + + private static NBTTagCompound read(File file){ + if (file != null && file.exists()) { + try(FileInputStream fileInputStream= new FileInputStream(file)) { + return CompressedStreamTools.readCompressed(fileInputStream); + } catch (Exception var9) { + TecTech.LOGGER.error("Cannot read NBT File: "+file.getAbsolutePath()); + } + } + return null; + } + + private static NBTTagCompound readBackup(File file){ + if (file != null && file.exists()) { + try(FileInputStream fileInputStream= new FileInputStream(file)) { + return CompressedStreamTools.readCompressed(fileInputStream); + } catch (Exception var9) { + TecTech.LOGGER.error("Cannot read NBT File: "+file.getAbsolutePath()); + return new NBTTagCompound(); + } + } + return null; + } + + private static void write(File file,NBTTagCompound tagCompound){ + if (file != null) { + if(tagCompound==null){ + if(file.exists()) file.delete(); + }else { + try(FileOutputStream fileOutputStream= new FileOutputStream(file)) { + CompressedStreamTools.writeCompressed(tagCompound,fileOutputStream); + } catch (Exception var9) { + TecTech.LOGGER.error("Cannot write NBT File: "+file.getAbsolutePath()); + } + } + } + } } diff --git a/src/main/java/com/github/technus/tectech/mechanics/PlayerPersistence.java b/src/main/java/com/github/technus/tectech/mechanics/PlayerPersistence.java new file mode 100644 index 0000000000..db57b1e563 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/PlayerPersistence.java @@ -0,0 +1,42 @@ +package com.github.technus.tectech.mechanics; + +import com.github.technus.tectech.Util; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; + +import java.util.HashMap; +import java.util.UUID; + +public class PlayerPersistence { + private final HashMap map=new HashMap<>(); + private final String extension; + + public PlayerPersistence(String extension) { + this.extension = extension; + } + + public final NBTTagCompound getData(EntityPlayer player){ + NBTTagCompound tag=map.get(player.getUniqueID()); + if(tag!=null){ + return tag; + } + tag=map.get(UUID.fromString(player.getCommandSenderName())); + if(tag!=null){ + return tag; + } + tag=Util.getPlayerData(player,extension); + if(tag!=null){ + map.put(player.getUniqueID(),tag); + map.put(UUID.fromString(player.getCommandSenderName()),tag); + } + return tag; + } + + public final void saveData(EntityPlayer player){ + NBTTagCompound tag=map.get(player.getUniqueID()); + if(tag==null){ + tag=map.get(UUID.fromString(player.getCommandSenderName())); + } + Util.savePlayerFile(player,extension,tag); + } +} diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java index ce79c42003..1692037d6b 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java @@ -6,31 +6,19 @@ import com.github.technus.tectech.chunkData.IChunkMetaDataHandler; import com.github.technus.tectech.loader.network.ChunkDataMessage; import com.github.technus.tectech.loader.network.NetworkDispatcher; import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.dAtomDefinition; -import cpw.mods.fml.common.eventhandler.EventPriority; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; -import crazypants.util.BaublesUtil; -import crazypants.util.GalacticraftUtil; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityClientPlayerMP; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; -import net.minecraftforge.common.util.FakePlayer; -import net.minecraftforge.event.entity.player.PlayerDropsEvent; -import net.minecraftforge.event.entity.player.PlayerEvent; import net.minecraftforge.event.world.ChunkEvent; import java.util.ArrayList; import java.util.HashMap; -import java.util.ListIterator; public class AnomalyHandler implements IChunkMetaDataHandler { private static final double SWAP_THRESHOLD = dAtomDefinition.getSomethingHeavy().getMass() * 10000D; @@ -141,6 +129,16 @@ public class AnomalyHandler implements IChunkMetaDataHandler { } } + @Override + public void tickRender(HashMap data, TickEvent.RenderTickEvent aEvent) { + EntityClientPlayerMP player=Minecraft.getMinecraft().thePlayer; + if(player!=null) { + player.setAngles((TecTech.RANDOM.nextFloat() - .5F)*4, (TecTech.RANDOM.nextFloat() - .5F)*4); + player.setVelocity(TecTech.RANDOM.nextFloat()*2-1,TecTech.RANDOM.nextFloat()*2-1,TecTech.RANDOM.nextFloat()*2-1); + player.setInvisible(TecTech.RANDOM.nextBoolean()); + } + } + @Override public void pullData(ChunkEvent.Load aEvent) { NetworkDispatcher.INSTANCE.sendToServer(new ChunkDataMessage.ChunkDataQuery(aEvent, this)); @@ -179,27 +177,4 @@ public class AnomalyHandler implements IChunkMetaDataHandler { } TecTech.chunkDataHandler.getChunkData(this, world).markForTransmissionToClient(chunk); } - - @SubscribeEvent - public void onPlayerClone(PlayerEvent.Clone evt) { - if (evt.wasDeath && !evt.isCanceled()) { - if (evt.original != null && evt.entityPlayer != null && !(evt.entityPlayer instanceof FakePlayer)) { - int i; - ItemStack item; - for (i = 0; i < evt.original.field_71071_by.field_70462_a.length; ++i) { - item = evt.original.field_71071_by.field_70462_a[i]; - if (this.isSoulBound(item) && this.addToPlayerInventory(evt.entityPlayer, item)) { - evt.original.field_71071_by.field_70462_a[i] = null; - } - } - - for (i = 0; i < evt.original.field_71071_by.field_70460_b.length; ++i) { - item = evt.original.field_71071_by.field_70460_b[i]; - if (this.isSoulBound(item) && this.addToPlayerInventory(evt.entityPlayer, item)) { - evt.original.field_71071_by.field_70460_b[i] = null; - } - } - } - } - } } -- cgit From f84958b8a1781d28b06eba3932d26869fd48e5e1 Mon Sep 17 00:00:00 2001 From: Tec Date: Mon, 15 Jul 2019 16:04:01 +0200 Subject: Extra features --- .../java/com/github/technus/tectech/TecTech.java | 6 +- src/main/java/com/github/technus/tectech/Util.java | 33 +++-- .../tectech/loader/network/NetworkDispatcher.java | 2 + .../tectech/loader/network/PlayerDataMessage.java | 89 ++++++++++++ .../tectech/mechanics/PlayerPersistence.java | 55 ++++++-- .../tectech/mechanics/anomaly/AnomalyHandler.java | 152 +++++++++++++++------ 6 files changed, 275 insertions(+), 62 deletions(-) create mode 100644 src/main/java/com/github/technus/tectech/loader/network/PlayerDataMessage.java diff --git a/src/main/java/com/github/technus/tectech/TecTech.java b/src/main/java/com/github/technus/tectech/TecTech.java index 76cdc56060..49b989f794 100644 --- a/src/main/java/com/github/technus/tectech/TecTech.java +++ b/src/main/java/com/github/technus/tectech/TecTech.java @@ -81,6 +81,10 @@ public class TecTech { moduleAdminErrorLogs = new IngameErrorLog(); } + playerPersistence=new PlayerPersistence("tec"); + FMLCommonHandler.instance().bus().register(playerPersistence); + MinecraftForge.EVENT_BUS.register(playerPersistence); + chunkDataHandler=new ChunkDataHandler(); FMLCommonHandler.instance().bus().register(chunkDataHandler); MinecraftForge.EVENT_BUS.register(chunkDataHandler); @@ -192,7 +196,6 @@ public class TecTech { chunkDataHandler.registerChunkMetaDataHandler(anomalyHandler=new AnomalyHandler()); - playerPersistence=new PlayerPersistence("tec"); } @Mod.EventHandler @@ -208,5 +211,6 @@ public class TecTech { @Mod.EventHandler public void onServerAboutToStart(FMLServerAboutToStartEvent aEvent) { chunkDataHandler.clearData(); + playerPersistence.clearData(); } } diff --git a/src/main/java/com/github/technus/tectech/Util.java b/src/main/java/com/github/technus/tectech/Util.java index 6a8ab2d57e..c98fefcd86 100644 --- a/src/main/java/com/github/technus/tectech/Util.java +++ b/src/main/java/com/github/technus/tectech/Util.java @@ -25,8 +25,10 @@ import net.minecraft.nbt.CompressedStreamTools; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.server.MinecraftServer; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; import net.minecraft.world.storage.IPlayerFileData; import net.minecraft.world.storage.SaveHandler; import net.minecraftforge.fluids.FluidStack; @@ -42,6 +44,7 @@ import java.util.regex.Pattern; import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; import static gregtech.api.enums.GT_Values.E; +import static java.nio.charset.Charset.forName; /** * Created by Tec on 21.03.2017. @@ -1468,14 +1471,14 @@ public final class Util { return world.checkChunksExist(x, 0, z, x, 0, z); } - public static NBTTagCompound getPlayerData(EntityPlayer player,String extension) { + public static NBTTagCompound getPlayerData(UUID uuid1,UUID uuid2,String extension) { try { if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { - if (player != null) { + if (uuid1 != null && uuid2!=null) { IPlayerFileData playerNBTManagerObj = MinecraftServer.getServer().worldServerForDimension(0).getSaveHandler().getSaveHandler(); SaveHandler sh = (SaveHandler)playerNBTManagerObj; File dir = ObfuscationReflectionHelper.getPrivateValue(SaveHandler.class, sh, new String[]{"playersDirectory", "field_75771_c"}); - String id1=player.getUniqueID().toString(); + String id1=uuid1.toString(); NBTTagCompound tagCompound=read(new File(dir, id1 + "."+extension)); if(tagCompound!=null){ return tagCompound; @@ -1484,7 +1487,7 @@ public final class Util { if(tagCompound!=null){ return tagCompound; } - String id2=UUID.nameUUIDFromBytes(player.getCommandSenderName().getBytes()).toString(); + String id2=uuid2.toString(); tagCompound=read(new File(dir, id2 + "."+extension)); if(tagCompound!=null){ return tagCompound; @@ -1495,9 +1498,7 @@ public final class Util { } } } - } catch (Exception var9) { - TecTech.LOGGER.fatal("Error reading data for: "+player.getCommandSenderName()); - } + } catch (Exception ignored) {} return new NBTTagCompound(); } @@ -1511,14 +1512,12 @@ public final class Util { String id1=player.getUniqueID().toString(); write(new File(dir, id1 + "."+extension),data); write(new File(dir, id1 + "."+extension+"_bak"),data); - String id2=UUID.nameUUIDFromBytes(player.getCommandSenderName().getBytes()).toString(); + String id2=UUID.nameUUIDFromBytes(player.getCommandSenderName().getBytes(forName("UTF-8"))).toString(); write(new File(dir, id2 + "."+extension),data); write(new File(dir, id2 + "."+extension+"_bak"),data); } } - } catch (Exception var10) { - TecTech.LOGGER.fatal("Error saving data for: "+player.getCommandSenderName()); - } + } catch (Exception ignored) {} } private static NBTTagCompound read(File file){ @@ -1557,4 +1556,16 @@ public final class Util { } } } + + public static AxisAlignedBB fromChunkCoordIntPair(ChunkCoordIntPair chunkCoordIntPair){ + int x=chunkCoordIntPair.chunkXPos<<4; + int z=chunkCoordIntPair.chunkZPos<<4; + return AxisAlignedBB.getBoundingBox(x,-128,z,x+16,512,z+16); + } + + public static AxisAlignedBB fromChunk(Chunk chunk){ + int x=chunk.xPosition<<4; + int z=chunk.zPosition<<4; + return AxisAlignedBB.getBoundingBox(x,-128,z,x+16,512,z+16); + } } diff --git a/src/main/java/com/github/technus/tectech/loader/network/NetworkDispatcher.java b/src/main/java/com/github/technus/tectech/loader/network/NetworkDispatcher.java index 56455a13c4..e424edd385 100644 --- a/src/main/java/com/github/technus/tectech/loader/network/NetworkDispatcher.java +++ b/src/main/java/com/github/technus/tectech/loader/network/NetworkDispatcher.java @@ -19,5 +19,7 @@ public class NetworkDispatcher extends eu.usrv.yamcore.network.PacketDispatcher registerMessage(RotationMessage.ClientHandler.class, RotationMessage.RotationData.class); registerMessage(ChunkDataMessage.ServerHandler.class, ChunkDataMessage.ChunkDataQuery.class); registerMessage(ChunkDataMessage.ClientHandler.class, ChunkDataMessage.ChunkDataData.class); + registerMessage(PlayerDataMessage.ServerHandler.class, PlayerDataMessage.PlayerDataQuery.class); + registerMessage(PlayerDataMessage.ClientHandler.class, PlayerDataMessage.PlayerDataData.class); } } diff --git a/src/main/java/com/github/technus/tectech/loader/network/PlayerDataMessage.java b/src/main/java/com/github/technus/tectech/loader/network/PlayerDataMessage.java new file mode 100644 index 0000000000..48a21423a9 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/loader/network/PlayerDataMessage.java @@ -0,0 +1,89 @@ +package com.github.technus.tectech.loader.network; + +import com.github.technus.tectech.TecTech; +import cpw.mods.fml.common.network.ByteBufUtils; +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import cpw.mods.fml.common.network.simpleimpl.MessageContext; +import eu.usrv.yamcore.network.client.AbstractClientMessageHandler; +import eu.usrv.yamcore.network.server.AbstractServerMessageHandler; +import io.netty.buffer.ByteBuf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; + +import java.util.UUID; + +import static java.nio.charset.Charset.forName; + +public class PlayerDataMessage implements IMessage { + NBTTagCompound data; + UUID uuid1,uuid2; + + public PlayerDataMessage(){} + + @Override + public void fromBytes(ByteBuf pBuffer) { + NBTTagCompound tag = ByteBufUtils.readTag(pBuffer); + uuid1=UUID.fromString(tag.getString("id1")); + uuid2=UUID.fromString(tag.getString("id2")); + if(tag.hasKey("data")){ + data=tag.getCompoundTag("data"); + } + } + + @Override + public void toBytes(ByteBuf pBuffer) { + NBTTagCompound tag = new NBTTagCompound(); + tag.setString("id1",uuid1.toString()); + tag.setString("id2",uuid2.toString()); + if(data!=null){ + tag.setTag("data",data); + } + ByteBufUtils.writeTag(pBuffer, tag); + } + + public static class PlayerDataQuery extends PlayerDataMessage { + public PlayerDataQuery() { + } + + public PlayerDataQuery(EntityPlayer player) { + uuid1=player.getUniqueID(); + uuid2=UUID.nameUUIDFromBytes(player.getCommandSenderName().getBytes(forName("UTF-8"))); + } + } + + public static class PlayerDataData extends PlayerDataMessage { + public PlayerDataData() { + } + + public PlayerDataData(EntityPlayer player){ + uuid1=player.getUniqueID(); + uuid2=UUID.nameUUIDFromBytes(player.getCommandSenderName().getBytes(forName("UTF-8"))); + data=TecTech.playerPersistence.getDataOrSetToNewTag(player); + } + + public PlayerDataData(PlayerDataQuery query){ + uuid1=query.uuid1; + uuid2=query.uuid2; + data= TecTech.playerPersistence.getDataOrSetToNewTag(uuid1,uuid2); + } + } + + public static class ClientHandler extends AbstractClientMessageHandler { + @Override + public IMessage handleClientMessage(EntityPlayer pPlayer, PlayerDataData pMessage, MessageContext pCtx) { + TecTech.playerPersistence.putDataOrSetToNewTag(pMessage.uuid1,pMessage.uuid2,pMessage.data); + return null; + } + } + + public static class ServerHandler extends AbstractServerMessageHandler { + @Override + public IMessage handleServerMessage(EntityPlayer pPlayer, PlayerDataQuery pMessage, MessageContext pCtx) { + if(pPlayer instanceof EntityPlayerMP){ + NetworkDispatcher.INSTANCE.sendTo(new PlayerDataData(pMessage),(EntityPlayerMP) pPlayer); + } + return null; + } + } +} diff --git a/src/main/java/com/github/technus/tectech/mechanics/PlayerPersistence.java b/src/main/java/com/github/technus/tectech/mechanics/PlayerPersistence.java index db57b1e563..72416c3e0c 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/PlayerPersistence.java +++ b/src/main/java/com/github/technus/tectech/mechanics/PlayerPersistence.java @@ -1,12 +1,19 @@ package com.github.technus.tectech.mechanics; import com.github.technus.tectech.Util; +import com.github.technus.tectech.loader.network.NetworkDispatcher; +import com.github.technus.tectech.loader.network.PlayerDataMessage; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.PlayerEvent; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.nbt.NBTTagCompound; import java.util.HashMap; import java.util.UUID; +import static java.nio.charset.Charset.forName; + public class PlayerPersistence { private final HashMap map=new HashMap<>(); private final String extension; @@ -15,28 +22,52 @@ public class PlayerPersistence { this.extension = extension; } - public final NBTTagCompound getData(EntityPlayer player){ - NBTTagCompound tag=map.get(player.getUniqueID()); + public NBTTagCompound getDataOrSetToNewTag(UUID uuid1, UUID uuid2){ + NBTTagCompound tag=map.get(uuid1); if(tag!=null){ return tag; } - tag=map.get(UUID.fromString(player.getCommandSenderName())); + tag=map.get(uuid2); if(tag!=null){ return tag; } - tag=Util.getPlayerData(player,extension); - if(tag!=null){ - map.put(player.getUniqueID(),tag); - map.put(UUID.fromString(player.getCommandSenderName()),tag); + tag=Util.getPlayerData(uuid1,uuid2,extension); + if(tag==null){ + tag=new NBTTagCompound(); } + map.put(uuid1,tag); + map.put(uuid2,tag); return tag; } - public final void saveData(EntityPlayer player){ - NBTTagCompound tag=map.get(player.getUniqueID()); - if(tag==null){ - tag=map.get(UUID.fromString(player.getCommandSenderName())); + public NBTTagCompound getDataOrSetToNewTag(EntityPlayer player){ + return getDataOrSetToNewTag(player.getUniqueID(),UUID.nameUUIDFromBytes(player.getCommandSenderName().getBytes(forName("UTF-8")))); + } + + public void putDataOrSetToNewTag(UUID uuid1, UUID uuid2, NBTTagCompound tagCompound){ + if(tagCompound==null){ + tagCompound=new NBTTagCompound(); } - Util.savePlayerFile(player,extension,tag); + map.put(uuid1,tagCompound); + map.put(uuid2,tagCompound); + } + + public void putDataOrSetToNewTag(EntityPlayer player, NBTTagCompound tagCompound){ + putDataOrSetToNewTag(player.getUniqueID(),UUID.nameUUIDFromBytes(player.getCommandSenderName().getBytes(forName("UTF-8"))),tagCompound); + } + + public void saveData(EntityPlayer player){ + Util.savePlayerFile(player,extension,getDataOrSetToNewTag(player)); + } + + @SubscribeEvent + public void onLogin(PlayerEvent.PlayerLoggedInEvent event){ + if(event.player instanceof EntityPlayerMP){ + NetworkDispatcher.INSTANCE.sendTo(new PlayerDataMessage.PlayerDataData(event.player),(EntityPlayerMP)event.player); + } + } + + public void clearData() { + map.clear(); } } diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java index 1692037d6b..3a932ec53b 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java @@ -1,17 +1,28 @@ package com.github.technus.tectech.mechanics.anomaly; import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.Util; import com.github.technus.tectech.chunkData.ChunkDataHandler; import com.github.technus.tectech.chunkData.IChunkMetaDataHandler; +import com.github.technus.tectech.loader.MainLoader; import com.github.technus.tectech.loader.network.ChunkDataMessage; import com.github.technus.tectech.loader.network.NetworkDispatcher; +import com.github.technus.tectech.loader.network.PlayerDataMessage; import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.dAtomDefinition; import cpw.mods.fml.common.gameevent.TickEvent; +import gregtech.api.GregTech_API; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.Vec3; import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; @@ -19,11 +30,13 @@ import net.minecraftforge.event.world.ChunkEvent; import java.util.ArrayList; import java.util.HashMap; +import java.util.List; public class AnomalyHandler implements IChunkMetaDataHandler { private static final double SWAP_THRESHOLD = dAtomDefinition.getSomethingHeavy().getMass() * 10000D; - private static final double PER_PARTICLE=SWAP_THRESHOLD/32; - private static final String INTENSITY = "intensity"; + private static final int COUNT_DIV=32; + private static final double PER_PARTICLE=SWAP_THRESHOLD/COUNT_DIV; + private static final String INTENSITY = "intensity",SPACE_CANCER="space_cancer"; private static final int MEAN_DELAY =50; @Override @@ -64,44 +77,84 @@ public class AnomalyHandler implements IChunkMetaDataHandler { data.get(dim).get(b.getChunkCoordIntPair()).setDouble(INTENSITY, Math.min(SWAP_THRESHOLD,avg * (TecTech.RANDOM.nextFloat()+.5F) * 0.5F)); data.get(dim).markForTransmissionToClient(a.getChunkCoordIntPair()); data.get(dim).markForTransmissionToClient(b.getChunkCoordIntPair()); - swapSomething(a, b); + swapSomething(a, b,avg); } } } - private void swapSomething(Chunk a,Chunk b){ - for(int i=0;i<128;i++){ - int x=TecTech.RANDOM.nextInt(16); - int y=TecTech.RANDOM.nextInt(a.worldObj.getActualHeight()); - int z=TecTech.RANDOM.nextInt(16); - Block aBlock=a.getBlock(x,y,z); - Block bBlock=a.getBlock(x,y,z); - int aMeta=a.getBlockMetadata(x,y,z); - int bMeta=a.getBlockMetadata(x,y,z); - if(a.getTileEntityUnsafe(x,y,z)==null&&b.getTileEntityUnsafe(x,y,z)==null){ - a.worldObj.setBlock((a.xPosition<<4)+x,y,(a.zPosition<<4)+z,bBlock,bMeta,3); - b.worldObj.setBlock((b.xPosition<<4)+x,y,(b.zPosition<<4)+z,aBlock,aMeta,3); - }else if(a.getTileEntityUnsafe(x,y,z)==null){ - a.worldObj.setBlockToAir((a.xPosition<<4)+x,y,(a.zPosition<<4)+z); - b.worldObj.setBlock((b.xPosition<<4)+x,y,(b.zPosition<<4)+z,aBlock,aMeta,3); - }else if(b.getTileEntityUnsafe(x,y,z)==null){ - a.worldObj.setBlock((a.xPosition<<4)+x,y,(a.zPosition<<4)+z,bBlock,bMeta,3); - b.worldObj.setBlockToAir((b.xPosition<<4)+x,y,(b.zPosition<<4)+z); - }else{ - a.worldObj.setBlockToAir((a.xPosition<<4)+x,y,(a.zPosition<<4)+z); - b.worldObj.setBlockToAir((b.xPosition<<4)+x,y,(b.zPosition<<4)+z); + private void swapSomething(Chunk a,Chunk b,double avg) { + for (int i = 0; i < 64; i++) { + int x = TecTech.RANDOM.nextInt(16); + int y = TecTech.RANDOM.nextInt(a.worldObj.getActualHeight()); + int z = TecTech.RANDOM.nextInt(16); + Block aBlock = a.getBlock(x, y, z); + Block bBlock = a.getBlock(x, y, z); + int aMeta = a.getBlockMetadata(x, y, z); + int bMeta = a.getBlockMetadata(x, y, z); + if (a.getTileEntityUnsafe(x, y, z) == null && b.getTileEntityUnsafe(x, y, z) == null) { + a.worldObj.setBlock((a.xPosition << 4) + x, y, (a.zPosition << 4) + z, bBlock, bMeta, 3); + b.worldObj.setBlock((b.xPosition << 4) + x, y, (b.zPosition << 4) + z, aBlock, aMeta, 3); + } else if (a.getTileEntityUnsafe(x, y, z) == null) { + b.worldObj.setBlock((b.xPosition << 4) + x, y, (b.zPosition << 4) + z, aBlock, aMeta, 3); + a.worldObj.setBlockToAir((a.xPosition << 4) + x, y, (a.zPosition << 4) + z); + if (TecTech.RANDOM.nextBoolean()) { + a.worldObj.createExplosion(null, (a.xPosition << 4) + x + .5, y + .5, (a.zPosition << 4) + z + .5, (float) Math.log10(avg), true); + GT_Utility.sendSoundToPlayers(a.worldObj, GregTech_API.sSoundList.get(209), 1.0F, -1, (a.xPosition << 4) + x, y, (a.zPosition << 4) + z); + } + } else if (b.getTileEntityUnsafe(x, y, z) == null) { + a.worldObj.setBlock((a.xPosition << 4) + x, y, (a.zPosition << 4) + z, bBlock, bMeta, 3); + b.worldObj.setBlockToAir((b.xPosition << 4) + x, y, (b.zPosition << 4) + z); + if (TecTech.RANDOM.nextBoolean()) { + b.worldObj.createExplosion(null, (b.xPosition << 4) + x + .5, y + .5, (b.zPosition << 4) + z + .5, (float) Math.log10(avg), true); + GT_Utility.sendSoundToPlayers(b.worldObj, GregTech_API.sSoundList.get(209), 1.0F, -1, (b.xPosition << 4) + x, y, (b.zPosition << 4) + z); + } + } else { + if (TecTech.RANDOM.nextBoolean()) { + a.worldObj.setBlockToAir((a.xPosition << 4) + x, y, (a.zPosition << 4) + z); + a.worldObj.createExplosion(null, (a.xPosition << 4) + x + .5, y + .5, (a.zPosition << 4) + z + .5, (float) Math.log10(avg), true); + GT_Utility.sendSoundToPlayers(a.worldObj, GregTech_API.sSoundList.get(209), 1.0F, -1, (a.xPosition << 4) + x, y, (a.zPosition << 4) + z); + } + if (TecTech.RANDOM.nextBoolean()) { + b.worldObj.setBlockToAir((b.xPosition << 4) + x, y, (b.zPosition << 4) + z); + b.worldObj.createExplosion(null, (b.xPosition << 4) + x + .5, y + .5, (b.zPosition << 4) + z + .5, (float) Math.log10(avg), true); + GT_Utility.sendSoundToPlayers(b.worldObj, GregTech_API.sSoundList.get(209), 1.0F, -1, (b.xPosition << 4) + x, y, (b.zPosition << 4) + z); + } } } + int x = (b.xPosition - a.xPosition) << 4; + int z = (b.xPosition - a.xPosition) << 4; + List aE = a.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, Util.fromChunk(a)); + List bE = b.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, Util.fromChunk(b)); + aE.forEach(o -> { + if (TecTech.RANDOM.nextBoolean()) { + Vec3 pos = ((EntityLivingBase) o).getPosition(1); + ((EntityLivingBase) o).setPositionAndUpdate(pos.xCoord + x, pos.yCoord, pos.zCoord + z); + ((EntityLivingBase) o).attackEntityFrom(MainLoader.subspace,18); + if(o instanceof EntityPlayer){ + ((EntityPlayer) o).addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 200)); + } + } + }); + bE.forEach(o -> { + if (TecTech.RANDOM.nextBoolean()) { + Vec3 pos = ((EntityLivingBase) o).getPosition(1); + ((EntityLivingBase) o).setPositionAndUpdate(pos.xCoord - x, pos.yCoord, pos.zCoord - z); + ((EntityLivingBase) o).attackEntityFrom(MainLoader.subspace,18); + if(o instanceof EntityPlayer){ + ((EntityPlayer) o).addPotionEffect(new PotionEffect(Potion.digSpeed.id, 200)); + } + } + }); } @Override public void tickPlayer(HashMap data, TickEvent.PlayerTickEvent aEvent) { if (aEvent.side.isClient()) { - EntityClientPlayerMP player=Minecraft.getMinecraft().thePlayer; + EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer; ChunkCoordIntPair pair = new ChunkCoordIntPair(player.chunkCoordX, player.chunkCoordZ); NBTTagCompound compound = data.get(player.worldObj.provider.dimensionId).get(pair); if (compound != null) { - for (int i = 0, pow = (int)Math.min(32,compound.getDouble(INTENSITY) / PER_PARTICLE); i < pow; i++) { + for (int i = 0, badness = (int) Math.min(COUNT_DIV, compound.getDouble(INTENSITY) / PER_PARTICLE); i < badness; i++) { TecTech.proxy.em_particle(player.worldObj, player.posX - 32D + TecTech.RANDOM.nextFloat() * 64D, player.posY - 32D + TecTech.RANDOM.nextFloat() * 64D, @@ -111,7 +164,7 @@ public class AnomalyHandler implements IChunkMetaDataHandler { data.get(player.worldObj.provider.dimensionId).forEach((chunkCoordIntPair, dat) -> { if (Math.abs(chunkCoordIntPair.getCenterXPos() - player.posX) + Math.abs(chunkCoordIntPair.getCenterZPosition() - player.posZ) < 256) { - for (int i = 0, pow = (int)Math.min(32,dat.getDouble(INTENSITY) / PER_PARTICLE); i < pow; i++) { + for (int i = 0, pow = (int) Math.min(32, dat.getDouble(INTENSITY) / PER_PARTICLE); i < pow; i++) { TecTech.proxy.em_particle(player.worldObj, (chunkCoordIntPair.chunkXPos << 4) + TecTech.RANDOM.nextFloat() * 48D - 16D, player.posY + TecTech.RANDOM.nextFloat() * 128D - 64D, @@ -119,23 +172,46 @@ public class AnomalyHandler implements IChunkMetaDataHandler { } } }); - } - } - - @Override - public void tickServer(HashMap data, TickEvent.ServerTickEvent event) { - if(event.side.isServer()){ - + } else if (TecTech.RANDOM.nextInt(50) == 0) { + EntityPlayer player = aEvent.player; + ChunkCoordIntPair pair = new ChunkCoordIntPair(player.chunkCoordX, player.chunkCoordZ); + NBTTagCompound compound = data.get(player.worldObj.provider.dimensionId).get(pair); + NBTTagCompound playerTag = TecTech.playerPersistence.getDataOrSetToNewTag(player); + if(player.capabilities.isCreativeMode){ + playerTag.setDouble(SPACE_CANCER, 0); + }else { + if (compound != null) { + int badness = (int) Math.min(COUNT_DIV, compound.getDouble(INTENSITY) / PER_PARTICLE); + if (badness > 0) { + playerTag.setDouble(SPACE_CANCER, Math.min(2, playerTag.getDouble(SPACE_CANCER) + 9.765625E-4f * badness)); + player.attackEntityFrom(MainLoader.subspace,Math.max(1,badness/8f)); + } + } else if (playerTag.getDouble(SPACE_CANCER) > 0) { + playerTag.setDouble(SPACE_CANCER, Math.max(0, playerTag.getDouble(SPACE_CANCER) - 7.6293945E-6f)); + } + } + TecTech.playerPersistence.saveData(player); + NetworkDispatcher.INSTANCE.sendTo(new PlayerDataMessage.PlayerDataData(player), (EntityPlayerMP) player); } } @Override public void tickRender(HashMap data, TickEvent.RenderTickEvent aEvent) { EntityClientPlayerMP player=Minecraft.getMinecraft().thePlayer; - if(player!=null) { - player.setAngles((TecTech.RANDOM.nextFloat() - .5F)*4, (TecTech.RANDOM.nextFloat() - .5F)*4); - player.setVelocity(TecTech.RANDOM.nextFloat()*2-1,TecTech.RANDOM.nextFloat()*2-1,TecTech.RANDOM.nextFloat()*2-1); - player.setInvisible(TecTech.RANDOM.nextBoolean()); + if(player!=null && !player.capabilities.isCreativeMode) { + NBTTagCompound tagCompound=TecTech.playerPersistence.getDataOrSetToNewTag(Minecraft.getMinecraft().thePlayer); + if(tagCompound!=null) { + float cancer = tagCompound.getFloat(SPACE_CANCER); + if (cancer > 0) { + player.setAngles((TecTech.RANDOM.nextFloat() - .5F) * 4 * cancer, (TecTech.RANDOM.nextFloat() - .5F) * 4 * cancer); + player.setInvisible(TecTech.RANDOM.nextFloat() * 2 < cancer); + if (cancer > 1.9f) { + player.setVelocity((TecTech.RANDOM.nextFloat() - .5F) * cancer*cancer/2, (TecTech.RANDOM.nextFloat() - .5F) * cancer*cancer/2, (TecTech.RANDOM.nextFloat() - .5F) * cancer*cancer/2); + } else{ + player.addVelocity((TecTech.RANDOM.nextFloat() - .5F) * cancer*cancer/2, (TecTech.RANDOM.nextFloat() - .5F) * cancer*cancer/2, (TecTech.RANDOM.nextFloat() - .5F) * cancer*cancer/2); + } + } + } } } -- cgit From 69e760223bc47e41fee609f9dc269ef0538ff805 Mon Sep 17 00:00:00 2001 From: Tec Date: Mon, 15 Jul 2019 16:27:58 +0200 Subject: Fix gui --- .../thing/metaTileEntity/multi/base/GT_Container_MultiMachineEM.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 0ad5aa48ca..dd2eb0a7be 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 @@ -151,7 +151,7 @@ public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { allowedToWork = (par2 & 4) == 4; } else if(par1>=128 && par1<208){ int pos=(par1-128)>>2; - eParamsIn[pos]=Util.receiveDouble(eParamsIn[pos],par1&0xFFFFFFFC,par1,par2); + eParamsOut[pos]=Util.receiveDouble(eParamsOut[pos],par1&0xFFFFFFFC,par1,par2); }else if(par1>=208 && par1<288){ int pos=(par1-208)>>2; eParamsIn[pos]=Util.receiveDouble(eParamsIn[pos],par1&0xFFFFFFFC,par1,par2); -- cgit From d35f9b61c8d480d616238c21ba78ac3b7e4f79e7 Mon Sep 17 00:00:00 2001 From: Tec Date: Mon, 15 Jul 2019 17:31:20 +0200 Subject: Fix just in case. --- .../tectech/mechanics/anomaly/AnomalyHandler.java | 30 ++++++++++++++-------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java index 3a932ec53b..fcc0242432 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java @@ -39,6 +39,8 @@ public class AnomalyHandler implements IChunkMetaDataHandler { private static final String INTENSITY = "intensity",SPACE_CANCER="space_cancer"; private static final int MEAN_DELAY =50; + private boolean fixMe=false; + @Override public String getTagName() { return "anomaly"; @@ -198,20 +200,26 @@ public class AnomalyHandler implements IChunkMetaDataHandler { @Override public void tickRender(HashMap data, TickEvent.RenderTickEvent aEvent) { EntityClientPlayerMP player=Minecraft.getMinecraft().thePlayer; - if(player!=null && !player.capabilities.isCreativeMode) { - NBTTagCompound tagCompound=TecTech.playerPersistence.getDataOrSetToNewTag(Minecraft.getMinecraft().thePlayer); - if(tagCompound!=null) { - float cancer = tagCompound.getFloat(SPACE_CANCER); - if (cancer > 0) { - player.setAngles((TecTech.RANDOM.nextFloat() - .5F) * 4 * cancer, (TecTech.RANDOM.nextFloat() - .5F) * 4 * cancer); - player.setInvisible(TecTech.RANDOM.nextFloat() * 2 < cancer); - if (cancer > 1.9f) { - player.setVelocity((TecTech.RANDOM.nextFloat() - .5F) * cancer*cancer/2, (TecTech.RANDOM.nextFloat() - .5F) * cancer*cancer/2, (TecTech.RANDOM.nextFloat() - .5F) * cancer*cancer/2); - } else{ - player.addVelocity((TecTech.RANDOM.nextFloat() - .5F) * cancer*cancer/2, (TecTech.RANDOM.nextFloat() - .5F) * cancer*cancer/2, (TecTech.RANDOM.nextFloat() - .5F) * cancer*cancer/2); + if(player!=null) { + if(player.capabilities.isCreativeMode) { + NBTTagCompound tagCompound = TecTech.playerPersistence.getDataOrSetToNewTag(Minecraft.getMinecraft().thePlayer); + if (tagCompound != null) { + float cancer = tagCompound.getFloat(SPACE_CANCER); + if (cancer > 0) { + player.setAngles((TecTech.RANDOM.nextFloat() - .5F) * 4 * cancer, (TecTech.RANDOM.nextFloat() - .5F) * 4 * cancer); + player.setInvisible(fixMe = TecTech.RANDOM.nextFloat() * 2 < cancer); + if (cancer > 1.9f) { + player.setVelocity((TecTech.RANDOM.nextFloat() - .5F) * cancer * cancer / 2, (TecTech.RANDOM.nextFloat() - .5F) * cancer * cancer / 2, (TecTech.RANDOM.nextFloat() - .5F) * cancer * cancer / 2); + } else { + player.addVelocity((TecTech.RANDOM.nextFloat() - .5F) * cancer * cancer / 2, (TecTech.RANDOM.nextFloat() - .5F) * cancer * cancer / 2, (TecTech.RANDOM.nextFloat() - .5F) * cancer * cancer / 2); + } } } } + if (fixMe){ + player.setInvisible(false); + fixMe=false; + } } } -- cgit From 0f367b0d1d46c93ea39ae191d37d2359a6dc2d4c Mon Sep 17 00:00:00 2001 From: Tec Date: Mon, 15 Jul 2019 17:37:19 +0200 Subject: refactor classes --- .../java/com/github/technus/tectech/TecTech.java | 8 +- .../tectech/chunkData/ChunkDataHandler.java | 363 --------------------- .../tectech/chunkData/IChunkMetaDataHandler.java | 34 -- .../technus/tectech/chunkData/WorldData.java | 52 --- .../technus/tectech/loader/ElementalLoader.java | 40 +++ .../technus/tectech/loader/EntityLoader.java | 18 + .../github/technus/tectech/loader/MainLoader.java | 3 - .../technus/tectech/loader/NetworkDispatcher.java | 30 ++ .../tectech/loader/entity/EntityLoader.java | 18 - .../tectech/loader/mechanics/ElementalLoader.java | 40 --- .../tectech/loader/network/ChunkDataMessage.java | 101 ------ .../tectech/loader/network/NetworkDispatcher.java | 25 -- .../loader/network/PipeActivityMessage.java | 134 -------- .../tectech/loader/network/PlayerDataMessage.java | 89 ----- .../tectech/loader/network/RotationMessage.java | 140 -------- .../technus/tectech/mechanics/ConvertFloat.java | 76 ----- .../technus/tectech/mechanics/ConvertInteger.java | 76 ----- .../tectech/mechanics/PlayerPersistence.java | 73 ----- .../tectech/mechanics/anomaly/AnomalyHandler.java | 10 +- .../tectech/mechanics/commands/ConvertFloat.java | 76 +++++ .../tectech/mechanics/commands/ConvertInteger.java | 76 +++++ .../tectech/mechanics/data/ChunkDataHandler.java | 363 +++++++++++++++++++++ .../tectech/mechanics/data/ChunkDataMessage.java | 101 ++++++ .../mechanics/data/IChunkMetaDataHandler.java | 34 ++ .../tectech/mechanics/data/PlayerDataMessage.java | 90 +++++ .../tectech/mechanics/data/PlayerPersistence.java | 72 ++++ .../technus/tectech/mechanics/data/WorldData.java | 52 +++ .../thing/metaTileEntity/RotationMessage.java | 139 ++++++++ .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 4 +- .../pipe/GT_MetaTileEntity_Pipe_Data.java | 3 +- .../pipe/GT_MetaTileEntity_Pipe_EM.java | 3 +- .../pipe/GT_MetaTileEntity_Pipe_Energy.java | 3 +- .../metaTileEntity/pipe/PipeActivityMessage.java | 133 ++++++++ 33 files changed, 1238 insertions(+), 1241 deletions(-) delete mode 100644 src/main/java/com/github/technus/tectech/chunkData/ChunkDataHandler.java delete mode 100644 src/main/java/com/github/technus/tectech/chunkData/IChunkMetaDataHandler.java delete mode 100644 src/main/java/com/github/technus/tectech/chunkData/WorldData.java create mode 100644 src/main/java/com/github/technus/tectech/loader/ElementalLoader.java create mode 100644 src/main/java/com/github/technus/tectech/loader/EntityLoader.java create mode 100644 src/main/java/com/github/technus/tectech/loader/NetworkDispatcher.java delete mode 100644 src/main/java/com/github/technus/tectech/loader/entity/EntityLoader.java delete mode 100644 src/main/java/com/github/technus/tectech/loader/mechanics/ElementalLoader.java delete mode 100644 src/main/java/com/github/technus/tectech/loader/network/ChunkDataMessage.java delete mode 100644 src/main/java/com/github/technus/tectech/loader/network/NetworkDispatcher.java delete mode 100644 src/main/java/com/github/technus/tectech/loader/network/PipeActivityMessage.java delete mode 100644 src/main/java/com/github/technus/tectech/loader/network/PlayerDataMessage.java delete mode 100644 src/main/java/com/github/technus/tectech/loader/network/RotationMessage.java delete mode 100644 src/main/java/com/github/technus/tectech/mechanics/ConvertFloat.java delete mode 100644 src/main/java/com/github/technus/tectech/mechanics/ConvertInteger.java delete mode 100644 src/main/java/com/github/technus/tectech/mechanics/PlayerPersistence.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/commands/ConvertFloat.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/commands/ConvertInteger.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/data/ChunkDataHandler.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/data/ChunkDataMessage.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/data/IChunkMetaDataHandler.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/data/PlayerDataMessage.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/data/PlayerPersistence.java create mode 100644 src/main/java/com/github/technus/tectech/mechanics/data/WorldData.java create mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/RotationMessage.java create mode 100644 src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/PipeActivityMessage.java diff --git a/src/main/java/com/github/technus/tectech/TecTech.java b/src/main/java/com/github/technus/tectech/TecTech.java index 49b989f794..493d3aa115 100644 --- a/src/main/java/com/github/technus/tectech/TecTech.java +++ b/src/main/java/com/github/technus/tectech/TecTech.java @@ -2,11 +2,11 @@ package com.github.technus.tectech; import com.github.technus.tectech.loader.MainLoader; import com.github.technus.tectech.loader.TecTechConfig; -import com.github.technus.tectech.mechanics.ConvertFloat; -import com.github.technus.tectech.mechanics.ConvertInteger; -import com.github.technus.tectech.mechanics.PlayerPersistence; +import com.github.technus.tectech.mechanics.commands.ConvertFloat; +import com.github.technus.tectech.mechanics.commands.ConvertInteger; import com.github.technus.tectech.mechanics.anomaly.AnomalyHandler; -import com.github.technus.tectech.chunkData.ChunkDataHandler; +import com.github.technus.tectech.mechanics.data.ChunkDataHandler; +import com.github.technus.tectech.mechanics.data.PlayerPersistence; import com.github.technus.tectech.mechanics.elementalMatter.core.commands.GiveEM; import com.github.technus.tectech.mechanics.elementalMatter.core.commands.ListEM; import com.github.technus.tectech.proxy.CommonProxy; diff --git a/src/main/java/com/github/technus/tectech/chunkData/ChunkDataHandler.java b/src/main/java/com/github/technus/tectech/chunkData/ChunkDataHandler.java deleted file mode 100644 index 108e762af0..0000000000 --- a/src/main/java/com/github/technus/tectech/chunkData/ChunkDataHandler.java +++ /dev/null @@ -1,363 +0,0 @@ -package com.github.technus.tectech.chunkData; - -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.ChunkCoordIntPair; -import net.minecraftforge.event.world.ChunkDataEvent; -import net.minecraftforge.event.world.ChunkEvent; -import net.minecraftforge.event.world.WorldEvent; - -import java.util.*; - -public class ChunkDataHandler { - private final String BASE_TAG_NAME ="TecTechData"; - private final HashMap> dimensionWiseChunkData=new HashMap<>(); - private final HashMap> dimensionWiseMetaChunkData=new HashMap<>(); - private final HashMap metaDataHandlerHashMap =new HashMap<>(); - private final ArrayList pushSyncHandlers =new ArrayList<>(); - private final ArrayList pullSyncHandlers =new ArrayList<>(); - private final ArrayList serverHandlers=new ArrayList<>(); - private final ArrayList worldHandlers=new ArrayList<>(); - private final ArrayList playerHandlers=new ArrayList<>(); - private final ArrayList clientHandlers=new ArrayList<>(); - private final ArrayList renderHandlers=new ArrayList<>(); - - @SubscribeEvent - public void onWorldLoad(WorldEvent.Load event){ - int dim=event.world.provider.dimensionId; - dimensionWiseChunkData.computeIfAbsent(dim, m->{ - HashMap map = new HashMap<>(); - for (Map.Entry meta : metaDataHandlerHashMap.entrySet()) { - dimensionWiseMetaChunkData.get(meta.getKey()).put(dim, new ChunkHashMap(meta.getValue(), map)); - } - return map; - }); - } - - @SubscribeEvent - public void handleChunkSaveEvent(ChunkDataEvent.Save event) { - HashMap dimensionData = dimensionWiseChunkData.get(event.world.provider.dimensionId); - NBTChunk chunkData = dimensionData != null ? dimensionData.get(event.getChunk().getChunkCoordIntPair()) : null; - if (chunkData == null) { - event.getData().removeTag(BASE_TAG_NAME); - } else { - chunkData.isLoaded = true; - event.getData().setTag(BASE_TAG_NAME, chunkData.data); - } - } - - @SubscribeEvent - public void handleChunkLoadEvent(ChunkDataEvent.Load event) { - NBTTagCompound loadedTag = event.getData().getCompoundTag(BASE_TAG_NAME); - if (loadedTag.hasNoTags()) { - return; - } - int dimId = event.world.provider.dimensionId; - HashMap dimensionMemory = dimensionWiseChunkData.get(dimId); - ChunkCoordIntPair chunkCoordIntPair = event.getChunk().getChunkCoordIntPair(); - Set loadedKeys = loadedTag.func_150296_c(); - NBTChunk chunkMemory = dimensionMemory.get(chunkCoordIntPair); - if (chunkMemory == null) { - chunkMemory = new NBTChunk(loadedTag, true); - dimensionMemory.put(chunkCoordIntPair, chunkMemory); - for (String s : loadedKeys) { - dimensionWiseMetaChunkData.get(s).get(dimId).putLoaded(chunkCoordIntPair, loadedTag.getCompoundTag(s)); - } - } else if (!chunkMemory.isLoaded) { - chunkMemory.isLoaded = true; - - Set tagsDuplicated = new HashSet(loadedKeys); - tagsDuplicated.retainAll(chunkMemory.data.func_150296_c()); - - if (tagsDuplicated.isEmpty()) { - for (String s : loadedKeys) { - NBTTagCompound tag = loadedTag.getCompoundTag(s); - chunkMemory.data.setTag(s, tag); - dimensionWiseMetaChunkData.get(s).get(dimId).putLoaded(chunkCoordIntPair, tag); - } - } else { - for (String s : loadedKeys) { - NBTTagCompound memory = chunkMemory.data.getCompoundTag(s); - if (tagsDuplicated.contains(s)) { - metaDataHandlerHashMap.get(s).mergeData(memory, loadedTag.getCompoundTag(s)); - } else { - chunkMemory.data.setTag(s, loadedTag.getCompoundTag(s)); - dimensionWiseMetaChunkData.get(s).get(dimId).putLoaded(chunkCoordIntPair, memory); - } - } - } - } - } - - @SideOnly(Side.CLIENT) - @SubscribeEvent - public void onLoadChunk(ChunkEvent.Load aEvent){ - pullSyncHandlers.forEach(chunkMetaDataHandler -> chunkMetaDataHandler.pullData(aEvent)); - } - - @SideOnly(Side.CLIENT) - @SubscribeEvent - public void onUnLoadChunk(ChunkEvent.Unload aEvent){ - pullSyncHandlers.forEach(chunkMetaDataHandler -> dimensionWiseMetaChunkData - .get(chunkMetaDataHandler.getTagName()) - .get(aEvent.world.provider.dimensionId) - .remove(aEvent.getChunk().getChunkCoordIntPair())); - } - - @SideOnly(Side.CLIENT) - @SubscribeEvent - public void onClientTickEvent(TickEvent.ClientTickEvent aEvent) { - clientHandlers.forEach(chunkMetaDataHandler -> - chunkMetaDataHandler.tickClient( - dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), aEvent)); - } - - @SideOnly(Side.CLIENT) - @SubscribeEvent - public void onRenderTickEvent(TickEvent.RenderTickEvent aEvent) { - renderHandlers.forEach(chunkMetaDataHandler -> - chunkMetaDataHandler.tickRender( - dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), aEvent)); - } - - @SubscribeEvent - public void onServerTickEvent(TickEvent.ServerTickEvent aEvent) { - serverHandlers.forEach(chunkMetaDataHandler -> - chunkMetaDataHandler.tickServer( - dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), aEvent)); - } - - @SubscribeEvent - public void onWorldTickEvent(TickEvent.WorldTickEvent aEvent) { - if(aEvent.side.isServer()) { - int dim = aEvent.world.provider.dimensionId; - pushSyncHandlers.forEach(chunkMetaDataHandler -> { - ChunkHashMap data = dimensionWiseMetaChunkData - .get(chunkMetaDataHandler.getTagName()).get(dim); - int cycle = chunkMetaDataHandler.pushPayloadSpreadPeriod(); - int epoch = (int) (aEvent.world.getTotalWorldTime() % cycle); - ArrayList work; - if (epoch == 0) { - int per = data.dirtyBoys.size() / cycle; - int mod = data.dirtyBoys.size() % cycle; - Iterator iter = data.dirtyBoys.iterator(); - for (int periodWork = 0; periodWork < cycle; periodWork++) { - work = data.workLoad.get(periodWork); - for (int i = 0; i < per; i++) { - work.add(iter.next()); - } - if (periodWork < mod) { - work.add(iter.next()); - } - } - data.dirtyBoys.clear(); - } - work = data.workLoad.get(epoch); - chunkMetaDataHandler.pushPayload(dim, work); - work.clear(); - }); - worldHandlers.forEach(chunkMetaDataHandler -> - chunkMetaDataHandler.tickWorld( - dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), aEvent)); - } - } - - @SubscribeEvent - public void onPlayerTickEvent(TickEvent.PlayerTickEvent aEvent) { - playerHandlers.forEach(chunkMetaDataHandler -> - chunkMetaDataHandler.tickPlayer( - dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), aEvent)); - } - - - public void clearData() { - dimensionWiseChunkData.clear(); - dimensionWiseMetaChunkData.forEach((k,v)->v.clear()); - } - - public IChunkMetaDataHandler getChunkMetaDataHandler(String s){ - return metaDataHandlerHashMap.get(s); - } - - public void registerChunkMetaDataHandler(IChunkMetaDataHandler handler){ - metaDataHandlerHashMap.put(handler.getTagName(),handler); - dimensionWiseMetaChunkData.put(handler.getTagName(),new HashMap<>()); - Class clazz=handler.getClass(); - try { - if(clazz.getMethod("tickServer", HashMap.class, TickEvent.ServerTickEvent.class).getDeclaringClass()!= IChunkMetaDataHandler.class){ - serverHandlers.add(handler); - } - if(clazz.getMethod("tickPlayer", HashMap.class, TickEvent.PlayerTickEvent.class).getDeclaringClass()!= IChunkMetaDataHandler.class){ - playerHandlers.add(handler); - } - if (clazz.getMethod("pushData", int.class, ChunkCoordIntPair.class).getDeclaringClass()!=IChunkMetaDataHandler.class) { - pushSyncHandlers.add(handler); - } - if(clazz.getMethod("tickWorld", HashMap.class, TickEvent.WorldTickEvent.class).getDeclaringClass()!= IChunkMetaDataHandler.class){ - worldHandlers.add(handler); - } - } catch (NoSuchMethodException e) { - throw new RuntimeException("Cannot register common event handlers!",e); - } - if(FMLCommonHandler.instance().getEffectiveSide().isClient()) { - try { - if (clazz.getMethod("pullData", ChunkEvent.Load.class).getDeclaringClass() != IChunkMetaDataHandler.class) { - pullSyncHandlers.add(handler); - } - if (clazz.getMethod("tickClient", HashMap.class, TickEvent.ClientTickEvent.class).getDeclaringClass() != IChunkMetaDataHandler.class) { - clientHandlers.add(handler); - } - if (clazz.getMethod("tickRender", HashMap.class, TickEvent.RenderTickEvent.class).getDeclaringClass() != IChunkMetaDataHandler.class) { - renderHandlers.add(handler); - } - } catch (NoSuchMethodException e) { - throw new RuntimeException("Cannot register client event handlers!",e); - } - } - } - - public NBTTagCompound removeChunkData(IChunkMetaDataHandler handler, int world, ChunkCoordIntPair chunk){ - return dimensionWiseMetaChunkData.get(handler.getTagName()).get(world).remove(chunk); - } - - public NBTTagCompound getChunkData(IChunkMetaDataHandler handler, int world, ChunkCoordIntPair chunk){ - return dimensionWiseMetaChunkData.get(handler.getTagName()).get(world).get(chunk); - } - - public NBTTagCompound putChunkData(IChunkMetaDataHandler handler, int world, ChunkCoordIntPair chunk, NBTTagCompound data){ - return dimensionWiseMetaChunkData.get(handler.getTagName()).get(world).put(chunk,data); - } - - public NBTTagCompound createIfAbsentChunkData(IChunkMetaDataHandler handler, int world, ChunkCoordIntPair chunk){ - return dimensionWiseMetaChunkData.get(handler.getTagName()).get(world) - .computeIfAbsent(chunk,chunkCoordIntPair -> handler.createData()); - } - - public HashMap getChunkData(IChunkMetaDataHandler chunkMetaDataHandler){ - return dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()); - } - - public ChunkHashMap getChunkData(IChunkMetaDataHandler chunkMetaDataHandler, int world){ - return dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()).get(world); - } - - public static final class ChunkHashMap implements Map{ - private final HashMap storage; - private final HashMap storageMeta=new HashMap<>(1024); - private final HashSet dirtyBoys=new HashSet<>(1024); - private final ArrayList> workLoad=new ArrayList<>(); - private final String meta; - - private ChunkHashMap(IChunkMetaDataHandler meta, HashMap storage) { - this.storage =storage; - this.meta=meta.getTagName(); - for (int i = 0; i < meta.pushPayloadSpreadPeriod(); i++) { - workLoad.add(new ArrayList<>(128)); - } - } - - public void markForTransmissionToClient(ChunkCoordIntPair chunk){ - dirtyBoys.add(chunk); - } - - private void putLoaded(ChunkCoordIntPair key, NBTTagCompound value) { - storageMeta.put(key, value); - } - - @Override - public NBTTagCompound remove(Object key) { - NBTTagCompound compound=storageMeta.remove(key); - if(compound!=null) { - NBTChunk chunk = storage.get(key); - chunk.data.removeTag(meta); - if(chunk.data.hasNoTags()){ - storage.remove(key); - } - } - return compound; - } - - @Override - public NBTTagCompound put(ChunkCoordIntPair key, NBTTagCompound value) { - if(value==null){ - return remove(key); - } - NBTChunk chunk = storage.get(key); - if(chunk==null){ - NBTTagCompound base=new NBTTagCompound(); - base.setTag(meta,value); - storage.put(key,new NBTChunk(base,false)); - }else { - chunk.data.setTag(meta,value); - } - return storageMeta.put(key, value); - } - - @Override - public int size() { - return storageMeta.size(); - } - - @Override - public boolean isEmpty() { - return storageMeta.isEmpty(); - } - - @Override - public NBTTagCompound get(Object key) { - return storageMeta.get(key); - } - - @Override - public void clear() { - storageMeta.entrySet().forEach(this::remove); - } - - @Override - public void putAll(Map m) { - m.forEach(this::put); - } - - @Override - public boolean containsKey(Object key) { - return storageMeta.containsKey(key); - } - - @Override - public boolean containsValue(Object value) { - return storageMeta.containsValue(value); - } - - @Override - public Set keySet() { - return storageMeta.keySet(); - } - - @Override - public Collection values() { - return storageMeta.values(); - } - - @Override - public Set> entrySet() { - return storageMeta.entrySet(); - } - } - - private static final class NBTChunk { - private final NBTTagCompound data; - private boolean isLoaded; - - private NBTChunk(NBTTagCompound data, boolean isLoaded) { - if(data==null){ - data=new NBTTagCompound(); - } - this.data = data; - this.isLoaded = isLoaded; - } - } -} diff --git a/src/main/java/com/github/technus/tectech/chunkData/IChunkMetaDataHandler.java b/src/main/java/com/github/technus/tectech/chunkData/IChunkMetaDataHandler.java deleted file mode 100644 index b5c79a4628..0000000000 --- a/src/main/java/com/github/technus/tectech/chunkData/IChunkMetaDataHandler.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.github.technus.tectech.chunkData; - -import cpw.mods.fml.common.gameevent.TickEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.ChunkCoordIntPair; -import net.minecraftforge.event.world.ChunkEvent; - -import java.util.ArrayList; -import java.util.HashMap; - -public interface IChunkMetaDataHandler { - String getTagName(); - void mergeData(NBTTagCompound target, NBTTagCompound loadedData); - NBTTagCompound createData(); - @SideOnly(Side.CLIENT) - default void pullData(ChunkEvent.Load aEvent){} - default void pushData(int world, ChunkCoordIntPair chunk){} - default void pushPayload(int world, ArrayList chunk){ - chunk.forEach(chunkCoordIntPair -> pushData(world,chunkCoordIntPair)); - } - default int pushPayloadSpreadPeriod(){ - return 20; - } - @SideOnly(Side.CLIENT) - default void tickRender(HashMap data, TickEvent.RenderTickEvent aEvent){} - @SideOnly(Side.CLIENT) - default void tickClient(HashMap data, TickEvent.ClientTickEvent aEvent){} - default void tickServer(HashMap data, TickEvent.ServerTickEvent event){} - default void tickWorld(HashMap data, TickEvent.WorldTickEvent aEvent){} - default void tickPlayer(HashMap data, TickEvent.PlayerTickEvent aEvent){} -} - diff --git a/src/main/java/com/github/technus/tectech/chunkData/WorldData.java b/src/main/java/com/github/technus/tectech/chunkData/WorldData.java deleted file mode 100644 index 42641a015e..0000000000 --- a/src/main/java/com/github/technus/tectech/chunkData/WorldData.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.github.technus.tectech.chunkData; - -import net.minecraft.world.ChunkCoordIntPair; -import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; - -import java.util.Objects; - -public final class WorldData { - private final World world; - private final Chunk chunk; - private final ChunkCoordIntPair coordIntPair; - - public WorldData(World world, Chunk data) { - this.world = world; - this.chunk = data; - coordIntPair=data.getChunkCoordIntPair(); - } - - public WorldData(World world, ChunkCoordIntPair data) { - this.world = world; - this.coordIntPair = data; - chunk= world.getChunkFromChunkCoords(data.chunkXPos,data.chunkZPos); - } - - public World getWorld() { - return world; - } - - public Chunk getChunk() { - return chunk; - } - - public ChunkCoordIntPair getCoordIntPair() { - return coordIntPair; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - WorldData worldData = (WorldData) o; - return world.provider.dimensionId==worldData.world.provider.dimensionId && - coordIntPair.chunkXPos==worldData.coordIntPair.chunkXPos && - coordIntPair.chunkZPos==worldData.coordIntPair.chunkXPos; - } - - @Override - public int hashCode() { - return Objects.hash(world.provider.dimensionId, coordIntPair); - } -} diff --git a/src/main/java/com/github/technus/tectech/loader/ElementalLoader.java b/src/main/java/com/github/technus/tectech/loader/ElementalLoader.java new file mode 100644 index 0000000000..130106a76b --- /dev/null +++ b/src/main/java/com/github/technus/tectech/loader/ElementalLoader.java @@ -0,0 +1,40 @@ +package com.github.technus.tectech.loader; + +import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.dComplexAspectDefinition; +import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.ePrimalAspectDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.core.templates.cElementalPrimitive; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.dAtomDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.iaeaNuclide; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.hadron.dHadronDefinition; +import com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.*; + +/** + * Created by danie_000 on 16.11.2016. + */ +public class ElementalLoader implements Runnable { + @Override + public void run() { + // =================================================================================================== + // Definition init + // =================================================================================================== + + cElementalPrimitive.run(); + + cPrimitiveDefinition.run(); + + eQuarkDefinition.run(); + eLeptonDefinition.run(); + eNeutrinoDefinition.run(); + eBosonDefinition.run(); + + dHadronDefinition.run(); + + iaeaNuclide.run(); + + dAtomDefinition.run(); + + ePrimalAspectDefinition.run(); + + dComplexAspectDefinition.run(); + } +} diff --git a/src/main/java/com/github/technus/tectech/loader/EntityLoader.java b/src/main/java/com/github/technus/tectech/loader/EntityLoader.java new file mode 100644 index 0000000000..b188989ba3 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/loader/EntityLoader.java @@ -0,0 +1,18 @@ +package com.github.technus.tectech.loader; + +import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.compatibility.openmodularturrets.entity.projectiles.projectileEM; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.registry.EntityRegistry; + +/** + * Created by Tec on 30.07.2017. + */ +public class EntityLoader implements Runnable { + @Override + public void run() { + if(Loader.isModLoaded("openmodularturrets")) { + EntityRegistry.registerModEntity(projectileEM.class, "projectileEM", 0, TecTech.instance, 16, 5, true); + } + } +} diff --git a/src/main/java/com/github/technus/tectech/loader/MainLoader.java b/src/main/java/com/github/technus/tectech/loader/MainLoader.java index 2272733d5a..b45e8bd532 100644 --- a/src/main/java/com/github/technus/tectech/loader/MainLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/MainLoader.java @@ -6,11 +6,8 @@ import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.defin import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.AspectDefinitionCompatEnabled; import com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi.EssentiaCompat; import com.github.technus.tectech.compatibility.thaumcraft.thing.metaTileEntity.multi.EssentiaCompatEnabled; -import com.github.technus.tectech.loader.entity.EntityLoader; import com.github.technus.tectech.loader.gui.CreativeTabTecTech; import com.github.technus.tectech.loader.gui.ModGuiHandler; -import com.github.technus.tectech.loader.mechanics.ElementalLoader; -import com.github.technus.tectech.loader.network.NetworkDispatcher; import com.github.technus.tectech.loader.recipe.RecipeLoader; import com.github.technus.tectech.loader.thing.ComponentLoader; import com.github.technus.tectech.loader.thing.MachineLoader; diff --git a/src/main/java/com/github/technus/tectech/loader/NetworkDispatcher.java b/src/main/java/com/github/technus/tectech/loader/NetworkDispatcher.java new file mode 100644 index 0000000000..0f20d31f4d --- /dev/null +++ b/src/main/java/com/github/technus/tectech/loader/NetworkDispatcher.java @@ -0,0 +1,30 @@ +package com.github.technus.tectech.loader; + +import com.github.technus.tectech.thing.metaTileEntity.pipe.PipeActivityMessage; +import com.github.technus.tectech.thing.metaTileEntity.RotationMessage; +import com.github.technus.tectech.mechanics.data.ChunkDataMessage; +import com.github.technus.tectech.mechanics.data.PlayerDataMessage; + +import static com.github.technus.tectech.Reference.MODID; + +public class NetworkDispatcher extends eu.usrv.yamcore.network.PacketDispatcher { + public static NetworkDispatcher INSTANCE; + + public NetworkDispatcher() { + super(MODID); + INSTANCE = this; + registerPackets(); + } + + @Override + public void registerPackets() { + registerMessage(PipeActivityMessage.ServerHandler.class, PipeActivityMessage.PipeActivityQuery.class); + registerMessage(PipeActivityMessage.ClientHandler.class, PipeActivityMessage.PipeActivityData.class); + registerMessage(RotationMessage.ServerHandler.class, RotationMessage.RotationQuery.class); + registerMessage(RotationMessage.ClientHandler.class, RotationMessage.RotationData.class); + registerMessage(ChunkDataMessage.ServerHandler.class, ChunkDataMessage.ChunkDataQuery.class); + registerMessage(ChunkDataMessage.ClientHandler.class, ChunkDataMessage.ChunkDataData.class); + registerMessage(PlayerDataMessage.ServerHandler.class, PlayerDataMessage.PlayerDataQuery.class); + registerMessage(PlayerDataMessage.ClientHandler.class, PlayerDataMessage.PlayerDataData.class); + } +} diff --git a/src/main/java/com/github/technus/tectech/loader/entity/EntityLoader.java b/src/main/java/com/github/technus/tectech/loader/entity/EntityLoader.java deleted file mode 100644 index 209d7ccd39..0000000000 --- a/src/main/java/com/github/technus/tectech/loader/entity/EntityLoader.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.github.technus.tectech.loader.entity; - -import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.compatibility.openmodularturrets.entity.projectiles.projectileEM; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.registry.EntityRegistry; - -/** - * Created by Tec on 30.07.2017. - */ -public class EntityLoader implements Runnable { - @Override - public void run() { - if(Loader.isModLoaded("openmodularturrets")) { - EntityRegistry.registerModEntity(projectileEM.class, "projectileEM", 0, TecTech.instance, 16, 5, true); - } - } -} diff --git a/src/main/java/com/github/technus/tectech/loader/mechanics/ElementalLoader.java b/src/main/java/com/github/technus/tectech/loader/mechanics/ElementalLoader.java deleted file mode 100644 index a2ea8c60de..0000000000 --- a/src/main/java/com/github/technus/tectech/loader/mechanics/ElementalLoader.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.github.technus.tectech.loader.mechanics; - -import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.dComplexAspectDefinition; -import com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.ePrimalAspectDefinition; -import com.github.technus.tectech.mechanics.elementalMatter.core.templates.cElementalPrimitive; -import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.dAtomDefinition; -import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.iaeaNuclide; -import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.hadron.dHadronDefinition; -import com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.*; - -/** - * Created by danie_000 on 16.11.2016. - */ -public class ElementalLoader implements Runnable { - @Override - public void run() { - // =================================================================================================== - // Definition init - // =================================================================================================== - - cElementalPrimitive.run(); - - cPrimitiveDefinition.run(); - - eQuarkDefinition.run(); - eLeptonDefinition.run(); - eNeutrinoDefinition.run(); - eBosonDefinition.run(); - - dHadronDefinition.run(); - - iaeaNuclide.run(); - - dAtomDefinition.run(); - - ePrimalAspectDefinition.run(); - - dComplexAspectDefinition.run(); - } -} diff --git a/src/main/java/com/github/technus/tectech/loader/network/ChunkDataMessage.java b/src/main/java/com/github/technus/tectech/loader/network/ChunkDataMessage.java deleted file mode 100644 index 15c936191a..0000000000 --- a/src/main/java/com/github/technus/tectech/loader/network/ChunkDataMessage.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.github.technus.tectech.loader.network; - -import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.Util; -import com.github.technus.tectech.chunkData.IChunkMetaDataHandler; -import cpw.mods.fml.common.network.ByteBufUtils; -import cpw.mods.fml.common.network.simpleimpl.IMessage; -import cpw.mods.fml.common.network.simpleimpl.MessageContext; -import eu.usrv.yamcore.network.client.AbstractClientMessageHandler; -import eu.usrv.yamcore.network.server.AbstractServerMessageHandler; -import io.netty.buffer.ByteBuf; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.ChunkCoordIntPair; -import net.minecraftforge.event.world.ChunkEvent; - -public class ChunkDataMessage implements IMessage { - int worldId; - ChunkCoordIntPair chunk; - NBTTagCompound data; - IChunkMetaDataHandler handler; - - public ChunkDataMessage(){} - - @Override - public void fromBytes(ByteBuf pBuffer) { - NBTTagCompound tag = ByteBufUtils.readTag(pBuffer); - worldId = tag.getInteger("wId"); - chunk=new ChunkCoordIntPair( - tag.getInteger("posx"), - tag.getInteger("posz")); - handler = TecTech.chunkDataHandler.getChunkMetaDataHandler( - tag.getString("handle")); - if(tag.hasKey("data")){ - data=tag.getCompoundTag("data"); - } - } - - @Override - public void toBytes(ByteBuf pBuffer) { - NBTTagCompound tag = new NBTTagCompound(); - tag.setInteger("wId",worldId); - tag.setInteger("posx",chunk.chunkXPos); - tag.setInteger("posz",chunk.chunkZPos); - tag.setString("handle",handler.getTagName()); - if(data!=null){ - tag.setTag("data",data); - } - ByteBufUtils.writeTag(pBuffer, tag); - } - - public static class ChunkDataQuery extends ChunkDataMessage { - public ChunkDataQuery() { - } - public ChunkDataQuery(ChunkEvent.Load aEvent, IChunkMetaDataHandler handler) { - worldId=aEvent.world.provider.dimensionId; - chunk=aEvent.getChunk().getChunkCoordIntPair(); - this.handler=handler; - } - } - - public static class ChunkDataData extends ChunkDataMessage { - public ChunkDataData() { - } - - public ChunkDataData(int worldId, ChunkCoordIntPair chunk, IChunkMetaDataHandler handler){ - this.worldId=worldId; - this.chunk=chunk; - this.handler=handler; - this.data=TecTech.chunkDataHandler.getChunkData(handler,worldId,chunk); - } - - public ChunkDataData(ChunkDataQuery query){ - worldId=query.worldId; - chunk=query.chunk; - handler=query.handler; - data=TecTech.chunkDataHandler.getChunkData(handler,worldId,chunk); - } - } - - public static class ClientHandler extends AbstractClientMessageHandler { - @Override - public IMessage handleClientMessage(EntityPlayer pPlayer, ChunkDataData pMessage, MessageContext pCtx) { - if(Util.checkChunkExist(pPlayer.worldObj,pMessage.chunk)){ - TecTech.chunkDataHandler.putChunkData(pMessage.handler, pMessage.worldId,pMessage.chunk, pMessage.data); - } - return null; - } - } - - public static class ServerHandler extends AbstractServerMessageHandler { - @Override - public IMessage handleServerMessage(EntityPlayer pPlayer, ChunkDataQuery pMessage, MessageContext pCtx) { - if(pPlayer instanceof EntityPlayerMP){ - NetworkDispatcher.INSTANCE.sendTo(new ChunkDataData(pMessage),(EntityPlayerMP) pPlayer); - } - return null; - } - } -} diff --git a/src/main/java/com/github/technus/tectech/loader/network/NetworkDispatcher.java b/src/main/java/com/github/technus/tectech/loader/network/NetworkDispatcher.java deleted file mode 100644 index e424edd385..0000000000 --- a/src/main/java/com/github/technus/tectech/loader/network/NetworkDispatcher.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.github.technus.tectech.loader.network; - -import static com.github.technus.tectech.Reference.MODID; - -public class NetworkDispatcher extends eu.usrv.yamcore.network.PacketDispatcher { - public static NetworkDispatcher INSTANCE; - - public NetworkDispatcher() { - super(MODID); - INSTANCE = this; - registerPackets(); - } - - @Override - public void registerPackets() { - registerMessage(PipeActivityMessage.ServerHandler.class, PipeActivityMessage.PipeActivityQuery.class); - registerMessage(PipeActivityMessage.ClientHandler.class, PipeActivityMessage.PipeActivityData.class); - registerMessage(RotationMessage.ServerHandler.class, RotationMessage.RotationQuery.class); - registerMessage(RotationMessage.ClientHandler.class, RotationMessage.RotationData.class); - registerMessage(ChunkDataMessage.ServerHandler.class, ChunkDataMessage.ChunkDataQuery.class); - registerMessage(ChunkDataMessage.ClientHandler.class, ChunkDataMessage.ChunkDataData.class); - registerMessage(PlayerDataMessage.ServerHandler.class, PlayerDataMessage.PlayerDataQuery.class); - registerMessage(PlayerDataMessage.ClientHandler.class, PlayerDataMessage.PlayerDataData.class); - } -} diff --git a/src/main/java/com/github/technus/tectech/loader/network/PipeActivityMessage.java b/src/main/java/com/github/technus/tectech/loader/network/PipeActivityMessage.java deleted file mode 100644 index 0323f19428..0000000000 --- a/src/main/java/com/github/technus/tectech/loader/network/PipeActivityMessage.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.github.technus.tectech.loader.network; - -import com.github.technus.tectech.thing.metaTileEntity.pipe.IActivePipe; -import cpw.mods.fml.common.network.ByteBufUtils; -import cpw.mods.fml.common.network.simpleimpl.IMessage; -import cpw.mods.fml.common.network.simpleimpl.MessageContext; -import eu.usrv.yamcore.network.client.AbstractClientMessageHandler; -import eu.usrv.yamcore.network.server.AbstractServerMessageHandler; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import io.netty.buffer.ByteBuf; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.DimensionManager; - -public class PipeActivityMessage implements IMessage { - int mPosX; - int mPosY; - int mPosZ; - int mPosD; - int mActive; - - public PipeActivityMessage() { - } - - private PipeActivityMessage(IActivePipe metaTile) { - IGregTechTileEntity base=metaTile.getBaseMetaTileEntity(); - mPosX=base.getXCoord(); - mPosY=base.getYCoord(); - mPosZ=base.getZCoord(); - mPosD=base.getWorld().provider.dimensionId; - mActive=metaTile.getActive()?1:0; - } - - private PipeActivityMessage(World world, int x, int y, int z, boolean active) { - mPosX=x; - mPosY=y; - mPosZ=z; - mPosD=world.provider.dimensionId; - mActive=active?1:0; - } - - @Override - public void fromBytes(ByteBuf pBuffer) { - NBTTagCompound tTag = ByteBufUtils.readTag(pBuffer); - mPosX = tTag.getInteger("posx"); - mPosY = tTag.getInteger("posy"); - mPosZ = tTag.getInteger("posz"); - mPosD = tTag.getInteger("posd"); - mActive = tTag.getInteger("active"); - } - - @Override - public void toBytes(ByteBuf pBuffer) { - NBTTagCompound tFXTag = new NBTTagCompound(); - tFXTag.setInteger("posx", mPosX); - tFXTag.setInteger("posy", mPosY); - tFXTag.setInteger("posz", mPosZ); - tFXTag.setInteger("posd", mPosD); - tFXTag.setInteger("active", mActive); - - ByteBufUtils.writeTag(pBuffer, tFXTag); - } - - public static class PipeActivityQuery extends PipeActivityMessage { - public PipeActivityQuery() { - } - - public PipeActivityQuery(IActivePipe metaTile) { - super(metaTile); - } - - public PipeActivityQuery(World world, int x,int y,int z, boolean active) { - super(world,x,y,z,active); - } - } - - public static class PipeActivityData extends PipeActivityMessage { - public PipeActivityData() { - } - - private PipeActivityData(PipeActivityQuery query){ - mPosX=query.mPosX; - mPosY=query.mPosY; - mPosZ=query.mPosZ; - mPosD=query.mPosD; - mActive=query.mActive; - } - - public PipeActivityData(IActivePipe metaTile) { - super(metaTile); - } - - public PipeActivityData(World world, int x,int y,int z, boolean active) { - super(world,x,y,z,active); - } - } - - public static class ClientHandler extends AbstractClientMessageHandler { - @Override - public IMessage handleClientMessage(EntityPlayer pPlayer, PipeActivityData pMessage, MessageContext pCtx) { - if(pPlayer.worldObj.provider.dimensionId==pMessage.mPosD){ - TileEntity te=pPlayer.worldObj.getTileEntity(pMessage.mPosX,pMessage.mPosY,pMessage.mPosZ); - if(te instanceof IGregTechTileEntity){ - IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity(); - if(meta instanceof IActivePipe){ - ((IActivePipe) meta).setActive((byte)pMessage.mActive==1); - } - } - } - return null; - } - } - - public static class ServerHandler extends AbstractServerMessageHandler { - @Override - public IMessage handleServerMessage(EntityPlayer pPlayer, PipeActivityQuery pMessage, MessageContext pCtx) { - World world= DimensionManager.getWorld(pMessage.mPosD); - if(world!=null) { - TileEntity te = world.getTileEntity(pMessage.mPosX, pMessage.mPosY, pMessage.mPosZ); - if (te instanceof IGregTechTileEntity) { - IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity(); - if (meta instanceof IActivePipe) { - pMessage.mActive=((IActivePipe) meta).getActive()?1:0; - return new PipeActivityData(pMessage); - } - } - } - return null; - } - } -} \ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/loader/network/PlayerDataMessage.java b/src/main/java/com/github/technus/tectech/loader/network/PlayerDataMessage.java deleted file mode 100644 index 48a21423a9..0000000000 --- a/src/main/java/com/github/technus/tectech/loader/network/PlayerDataMessage.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.github.technus.tectech.loader.network; - -import com.github.technus.tectech.TecTech; -import cpw.mods.fml.common.network.ByteBufUtils; -import cpw.mods.fml.common.network.simpleimpl.IMessage; -import cpw.mods.fml.common.network.simpleimpl.MessageContext; -import eu.usrv.yamcore.network.client.AbstractClientMessageHandler; -import eu.usrv.yamcore.network.server.AbstractServerMessageHandler; -import io.netty.buffer.ByteBuf; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.nbt.NBTTagCompound; - -import java.util.UUID; - -import static java.nio.charset.Charset.forName; - -public class PlayerDataMessage implements IMessage { - NBTTagCompound data; - UUID uuid1,uuid2; - - public PlayerDataMessage(){} - - @Override - public void fromBytes(ByteBuf pBuffer) { - NBTTagCompound tag = ByteBufUtils.readTag(pBuffer); - uuid1=UUID.fromString(tag.getString("id1")); - uuid2=UUID.fromString(tag.getString("id2")); - if(tag.hasKey("data")){ - data=tag.getCompoundTag("data"); - } - } - - @Override - public void toBytes(ByteBuf pBuffer) { - NBTTagCompound tag = new NBTTagCompound(); - tag.setString("id1",uuid1.toString()); - tag.setString("id2",uuid2.toString()); - if(data!=null){ - tag.setTag("data",data); - } - ByteBufUtils.writeTag(pBuffer, tag); - } - - public static class PlayerDataQuery extends PlayerDataMessage { - public PlayerDataQuery() { - } - - public PlayerDataQuery(EntityPlayer player) { - uuid1=player.getUniqueID(); - uuid2=UUID.nameUUIDFromBytes(player.getCommandSenderName().getBytes(forName("UTF-8"))); - } - } - - public static class PlayerDataData extends PlayerDataMessage { - public PlayerDataData() { - } - - public PlayerDataData(EntityPlayer player){ - uuid1=player.getUniqueID(); - uuid2=UUID.nameUUIDFromBytes(player.getCommandSenderName().getBytes(forName("UTF-8"))); - data=TecTech.playerPersistence.getDataOrSetToNewTag(player); - } - - public PlayerDataData(PlayerDataQuery query){ - uuid1=query.uuid1; - uuid2=query.uuid2; - data= TecTech.playerPersistence.getDataOrSetToNewTag(uuid1,uuid2); - } - } - - public static class ClientHandler extends AbstractClientMessageHandler { - @Override - public IMessage handleClientMessage(EntityPlayer pPlayer, PlayerDataData pMessage, MessageContext pCtx) { - TecTech.playerPersistence.putDataOrSetToNewTag(pMessage.uuid1,pMessage.uuid2,pMessage.data); - return null; - } - } - - public static class ServerHandler extends AbstractServerMessageHandler { - @Override - public IMessage handleServerMessage(EntityPlayer pPlayer, PlayerDataQuery pMessage, MessageContext pCtx) { - if(pPlayer instanceof EntityPlayerMP){ - NetworkDispatcher.INSTANCE.sendTo(new PlayerDataData(pMessage),(EntityPlayerMP) pPlayer); - } - return null; - } - } -} diff --git a/src/main/java/com/github/technus/tectech/loader/network/RotationMessage.java b/src/main/java/com/github/technus/tectech/loader/network/RotationMessage.java deleted file mode 100644 index ec78021a60..0000000000 --- a/src/main/java/com/github/technus/tectech/loader/network/RotationMessage.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.github.technus.tectech.loader.network; - -import com.github.technus.tectech.thing.metaTileEntity.IFrontRotation; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import cpw.mods.fml.common.network.ByteBufUtils; -import cpw.mods.fml.common.network.simpleimpl.IMessage; -import cpw.mods.fml.common.network.simpleimpl.MessageContext; -import eu.usrv.yamcore.network.client.AbstractClientMessageHandler; -import eu.usrv.yamcore.network.server.AbstractServerMessageHandler; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import io.netty.buffer.ByteBuf; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.DimensionManager; - -public class RotationMessage implements IMessage { - int mPosX; - int mPosY; - int mPosZ; - int mPosD; - int mRotF; - - public RotationMessage() { - } - - private RotationMessage(GT_MetaTileEntity_MultiblockBase_EM metaTile) { - IGregTechTileEntity base=metaTile.getBaseMetaTileEntity(); - mPosX=base.getXCoord(); - mPosY=base.getYCoord(); - mPosZ=base.getZCoord(); - mPosD=base.getWorld().provider.dimensionId; - mRotF=metaTile.getFrontRotation(); - } - - private RotationMessage(World world, int x,int y,int z, IFrontRotation front) { - mPosX=x; - mPosY=y; - mPosZ=z; - mPosD=world.provider.dimensionId; - mRotF=front.getFrontRotation(); - } - - @Override - public void fromBytes(ByteBuf pBuffer) { - NBTTagCompound tTag = ByteBufUtils.readTag(pBuffer); - mPosX = tTag.getInteger("posx"); - mPosY = tTag.getInteger("posy"); - mPosZ = tTag.getInteger("posz"); - mPosD = tTag.getInteger("posd"); - mRotF = tTag.getInteger("rotf"); - } - - @Override - public void toBytes(ByteBuf pBuffer) { - NBTTagCompound tFXTag = new NBTTagCompound(); - tFXTag.setInteger("posx", mPosX); - tFXTag.setInteger("posy", mPosY); - tFXTag.setInteger("posz", mPosZ); - tFXTag.setInteger("posd", mPosD); - tFXTag.setInteger("rotf", mRotF); - - ByteBufUtils.writeTag(pBuffer, tFXTag); - } - - public static class RotationQuery extends RotationMessage{ - public RotationQuery() { - } - - public RotationQuery(GT_MetaTileEntity_MultiblockBase_EM metaTile) { - super(metaTile); - } - - public RotationQuery(World world, int x,int y,int z, IFrontRotation front) { - super(world,x,y,z,front); - } - } - - public static class RotationData extends RotationMessage{ - public RotationData() { - } - - private RotationData(RotationQuery query){ - mPosX=query.mPosX; - mPosY=query.mPosY; - mPosZ=query.mPosZ; - mPosD=query.mPosD; - mRotF=query.mRotF; - } - - public RotationData(GT_MetaTileEntity_MultiblockBase_EM metaTile) { - super(metaTile); - } - - public RotationData(World world, int x,int y,int z, IFrontRotation front) { - super(world,x,y,z,front); - } - } - - public static class ClientHandler extends AbstractClientMessageHandler { - @Override - public IMessage handleClientMessage(EntityPlayer pPlayer, RotationData pMessage, MessageContext pCtx) { - if(pPlayer.worldObj.provider.dimensionId==pMessage.mPosD){ - TileEntity te=pPlayer.worldObj.getTileEntity(pMessage.mPosX,pMessage.mPosY,pMessage.mPosZ); - if(te instanceof IGregTechTileEntity){ - IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity(); - if(meta instanceof IFrontRotation){ - ((IFrontRotation) meta).forceSetRotationDoRender((byte)pMessage.mRotF); - } - }else if (te instanceof IFrontRotation){ - ((IFrontRotation) te).forceSetRotationDoRender((byte)pMessage.mRotF); - } - } - return null; - } - } - - public static class ServerHandler extends AbstractServerMessageHandler { - @Override - public IMessage handleServerMessage(EntityPlayer pPlayer, RotationQuery pMessage, MessageContext pCtx) { - World world= DimensionManager.getWorld(pMessage.mPosD); - if(world!=null) { - TileEntity te = world.getTileEntity(pMessage.mPosX, pMessage.mPosY, pMessage.mPosZ); - if (te instanceof IGregTechTileEntity) { - IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity(); - if (meta instanceof IFrontRotation) { - pMessage.mRotF=((IFrontRotation) meta).getFrontRotation(); - return new RotationData(pMessage); - } - } else if (te instanceof IFrontRotation) { - pMessage.mRotF=((IFrontRotation) te).getFrontRotation(); - return new RotationData(pMessage); - } - } - return null; - } - } -} \ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/mechanics/ConvertFloat.java b/src/main/java/com/github/technus/tectech/mechanics/ConvertFloat.java deleted file mode 100644 index 8e25b8908a..0000000000 --- a/src/main/java/com/github/technus/tectech/mechanics/ConvertFloat.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.github.technus.tectech.mechanics; - -import com.github.technus.tectech.Util; -import net.minecraft.command.ICommand; -import net.minecraft.command.ICommandSender; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; - -import java.util.ArrayList; -import java.util.List; - -public class ConvertFloat implements ICommand { - ArrayList aliases=new ArrayList<>(); - - public ConvertFloat(){ - aliases.add("convert_float"); - aliases.add("c_f"); - } - - @Override - public void processCommand(ICommandSender sender, String[] args) { - if (!sender.getEntityWorld().isRemote) { - if(args.length == 1) { - try{ - float value=Float.parseFloat(args[0]); - sender.addChatMessage(new ChatComponentText( - EnumChatFormatting.AQUA.toString()+ EnumChatFormatting.BOLD + - Util.intBitsToShortString(Float.floatToIntBits(value))+" "+ - EnumChatFormatting.RESET+EnumChatFormatting.BLUE +value)); - }catch (Exception e){ - sender.addChatMessage(new ChatComponentText(EnumChatFormatting.RED+"Invalid Float "+args[0])); - } - }else{ - sender.addChatMessage(new ChatComponentText(getCommandUsage(sender))); - } - } - } - - @Override - public boolean isUsernameIndex(String[] p_82358_1_, int p_82358_2_) { - return false; - } - - @Override - public List getCommandAliases() { - return aliases; - } - - @Override - public String getCommandName() { - return aliases.get(0); - } - - @Override - public List addTabCompletionOptions(ICommandSender sender, String[] args) { - return null; - } - - @Override - public String getCommandUsage(ICommandSender p_71518_1_) { - return "c_f Float"; - } - - @Override - public int compareTo(Object o) { - if(o instanceof ICommand){ - return getCommandName().compareTo(((ICommand) o).getCommandName()); - } - return 0; - } - - @Override - public boolean canCommandSenderUseCommand(ICommandSender sender) { - return true; - } -} diff --git a/src/main/java/com/github/technus/tectech/mechanics/ConvertInteger.java b/src/main/java/com/github/technus/tectech/mechanics/ConvertInteger.java deleted file mode 100644 index c381f34939..0000000000 --- a/src/main/java/com/github/technus/tectech/mechanics/ConvertInteger.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.github.technus.tectech.mechanics; - -import com.github.technus.tectech.Util; -import net.minecraft.command.ICommand; -import net.minecraft.command.ICommandSender; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; - -import java.util.ArrayList; -import java.util.List; - -public class ConvertInteger implements ICommand { - ArrayList aliases=new ArrayList<>(); - - public ConvertInteger(){ - aliases.add("convert_integer"); - aliases.add("c_i"); - } - - @Override - public void processCommand(ICommandSender sender, String[] args) { - if (!sender.getEntityWorld().isRemote) { - if(args.length == 1) { - try{ - int value=Integer.parseInt(args[0]); - sender.addChatMessage(new ChatComponentText( - EnumChatFormatting.AQUA.toString()+ EnumChatFormatting.BOLD + - Util.intBitsToShortString(value)+" "+ - EnumChatFormatting.RESET+EnumChatFormatting.BLUE +value)); - }catch (Exception e){ - sender.addChatMessage(new ChatComponentText(EnumChatFormatting.RED+"Invalid Integer "+args[0])); - } - }else{ - sender.addChatMessage(new ChatComponentText(getCommandUsage(sender))); - } - } - } - - @Override - public boolean isUsernameIndex(String[] p_82358_1_, int p_82358_2_) { - return false; - } - - @Override - public List getCommandAliases() { - return aliases; - } - - @Override - public String getCommandName() { - return aliases.get(0); - } - - @Override - public List addTabCompletionOptions(ICommandSender sender, String[] args) { - return null; - } - - @Override - public String getCommandUsage(ICommandSender p_71518_1_) { - return "c_i Integer"; - } - - @Override - public int compareTo(Object o) { - if(o instanceof ICommand){ - return getCommandName().compareTo(((ICommand) o).getCommandName()); - } - return 0; - } - - @Override - public boolean canCommandSenderUseCommand(ICommandSender sender) { - return true; - } -} diff --git a/src/main/java/com/github/technus/tectech/mechanics/PlayerPersistence.java b/src/main/java/com/github/technus/tectech/mechanics/PlayerPersistence.java deleted file mode 100644 index 72416c3e0c..0000000000 --- a/src/main/java/com/github/technus/tectech/mechanics/PlayerPersistence.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.github.technus.tectech.mechanics; - -import com.github.technus.tectech.Util; -import com.github.technus.tectech.loader.network.NetworkDispatcher; -import com.github.technus.tectech.loader.network.PlayerDataMessage; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.nbt.NBTTagCompound; - -import java.util.HashMap; -import java.util.UUID; - -import static java.nio.charset.Charset.forName; - -public class PlayerPersistence { - private final HashMap map=new HashMap<>(); - private final String extension; - - public PlayerPersistence(String extension) { - this.extension = extension; - } - - public NBTTagCompound getDataOrSetToNewTag(UUID uuid1, UUID uuid2){ - NBTTagCompound tag=map.get(uuid1); - if(tag!=null){ - return tag; - } - tag=map.get(uuid2); - if(tag!=null){ - return tag; - } - tag=Util.getPlayerData(uuid1,uuid2,extension); - if(tag==null){ - tag=new NBTTagCompound(); - } - map.put(uuid1,tag); - map.put(uuid2,tag); - return tag; - } - - public NBTTagCompound getDataOrSetToNewTag(EntityPlayer player){ - return getDataOrSetToNewTag(player.getUniqueID(),UUID.nameUUIDFromBytes(player.getCommandSenderName().getBytes(forName("UTF-8")))); - } - - public void putDataOrSetToNewTag(UUID uuid1, UUID uuid2, NBTTagCompound tagCompound){ - if(tagCompound==null){ - tagCompound=new NBTTagCompound(); - } - map.put(uuid1,tagCompound); - map.put(uuid2,tagCompound); - } - - public void putDataOrSetToNewTag(EntityPlayer player, NBTTagCompound tagCompound){ - putDataOrSetToNewTag(player.getUniqueID(),UUID.nameUUIDFromBytes(player.getCommandSenderName().getBytes(forName("UTF-8"))),tagCompound); - } - - public void saveData(EntityPlayer player){ - Util.savePlayerFile(player,extension,getDataOrSetToNewTag(player)); - } - - @SubscribeEvent - public void onLogin(PlayerEvent.PlayerLoggedInEvent event){ - if(event.player instanceof EntityPlayerMP){ - NetworkDispatcher.INSTANCE.sendTo(new PlayerDataMessage.PlayerDataData(event.player),(EntityPlayerMP)event.player); - } - } - - public void clearData() { - map.clear(); - } -} diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java index fcc0242432..4f76b22279 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java @@ -2,12 +2,12 @@ package com.github.technus.tectech.mechanics.anomaly; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.Util; -import com.github.technus.tectech.chunkData.ChunkDataHandler; -import com.github.technus.tectech.chunkData.IChunkMetaDataHandler; +import com.github.technus.tectech.mechanics.data.ChunkDataHandler; +import com.github.technus.tectech.mechanics.data.IChunkMetaDataHandler; import com.github.technus.tectech.loader.MainLoader; -import com.github.technus.tectech.loader.network.ChunkDataMessage; -import com.github.technus.tectech.loader.network.NetworkDispatcher; -import com.github.technus.tectech.loader.network.PlayerDataMessage; +import com.github.technus.tectech.mechanics.data.ChunkDataMessage; +import com.github.technus.tectech.loader.NetworkDispatcher; +import com.github.technus.tectech.mechanics.data.PlayerDataMessage; import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.dAtomDefinition; import cpw.mods.fml.common.gameevent.TickEvent; import gregtech.api.GregTech_API; diff --git a/src/main/java/com/github/technus/tectech/mechanics/commands/ConvertFloat.java b/src/main/java/com/github/technus/tectech/mechanics/commands/ConvertFloat.java new file mode 100644 index 0000000000..61fa56f93a --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/commands/ConvertFloat.java @@ -0,0 +1,76 @@ +package com.github.technus.tectech.mechanics.commands; + +import com.github.technus.tectech.Util; +import net.minecraft.command.ICommand; +import net.minecraft.command.ICommandSender; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; + +import java.util.ArrayList; +import java.util.List; + +public class ConvertFloat implements ICommand { + ArrayList aliases=new ArrayList<>(); + + public ConvertFloat(){ + aliases.add("convert_float"); + aliases.add("c_f"); + } + + @Override + public void processCommand(ICommandSender sender, String[] args) { + if (!sender.getEntityWorld().isRemote) { + if(args.length == 1) { + try{ + float value=Float.parseFloat(args[0]); + sender.addChatMessage(new ChatComponentText( + EnumChatFormatting.AQUA.toString()+ EnumChatFormatting.BOLD + + Util.intBitsToShortString(Float.floatToIntBits(value))+" "+ + EnumChatFormatting.RESET+EnumChatFormatting.BLUE +value)); + }catch (Exception e){ + sender.addChatMessage(new ChatComponentText(EnumChatFormatting.RED+"Invalid Float "+args[0])); + } + }else{ + sender.addChatMessage(new ChatComponentText(getCommandUsage(sender))); + } + } + } + + @Override + public boolean isUsernameIndex(String[] p_82358_1_, int p_82358_2_) { + return false; + } + + @Override + public List getCommandAliases() { + return aliases; + } + + @Override + public String getCommandName() { + return aliases.get(0); + } + + @Override + public List addTabCompletionOptions(ICommandSender sender, String[] args) { + return null; + } + + @Override + public String getCommandUsage(ICommandSender p_71518_1_) { + return "c_f Float"; + } + + @Override + public int compareTo(Object o) { + if(o instanceof ICommand){ + return getCommandName().compareTo(((ICommand) o).getCommandName()); + } + return 0; + } + + @Override + public boolean canCommandSenderUseCommand(ICommandSender sender) { + return true; + } +} diff --git a/src/main/java/com/github/technus/tectech/mechanics/commands/ConvertInteger.java b/src/main/java/com/github/technus/tectech/mechanics/commands/ConvertInteger.java new file mode 100644 index 0000000000..c9767560c3 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/commands/ConvertInteger.java @@ -0,0 +1,76 @@ +package com.github.technus.tectech.mechanics.commands; + +import com.github.technus.tectech.Util; +import net.minecraft.command.ICommand; +import net.minecraft.command.ICommandSender; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; + +import java.util.ArrayList; +import java.util.List; + +public class ConvertInteger implements ICommand { + ArrayList aliases=new ArrayList<>(); + + public ConvertInteger(){ + aliases.add("convert_integer"); + aliases.add("c_i"); + } + + @Override + public void processCommand(ICommandSender sender, String[] args) { + if (!sender.getEntityWorld().isRemote) { + if(args.length == 1) { + try{ + int value=Integer.parseInt(args[0]); + sender.addChatMessage(new ChatComponentText( + EnumChatFormatting.AQUA.toString()+ EnumChatFormatting.BOLD + + Util.intBitsToShortString(value)+" "+ + EnumChatFormatting.RESET+EnumChatFormatting.BLUE +value)); + }catch (Exception e){ + sender.addChatMessage(new ChatComponentText(EnumChatFormatting.RED+"Invalid Integer "+args[0])); + } + }else{ + sender.addChatMessage(new ChatComponentText(getCommandUsage(sender))); + } + } + } + + @Override + public boolean isUsernameIndex(String[] p_82358_1_, int p_82358_2_) { + return false; + } + + @Override + public List getCommandAliases() { + return aliases; + } + + @Override + public String getCommandName() { + return aliases.get(0); + } + + @Override + public List addTabCompletionOptions(ICommandSender sender, String[] args) { + return null; + } + + @Override + public String getCommandUsage(ICommandSender p_71518_1_) { + return "c_i Integer"; + } + + @Override + public int compareTo(Object o) { + if(o instanceof ICommand){ + return getCommandName().compareTo(((ICommand) o).getCommandName()); + } + return 0; + } + + @Override + public boolean canCommandSenderUseCommand(ICommandSender sender) { + return true; + } +} diff --git a/src/main/java/com/github/technus/tectech/mechanics/data/ChunkDataHandler.java b/src/main/java/com/github/technus/tectech/mechanics/data/ChunkDataHandler.java new file mode 100644 index 0000000000..f6d84d6b12 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/data/ChunkDataHandler.java @@ -0,0 +1,363 @@ +package com.github.technus.tectech.mechanics.data; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.TickEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraftforge.event.world.ChunkDataEvent; +import net.minecraftforge.event.world.ChunkEvent; +import net.minecraftforge.event.world.WorldEvent; + +import java.util.*; + +public class ChunkDataHandler { + private final String BASE_TAG_NAME ="TecTechData"; + private final HashMap> dimensionWiseChunkData=new HashMap<>(); + private final HashMap> dimensionWiseMetaChunkData=new HashMap<>(); + private final HashMap metaDataHandlerHashMap =new HashMap<>(); + private final ArrayList pushSyncHandlers =new ArrayList<>(); + private final ArrayList pullSyncHandlers =new ArrayList<>(); + private final ArrayList serverHandlers=new ArrayList<>(); + private final ArrayList worldHandlers=new ArrayList<>(); + private final ArrayList playerHandlers=new ArrayList<>(); + private final ArrayList clientHandlers=new ArrayList<>(); + private final ArrayList renderHandlers=new ArrayList<>(); + + @SubscribeEvent + public void onWorldLoad(WorldEvent.Load event){ + int dim=event.world.provider.dimensionId; + dimensionWiseChunkData.computeIfAbsent(dim, m->{ + HashMap map = new HashMap<>(); + for (Map.Entry meta : metaDataHandlerHashMap.entrySet()) { + dimensionWiseMetaChunkData.get(meta.getKey()).put(dim, new ChunkHashMap(meta.getValue(), map)); + } + return map; + }); + } + + @SubscribeEvent + public void handleChunkSaveEvent(ChunkDataEvent.Save event) { + HashMap dimensionData = dimensionWiseChunkData.get(event.world.provider.dimensionId); + NBTChunk chunkData = dimensionData != null ? dimensionData.get(event.getChunk().getChunkCoordIntPair()) : null; + if (chunkData == null) { + event.getData().removeTag(BASE_TAG_NAME); + } else { + chunkData.isLoaded = true; + event.getData().setTag(BASE_TAG_NAME, chunkData.data); + } + } + + @SubscribeEvent + public void handleChunkLoadEvent(ChunkDataEvent.Load event) { + NBTTagCompound loadedTag = event.getData().getCompoundTag(BASE_TAG_NAME); + if (loadedTag.hasNoTags()) { + return; + } + int dimId = event.world.provider.dimensionId; + HashMap dimensionMemory = dimensionWiseChunkData.get(dimId); + ChunkCoordIntPair chunkCoordIntPair = event.getChunk().getChunkCoordIntPair(); + Set loadedKeys = loadedTag.func_150296_c(); + NBTChunk chunkMemory = dimensionMemory.get(chunkCoordIntPair); + if (chunkMemory == null) { + chunkMemory = new NBTChunk(loadedTag, true); + dimensionMemory.put(chunkCoordIntPair, chunkMemory); + for (String s : loadedKeys) { + dimensionWiseMetaChunkData.get(s).get(dimId).putLoaded(chunkCoordIntPair, loadedTag.getCompoundTag(s)); + } + } else if (!chunkMemory.isLoaded) { + chunkMemory.isLoaded = true; + + Set tagsDuplicated = new HashSet(loadedKeys); + tagsDuplicated.retainAll(chunkMemory.data.func_150296_c()); + + if (tagsDuplicated.isEmpty()) { + for (String s : loadedKeys) { + NBTTagCompound tag = loadedTag.getCompoundTag(s); + chunkMemory.data.setTag(s, tag); + dimensionWiseMetaChunkData.get(s).get(dimId).putLoaded(chunkCoordIntPair, tag); + } + } else { + for (String s : loadedKeys) { + NBTTagCompound memory = chunkMemory.data.getCompoundTag(s); + if (tagsDuplicated.contains(s)) { + metaDataHandlerHashMap.get(s).mergeData(memory, loadedTag.getCompoundTag(s)); + } else { + chunkMemory.data.setTag(s, loadedTag.getCompoundTag(s)); + dimensionWiseMetaChunkData.get(s).get(dimId).putLoaded(chunkCoordIntPair, memory); + } + } + } + } + } + + @SideOnly(Side.CLIENT) + @SubscribeEvent + public void onLoadChunk(ChunkEvent.Load aEvent){ + pullSyncHandlers.forEach(chunkMetaDataHandler -> chunkMetaDataHandler.pullData(aEvent)); + } + + @SideOnly(Side.CLIENT) + @SubscribeEvent + public void onUnLoadChunk(ChunkEvent.Unload aEvent){ + pullSyncHandlers.forEach(chunkMetaDataHandler -> dimensionWiseMetaChunkData + .get(chunkMetaDataHandler.getTagName()) + .get(aEvent.world.provider.dimensionId) + .remove(aEvent.getChunk().getChunkCoordIntPair())); + } + + @SideOnly(Side.CLIENT) + @SubscribeEvent + public void onClientTickEvent(TickEvent.ClientTickEvent aEvent) { + clientHandlers.forEach(chunkMetaDataHandler -> + chunkMetaDataHandler.tickClient( + dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), aEvent)); + } + + @SideOnly(Side.CLIENT) + @SubscribeEvent + public void onRenderTickEvent(TickEvent.RenderTickEvent aEvent) { + renderHandlers.forEach(chunkMetaDataHandler -> + chunkMetaDataHandler.tickRender( + dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), aEvent)); + } + + @SubscribeEvent + public void onServerTickEvent(TickEvent.ServerTickEvent aEvent) { + serverHandlers.forEach(chunkMetaDataHandler -> + chunkMetaDataHandler.tickServer( + dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), aEvent)); + } + + @SubscribeEvent + public void onWorldTickEvent(TickEvent.WorldTickEvent aEvent) { + if(aEvent.side.isServer()) { + int dim = aEvent.world.provider.dimensionId; + pushSyncHandlers.forEach(chunkMetaDataHandler -> { + ChunkHashMap data = dimensionWiseMetaChunkData + .get(chunkMetaDataHandler.getTagName()).get(dim); + int cycle = chunkMetaDataHandler.pushPayloadSpreadPeriod(); + int epoch = (int) (aEvent.world.getTotalWorldTime() % cycle); + ArrayList work; + if (epoch == 0) { + int per = data.dirtyBoys.size() / cycle; + int mod = data.dirtyBoys.size() % cycle; + Iterator iter = data.dirtyBoys.iterator(); + for (int periodWork = 0; periodWork < cycle; periodWork++) { + work = data.workLoad.get(periodWork); + for (int i = 0; i < per; i++) { + work.add(iter.next()); + } + if (periodWork < mod) { + work.add(iter.next()); + } + } + data.dirtyBoys.clear(); + } + work = data.workLoad.get(epoch); + chunkMetaDataHandler.pushPayload(dim, work); + work.clear(); + }); + worldHandlers.forEach(chunkMetaDataHandler -> + chunkMetaDataHandler.tickWorld( + dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), aEvent)); + } + } + + @SubscribeEvent + public void onPlayerTickEvent(TickEvent.PlayerTickEvent aEvent) { + playerHandlers.forEach(chunkMetaDataHandler -> + chunkMetaDataHandler.tickPlayer( + dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), aEvent)); + } + + + public void clearData() { + dimensionWiseChunkData.clear(); + dimensionWiseMetaChunkData.forEach((k,v)->v.clear()); + } + + public IChunkMetaDataHandler getChunkMetaDataHandler(String s){ + return metaDataHandlerHashMap.get(s); + } + + public void registerChunkMetaDataHandler(IChunkMetaDataHandler handler){ + metaDataHandlerHashMap.put(handler.getTagName(),handler); + dimensionWiseMetaChunkData.put(handler.getTagName(),new HashMap<>()); + Class clazz=handler.getClass(); + try { + if(clazz.getMethod("tickServer", HashMap.class, TickEvent.ServerTickEvent.class).getDeclaringClass()!= IChunkMetaDataHandler.class){ + serverHandlers.add(handler); + } + if(clazz.getMethod("tickPlayer", HashMap.class, TickEvent.PlayerTickEvent.class).getDeclaringClass()!= IChunkMetaDataHandler.class){ + playerHandlers.add(handler); + } + if (clazz.getMethod("pushData", int.class, ChunkCoordIntPair.class).getDeclaringClass()!=IChunkMetaDataHandler.class) { + pushSyncHandlers.add(handler); + } + if(clazz.getMethod("tickWorld", HashMap.class, TickEvent.WorldTickEvent.class).getDeclaringClass()!= IChunkMetaDataHandler.class){ + worldHandlers.add(handler); + } + } catch (NoSuchMethodException e) { + throw new RuntimeException("Cannot register common event handlers!",e); + } + if(FMLCommonHandler.instance().getEffectiveSide().isClient()) { + try { + if (clazz.getMethod("pullData", ChunkEvent.Load.class).getDeclaringClass() != IChunkMetaDataHandler.class) { + pullSyncHandlers.add(handler); + } + if (clazz.getMethod("tickClient", HashMap.class, TickEvent.ClientTickEvent.class).getDeclaringClass() != IChunkMetaDataHandler.class) { + clientHandlers.add(handler); + } + if (clazz.getMethod("tickRender", HashMap.class, TickEvent.RenderTickEvent.class).getDeclaringClass() != IChunkMetaDataHandler.class) { + renderHandlers.add(handler); + } + } catch (NoSuchMethodException e) { + throw new RuntimeException("Cannot register client event handlers!",e); + } + } + } + + public NBTTagCompound removeChunkData(IChunkMetaDataHandler handler, int world, ChunkCoordIntPair chunk){ + return dimensionWiseMetaChunkData.get(handler.getTagName()).get(world).remove(chunk); + } + + public NBTTagCompound getChunkData(IChunkMetaDataHandler handler, int world, ChunkCoordIntPair chunk){ + return dimensionWiseMetaChunkData.get(handler.getTagName()).get(world).get(chunk); + } + + public NBTTagCompound putChunkData(IChunkMetaDataHandler handler, int world, ChunkCoordIntPair chunk, NBTTagCompound data){ + return dimensionWiseMetaChunkData.get(handler.getTagName()).get(world).put(chunk,data); + } + + public NBTTagCompound createIfAbsentChunkData(IChunkMetaDataHandler handler, int world, ChunkCoordIntPair chunk){ + return dimensionWiseMetaChunkData.get(handler.getTagName()).get(world) + .computeIfAbsent(chunk,chunkCoordIntPair -> handler.createData()); + } + + public HashMap getChunkData(IChunkMetaDataHandler chunkMetaDataHandler){ + return dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()); + } + + public ChunkHashMap getChunkData(IChunkMetaDataHandler chunkMetaDataHandler, int world){ + return dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()).get(world); + } + + public static final class ChunkHashMap implements Map{ + private final HashMap storage; + private final HashMap storageMeta=new HashMap<>(1024); + private final HashSet dirtyBoys=new HashSet<>(1024); + private final ArrayList> workLoad=new ArrayList<>(); + private final String meta; + + private ChunkHashMap(IChunkMetaDataHandler meta, HashMap storage) { + this.storage =storage; + this.meta=meta.getTagName(); + for (int i = 0; i < meta.pushPayloadSpreadPeriod(); i++) { + workLoad.add(new ArrayList<>(128)); + } + } + + public void markForTransmissionToClient(ChunkCoordIntPair chunk){ + dirtyBoys.add(chunk); + } + + private void putLoaded(ChunkCoordIntPair key, NBTTagCompound value) { + storageMeta.put(key, value); + } + + @Override + public NBTTagCompound remove(Object key) { + NBTTagCompound compound=storageMeta.remove(key); + if(compound!=null) { + NBTChunk chunk = storage.get(key); + chunk.data.removeTag(meta); + if(chunk.data.hasNoTags()){ + storage.remove(key); + } + } + return compound; + } + + @Override + public NBTTagCompound put(ChunkCoordIntPair key, NBTTagCompound value) { + if(value==null){ + return remove(key); + } + NBTChunk chunk = storage.get(key); + if(chunk==null){ + NBTTagCompound base=new NBTTagCompound(); + base.setTag(meta,value); + storage.put(key,new NBTChunk(base,false)); + }else { + chunk.data.setTag(meta,value); + } + return storageMeta.put(key, value); + } + + @Override + public int size() { + return storageMeta.size(); + } + + @Override + public boolean isEmpty() { + return storageMeta.isEmpty(); + } + + @Override + public NBTTagCompound get(Object key) { + return storageMeta.get(key); + } + + @Override + public void clear() { + storageMeta.entrySet().forEach(this::remove); + } + + @Override + public void putAll(Map m) { + m.forEach(this::put); + } + + @Override + public boolean containsKey(Object key) { + return storageMeta.containsKey(key); + } + + @Override + public boolean containsValue(Object value) { + return storageMeta.containsValue(value); + } + + @Override + public Set keySet() { + return storageMeta.keySet(); + } + + @Override + public Collection values() { + return storageMeta.values(); + } + + @Override + public Set> entrySet() { + return storageMeta.entrySet(); + } + } + + private static final class NBTChunk { + private final NBTTagCompound data; + private boolean isLoaded; + + private NBTChunk(NBTTagCompound data, boolean isLoaded) { + if(data==null){ + data=new NBTTagCompound(); + } + this.data = data; + this.isLoaded = isLoaded; + } + } +} diff --git a/src/main/java/com/github/technus/tectech/mechanics/data/ChunkDataMessage.java b/src/main/java/com/github/technus/tectech/mechanics/data/ChunkDataMessage.java new file mode 100644 index 0000000000..a8ed9de2c8 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/data/ChunkDataMessage.java @@ -0,0 +1,101 @@ +package com.github.technus.tectech.mechanics.data; + +import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.Util; +import com.github.technus.tectech.loader.NetworkDispatcher; +import cpw.mods.fml.common.network.ByteBufUtils; +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import cpw.mods.fml.common.network.simpleimpl.MessageContext; +import eu.usrv.yamcore.network.client.AbstractClientMessageHandler; +import eu.usrv.yamcore.network.server.AbstractServerMessageHandler; +import io.netty.buffer.ByteBuf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraftforge.event.world.ChunkEvent; + +public class ChunkDataMessage implements IMessage { + int worldId; + ChunkCoordIntPair chunk; + NBTTagCompound data; + IChunkMetaDataHandler handler; + + public ChunkDataMessage(){} + + @Override + public void fromBytes(ByteBuf pBuffer) { + NBTTagCompound tag = ByteBufUtils.readTag(pBuffer); + worldId = tag.getInteger("wId"); + chunk=new ChunkCoordIntPair( + tag.getInteger("posx"), + tag.getInteger("posz")); + handler = TecTech.chunkDataHandler.getChunkMetaDataHandler( + tag.getString("handle")); + if(tag.hasKey("data")){ + data=tag.getCompoundTag("data"); + } + } + + @Override + public void toBytes(ByteBuf pBuffer) { + NBTTagCompound tag = new NBTTagCompound(); + tag.setInteger("wId",worldId); + tag.setInteger("posx",chunk.chunkXPos); + tag.setInteger("posz",chunk.chunkZPos); + tag.setString("handle",handler.getTagName()); + if(data!=null){ + tag.setTag("data",data); + } + ByteBufUtils.writeTag(pBuffer, tag); + } + + public static class ChunkDataQuery extends ChunkDataMessage { + public ChunkDataQuery() { + } + public ChunkDataQuery(ChunkEvent.Load aEvent, IChunkMetaDataHandler handler) { + worldId=aEvent.world.provider.dimensionId; + chunk=aEvent.getChunk().getChunkCoordIntPair(); + this.handler=handler; + } + } + + public static class ChunkDataData extends ChunkDataMessage { + public ChunkDataData() { + } + + public ChunkDataData(int worldId, ChunkCoordIntPair chunk, IChunkMetaDataHandler handler){ + this.worldId=worldId; + this.chunk=chunk; + this.handler=handler; + this.data=TecTech.chunkDataHandler.getChunkData(handler,worldId,chunk); + } + + public ChunkDataData(ChunkDataQuery query){ + worldId=query.worldId; + chunk=query.chunk; + handler=query.handler; + data=TecTech.chunkDataHandler.getChunkData(handler,worldId,chunk); + } + } + + public static class ClientHandler extends AbstractClientMessageHandler { + @Override + public IMessage handleClientMessage(EntityPlayer pPlayer, ChunkDataData pMessage, MessageContext pCtx) { + if(Util.checkChunkExist(pPlayer.worldObj,pMessage.chunk)){ + TecTech.chunkDataHandler.putChunkData(pMessage.handler, pMessage.worldId,pMessage.chunk, pMessage.data); + } + return null; + } + } + + public static class ServerHandler extends AbstractServerMessageHandler { + @Override + public IMessage handleServerMessage(EntityPlayer pPlayer, ChunkDataQuery pMessage, MessageContext pCtx) { + if(pPlayer instanceof EntityPlayerMP){ + NetworkDispatcher.INSTANCE.sendTo(new ChunkDataData(pMessage),(EntityPlayerMP) pPlayer); + } + return null; + } + } +} diff --git a/src/main/java/com/github/technus/tectech/mechanics/data/IChunkMetaDataHandler.java b/src/main/java/com/github/technus/tectech/mechanics/data/IChunkMetaDataHandler.java new file mode 100644 index 0000000000..a8f5e013c5 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/data/IChunkMetaDataHandler.java @@ -0,0 +1,34 @@ +package com.github.technus.tectech.mechanics.data; + +import cpw.mods.fml.common.gameevent.TickEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraftforge.event.world.ChunkEvent; + +import java.util.ArrayList; +import java.util.HashMap; + +public interface IChunkMetaDataHandler { + String getTagName(); + void mergeData(NBTTagCompound target, NBTTagCompound loadedData); + NBTTagCompound createData(); + @SideOnly(Side.CLIENT) + default void pullData(ChunkEvent.Load aEvent){} + default void pushData(int world, ChunkCoordIntPair chunk){} + default void pushPayload(int world, ArrayList chunk){ + chunk.forEach(chunkCoordIntPair -> pushData(world,chunkCoordIntPair)); + } + default int pushPayloadSpreadPeriod(){ + return 20; + } + @SideOnly(Side.CLIENT) + default void tickRender(HashMap data, TickEvent.RenderTickEvent aEvent){} + @SideOnly(Side.CLIENT) + default void tickClient(HashMap data, TickEvent.ClientTickEvent aEvent){} + default void tickServer(HashMap data, TickEvent.ServerTickEvent event){} + default void tickWorld(HashMap data, TickEvent.WorldTickEvent aEvent){} + default void tickPlayer(HashMap data, TickEvent.PlayerTickEvent aEvent){} +} + diff --git a/src/main/java/com/github/technus/tectech/mechanics/data/PlayerDataMessage.java b/src/main/java/com/github/technus/tectech/mechanics/data/PlayerDataMessage.java new file mode 100644 index 0000000000..ca62fb0876 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/data/PlayerDataMessage.java @@ -0,0 +1,90 @@ +package com.github.technus.tectech.mechanics.data; + +import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.loader.NetworkDispatcher; +import cpw.mods.fml.common.network.ByteBufUtils; +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import cpw.mods.fml.common.network.simpleimpl.MessageContext; +import eu.usrv.yamcore.network.client.AbstractClientMessageHandler; +import eu.usrv.yamcore.network.server.AbstractServerMessageHandler; +import io.netty.buffer.ByteBuf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; + +import java.util.UUID; + +import static java.nio.charset.Charset.forName; + +public class PlayerDataMessage implements IMessage { + NBTTagCompound data; + UUID uuid1,uuid2; + + public PlayerDataMessage(){} + + @Override + public void fromBytes(ByteBuf pBuffer) { + NBTTagCompound tag = ByteBufUtils.readTag(pBuffer); + uuid1=UUID.fromString(tag.getString("id1")); + uuid2=UUID.fromString(tag.getString("id2")); + if(tag.hasKey("data")){ + data=tag.getCompoundTag("data"); + } + } + + @Override + public void toBytes(ByteBuf pBuffer) { + NBTTagCompound tag = new NBTTagCompound(); + tag.setString("id1",uuid1.toString()); + tag.setString("id2",uuid2.toString()); + if(data!=null){ + tag.setTag("data",data); + } + ByteBufUtils.writeTag(pBuffer, tag); + } + + public static class PlayerDataQuery extends PlayerDataMessage { + public PlayerDataQuery() { + } + + public PlayerDataQuery(EntityPlayer player) { + uuid1=player.getUniqueID(); + uuid2=UUID.nameUUIDFromBytes(player.getCommandSenderName().getBytes(forName("UTF-8"))); + } + } + + public static class PlayerDataData extends PlayerDataMessage { + public PlayerDataData() { + } + + public PlayerDataData(EntityPlayer player){ + uuid1=player.getUniqueID(); + uuid2=UUID.nameUUIDFromBytes(player.getCommandSenderName().getBytes(forName("UTF-8"))); + data=TecTech.playerPersistence.getDataOrSetToNewTag(player); + } + + public PlayerDataData(PlayerDataQuery query){ + uuid1=query.uuid1; + uuid2=query.uuid2; + data= TecTech.playerPersistence.getDataOrSetToNewTag(uuid1,uuid2); + } + } + + public static class ClientHandler extends AbstractClientMessageHandler { + @Override + public IMessage handleClientMessage(EntityPlayer pPlayer, PlayerDataData pMessage, MessageContext pCtx) { + TecTech.playerPersistence.putDataOrSetToNewTag(pMessage.uuid1,pMessage.uuid2,pMessage.data); + return null; + } + } + + public static class ServerHandler extends AbstractServerMessageHandler { + @Override + public IMessage handleServerMessage(EntityPlayer pPlayer, PlayerDataQuery pMessage, MessageContext pCtx) { + if(pPlayer instanceof EntityPlayerMP){ + NetworkDispatcher.INSTANCE.sendTo(new PlayerDataData(pMessage),(EntityPlayerMP) pPlayer); + } + return null; + } + } +} diff --git a/src/main/java/com/github/technus/tectech/mechanics/data/PlayerPersistence.java b/src/main/java/com/github/technus/tectech/mechanics/data/PlayerPersistence.java new file mode 100644 index 0000000000..9282001c9a --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/data/PlayerPersistence.java @@ -0,0 +1,72 @@ +package com.github.technus.tectech.mechanics.data; + +import com.github.technus.tectech.Util; +import com.github.technus.tectech.loader.NetworkDispatcher; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.PlayerEvent; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; + +import java.util.HashMap; +import java.util.UUID; + +import static java.nio.charset.Charset.forName; + +public class PlayerPersistence { + private final HashMap map=new HashMap<>(); + private final String extension; + + public PlayerPersistence(String extension) { + this.extension = extension; + } + + public NBTTagCompound getDataOrSetToNewTag(UUID uuid1, UUID uuid2){ + NBTTagCompound tag=map.get(uuid1); + if(tag!=null){ + return tag; + } + tag=map.get(uuid2); + if(tag!=null){ + return tag; + } + tag=Util.getPlayerData(uuid1,uuid2,extension); + if(tag==null){ + tag=new NBTTagCompound(); + } + map.put(uuid1,tag); + map.put(uuid2,tag); + return tag; + } + + public NBTTagCompound getDataOrSetToNewTag(EntityPlayer player){ + return getDataOrSetToNewTag(player.getUniqueID(),UUID.nameUUIDFromBytes(player.getCommandSenderName().getBytes(forName("UTF-8")))); + } + + public void putDataOrSetToNewTag(UUID uuid1, UUID uuid2, NBTTagCompound tagCompound){ + if(tagCompound==null){ + tagCompound=new NBTTagCompound(); + } + map.put(uuid1,tagCompound); + map.put(uuid2,tagCompound); + } + + public void putDataOrSetToNewTag(EntityPlayer player, NBTTagCompound tagCompound){ + putDataOrSetToNewTag(player.getUniqueID(),UUID.nameUUIDFromBytes(player.getCommandSenderName().getBytes(forName("UTF-8"))),tagCompound); + } + + public void saveData(EntityPlayer player){ + Util.savePlayerFile(player,extension,getDataOrSetToNewTag(player)); + } + + @SubscribeEvent + public void onLogin(PlayerEvent.PlayerLoggedInEvent event){ + if(event.player instanceof EntityPlayerMP){ + NetworkDispatcher.INSTANCE.sendTo(new PlayerDataMessage.PlayerDataData(event.player),(EntityPlayerMP)event.player); + } + } + + public void clearData() { + map.clear(); + } +} diff --git a/src/main/java/com/github/technus/tectech/mechanics/data/WorldData.java b/src/main/java/com/github/technus/tectech/mechanics/data/WorldData.java new file mode 100644 index 0000000000..4f6f730c9b --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/data/WorldData.java @@ -0,0 +1,52 @@ +package com.github.technus.tectech.mechanics.data; + +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; + +import java.util.Objects; + +public final class WorldData { + private final World world; + private final Chunk chunk; + private final ChunkCoordIntPair coordIntPair; + + public WorldData(World world, Chunk data) { + this.world = world; + this.chunk = data; + coordIntPair=data.getChunkCoordIntPair(); + } + + public WorldData(World world, ChunkCoordIntPair data) { + this.world = world; + this.coordIntPair = data; + chunk= world.getChunkFromChunkCoords(data.chunkXPos,data.chunkZPos); + } + + public World getWorld() { + return world; + } + + public Chunk getChunk() { + return chunk; + } + + public ChunkCoordIntPair getCoordIntPair() { + return coordIntPair; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + WorldData worldData = (WorldData) o; + return world.provider.dimensionId==worldData.world.provider.dimensionId && + coordIntPair.chunkXPos==worldData.coordIntPair.chunkXPos && + coordIntPair.chunkZPos==worldData.coordIntPair.chunkXPos; + } + + @Override + public int hashCode() { + return Objects.hash(world.provider.dimensionId, coordIntPair); + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/RotationMessage.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/RotationMessage.java new file mode 100644 index 0000000000..92b38e68ea --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/RotationMessage.java @@ -0,0 +1,139 @@ +package com.github.technus.tectech.thing.metaTileEntity; + +import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import cpw.mods.fml.common.network.ByteBufUtils; +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import cpw.mods.fml.common.network.simpleimpl.MessageContext; +import eu.usrv.yamcore.network.client.AbstractClientMessageHandler; +import eu.usrv.yamcore.network.server.AbstractServerMessageHandler; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import io.netty.buffer.ByteBuf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.DimensionManager; + +public class RotationMessage implements IMessage { + int mPosX; + int mPosY; + int mPosZ; + int mPosD; + int mRotF; + + public RotationMessage() { + } + + private RotationMessage(GT_MetaTileEntity_MultiblockBase_EM metaTile) { + IGregTechTileEntity base=metaTile.getBaseMetaTileEntity(); + mPosX=base.getXCoord(); + mPosY=base.getYCoord(); + mPosZ=base.getZCoord(); + mPosD=base.getWorld().provider.dimensionId; + mRotF=metaTile.getFrontRotation(); + } + + private RotationMessage(World world, int x,int y,int z, IFrontRotation front) { + mPosX=x; + mPosY=y; + mPosZ=z; + mPosD=world.provider.dimensionId; + mRotF=front.getFrontRotation(); + } + + @Override + public void fromBytes(ByteBuf pBuffer) { + NBTTagCompound tTag = ByteBufUtils.readTag(pBuffer); + mPosX = tTag.getInteger("posx"); + mPosY = tTag.getInteger("posy"); + mPosZ = tTag.getInteger("posz"); + mPosD = tTag.getInteger("posd"); + mRotF = tTag.getInteger("rotf"); + } + + @Override + public void toBytes(ByteBuf pBuffer) { + NBTTagCompound tFXTag = new NBTTagCompound(); + tFXTag.setInteger("posx", mPosX); + tFXTag.setInteger("posy", mPosY); + tFXTag.setInteger("posz", mPosZ); + tFXTag.setInteger("posd", mPosD); + tFXTag.setInteger("rotf", mRotF); + + ByteBufUtils.writeTag(pBuffer, tFXTag); + } + + public static class RotationQuery extends RotationMessage{ + public RotationQuery() { + } + + public RotationQuery(GT_MetaTileEntity_MultiblockBase_EM metaTile) { + super(metaTile); + } + + public RotationQuery(World world, int x,int y,int z, IFrontRotation front) { + super(world,x,y,z,front); + } + } + + public static class RotationData extends RotationMessage{ + public RotationData() { + } + + private RotationData(RotationQuery query){ + mPosX=query.mPosX; + mPosY=query.mPosY; + mPosZ=query.mPosZ; + mPosD=query.mPosD; + mRotF=query.mRotF; + } + + public RotationData(GT_MetaTileEntity_MultiblockBase_EM metaTile) { + super(metaTile); + } + + public RotationData(World world, int x,int y,int z, IFrontRotation front) { + super(world,x,y,z,front); + } + } + + public static class ClientHandler extends AbstractClientMessageHandler { + @Override + public IMessage handleClientMessage(EntityPlayer pPlayer, RotationData pMessage, MessageContext pCtx) { + if(pPlayer.worldObj.provider.dimensionId==pMessage.mPosD){ + TileEntity te=pPlayer.worldObj.getTileEntity(pMessage.mPosX,pMessage.mPosY,pMessage.mPosZ); + if(te instanceof IGregTechTileEntity){ + IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity(); + if(meta instanceof IFrontRotation){ + ((IFrontRotation) meta).forceSetRotationDoRender((byte)pMessage.mRotF); + } + }else if (te instanceof IFrontRotation){ + ((IFrontRotation) te).forceSetRotationDoRender((byte)pMessage.mRotF); + } + } + return null; + } + } + + public static class ServerHandler extends AbstractServerMessageHandler { + @Override + public IMessage handleServerMessage(EntityPlayer pPlayer, RotationQuery pMessage, MessageContext pCtx) { + World world= DimensionManager.getWorld(pMessage.mPosD); + if(world!=null) { + TileEntity te = world.getTileEntity(pMessage.mPosX, pMessage.mPosY, pMessage.mPosZ); + if (te instanceof IGregTechTileEntity) { + IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity(); + if (meta instanceof IFrontRotation) { + pMessage.mRotF=((IFrontRotation) meta).getFrontRotation(); + return new RotationData(pMessage); + } + } else if (te instanceof IFrontRotation) { + pMessage.mRotF=((IFrontRotation) te).getFrontRotation(); + return new RotationData(pMessage); + } + } + return null; + } + } +} \ No newline at end of file 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 90e69c4fb7..19d64910e1 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 @@ -10,8 +10,8 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElement import com.github.technus.tectech.mechanics.elementalMatter.core.tElementalException; import com.github.technus.tectech.thing.metaTileEntity.IFrontRotation; import com.github.technus.tectech.thing.metaTileEntity.hatch.*; -import com.github.technus.tectech.loader.network.RotationMessage; -import com.github.technus.tectech.loader.network.NetworkDispatcher; +import com.github.technus.tectech.thing.metaTileEntity.RotationMessage; +import com.github.technus.tectech.loader.NetworkDispatcher; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java index 3331430cb9..6c406313fb 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Data.java @@ -2,8 +2,7 @@ package com.github.technus.tectech.thing.metaTileEntity.pipe; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.loader.network.PipeActivityMessage; -import com.github.technus.tectech.loader.network.NetworkDispatcher; +import com.github.technus.tectech.loader.NetworkDispatcher; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.GT_Mod; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java index caccee07c4..742d298bc6 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_EM.java @@ -2,8 +2,7 @@ package com.github.technus.tectech.thing.metaTileEntity.pipe; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.loader.network.PipeActivityMessage; -import com.github.technus.tectech.loader.network.NetworkDispatcher; +import com.github.technus.tectech.loader.NetworkDispatcher; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.GT_Mod; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java index 8ee90c6954..4cc40b471c 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/GT_MetaTileEntity_Pipe_Energy.java @@ -2,8 +2,7 @@ package com.github.technus.tectech.thing.metaTileEntity.pipe; import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.loader.network.PipeActivityMessage; -import com.github.technus.tectech.loader.network.NetworkDispatcher; +import com.github.technus.tectech.loader.NetworkDispatcher; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.GT_Mod; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/PipeActivityMessage.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/PipeActivityMessage.java new file mode 100644 index 0000000000..e7183b8838 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/pipe/PipeActivityMessage.java @@ -0,0 +1,133 @@ +package com.github.technus.tectech.thing.metaTileEntity.pipe; + +import cpw.mods.fml.common.network.ByteBufUtils; +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import cpw.mods.fml.common.network.simpleimpl.MessageContext; +import eu.usrv.yamcore.network.client.AbstractClientMessageHandler; +import eu.usrv.yamcore.network.server.AbstractServerMessageHandler; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import io.netty.buffer.ByteBuf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.DimensionManager; + +public class PipeActivityMessage implements IMessage { + int mPosX; + int mPosY; + int mPosZ; + int mPosD; + int mActive; + + public PipeActivityMessage() { + } + + private PipeActivityMessage(IActivePipe metaTile) { + IGregTechTileEntity base=metaTile.getBaseMetaTileEntity(); + mPosX=base.getXCoord(); + mPosY=base.getYCoord(); + mPosZ=base.getZCoord(); + mPosD=base.getWorld().provider.dimensionId; + mActive=metaTile.getActive()?1:0; + } + + private PipeActivityMessage(World world, int x, int y, int z, boolean active) { + mPosX=x; + mPosY=y; + mPosZ=z; + mPosD=world.provider.dimensionId; + mActive=active?1:0; + } + + @Override + public void fromBytes(ByteBuf pBuffer) { + NBTTagCompound tTag = ByteBufUtils.readTag(pBuffer); + mPosX = tTag.getInteger("posx"); + mPosY = tTag.getInteger("posy"); + mPosZ = tTag.getInteger("posz"); + mPosD = tTag.getInteger("posd"); + mActive = tTag.getInteger("active"); + } + + @Override + public void toBytes(ByteBuf pBuffer) { + NBTTagCompound tFXTag = new NBTTagCompound(); + tFXTag.setInteger("posx", mPosX); + tFXTag.setInteger("posy", mPosY); + tFXTag.setInteger("posz", mPosZ); + tFXTag.setInteger("posd", mPosD); + tFXTag.setInteger("active", mActive); + + ByteBufUtils.writeTag(pBuffer, tFXTag); + } + + public static class PipeActivityQuery extends PipeActivityMessage { + public PipeActivityQuery() { + } + + public PipeActivityQuery(IActivePipe metaTile) { + super(metaTile); + } + + public PipeActivityQuery(World world, int x,int y,int z, boolean active) { + super(world,x,y,z,active); + } + } + + public static class PipeActivityData extends PipeActivityMessage { + public PipeActivityData() { + } + + private PipeActivityData(PipeActivityQuery query){ + mPosX=query.mPosX; + mPosY=query.mPosY; + mPosZ=query.mPosZ; + mPosD=query.mPosD; + mActive=query.mActive; + } + + public PipeActivityData(IActivePipe metaTile) { + super(metaTile); + } + + public PipeActivityData(World world, int x,int y,int z, boolean active) { + super(world,x,y,z,active); + } + } + + public static class ClientHandler extends AbstractClientMessageHandler { + @Override + public IMessage handleClientMessage(EntityPlayer pPlayer, PipeActivityData pMessage, MessageContext pCtx) { + if(pPlayer.worldObj.provider.dimensionId==pMessage.mPosD){ + TileEntity te=pPlayer.worldObj.getTileEntity(pMessage.mPosX,pMessage.mPosY,pMessage.mPosZ); + if(te instanceof IGregTechTileEntity){ + IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity(); + if(meta instanceof IActivePipe){ + ((IActivePipe) meta).setActive((byte)pMessage.mActive==1); + } + } + } + return null; + } + } + + public static class ServerHandler extends AbstractServerMessageHandler { + @Override + public IMessage handleServerMessage(EntityPlayer pPlayer, PipeActivityQuery pMessage, MessageContext pCtx) { + World world= DimensionManager.getWorld(pMessage.mPosD); + if(world!=null) { + TileEntity te = world.getTileEntity(pMessage.mPosX, pMessage.mPosY, pMessage.mPosZ); + if (te instanceof IGregTechTileEntity) { + IMetaTileEntity meta = ((IGregTechTileEntity) te).getMetaTileEntity(); + if (meta instanceof IActivePipe) { + pMessage.mActive=((IActivePipe) meta).getActive()?1:0; + return new PipeActivityData(pMessage); + } + } + } + return null; + } + } +} \ No newline at end of file -- cgit From a696ad3aa1660fb74b4b8a2ea792cc0cde86f595 Mon Sep 17 00:00:00 2001 From: Tec Date: Mon, 15 Jul 2019 20:06:58 +0200 Subject: Sanser command --- .../java/com/github/technus/tectech/TecTech.java | 2 + .../tectech/mechanics/anomaly/AnomalyHandler.java | 10 +-- .../tectech/mechanics/commands/CancerCommand.java | 87 ++++++++++++++++++++++ 3 files changed, 94 insertions(+), 5 deletions(-) create mode 100644 src/main/java/com/github/technus/tectech/mechanics/commands/CancerCommand.java diff --git a/src/main/java/com/github/technus/tectech/TecTech.java b/src/main/java/com/github/technus/tectech/TecTech.java index 493d3aa115..096aafc468 100644 --- a/src/main/java/com/github/technus/tectech/TecTech.java +++ b/src/main/java/com/github/technus/tectech/TecTech.java @@ -2,6 +2,7 @@ package com.github.technus.tectech; import com.github.technus.tectech.loader.MainLoader; import com.github.technus.tectech.loader.TecTechConfig; +import com.github.technus.tectech.mechanics.commands.CancerCommand; import com.github.technus.tectech.mechanics.commands.ConvertFloat; import com.github.technus.tectech.mechanics.commands.ConvertInteger; import com.github.technus.tectech.mechanics.anomaly.AnomalyHandler; @@ -205,6 +206,7 @@ public class TecTech { pEvent.registerServerCommand(new ListEM()); if(DEBUG_MODE) { pEvent.registerServerCommand(new GiveEM()); + pEvent.registerServerCommand(new CancerCommand()); } } diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java index 4f76b22279..01c028bf40 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java @@ -33,11 +33,11 @@ import java.util.HashMap; import java.util.List; public class AnomalyHandler implements IChunkMetaDataHandler { - private static final double SWAP_THRESHOLD = dAtomDefinition.getSomethingHeavy().getMass() * 10000D; - private static final int COUNT_DIV=32; - private static final double PER_PARTICLE=SWAP_THRESHOLD/COUNT_DIV; - private static final String INTENSITY = "intensity",SPACE_CANCER="space_cancer"; - private static final int MEAN_DELAY =50; + public static final double SWAP_THRESHOLD = dAtomDefinition.getSomethingHeavy().getMass() * 10000D; + public static final int COUNT_DIV=32; + public static final double PER_PARTICLE=SWAP_THRESHOLD/COUNT_DIV; + public static final String INTENSITY = "intensity",SPACE_CANCER="space_cancer"; + public static final int MEAN_DELAY =50; private boolean fixMe=false; diff --git a/src/main/java/com/github/technus/tectech/mechanics/commands/CancerCommand.java b/src/main/java/com/github/technus/tectech/mechanics/commands/CancerCommand.java new file mode 100644 index 0000000000..64caeb1caf --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/commands/CancerCommand.java @@ -0,0 +1,87 @@ +package com.github.technus.tectech.mechanics.commands; + +import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.loader.NetworkDispatcher; +import com.github.technus.tectech.mechanics.data.PlayerDataMessage; +import net.minecraft.command.ICommand; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ChatComponentText; + +import java.util.ArrayList; +import java.util.List; + +import static com.github.technus.tectech.mechanics.anomaly.AnomalyHandler.SPACE_CANCER; + +public class CancerCommand implements ICommand { + ArrayList aliases=new ArrayList<>(); + + public CancerCommand(){ + aliases.add("cancer"); + } + + @Override + public void processCommand(ICommandSender sender, String[] args) { + if (sender instanceof EntityPlayerMP && !sender.getEntityWorld().isRemote) { + double amount; + try { + amount = Double.parseDouble(args[0]); + }catch (NumberFormatException e){ + sender.addChatMessage(new ChatComponentText("Cannot parse amount!")); + return; + } + if(amount<0||amount>2){ + sender.addChatMessage(new ChatComponentText("Invalid amount provided!")); + return; + } + EntityPlayerMP player=(EntityPlayerMP)sender; + NBTTagCompound playerTag = TecTech.playerPersistence.getDataOrSetToNewTag(player); + if(player.capabilities.isCreativeMode){ + sender.addChatMessage(new ChatComponentText("Doesn't really work in creative mode!")); + }else { + playerTag.setDouble(SPACE_CANCER, amount); + TecTech.playerPersistence.saveData(player); + NetworkDispatcher.INSTANCE.sendTo(new PlayerDataMessage.PlayerDataData(player), player); + } + } + } + + @Override + public boolean isUsernameIndex(String[] p_82358_1_, int p_82358_2_) { + return false; + } + + @Override + public List getCommandAliases() { + return aliases; + } + + @Override + public String getCommandName() { + return aliases.get(0); + } + + @Override + public List addTabCompletionOptions(ICommandSender sender, String[] args) { + return null; + } + + @Override + public String getCommandUsage(ICommandSender p_71518_1_) { + return "cancer [Amount 0.0-2.0]"; + } + + @Override + public int compareTo(Object o) { + if(o instanceof ICommand){ + return getCommandName().compareTo(((ICommand) o).getCommandName()); + } + return 0; + } + + @Override + public boolean canCommandSenderUseCommand(ICommandSender sender) { + return true; + } +} -- cgit From 7e9be0b980555a169b735cb73d3ae67b670c3d3c Mon Sep 17 00:00:00 2001 From: Tec Date: Mon, 15 Jul 2019 20:13:44 +0200 Subject: When did i accidently broke it... --- .../com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java index 01c028bf40..c4e6c026ea 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java @@ -201,7 +201,7 @@ public class AnomalyHandler implements IChunkMetaDataHandler { public void tickRender(HashMap data, TickEvent.RenderTickEvent aEvent) { EntityClientPlayerMP player=Minecraft.getMinecraft().thePlayer; if(player!=null) { - if(player.capabilities.isCreativeMode) { + if(!player.capabilities.isCreativeMode) { NBTTagCompound tagCompound = TecTech.playerPersistence.getDataOrSetToNewTag(Minecraft.getMinecraft().thePlayer); if (tagCompound != null) { float cancer = tagCompound.getFloat(SPACE_CANCER); -- cgit From b2d44dfbbb714fcb30a526a20405e9436855a233 Mon Sep 17 00:00:00 2001 From: Tec Date: Tue, 16 Jul 2019 12:07:50 +0200 Subject: Do not unload in SSP --- .../technus/tectech/mechanics/data/ChunkDataHandler.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/mechanics/data/ChunkDataHandler.java b/src/main/java/com/github/technus/tectech/mechanics/data/ChunkDataHandler.java index f6d84d6b12..8109db9b86 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/data/ChunkDataHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/data/ChunkDataHandler.java @@ -5,6 +5,7 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.ChunkCoordIntPair; import net.minecraftforge.event.world.ChunkDataEvent; @@ -102,10 +103,12 @@ public class ChunkDataHandler { @SideOnly(Side.CLIENT) @SubscribeEvent public void onUnLoadChunk(ChunkEvent.Unload aEvent){ - pullSyncHandlers.forEach(chunkMetaDataHandler -> dimensionWiseMetaChunkData - .get(chunkMetaDataHandler.getTagName()) - .get(aEvent.world.provider.dimensionId) - .remove(aEvent.getChunk().getChunkCoordIntPair())); + if(aEvent.world.isRemote && !Minecraft.getMinecraft().isSingleplayer()) { + pullSyncHandlers.forEach(chunkMetaDataHandler -> dimensionWiseMetaChunkData + .get(chunkMetaDataHandler.getTagName()) + .get(aEvent.world.provider.dimensionId) + .remove(aEvent.getChunk().getChunkCoordIntPair())); + } } @SideOnly(Side.CLIENT) -- cgit From ba2ebe760a7000b058ef504505d73aabefc6a576 Mon Sep 17 00:00:00 2001 From: Tec Date: Tue, 16 Jul 2019 12:14:14 +0200 Subject: Change Cancer Command --- .../tectech/mechanics/anomaly/CancerCommand.java | 90 ++++++++++++++++++++++ .../tectech/mechanics/commands/CancerCommand.java | 87 --------------------- 2 files changed, 90 insertions(+), 87 deletions(-) create mode 100644 src/main/java/com/github/technus/tectech/mechanics/anomaly/CancerCommand.java delete mode 100644 src/main/java/com/github/technus/tectech/mechanics/commands/CancerCommand.java diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/CancerCommand.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/CancerCommand.java new file mode 100644 index 0000000000..c19cca64d5 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/CancerCommand.java @@ -0,0 +1,90 @@ +package com.github.technus.tectech.mechanics.anomaly; + +import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.loader.NetworkDispatcher; +import com.github.technus.tectech.mechanics.data.PlayerDataMessage; +import net.minecraft.command.ICommand; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ChatComponentText; + +import java.util.ArrayList; +import java.util.List; + +import static com.github.technus.tectech.mechanics.anomaly.AnomalyHandler.SPACE_CANCER; + +public class CancerCommand implements ICommand { + ArrayList aliases=new ArrayList<>(); + + public CancerCommand(){ + aliases.add("cancer_EM"); + aliases.add("cancer"); + aliases.add("sanser"); + aliases.add("sancer"); + } + + @Override + public void processCommand(ICommandSender sender, String[] args) { + if (sender instanceof EntityPlayerMP && !sender.getEntityWorld().isRemote) { + double amount; + try { + amount = Double.parseDouble(args[0]); + }catch (NumberFormatException e){ + sender.addChatMessage(new ChatComponentText("Cannot parse amount!")); + return; + } + if(amount<0||amount>2){ + sender.addChatMessage(new ChatComponentText("Invalid amount provided!")); + return; + } + EntityPlayerMP player=(EntityPlayerMP)sender; + NBTTagCompound playerTag = TecTech.playerPersistence.getDataOrSetToNewTag(player); + if(player.capabilities.isCreativeMode){ + sender.addChatMessage(new ChatComponentText("Doesn't really work in creative mode!")); + }else { + playerTag.setDouble(SPACE_CANCER, amount); + TecTech.playerPersistence.saveData(player); + NetworkDispatcher.INSTANCE.sendTo(new PlayerDataMessage.PlayerDataData(player), player); + } + } + } + + @Override + public boolean isUsernameIndex(String[] p_82358_1_, int p_82358_2_) { + return false; + } + + @Override + public List getCommandAliases() { + return aliases; + } + + @Override + public String getCommandName() { + return aliases.get(0); + } + + @Override + public List addTabCompletionOptions(ICommandSender sender, String[] args) { + return null; + } + + @Override + public String getCommandUsage(ICommandSender p_71518_1_) { + return "cancer_EM [Amount 0.0-2.0]"; + } + + @Override + public int compareTo(Object o) { + if(o instanceof ICommand){ + return getCommandName().compareTo(((ICommand) o).getCommandName()); + } + return 0; + } + + @Override + public boolean canCommandSenderUseCommand(ICommandSender sender) { + return true; + } +} diff --git a/src/main/java/com/github/technus/tectech/mechanics/commands/CancerCommand.java b/src/main/java/com/github/technus/tectech/mechanics/commands/CancerCommand.java deleted file mode 100644 index 64caeb1caf..0000000000 --- a/src/main/java/com/github/technus/tectech/mechanics/commands/CancerCommand.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.github.technus.tectech.mechanics.commands; - -import com.github.technus.tectech.TecTech; -import com.github.technus.tectech.loader.NetworkDispatcher; -import com.github.technus.tectech.mechanics.data.PlayerDataMessage; -import net.minecraft.command.ICommand; -import net.minecraft.command.ICommandSender; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ChatComponentText; - -import java.util.ArrayList; -import java.util.List; - -import static com.github.technus.tectech.mechanics.anomaly.AnomalyHandler.SPACE_CANCER; - -public class CancerCommand implements ICommand { - ArrayList aliases=new ArrayList<>(); - - public CancerCommand(){ - aliases.add("cancer"); - } - - @Override - public void processCommand(ICommandSender sender, String[] args) { - if (sender instanceof EntityPlayerMP && !sender.getEntityWorld().isRemote) { - double amount; - try { - amount = Double.parseDouble(args[0]); - }catch (NumberFormatException e){ - sender.addChatMessage(new ChatComponentText("Cannot parse amount!")); - return; - } - if(amount<0||amount>2){ - sender.addChatMessage(new ChatComponentText("Invalid amount provided!")); - return; - } - EntityPlayerMP player=(EntityPlayerMP)sender; - NBTTagCompound playerTag = TecTech.playerPersistence.getDataOrSetToNewTag(player); - if(player.capabilities.isCreativeMode){ - sender.addChatMessage(new ChatComponentText("Doesn't really work in creative mode!")); - }else { - playerTag.setDouble(SPACE_CANCER, amount); - TecTech.playerPersistence.saveData(player); - NetworkDispatcher.INSTANCE.sendTo(new PlayerDataMessage.PlayerDataData(player), player); - } - } - } - - @Override - public boolean isUsernameIndex(String[] p_82358_1_, int p_82358_2_) { - return false; - } - - @Override - public List getCommandAliases() { - return aliases; - } - - @Override - public String getCommandName() { - return aliases.get(0); - } - - @Override - public List addTabCompletionOptions(ICommandSender sender, String[] args) { - return null; - } - - @Override - public String getCommandUsage(ICommandSender p_71518_1_) { - return "cancer [Amount 0.0-2.0]"; - } - - @Override - public int compareTo(Object o) { - if(o instanceof ICommand){ - return getCommandName().compareTo(((ICommand) o).getCommandName()); - } - return 0; - } - - @Override - public boolean canCommandSenderUseCommand(ICommandSender sender) { - return true; - } -} -- cgit From a26324b8d84f1185d1452ff6ce77f1978efad2e7 Mon Sep 17 00:00:00 2001 From: Tec Date: Tue, 16 Jul 2019 12:14:42 +0200 Subject: Add proxy get Player --- src/main/java/com/github/technus/tectech/proxy/ClientProxy.java | 6 ++++++ src/main/java/com/github/technus/tectech/proxy/CommonProxy.java | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java index 255cf56e96..d66cc8bf82 100644 --- a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java +++ b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java @@ -14,6 +14,7 @@ import cpw.mods.fml.common.Loader; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityClientPlayerMP; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.GuiNewChat; import net.minecraft.client.particle.EntityExplodeFX; @@ -138,4 +139,9 @@ public class ClientProxy extends CommonProxy { public void renderAABB(AxisAlignedBB box) { renderAABB(Minecraft.getMinecraft().theWorld,box); } + + @Override + public EntityClientPlayerMP getPlayer(){ + return Minecraft.getMinecraft().thePlayer; + } } diff --git a/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java b/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java index 598a8b148f..6f5f367d7f 100644 --- a/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java +++ b/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java @@ -81,4 +81,8 @@ public class CommonProxy implements IGuiHandler { } return false; } + + public EntityPlayer getPlayer(){ + return null; + } } -- cgit From ce2ee8cb6a41031d4b1b4912a0d6017feaf68840 Mon Sep 17 00:00:00 2001 From: Tec Date: Tue, 16 Jul 2019 12:15:06 +0200 Subject: Remove that print line --- .../com/github/technus/tectech/thing/item/FrontRotationTriggerItem.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/github/technus/tectech/thing/item/FrontRotationTriggerItem.java b/src/main/java/com/github/technus/tectech/thing/item/FrontRotationTriggerItem.java index 8e2a1c1a9b..15567bc477 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/FrontRotationTriggerItem.java +++ b/src/main/java/com/github/technus/tectech/thing/item/FrontRotationTriggerItem.java @@ -40,7 +40,6 @@ public final class FrontRotationTriggerItem extends Item { IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); if (metaTE instanceof IFrontRotation) { ((IFrontRotation) metaTE).rotateAroundFrontPlane(!aPlayer.isSneaking()); - System.out.println("DID SHIT"); return true; } } else if (tTileEntity instanceof IFrontRotation) { -- cgit From 312baeb8c15e01551885606989a2a3268b89573c Mon Sep 17 00:00:00 2001 From: Tec Date: Tue, 16 Jul 2019 12:19:20 +0200 Subject: Update imports --- src/main/java/com/github/technus/tectech/TecTech.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/TecTech.java b/src/main/java/com/github/technus/tectech/TecTech.java index 096aafc468..264c8dd797 100644 --- a/src/main/java/com/github/technus/tectech/TecTech.java +++ b/src/main/java/com/github/technus/tectech/TecTech.java @@ -2,10 +2,10 @@ package com.github.technus.tectech; import com.github.technus.tectech.loader.MainLoader; import com.github.technus.tectech.loader.TecTechConfig; -import com.github.technus.tectech.mechanics.commands.CancerCommand; +import com.github.technus.tectech.mechanics.anomaly.AnomalyHandler; +import com.github.technus.tectech.mechanics.anomaly.CancerCommand; import com.github.technus.tectech.mechanics.commands.ConvertFloat; import com.github.technus.tectech.mechanics.commands.ConvertInteger; -import com.github.technus.tectech.mechanics.anomaly.AnomalyHandler; import com.github.technus.tectech.mechanics.data.ChunkDataHandler; import com.github.technus.tectech.mechanics.data.PlayerPersistence; import com.github.technus.tectech.mechanics.elementalMatter.core.commands.GiveEM; -- cgit From 0989424cca10758930071d0846070e521f856957 Mon Sep 17 00:00:00 2001 From: Tec Date: Tue, 16 Jul 2019 12:27:31 +0200 Subject: Route get player to proxy --- .../technus/tectech/mechanics/anomaly/AnomalyHandler.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java index c4e6c026ea..4eb2cc45a2 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java @@ -2,11 +2,11 @@ package com.github.technus.tectech.mechanics.anomaly; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.Util; -import com.github.technus.tectech.mechanics.data.ChunkDataHandler; -import com.github.technus.tectech.mechanics.data.IChunkMetaDataHandler; import com.github.technus.tectech.loader.MainLoader; -import com.github.technus.tectech.mechanics.data.ChunkDataMessage; import com.github.technus.tectech.loader.NetworkDispatcher; +import com.github.technus.tectech.mechanics.data.ChunkDataHandler; +import com.github.technus.tectech.mechanics.data.ChunkDataMessage; +import com.github.technus.tectech.mechanics.data.IChunkMetaDataHandler; import com.github.technus.tectech.mechanics.data.PlayerDataMessage; import com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.atom.dAtomDefinition; import cpw.mods.fml.common.gameevent.TickEvent; @@ -14,8 +14,6 @@ import gregtech.api.GregTech_API; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; -import net.minecraft.client.entity.EntityClientPlayerMP; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; @@ -152,7 +150,7 @@ public class AnomalyHandler implements IChunkMetaDataHandler { @Override public void tickPlayer(HashMap data, TickEvent.PlayerTickEvent aEvent) { if (aEvent.side.isClient()) { - EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer; + EntityPlayer player = TecTech.proxy.getPlayer(); ChunkCoordIntPair pair = new ChunkCoordIntPair(player.chunkCoordX, player.chunkCoordZ); NBTTagCompound compound = data.get(player.worldObj.provider.dimensionId).get(pair); if (compound != null) { @@ -199,10 +197,10 @@ public class AnomalyHandler implements IChunkMetaDataHandler { @Override public void tickRender(HashMap data, TickEvent.RenderTickEvent aEvent) { - EntityClientPlayerMP player=Minecraft.getMinecraft().thePlayer; + EntityPlayer player=TecTech.proxy.getPlayer(); if(player!=null) { if(!player.capabilities.isCreativeMode) { - NBTTagCompound tagCompound = TecTech.playerPersistence.getDataOrSetToNewTag(Minecraft.getMinecraft().thePlayer); + NBTTagCompound tagCompound = TecTech.playerPersistence.getDataOrSetToNewTag(player); if (tagCompound != null) { float cancer = tagCompound.getFloat(SPACE_CANCER); if (cancer > 0) { -- cgit From ec335befdb0c2e03a33f4fbf42587b5585cf3796 Mon Sep 17 00:00:00 2001 From: Tec Date: Tue, 16 Jul 2019 23:49:27 +0200 Subject: It should work now. --- .../java/com/github/technus/tectech/TecTech.java | 2 + .../tectech/mechanics/anomaly/AnomalyHandler.java | 179 +++++++++++++++------ .../tectech/mechanics/anomaly/CancerCommand.java | 1 + .../tectech/mechanics/anomaly/ChargeCommand.java | 85 ++++++++++ .../tectech/mechanics/data/ChunkDataHandler.java | 70 ++++---- .../mechanics/data/IChunkMetaDataHandler.java | 15 +- .../tectech/mechanics/data/PlayerPersistence.java | 11 +- .../github/technus/tectech/proxy/ClientProxy.java | 4 + .../github/technus/tectech/proxy/CommonProxy.java | 4 + .../thing/item/ConstructableTriggerItem.java | 3 +- 10 files changed, 280 insertions(+), 94 deletions(-) create mode 100644 src/main/java/com/github/technus/tectech/mechanics/anomaly/ChargeCommand.java diff --git a/src/main/java/com/github/technus/tectech/TecTech.java b/src/main/java/com/github/technus/tectech/TecTech.java index 264c8dd797..f998a9017b 100644 --- a/src/main/java/com/github/technus/tectech/TecTech.java +++ b/src/main/java/com/github/technus/tectech/TecTech.java @@ -4,6 +4,7 @@ import com.github.technus.tectech.loader.MainLoader; import com.github.technus.tectech.loader.TecTechConfig; import com.github.technus.tectech.mechanics.anomaly.AnomalyHandler; import com.github.technus.tectech.mechanics.anomaly.CancerCommand; +import com.github.technus.tectech.mechanics.anomaly.ChargeCommand; import com.github.technus.tectech.mechanics.commands.ConvertFloat; import com.github.technus.tectech.mechanics.commands.ConvertInteger; import com.github.technus.tectech.mechanics.data.ChunkDataHandler; @@ -207,6 +208,7 @@ public class TecTech { if(DEBUG_MODE) { pEvent.registerServerCommand(new GiveEM()); pEvent.registerServerCommand(new CancerCommand()); + pEvent.registerServerCommand(new ChargeCommand()); } } diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java index 4eb2cc45a2..2f65fc05a1 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java @@ -20,7 +20,6 @@ import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; -import net.minecraft.util.Vec3; import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; @@ -34,10 +33,14 @@ public class AnomalyHandler implements IChunkMetaDataHandler { public static final double SWAP_THRESHOLD = dAtomDefinition.getSomethingHeavy().getMass() * 10000D; public static final int COUNT_DIV=32; public static final double PER_PARTICLE=SWAP_THRESHOLD/COUNT_DIV; - public static final String INTENSITY = "intensity",SPACE_CANCER="space_cancer"; + public static final String INTENSITY = "intensity",SPACE_CANCER="space_cancer", SPACE_CHARGE ="space_charge"; public static final int MEAN_DELAY =50; + private static final float CHARGE_EFFECTIVENESS = 10; + private static final float CHARGE_EXPLOSIVENESS = 5; private boolean fixMe=false; + private final ArrayList playersWithCharge = new ArrayList<>(); + private final ArrayList worldDataArrayList = new ArrayList<>(512); @Override public String getTagName() { @@ -59,7 +62,6 @@ public class AnomalyHandler implements IChunkMetaDataHandler { public void tickWorld(HashMap data, TickEvent.WorldTickEvent aEvent) { if (TecTech.RANDOM.nextInt(MEAN_DELAY) == 0) { int dim = aEvent.world.provider.dimensionId; - ArrayList worldDataArrayList = new ArrayList<>(1024); data.get(dim).forEach((chunkCoordIntPair, compound) -> { if (compound.getDouble(INTENSITY) >= SWAP_THRESHOLD) { Chunk chunk = aEvent.world.getChunkFromChunkCoords(chunkCoordIntPair.chunkXPos, chunkCoordIntPair.chunkZPos); @@ -71,18 +73,55 @@ public class AnomalyHandler implements IChunkMetaDataHandler { if (worldDataArrayList.size() >= 2) { Chunk a = worldDataArrayList.remove(TecTech.RANDOM.nextInt(worldDataArrayList.size())); Chunk b = worldDataArrayList.remove(TecTech.RANDOM.nextInt(worldDataArrayList.size())); - double avg=.5* (data.get(dim).get(a.getChunkCoordIntPair()).getDouble(INTENSITY)+ - data.get(dim).get(b.getChunkCoordIntPair()).getDouble(INTENSITY)); - data.get(dim).get(a.getChunkCoordIntPair()).setDouble(INTENSITY, Math.min(SWAP_THRESHOLD,avg * (TecTech.RANDOM.nextFloat()+.5F) * 0.5F)); - data.get(dim).get(b.getChunkCoordIntPair()).setDouble(INTENSITY, Math.min(SWAP_THRESHOLD,avg * (TecTech.RANDOM.nextFloat()+.5F) * 0.5F)); + double avg = .5 * (data.get(dim).get(a.getChunkCoordIntPair()).getDouble(INTENSITY) + + data.get(dim).get(b.getChunkCoordIntPair()).getDouble(INTENSITY)); + data.get(dim).get(a.getChunkCoordIntPair()).setDouble(INTENSITY, Math.min(SWAP_THRESHOLD, avg * (TecTech.RANDOM.nextFloat() + .5F) * 0.5F)); + data.get(dim).get(b.getChunkCoordIntPair()).setDouble(INTENSITY, Math.min(SWAP_THRESHOLD, avg * (TecTech.RANDOM.nextFloat() + .5F) * 0.5F)); data.get(dim).markForTransmissionToClient(a.getChunkCoordIntPair()); data.get(dim).markForTransmissionToClient(b.getChunkCoordIntPair()); - swapSomething(a, b,avg); + swapSomething(a, b, (float) Math.min(Math.log10(avg-5), 20)); } + worldDataArrayList.clear(); + } + for (Object o : aEvent.world.playerEntities) { + if (o instanceof EntityPlayer && !((EntityPlayer) o).capabilities.isCreativeMode) { + float charge = TecTech.playerPersistence.getDataOrSetToNewTag((EntityPlayer) o).getFloat(SPACE_CHARGE); + if (charge != 0) { + playersWithCharge.add((EntityPlayer) o); + } + } + } + if (playersWithCharge.size() > 0) { + outer: + for (EntityPlayer other : playersWithCharge) { + float fieldOther = TecTech.playerPersistence.getDataOrSetToNewTag(other).getFloat(SPACE_CHARGE); + for (EntityPlayer player : playersWithCharge) { + if (other == player) { + continue outer; + } + float field = TecTech.playerPersistence.getDataOrSetToNewTag(player).getFloat(SPACE_CHARGE); + float difference = Math.abs(field - fieldOther); + if (difference != 0) { + if (player.getDistanceSqToEntity(other) < 1) { + float avg = (fieldOther + field) / 2; + addAnomaly(other.worldObj.provider.dimensionId, new ChunkCoordIntPair(other.chunkCoordX, other.chunkCoordZ), Math.min(SWAP_THRESHOLD, PER_PARTICLE * difference)); + other.worldObj.createExplosion(other, other.posX, other.posY, other.posZ, Math.min(CHARGE_EXPLOSIVENESS * difference, 25), true); + player.worldObj.createExplosion(player, player.posX, player.posY, player.posZ, Math.min(CHARGE_EXPLOSIVENESS * difference, 25), true); + TecTech.playerPersistence.getDataOrSetToNewTag(player).setFloat(SPACE_CHARGE, avg); + TecTech.playerPersistence.getDataOrSetToNewTag(other).setFloat(SPACE_CHARGE, avg); + TecTech.playerPersistence.saveData(player); + TecTech.playerPersistence.saveData(other); + NetworkDispatcher.INSTANCE.sendToAll(new PlayerDataMessage.PlayerDataData(player)); + NetworkDispatcher.INSTANCE.sendToAll(new PlayerDataMessage.PlayerDataData(other)); + } + } + } + } + playersWithCharge.clear(); } } - private void swapSomething(Chunk a,Chunk b,double avg) { + private void swapSomething(Chunk a,Chunk b,float power) { for (int i = 0; i < 64; i++) { int x = TecTech.RANDOM.nextInt(16); int y = TecTech.RANDOM.nextInt(a.worldObj.getActualHeight()); @@ -97,51 +136,68 @@ public class AnomalyHandler implements IChunkMetaDataHandler { } else if (a.getTileEntityUnsafe(x, y, z) == null) { b.worldObj.setBlock((b.xPosition << 4) + x, y, (b.zPosition << 4) + z, aBlock, aMeta, 3); a.worldObj.setBlockToAir((a.xPosition << 4) + x, y, (a.zPosition << 4) + z); - if (TecTech.RANDOM.nextBoolean()) { - a.worldObj.createExplosion(null, (a.xPosition << 4) + x + .5, y + .5, (a.zPosition << 4) + z + .5, (float) Math.log10(avg), true); - GT_Utility.sendSoundToPlayers(a.worldObj, GregTech_API.sSoundList.get(209), 1.0F, -1, (a.xPosition << 4) + x, y, (a.zPosition << 4) + z); - } } else if (b.getTileEntityUnsafe(x, y, z) == null) { a.worldObj.setBlock((a.xPosition << 4) + x, y, (a.zPosition << 4) + z, bBlock, bMeta, 3); b.worldObj.setBlockToAir((b.xPosition << 4) + x, y, (b.zPosition << 4) + z); - if (TecTech.RANDOM.nextBoolean()) { - b.worldObj.createExplosion(null, (b.xPosition << 4) + x + .5, y + .5, (b.zPosition << 4) + z + .5, (float) Math.log10(avg), true); - GT_Utility.sendSoundToPlayers(b.worldObj, GregTech_API.sSoundList.get(209), 1.0F, -1, (b.xPosition << 4) + x, y, (b.zPosition << 4) + z); - } } else { - if (TecTech.RANDOM.nextBoolean()) { - a.worldObj.setBlockToAir((a.xPosition << 4) + x, y, (a.zPosition << 4) + z); - a.worldObj.createExplosion(null, (a.xPosition << 4) + x + .5, y + .5, (a.zPosition << 4) + z + .5, (float) Math.log10(avg), true); - GT_Utility.sendSoundToPlayers(a.worldObj, GregTech_API.sSoundList.get(209), 1.0F, -1, (a.xPosition << 4) + x, y, (a.zPosition << 4) + z); - } - if (TecTech.RANDOM.nextBoolean()) { - b.worldObj.setBlockToAir((b.xPosition << 4) + x, y, (b.zPosition << 4) + z); - b.worldObj.createExplosion(null, (b.xPosition << 4) + x + .5, y + .5, (b.zPosition << 4) + z + .5, (float) Math.log10(avg), true); - GT_Utility.sendSoundToPlayers(b.worldObj, GregTech_API.sSoundList.get(209), 1.0F, -1, (b.xPosition << 4) + x, y, (b.zPosition << 4) + z); - } + a.worldObj.setBlockToAir((a.xPosition << 4) + x, y, (a.zPosition << 4) + z); + b.worldObj.setBlockToAir((b.xPosition << 4) + x, y, (b.zPosition << 4) + z); + } + if (TecTech.RANDOM.nextBoolean()) { + a.worldObj.createExplosion(null, (a.xPosition << 4) + x + .5, y + .5, (a.zPosition << 4) + z + .5, power, true); + GT_Utility.sendSoundToPlayers(a.worldObj, GregTech_API.sSoundList.get(209), 1.0F, -1, (a.xPosition << 4) + x, y, (a.zPosition << 4) + z); + } + if (TecTech.RANDOM.nextBoolean()) { + b.worldObj.createExplosion(null, (b.xPosition << 4) + x + .5, y + .5, (b.zPosition << 4) + z + .5, power, true); + GT_Utility.sendSoundToPlayers(b.worldObj, GregTech_API.sSoundList.get(209), 1.0F, -1, (b.xPosition << 4) + x, y, (b.zPosition << 4) + z); } } int x = (b.xPosition - a.xPosition) << 4; int z = (b.xPosition - a.xPosition) << 4; - List aE = a.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, Util.fromChunk(a)); - List bE = b.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, Util.fromChunk(b)); + List aE = a.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, Util.fromChunk(a)); + List bE = b.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, Util.fromChunk(b)); aE.forEach(o -> { if (TecTech.RANDOM.nextBoolean()) { - Vec3 pos = ((EntityLivingBase) o).getPosition(1); - ((EntityLivingBase) o).setPositionAndUpdate(pos.xCoord + x, pos.yCoord, pos.zCoord + z); - ((EntityLivingBase) o).attackEntityFrom(MainLoader.subspace,18); + o.setPositionAndUpdate(o.posX + x, o.posY, o.posZ + z); + o.attackEntityFrom(MainLoader.subspace,8+TecTech.RANDOM.nextInt(8)); if(o instanceof EntityPlayer){ - ((EntityPlayer) o).addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 200)); + EntityPlayer player=((EntityPlayer) o); + if(!player.capabilities.isCreativeMode) { + player.addPotionEffect(new PotionEffect(Potion.hunger.id, 1200)); + player.addPotionEffect(new PotionEffect(Potion.weakness.id, 1000)); + player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 800)); + player.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 600)); + player.addPotionEffect(new PotionEffect(Potion.confusion.id, 400)); + player.addPotionEffect(new PotionEffect(Potion.poison.id, 200)); + player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100)); + player.addPotionEffect(new PotionEffect(Potion.wither.id, 60)); + TecTech.playerPersistence.getDataOrSetToNewTag(player).setFloat(SPACE_CHARGE, + TecTech.playerPersistence.getDataOrSetToNewTag(player).getFloat(SPACE_CHARGE)-(float)Math.abs(TecTech.RANDOM.nextGaussian())); + TecTech.playerPersistence.saveData(player); + NetworkDispatcher.INSTANCE.sendToAll(new PlayerDataMessage.PlayerDataData(player)); + } } } }); bE.forEach(o -> { if (TecTech.RANDOM.nextBoolean()) { - Vec3 pos = ((EntityLivingBase) o).getPosition(1); - ((EntityLivingBase) o).setPositionAndUpdate(pos.xCoord - x, pos.yCoord, pos.zCoord - z); - ((EntityLivingBase) o).attackEntityFrom(MainLoader.subspace,18); + o.setPositionAndUpdate(o.posX - x, o.posY, o.posZ - z); + o.attackEntityFrom(MainLoader.subspace,8+TecTech.RANDOM.nextInt(8)); if(o instanceof EntityPlayer){ - ((EntityPlayer) o).addPotionEffect(new PotionEffect(Potion.digSpeed.id, 200)); + EntityPlayer player=((EntityPlayer) o); + if(!player.capabilities.isCreativeMode) { + player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 800)); + player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 600)); + player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 400)); + player.addPotionEffect(new PotionEffect(Potion.jump.id, 200)); + player.addPotionEffect(new PotionEffect(Potion.resistance.id, 100)); + player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 60)); + TecTech.playerPersistence.getDataOrSetToNewTag(player).setFloat(SPACE_CHARGE, + TecTech.playerPersistence.getDataOrSetToNewTag(player).getFloat(SPACE_CHARGE)+(float)Math.abs(TecTech.RANDOM.nextGaussian())); + + TecTech.playerPersistence.saveData(player); + NetworkDispatcher.INSTANCE.sendToAll(new PlayerDataMessage.PlayerDataData(player)); + } } } }); @@ -156,9 +212,9 @@ public class AnomalyHandler implements IChunkMetaDataHandler { if (compound != null) { for (int i = 0, badness = (int) Math.min(COUNT_DIV, compound.getDouble(INTENSITY) / PER_PARTICLE); i < badness; i++) { TecTech.proxy.em_particle(player.worldObj, - player.posX - 32D + TecTech.RANDOM.nextFloat() * 64D, - player.posY - 32D + TecTech.RANDOM.nextFloat() * 64D, - player.posZ - 32D + TecTech.RANDOM.nextFloat() * 64D); + player.posX + TecTech.RANDOM.nextGaussian() * 64D, + player.posY + TecTech.RANDOM.nextGaussian() * 64D, + player.posZ + TecTech.RANDOM.nextGaussian() * 64D); } } @@ -166,9 +222,9 @@ public class AnomalyHandler implements IChunkMetaDataHandler { if (Math.abs(chunkCoordIntPair.getCenterXPos() - player.posX) + Math.abs(chunkCoordIntPair.getCenterZPosition() - player.posZ) < 256) { for (int i = 0, pow = (int) Math.min(32, dat.getDouble(INTENSITY) / PER_PARTICLE); i < pow; i++) { TecTech.proxy.em_particle(player.worldObj, - (chunkCoordIntPair.chunkXPos << 4) + TecTech.RANDOM.nextFloat() * 48D - 16D, + chunkCoordIntPair.getCenterXPos() + TecTech.RANDOM.nextGaussian() * 32D, player.posY + TecTech.RANDOM.nextFloat() * 128D - 64D, - (chunkCoordIntPair.chunkZPos << 4) + TecTech.RANDOM.nextFloat() * 48D - 16D); + chunkCoordIntPair.getCenterZPosition() + TecTech.RANDOM.nextGaussian() * 32D); } } }); @@ -186,7 +242,7 @@ public class AnomalyHandler implements IChunkMetaDataHandler { playerTag.setDouble(SPACE_CANCER, Math.min(2, playerTag.getDouble(SPACE_CANCER) + 9.765625E-4f * badness)); player.attackEntityFrom(MainLoader.subspace,Math.max(1,badness/8f)); } - } else if (playerTag.getDouble(SPACE_CANCER) > 0) { + } else if (playerTag.getDouble(SPACE_CANCER) > 0 && !player.isDead) { playerTag.setDouble(SPACE_CANCER, Math.max(0, playerTag.getDouble(SPACE_CANCER) - 7.6293945E-6f)); } } @@ -204,12 +260,37 @@ public class AnomalyHandler implements IChunkMetaDataHandler { if (tagCompound != null) { float cancer = tagCompound.getFloat(SPACE_CANCER); if (cancer > 0) { - player.setAngles((TecTech.RANDOM.nextFloat() - .5F) * 4 * cancer, (TecTech.RANDOM.nextFloat() - .5F) * 4 * cancer); player.setInvisible(fixMe = TecTech.RANDOM.nextFloat() * 2 < cancer); - if (cancer > 1.9f) { - player.setVelocity((TecTech.RANDOM.nextFloat() - .5F) * cancer * cancer / 2, (TecTech.RANDOM.nextFloat() - .5F) * cancer * cancer / 2, (TecTech.RANDOM.nextFloat() - .5F) * cancer * cancer / 2); + player.setAngles((TecTech.RANDOM.nextFloat() - .5F) * 36 * cancer, (TecTech.RANDOM.nextFloat() - .5F) * 36 * cancer); + cancer*=cancer/2F; + if (cancer > 1.75f) { + player.setVelocity((TecTech.RANDOM.nextFloat() - .5F) * cancer, (TecTech.RANDOM.nextFloat() - .5F) * cancer, (TecTech.RANDOM.nextFloat() - .5F) * cancer); } else { - player.addVelocity((TecTech.RANDOM.nextFloat() - .5F) * cancer * cancer / 2, (TecTech.RANDOM.nextFloat() - .5F) * cancer * cancer / 2, (TecTech.RANDOM.nextFloat() - .5F) * cancer * cancer / 2); + player.addVelocity((TecTech.RANDOM.nextFloat() - .5F) * cancer, (TecTech.RANDOM.nextFloat() - .5F) * cancer, (TecTech.RANDOM.nextFloat() - .5F) * cancer); + } + } + } + + float charge = TecTech.playerPersistence.getDataOrSetToNewTag(player).getFloat(SPACE_CHARGE); + if(charge!=0) { + for (Object o : player.worldObj.playerEntities) { + if (o instanceof EntityPlayer && !((EntityPlayer) o).capabilities.isCreativeMode) { + EntityPlayer otherPlayer=(EntityPlayer)o; + float chargeOther = TecTech.playerPersistence.getDataOrSetToNewTag(otherPlayer).getFloat(SPACE_CHARGE); + if (chargeOther != 0 && player != o) { + float reaction = chargeOther * charge; + if (reaction !=0) { + double distanceSq = otherPlayer.getDistanceSqToEntity(player); + if (distanceSq >= 1) { + double effect = CHARGE_EFFECTIVENESS * reaction / (distanceSq * distanceSq * distanceSq); + double dX = player.posX - otherPlayer.posX; + double dY = player.posY - otherPlayer.posY; + double dZ = player.posZ - otherPlayer.posZ; + player.addVelocity(effect * dX, effect * dY, effect * dZ); + otherPlayer.addVelocity(-effect * dX, -effect * dY, -effect * dZ); + } + } + } } } } @@ -227,8 +308,8 @@ public class AnomalyHandler implements IChunkMetaDataHandler { } @Override - public void pushData(int world, ChunkCoordIntPair chunk) { - NetworkDispatcher.INSTANCE.sendToDimension(new ChunkDataMessage.ChunkDataData(world, chunk, this), world); + public void pushData(World world, ChunkCoordIntPair chunk) { + NetworkDispatcher.INSTANCE.sendToDimension(new ChunkDataMessage.ChunkDataData(world.provider.dimensionId, chunk, this), world.provider.dimensionId); } @Override diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/CancerCommand.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/CancerCommand.java index c19cca64d5..a153671a59 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/anomaly/CancerCommand.java +++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/CancerCommand.java @@ -46,6 +46,7 @@ public class CancerCommand implements ICommand { playerTag.setDouble(SPACE_CANCER, amount); TecTech.playerPersistence.saveData(player); NetworkDispatcher.INSTANCE.sendTo(new PlayerDataMessage.PlayerDataData(player), player); + sender.addChatMessage(new ChatComponentText("Cancer set to: "+amount)); } } } diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/ChargeCommand.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/ChargeCommand.java new file mode 100644 index 0000000000..da365a92f8 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/ChargeCommand.java @@ -0,0 +1,85 @@ +package com.github.technus.tectech.mechanics.anomaly; + +import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.loader.NetworkDispatcher; +import com.github.technus.tectech.mechanics.data.PlayerDataMessage; +import net.minecraft.command.ICommand; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ChatComponentText; + +import java.util.ArrayList; +import java.util.List; + +import static com.github.technus.tectech.mechanics.anomaly.AnomalyHandler.SPACE_CHARGE; + +public class ChargeCommand implements ICommand { + ArrayList aliases=new ArrayList<>(); + + public ChargeCommand(){ + aliases.add("charge_EM"); + aliases.add("charge"); + } + + @Override + public void processCommand(ICommandSender sender, String[] args) { + if (sender instanceof EntityPlayerMP && !sender.getEntityWorld().isRemote) { + double amount; + try { + amount = Double.parseDouble(args[0]); + }catch (NumberFormatException e){ + sender.addChatMessage(new ChatComponentText("Cannot parse amount!")); + return; + } + EntityPlayerMP player=(EntityPlayerMP)sender; + NBTTagCompound playerTag = TecTech.playerPersistence.getDataOrSetToNewTag(player); + if(player.capabilities.isCreativeMode){ + sender.addChatMessage(new ChatComponentText("Doesn't really work in creative mode!")); + }else { + playerTag.setDouble(SPACE_CHARGE, amount); + TecTech.playerPersistence.saveData(player); + NetworkDispatcher.INSTANCE.sendToAll(new PlayerDataMessage.PlayerDataData(player)); + sender.addChatMessage(new ChatComponentText("Charge set to: "+amount)); + } + } + } + + @Override + public boolean isUsernameIndex(String[] p_82358_1_, int p_82358_2_) { + return false; + } + + @Override + public List getCommandAliases() { + return aliases; + } + + @Override + public String getCommandName() { + return aliases.get(0); + } + + @Override + public List addTabCompletionOptions(ICommandSender sender, String[] args) { + return null; + } + + @Override + public String getCommandUsage(ICommandSender p_71518_1_) { + return "charge_EM [Amount]"; + } + + @Override + public int compareTo(Object o) { + if(o instanceof ICommand){ + return getCommandName().compareTo(((ICommand) o).getCommandName()); + } + return 0; + } + + @Override + public boolean canCommandSenderUseCommand(ICommandSender sender) { + return true; + } +} diff --git a/src/main/java/com/github/technus/tectech/mechanics/data/ChunkDataHandler.java b/src/main/java/com/github/technus/tectech/mechanics/data/ChunkDataHandler.java index 8109db9b86..0d0af5b390 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/data/ChunkDataHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/data/ChunkDataHandler.java @@ -8,6 +8,7 @@ import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.Minecraft; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; import net.minecraftforge.event.world.ChunkDataEvent; import net.minecraftforge.event.world.ChunkEvent; import net.minecraftforge.event.world.WorldEvent; @@ -97,13 +98,15 @@ public class ChunkDataHandler { @SideOnly(Side.CLIENT) @SubscribeEvent public void onLoadChunk(ChunkEvent.Load aEvent){ - pullSyncHandlers.forEach(chunkMetaDataHandler -> chunkMetaDataHandler.pullData(aEvent)); + if(aEvent.world.isRemote && !Minecraft.getMinecraft().isSingleplayer()) {//we already have the data! + pullSyncHandlers.forEach(chunkMetaDataHandler -> chunkMetaDataHandler.pullData(aEvent)); + } } @SideOnly(Side.CLIENT) @SubscribeEvent - public void onUnLoadChunk(ChunkEvent.Unload aEvent){ - if(aEvent.world.isRemote && !Minecraft.getMinecraft().isSingleplayer()) { + public void onUnloadChunk(ChunkEvent.Unload aEvent){ + if(aEvent.world.isRemote && !Minecraft.getMinecraft().isSingleplayer()) {//we need all data if running local server! pullSyncHandlers.forEach(chunkMetaDataHandler -> dimensionWiseMetaChunkData .get(chunkMetaDataHandler.getTagName()) .get(aEvent.world.provider.dimensionId) @@ -134,39 +137,38 @@ public class ChunkDataHandler { dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), aEvent)); } + //Ticks only on server side (but must be present for client server) @SubscribeEvent public void onWorldTickEvent(TickEvent.WorldTickEvent aEvent) { - if(aEvent.side.isServer()) { - int dim = aEvent.world.provider.dimensionId; - pushSyncHandlers.forEach(chunkMetaDataHandler -> { - ChunkHashMap data = dimensionWiseMetaChunkData - .get(chunkMetaDataHandler.getTagName()).get(dim); - int cycle = chunkMetaDataHandler.pushPayloadSpreadPeriod(); - int epoch = (int) (aEvent.world.getTotalWorldTime() % cycle); - ArrayList work; - if (epoch == 0) { - int per = data.dirtyBoys.size() / cycle; - int mod = data.dirtyBoys.size() % cycle; - Iterator iter = data.dirtyBoys.iterator(); - for (int periodWork = 0; periodWork < cycle; periodWork++) { - work = data.workLoad.get(periodWork); - for (int i = 0; i < per; i++) { - work.add(iter.next()); - } - if (periodWork < mod) { - work.add(iter.next()); - } + int dim = aEvent.world.provider.dimensionId; + pushSyncHandlers.forEach(chunkMetaDataHandler -> { + ChunkHashMap data = dimensionWiseMetaChunkData + .get(chunkMetaDataHandler.getTagName()).get(dim); + int cycle = chunkMetaDataHandler.pushPayloadSpreadPeriod(); + int epoch = (int) (aEvent.world.getTotalWorldTime() % cycle); + ArrayList work; + if (epoch == 0) { + int per = data.dirtyBoys.size() / cycle; + int mod = data.dirtyBoys.size() % cycle; + Iterator iter = data.dirtyBoys.iterator(); + for (int periodWork = 0; periodWork < cycle; periodWork++) { + work = data.workLoad.get(periodWork); + for (int i = 0; i < per; i++) { + work.add(iter.next()); + } + if (periodWork < mod) { + work.add(iter.next()); } - data.dirtyBoys.clear(); } - work = data.workLoad.get(epoch); - chunkMetaDataHandler.pushPayload(dim, work); - work.clear(); - }); - worldHandlers.forEach(chunkMetaDataHandler -> - chunkMetaDataHandler.tickWorld( - dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), aEvent)); - } + data.dirtyBoys.clear(); + } + work = data.workLoad.get(epoch); + chunkMetaDataHandler.pushPayload(aEvent.world, work); + work.clear(); + }); + worldHandlers.forEach(chunkMetaDataHandler -> + chunkMetaDataHandler.tickWorld( + dimensionWiseMetaChunkData.get(chunkMetaDataHandler.getTagName()), aEvent)); } @SubscribeEvent @@ -197,7 +199,7 @@ public class ChunkDataHandler { if(clazz.getMethod("tickPlayer", HashMap.class, TickEvent.PlayerTickEvent.class).getDeclaringClass()!= IChunkMetaDataHandler.class){ playerHandlers.add(handler); } - if (clazz.getMethod("pushData", int.class, ChunkCoordIntPair.class).getDeclaringClass()!=IChunkMetaDataHandler.class) { + if (clazz.getMethod("pushData", World.class, ChunkCoordIntPair.class).getDeclaringClass()!=IChunkMetaDataHandler.class) { pushSyncHandlers.add(handler); } if(clazz.getMethod("tickWorld", HashMap.class, TickEvent.WorldTickEvent.class).getDeclaringClass()!= IChunkMetaDataHandler.class){ @@ -206,7 +208,7 @@ public class ChunkDataHandler { } catch (NoSuchMethodException e) { throw new RuntimeException("Cannot register common event handlers!",e); } - if(FMLCommonHandler.instance().getEffectiveSide().isClient()) { + if(FMLCommonHandler.instance().getSide().isClient()) { try { if (clazz.getMethod("pullData", ChunkEvent.Load.class).getDeclaringClass() != IChunkMetaDataHandler.class) { pullSyncHandlers.add(handler); diff --git a/src/main/java/com/github/technus/tectech/mechanics/data/IChunkMetaDataHandler.java b/src/main/java/com/github/technus/tectech/mechanics/data/IChunkMetaDataHandler.java index a8f5e013c5..0be1fec517 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/data/IChunkMetaDataHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/data/IChunkMetaDataHandler.java @@ -5,6 +5,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; import net.minecraftforge.event.world.ChunkEvent; import java.util.ArrayList; @@ -16,19 +17,19 @@ public interface IChunkMetaDataHandler { NBTTagCompound createData(); @SideOnly(Side.CLIENT) default void pullData(ChunkEvent.Load aEvent){} - default void pushData(int world, ChunkCoordIntPair chunk){} - default void pushPayload(int world, ArrayList chunk){ + default void pushData(World world, ChunkCoordIntPair chunk){} + default void pushPayload(World world, ArrayList chunk){ chunk.forEach(chunkCoordIntPair -> pushData(world,chunkCoordIntPair)); } default int pushPayloadSpreadPeriod(){ - return 20; + return 20;//must be a constant! } @SideOnly(Side.CLIENT) - default void tickRender(HashMap data, TickEvent.RenderTickEvent aEvent){} + default void tickRender(HashMap data, TickEvent.RenderTickEvent event){} @SideOnly(Side.CLIENT) - default void tickClient(HashMap data, TickEvent.ClientTickEvent aEvent){} + default void tickClient(HashMap data, TickEvent.ClientTickEvent event){} default void tickServer(HashMap data, TickEvent.ServerTickEvent event){} - default void tickWorld(HashMap data, TickEvent.WorldTickEvent aEvent){} - default void tickPlayer(HashMap data, TickEvent.PlayerTickEvent aEvent){} + default void tickWorld(HashMap data, TickEvent.WorldTickEvent event){} + default void tickPlayer(HashMap data, TickEvent.PlayerTickEvent event){} } diff --git a/src/main/java/com/github/technus/tectech/mechanics/data/PlayerPersistence.java b/src/main/java/com/github/technus/tectech/mechanics/data/PlayerPersistence.java index 9282001c9a..0a829de3e9 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/data/PlayerPersistence.java +++ b/src/main/java/com/github/technus/tectech/mechanics/data/PlayerPersistence.java @@ -7,6 +7,8 @@ import cpw.mods.fml.common.gameevent.PlayerEvent; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.WorldServer; import java.util.HashMap; import java.util.UUID; @@ -61,8 +63,13 @@ public class PlayerPersistence { @SubscribeEvent public void onLogin(PlayerEvent.PlayerLoggedInEvent event){ - if(event.player instanceof EntityPlayerMP){ - NetworkDispatcher.INSTANCE.sendTo(new PlayerDataMessage.PlayerDataData(event.player),(EntityPlayerMP)event.player); + if(!event.player.worldObj.isRemote){ + for (WorldServer worldServer : MinecraftServer.getServer().worldServers) { + for (Object playerEntity : worldServer.playerEntities) { + NetworkDispatcher.INSTANCE.sendTo(new PlayerDataMessage.PlayerDataData((EntityPlayer) playerEntity),(EntityPlayerMP) event.player); + } + } + NetworkDispatcher.INSTANCE.sendToAll(new PlayerDataMessage.PlayerDataData(event.player)); } } diff --git a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java index d66cc8bf82..5ab81d8283 100644 --- a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java +++ b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java @@ -144,4 +144,8 @@ public class ClientProxy extends CommonProxy { public EntityClientPlayerMP getPlayer(){ return Minecraft.getMinecraft().thePlayer; } + + public boolean isThePlayer(EntityPlayer player){ + return getPlayer()==player; + } } diff --git a/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java b/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java index 6f5f367d7f..59d2b95150 100644 --- a/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java +++ b/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java @@ -85,4 +85,8 @@ public class CommonProxy implements IGuiHandler { public EntityPlayer getPlayer(){ return null; } + + public boolean isThePlayer(EntityPlayer player){ + return false; + } } diff --git a/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java b/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java index f63f35e7f8..33f0d34ad5 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java @@ -10,7 +10,6 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ElectricBlastFurnace; import net.minecraft.block.Block; -import net.minecraft.client.entity.EntityClientPlayerMP; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.Item; @@ -63,7 +62,7 @@ public final class ConstructableTriggerItem extends Item { } } return true; - }else if (aPlayer instanceof EntityClientPlayerMP){//particles and text client side + }else if (TecTech.proxy.isThePlayer(aPlayer)){//particles and text client side //if ((!aPlayer.isSneaking() || !aPlayer.capabilities.isCreativeMode)) { if(tTileEntity instanceof IGregTechTileEntity) { IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); -- cgit From fdd4cdac351079dbb661ec9097068b95ab0cd527 Mon Sep 17 00:00:00 2001 From: Tec Date: Wed, 17 Jul 2019 00:29:58 +0200 Subject: Adjust some particles --- .../tectech/entity/fx/WeightlessParticleFX.java | 51 +++++++++++++++++ .../github/technus/tectech/proxy/ClientProxy.java | 64 ++++++++++++++++------ .../github/technus/tectech/proxy/CommonProxy.java | 10 ++-- .../single/GT_MetaTileEntity_DebugPollutor.java | 26 +-------- 4 files changed, 105 insertions(+), 46 deletions(-) create mode 100644 src/main/java/com/github/technus/tectech/entity/fx/WeightlessParticleFX.java diff --git a/src/main/java/com/github/technus/tectech/entity/fx/WeightlessParticleFX.java b/src/main/java/com/github/technus/tectech/entity/fx/WeightlessParticleFX.java new file mode 100644 index 0000000000..22b72463f8 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/entity/fx/WeightlessParticleFX.java @@ -0,0 +1,51 @@ +package com.github.technus.tectech.entity.fx; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class WeightlessParticleFX extends EntityFX +{ + private static final String __OBFID = "CL_00000903"; + + public WeightlessParticleFX(World p_i1205_1_, double p_i1205_2_, double p_i1205_4_, double p_i1205_6_, double p_i1205_8_, double p_i1205_10_, double p_i1205_12_) + { + super(p_i1205_1_, p_i1205_2_, p_i1205_4_, p_i1205_6_, p_i1205_8_, p_i1205_10_, p_i1205_12_); + this.motionX = p_i1205_8_ + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.05F); + this.motionY = p_i1205_10_ + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.05F); + this.motionZ = p_i1205_12_ + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.05F); + this.particleRed = this.particleGreen = this.particleBlue = this.rand.nextFloat() * 0.3F + 0.7F; + this.particleScale = this.rand.nextFloat() * this.rand.nextFloat() * 6.0F + 1.0F; + this.particleMaxAge = (int)(16.0D / ((double)this.rand.nextFloat() * 0.8D + 0.2D)) + 2; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + + this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge); + //this.motionY += 0.004D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.8999999761581421D; + this.motionY *= 0.8999999761581421D; + this.motionZ *= 0.8999999761581421D; + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } +} diff --git a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java index 5ab81d8283..232beebfb6 100644 --- a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java +++ b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java @@ -4,6 +4,7 @@ import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.compatibility.openmodularturrets.TT_turret_loader; import com.github.technus.tectech.entity.fx.BlockHint; +import com.github.technus.tectech.entity.fx.WeightlessParticleFX; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.block.QuantumGlassRender; import com.github.technus.tectech.thing.block.QuantumStuffBlock; @@ -17,7 +18,6 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityClientPlayerMP; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.GuiNewChat; -import net.minecraft.client.particle.EntityExplodeFX; import net.minecraft.client.particle.EntityFX; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.AxisAlignedBB; @@ -41,10 +41,10 @@ public class ClientProxy extends CommonProxy { } @Override - public void hint_particle(World world, int x, int y, int z, Block block, int meta) { - Minecraft.getMinecraft().effectRenderer.addEffect(new BlockHint(world,x,y,z,block,meta)); + public void hint_particle(World w,int x, int y, int z, Block block, int meta) { + Minecraft.getMinecraft().effectRenderer.addEffect(new BlockHint(w,x,y,z,block,meta)); - EntityFX particle = new EntityExplodeFX(world, x + TecTech.RANDOM.nextFloat() * 0.5F, y + TecTech.RANDOM.nextFloat() * 0.5F, z + TecTech.RANDOM.nextFloat() * 0.5F, 0, 0, 0); + EntityFX particle = new WeightlessParticleFX(w, x + TecTech.RANDOM.nextFloat() * 0.5F, y + TecTech.RANDOM.nextFloat() * 0.5F, z + TecTech.RANDOM.nextFloat() * 0.5F, 0, 0, 0); particle.setRBGColorF(0, 0.6F * TecTech.RANDOM.nextFloat(), 0.8f); Minecraft.getMinecraft().effectRenderer.addEffect(particle); } @@ -56,22 +56,59 @@ public class ClientProxy extends CommonProxy { float yPos = aDir.offsetY * 0.76F + aMuffler.getYCoord() + 0.25F; float zPos = aDir.offsetZ * 0.76F + aMuffler.getZCoord() + 0.25F; - float ySpd = 0; - //aDir.offsetY*0.1F+0.2F+0.1F*floatGen.nextFloat(); - float xSpd = 0; - float zSpd = 0; - EntityFX particle = new EntityExplodeFX(aMuffler.getWorld(), xPos + TecTech.RANDOM.nextFloat() * 0.5F, yPos + TecTech.RANDOM.nextFloat() * 0.5F, zPos + TecTech.RANDOM.nextFloat() * 0.5F, xSpd, ySpd, zSpd); + EntityFX particle = new WeightlessParticleFX(aMuffler.getWorld(), xPos + TecTech.RANDOM.nextFloat() * 0.5F, yPos + TecTech.RANDOM.nextFloat() * 0.5F, zPos + TecTech.RANDOM.nextFloat() * 0.5F, 0, 0, 0); particle.setRBGColorF(0, 0.6F * TecTech.RANDOM.nextFloat(), 0.8f); Minecraft.getMinecraft().effectRenderer.addEffect(particle); } @Override - public void em_particle(World w,double x,double y,double z) {//CUTE! - EntityFX particle = new EntityExplodeFX(w, x + TecTech.RANDOM.nextFloat() * 0.5F, y + TecTech.RANDOM.nextFloat() * 0.5F, z + TecTech.RANDOM.nextFloat() * 0.5F, 0, 0, 0); + public void pollutor_particle(IGregTechTileEntity aMuffler, byte facing) { + ForgeDirection aDir = ForgeDirection.getOrientation(facing); + float xPos = aDir.offsetX * 0.76F + aMuffler.getXCoord() + 0.25F; + float yPos = aDir.offsetY * 0.76F + aMuffler.getYCoord() + 0.25F; + float zPos = aDir.offsetZ * 0.76F + aMuffler.getZCoord() + 0.25F; + + float ySpd = aDir.offsetY * 0.1F + 0.2F + 0.1F * (float)TecTech.RANDOM.nextGaussian(); + float xSpd; + float zSpd; + + if (aDir.offsetY == -1) { + float temp = TecTech.RANDOM.nextFloat() * 2 * (float) Math.PI; + xSpd = (float) Math.sin(temp) * 0.1F*(float)TecTech.RANDOM.nextGaussian(); + zSpd = (float) Math.cos(temp) * 0.1F*(float)TecTech.RANDOM.nextGaussian(); + } else { + xSpd = aDir.offsetX * (0.1F + 0.2F *(float)TecTech.RANDOM.nextGaussian()); + zSpd = aDir.offsetZ * (0.1F + 0.2F *(float)TecTech.RANDOM.nextGaussian()); + } + aMuffler.getWorld().spawnParticle("largesmoke", xPos + TecTech.RANDOM.nextFloat() * 0.5F, yPos + TecTech.RANDOM.nextFloat() * 0.5F, zPos + TecTech.RANDOM.nextFloat() * 0.5F, xSpd, ySpd, zSpd); + aMuffler.getWorld().spawnParticle("largesmoke", xPos + TecTech.RANDOM.nextFloat() * 0.5F, yPos + TecTech.RANDOM.nextFloat() * 0.5F, zPos + TecTech.RANDOM.nextFloat() * 0.5F, xSpd, ySpd, zSpd); + aMuffler.getWorld().spawnParticle("largesmoke", xPos + TecTech.RANDOM.nextFloat() * 0.5F, yPos + TecTech.RANDOM.nextFloat() * 0.5F, zPos + TecTech.RANDOM.nextFloat() * 0.5F, xSpd, ySpd, zSpd); + } + + @Override + public void em_particle(World w,double x, double y, double z) {//CUTE! + EntityFX particle = new WeightlessParticleFX(w, + x + TecTech.RANDOM.nextFloat() * 0.5F, + y + TecTech.RANDOM.nextFloat() * 0.5F, + z + TecTech.RANDOM.nextFloat() * 0.5F, + 0, + 0, + 0); particle.setRBGColorF(0, 0.6F * TecTech.RANDOM.nextFloat(), 0.8f); Minecraft.getMinecraft().effectRenderer.addEffect(particle); } + @Override + public void pollutor_particle(World w,double x, double y, double z) { + w.spawnParticle("largesmoke", + x + TecTech.RANDOM.nextFloat() * 0.5F, + y + TecTech.RANDOM.nextFloat() * 0.5F, + z + TecTech.RANDOM.nextFloat() * 0.5F, + 0, + 0, + 0); + } + @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { return null; @@ -135,11 +172,6 @@ public class ClientProxy extends CommonProxy { em_particle(w,box.maxX,box.minY,box.minZ); } - @Override - public void renderAABB(AxisAlignedBB box) { - renderAABB(Minecraft.getMinecraft().theWorld,box); - } - @Override public EntityClientPlayerMP getPlayer(){ return Minecraft.getMinecraft().thePlayer; diff --git a/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java b/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java index 59d2b95150..296002b527 100644 --- a/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java +++ b/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java @@ -13,9 +13,12 @@ import net.minecraft.world.WorldServer; public class CommonProxy implements IGuiHandler { public void registerRenderInfo() {} - public void hint_particle(World world, int x, int y, int z, Block block, int meta){} + public void hint_particle(World w,int x, int y, int z, Block block, int meta){} public void em_particle(IGregTechTileEntity aMuffler, byte facing) {}//CUTE! - public void em_particle(World w,double x,double y,double z){} + public void pollutor_particle(IGregTechTileEntity aPollutor, byte facing) {}//CUTE! + public void em_particle(World w,double x, double y, double z){} + public void pollutor_particle(World w,double x, double y, double z){} + public void renderAABB(World w,AxisAlignedBB box){} @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { @@ -46,9 +49,6 @@ public class CommonProxy implements IGuiHandler { public void playSound(IGregTechTileEntity base,String name){} - public void renderAABB(AxisAlignedBB box){} - public void renderAABB(World w,AxisAlignedBB box){} - public String getUUID(String name) { for(WorldServer worldServer:MinecraftServer.getServer().worldServers){ for(Object o:worldServer.playerEntities){ diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java index ab68393dee..0e1c389006 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java @@ -118,7 +118,7 @@ public class GT_MetaTileEntity_DebugPollutor extends GT_MetaTileEntity_TieredMac for(byte i=0;i<6;i++){ if(i!=aBaseMetaTileEntity.getFrontFacing()){ TecTech.proxy.em_particle(aBaseMetaTileEntity, i); - pollutionParticles(aBaseMetaTileEntity.getWorld(),"largesmoke",i); + TecTech.proxy.pollutor_particle(aBaseMetaTileEntity,i); } } } @@ -157,28 +157,4 @@ public class GT_MetaTileEntity_DebugPollutor extends GT_MetaTileEntity_TieredMac return false; } - @SideOnly(Side.CLIENT) - public void pollutionParticles(World aWorld, String name,byte face) { - IGregTechTileEntity aMuffler = this.getBaseMetaTileEntity(); - ForgeDirection aDir = ForgeDirection.getOrientation(face); - float xPos = aDir.offsetX * 0.76F + aMuffler.getXCoord() + 0.25F; - float yPos = aDir.offsetY * 0.76F + aMuffler.getYCoord() + 0.25F; - float zPos = aDir.offsetZ * 0.76F + aMuffler.getZCoord() + 0.25F; - - float ySpd = aDir.offsetY * 0.1F + 0.2F + 0.1F * TecTech.RANDOM.nextFloat(); - float xSpd; - float zSpd; - - if (aDir.offsetY == -1) { - float temp = TecTech.RANDOM.nextFloat() * 2 * (float) Math.PI; - xSpd = (float) Math.sin(temp) * 0.1F; - zSpd = (float) Math.cos(temp) * 0.1F; - } else { - xSpd = aDir.offsetX * (0.1F + 0.2F * TecTech.RANDOM.nextFloat()); - zSpd = aDir.offsetZ * (0.1F + 0.2F * TecTech.RANDOM.nextFloat()); - } - aWorld.spawnParticle(name, xPos + TecTech.RANDOM.nextFloat() * 0.5F, yPos + TecTech.RANDOM.nextFloat() * 0.5F, zPos + TecTech.RANDOM.nextFloat() * 0.5F, xSpd, ySpd, zSpd); - aWorld.spawnParticle(name, xPos + TecTech.RANDOM.nextFloat() * 0.5F, yPos + TecTech.RANDOM.nextFloat() * 0.5F, zPos + TecTech.RANDOM.nextFloat() * 0.5F, xSpd, ySpd, zSpd); - aWorld.spawnParticle(name, xPos + TecTech.RANDOM.nextFloat() * 0.5F, yPos + TecTech.RANDOM.nextFloat() * 0.5F, zPos + TecTech.RANDOM.nextFloat() * 0.5F, xSpd, ySpd, zSpd); - } } -- cgit From 1d554019f1596476b7198c30debc9a41db27195f Mon Sep 17 00:00:00 2001 From: Tec Date: Wed, 17 Jul 2019 09:24:14 +0200 Subject: That is so pointless i cannot imagine --- .../com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java index 2f65fc05a1..dc7e8faef7 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java +++ b/src/main/java/com/github/technus/tectech/mechanics/anomaly/AnomalyHandler.java @@ -79,7 +79,7 @@ public class AnomalyHandler implements IChunkMetaDataHandler { data.get(dim).get(b.getChunkCoordIntPair()).setDouble(INTENSITY, Math.min(SWAP_THRESHOLD, avg * (TecTech.RANDOM.nextFloat() + .5F) * 0.5F)); data.get(dim).markForTransmissionToClient(a.getChunkCoordIntPair()); data.get(dim).markForTransmissionToClient(b.getChunkCoordIntPair()); - swapSomething(a, b, (float) Math.min(Math.log10(avg-5), 20)); + swapSomething(a, b, (float) Math.min(Math.log10(avg), 20)); } worldDataArrayList.clear(); } -- cgit