aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/gtPlusPlus')
-rw-r--r--src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java2
-rw-r--r--src/Java/gtPlusPlus/core/slots/SlotElectric.java43
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_2by2.java31
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_4by4.java43
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_2by2.java36
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_4by4.java36
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/CONTAINER_Electric_2by2.java22
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/CONTAINER_Electric_4by4.java35
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/GUI_Electric_2by2.java19
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/GUI_Electric_4by4.java20
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java219
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTileEntity.java22
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTransformerHiAmp.java73
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java243
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_PowerSubStationController.java77
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPowerSubStation.java18
17 files changed, 763 insertions, 180 deletions
diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
index 9236aa53e5..788d011733 100644
--- a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
+++ b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
@@ -55,7 +55,7 @@ public class COMPAT_HANDLER {
to
868
---
- 886
+ 890
to
950
*/
diff --git a/src/Java/gtPlusPlus/core/slots/SlotElectric.java b/src/Java/gtPlusPlus/core/slots/SlotElectric.java
new file mode 100644
index 0000000000..6b11cf5264
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/slots/SlotElectric.java
@@ -0,0 +1,43 @@
+package gtPlusPlus.core.slots;
+
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.items.GT_MetaGenerated_Tool;
+import ic2.api.info.Info;
+import ic2.api.item.ElectricItem;
+import ic2.api.item.IElectricItem;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+
+public class SlotElectric extends Slot {
+
+ public SlotElectric(final IInventory inventory, final int x, final int y, final int z) {
+ super(inventory, x, y, z);
+ }
+
+ public SlotElectric(IGregTechTileEntity mTileEntity, int i, int j, int k) {
+ this(mTileEntity.getIInventory(mTileEntity.getXCoord(), mTileEntity.getYCoord(), mTileEntity.getZCoord()), i, j, k);
+ }
+
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ if ((accepts(itemstack)) || (itemstack.getItem() instanceof GT_MetaGenerated_Tool) || (itemstack.getItem() instanceof IElectricItem)) {
+ return true;
+ }
+ return false;
+ }
+
+ public boolean accepts(final ItemStack stack) {
+ if (stack == null) {
+ return false;
+ }
+ return (Info.itemEnergy.getEnergyValue(stack) > 0.0D)
+ || (ElectricItem.manager.discharge(stack, (1.0D / 0.0D), 4, true, true, true) > 0.0D);
+ }
+
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
index 2032555a7f..e4da291b17 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
@@ -253,6 +253,10 @@ public enum GregtechItemList implements GregtechItemContainer {
Machine_Advanced_EV_Mixer, Machine_Advanced_IV_Mixer, Machine_Advanced_LuV_Mixer,
Machine_Advanced_ZPM_Mixer, Machine_Advanced_UV_Mixer,
+ //Custom hatches
+ Hatch_Input_Battery_MV, Hatch_Input_Battery_EV,
+ Hatch_Output_Battery_MV, Hatch_Output_Battery_EV,
+
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_2by2.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_2by2.java
new file mode 100644
index 0000000000..60106825a0
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_2by2.java
@@ -0,0 +1,31 @@
+package gtPlusPlus.xmod.gregtech.api.gui.hatches;
+
+import gregtech.api.gui.GT_ContainerMetaTile_Machine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.Slot;
+
+public class CONTAINER_2by2 extends GT_ContainerMetaTile_Machine {
+
+ public CONTAINER_2by2(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ @Override
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+ addSlotToContainer(new Slot(mTileEntity, 0, 71, 26));
+ addSlotToContainer(new Slot(mTileEntity, 1, 89, 26));
+ addSlotToContainer(new Slot(mTileEntity, 2, 71, 44));
+ addSlotToContainer(new Slot(mTileEntity, 3, 89, 44));
+ }
+
+ @Override
+ public int getSlotCount() {
+ return 4;
+ }
+
+ @Override
+ public int getShiftClickSlotCount() {
+ return 4;
+ }
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_4by4.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_4by4.java
new file mode 100644
index 0000000000..0c011f164b
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_4by4.java
@@ -0,0 +1,43 @@
+package gtPlusPlus.xmod.gregtech.api.gui.hatches;
+
+import gregtech.api.gui.GT_ContainerMetaTile_Machine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.Slot;
+
+public class CONTAINER_4by4 extends GT_ContainerMetaTile_Machine {
+
+ public CONTAINER_4by4(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ @Override
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+ addSlotToContainer(new Slot(mTileEntity, 0, 53, 8));
+ addSlotToContainer(new Slot(mTileEntity, 1, 71, 8));
+ addSlotToContainer(new Slot(mTileEntity, 2, 89, 8));
+ addSlotToContainer(new Slot(mTileEntity, 3, 107, 8));
+ addSlotToContainer(new Slot(mTileEntity, 4, 53, 26));
+ addSlotToContainer(new Slot(mTileEntity, 5, 71, 26));
+ addSlotToContainer(new Slot(mTileEntity, 6, 89, 26));
+ addSlotToContainer(new Slot(mTileEntity, 7, 107, 26));
+ addSlotToContainer(new Slot(mTileEntity, 8, 53, 44));
+ addSlotToContainer(new Slot(mTileEntity, 9, 71, 44));
+ addSlotToContainer(new Slot(mTileEntity, 10, 89, 44));
+ addSlotToContainer(new Slot(mTileEntity, 11, 107, 44));
+ addSlotToContainer(new Slot(mTileEntity, 12, 53, 62));
+ addSlotToContainer(new Slot(mTileEntity, 13, 71, 62));
+ addSlotToContainer(new Slot(mTileEntity, 14, 89, 62));
+ addSlotToContainer(new Slot(mTileEntity, 15, 107, 62));
+ }
+
+ @Override
+ public int getSlotCount() {
+ return 16;
+ }
+
+ @Override
+ public int getShiftClickSlotCount() {
+ return 16;
+ }
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_2by2.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_2by2.java
new file mode 100644
index 0000000000..b78d8454c3
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_2by2.java
@@ -0,0 +1,36 @@
+package gtPlusPlus.xmod.gregtech.api.gui.hatches;
+
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.InventoryPlayer;
+
+import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
+
+import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
+
+public class GUI_2by2 extends GT_GUIContainerMetaTile_Machine {
+
+ private final String mName;
+
+ public GUI_2by2(CONTAINER_2by2 containerType, InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) {
+ super(containerType, RES_PATH_GUI + "2by2.png");
+ mName = aName;
+ }
+
+ public GUI_2by2(CONTAINER_2by2 containerType, InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) {
+ super(containerType, RES_PATH_GUI + aBackground + "2by2.png");
+ mName = aName;
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+ fontRendererObj.drawString(mName, 8, 4, 4210752);
+ }
+
+ @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/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_4by4.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_4by4.java
new file mode 100644
index 0000000000..4cd599110c
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/GUI_4by4.java
@@ -0,0 +1,36 @@
+package gtPlusPlus.xmod.gregtech.api.gui.hatches;
+
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.InventoryPlayer;
+
+import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
+
+import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
+
+public class GUI_4by4 extends GT_GUIContainerMetaTile_Machine {
+
+ private final String mName;
+
+ public GUI_4by4(CONTAINER_4by4 containerType, InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) {
+ super(containerType, RES_PATH_GUI + "4by4.png");
+ mName = aName;
+ }
+
+ public GUI_4by4(CONTAINER_4by4 containerType, InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) {
+ super(containerType, RES_PATH_GUI + aBackground + "4by4.png");
+ mName = aName;
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+ fontRendererObj.drawString(mName, 8, 4, 4210752);
+ }
+
+ @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/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/CONTAINER_Electric_2by2.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/CONTAINER_Electric_2by2.java
new file mode 100644
index 0000000000..d2ca190658
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/CONTAINER_Electric_2by2.java
@@ -0,0 +1,22 @@
+package gtPlusPlus.xmod.gregtech.api.gui.hatches.charge;
+
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gtPlusPlus.core.slots.SlotElectric;
+import gtPlusPlus.xmod.gregtech.api.gui.hatches.CONTAINER_2by2;
+import net.minecraft.entity.player.InventoryPlayer;
+
+public class CONTAINER_Electric_2by2 extends CONTAINER_2by2{
+
+ public CONTAINER_Electric_2by2(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ @Override
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+ addSlotToContainer(new SlotElectric(mTileEntity, 0, 71, 26));
+ addSlotToContainer(new SlotElectric(mTileEntity, 1, 89, 26));
+ addSlotToContainer(new SlotElectric(mTileEntity, 2, 71, 44));
+ addSlotToContainer(new SlotElectric(mTileEntity, 3, 89, 44));
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/CONTAINER_Electric_4by4.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/CONTAINER_Electric_4by4.java
new file mode 100644
index 0000000000..bb70df0558
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/CONTAINER_Electric_4by4.java
@@ -0,0 +1,35 @@
+package gtPlusPlus.xmod.gregtech.api.gui.hatches.charge;
+
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gtPlusPlus.core.slots.SlotElectric;
+import gtPlusPlus.xmod.gregtech.api.gui.hatches.CONTAINER_4by4;
+import net.minecraft.entity.player.InventoryPlayer;
+
+public class CONTAINER_Electric_4by4 extends CONTAINER_4by4{
+
+ public CONTAINER_Electric_4by4(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+
+ @Override
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+ addSlotToContainer(new SlotElectric(mTileEntity, 0, 53, 8));
+ addSlotToContainer(new SlotElectric(mTileEntity, 1, 71, 8));
+ addSlotToContainer(new SlotElectric(mTileEntity, 2, 89, 8));
+ addSlotToContainer(new SlotElectric(mTileEntity, 3, 107, 8));
+ addSlotToContainer(new SlotElectric(mTileEntity, 4, 53, 26));
+ addSlotToContainer(new SlotElectric(mTileEntity, 5, 71, 26));
+ addSlotToContainer(new SlotElectric(mTileEntity, 6, 89, 26));
+ addSlotToContainer(new SlotElectric(mTileEntity, 7, 107, 26));
+ addSlotToContainer(new SlotElectric(mTileEntity, 8, 53, 44));
+ addSlotToContainer(new SlotElectric(mTileEntity, 9, 71, 44));
+ addSlotToContainer(new SlotElectric(mTileEntity, 10, 89, 44));
+ addSlotToContainer(new SlotElectric(mTileEntity, 11, 107, 44));
+ addSlotToContainer(new SlotElectric(mTileEntity, 12, 53, 62));
+ addSlotToContainer(new SlotElectric(mTileEntity, 13, 71, 62));
+ addSlotToContainer(new SlotElectric(mTileEntity, 14, 89, 62));
+ addSlotToContainer(new SlotElectric(mTileEntity, 15, 107, 62));
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/GUI_Electric_2by2.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/GUI_Electric_2by2.java
new file mode 100644
index 0000000000..2e365277ea
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/GUI_Electric_2by2.java
@@ -0,0 +1,19 @@
+package gtPlusPlus.xmod.gregtech.api.gui.hatches.charge;
+
+import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
+
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gtPlusPlus.xmod.gregtech.api.gui.hatches.GUI_2by2;
+import net.minecraft.entity.player.InventoryPlayer;
+
+public class GUI_Electric_2by2 extends GUI_2by2{
+
+ public GUI_Electric_2by2(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) {
+ super(new CONTAINER_Electric_2by2(aInventoryPlayer, aTileEntity), aInventoryPlayer, aTileEntity, aName);
+ }
+
+ public GUI_Electric_2by2(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) {
+ super(new CONTAINER_Electric_2by2(aInventoryPlayer, aTileEntity), aInventoryPlayer, aTileEntity, RES_PATH_GUI + aBackground + "2by2.png");
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/GUI_Electric_4by4.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/GUI_Electric_4by4.java
new file mode 100644
index 0000000000..a09ab7d7aa
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/charge/GUI_Electric_4by4.java
@@ -0,0 +1,20 @@
+package gtPlusPlus.xmod.gregtech.api.gui.hatches.charge;
+
+import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
+
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gtPlusPlus.xmod.gregtech.api.gui.hatches.GUI_4by4;
+import net.minecraft.entity.player.InventoryPlayer;
+
+public class GUI_Electric_4by4 extends GUI_4by4{
+
+ public GUI_Electric_4by4(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) {
+ super(new CONTAINER_Electric_4by4(aInventoryPlayer, aTileEntity), aInventoryPlayer, aTileEntity, aName);
+ }
+
+ public GUI_Electric_4by4(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) {
+ super(new CONTAINER_Electric_4by4(aInventoryPlayer, aTileEntity), aInventoryPlayer, aTileEntity, RES_PATH_GUI + aBackground + "4by4.png");
+
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java
index ee58e0f20f..6de1594b69 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java
@@ -43,7 +43,9 @@ public class GregtechMetaPipeEntityBase_Cable extends MetaPipeEntity implements
public short mOverheat;
public final int mWireHeatingTicks;
- public GregtechMetaPipeEntityBase_Cable(final int aID, final String aName, final String aNameRegional, final float aThickNess, final GT_Materials aMaterial, final long aCableLossPerMeter, final long aAmperage, final long aVoltage, final boolean aInsulated, final boolean aCanShock) {
+ public GregtechMetaPipeEntityBase_Cable(final int aID, final String aName, final String aNameRegional,
+ final float aThickNess, final GT_Materials aMaterial, final long aCableLossPerMeter, final long aAmperage,
+ final long aVoltage, final boolean aInsulated, final boolean aCanShock) {
super(aID, aName, aNameRegional, 0);
this.mThickNess = aThickNess;
this.mMaterial = aMaterial;
@@ -55,7 +57,9 @@ public class GregtechMetaPipeEntityBase_Cable extends MetaPipeEntity implements
this.mWireHeatingTicks = this.getGT5Var();
}
- public GregtechMetaPipeEntityBase_Cable(final String aName, final float aThickNess, final GT_Materials aMaterial, final long aCableLossPerMeter, final long aAmperage, final long aVoltage, final boolean aInsulated, final boolean aCanShock) {
+ public GregtechMetaPipeEntityBase_Cable(final String aName, final float aThickNess, final GT_Materials aMaterial,
+ final long aCableLossPerMeter, final long aAmperage, final long aVoltage, final boolean aInsulated,
+ final boolean aCanShock) {
super(aName, 0);
this.mThickNess = aThickNess;
this.mMaterial = aMaterial;
@@ -67,23 +71,23 @@ public class GregtechMetaPipeEntityBase_Cable extends MetaPipeEntity implements
this.mWireHeatingTicks = this.getGT5Var();
}
- private int getGT5Var(){
+ private int getGT5Var() {
final Class<? extends GT_Proxy> clazz = GT_Mod.gregtechproxy.getClass();
final String lookingForValue = "mWireHeatingTicks";
int temp = 4;
Field field;
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
try {
field = clazz.getClass().getField(lookingForValue);
final Class<?> clazzType = field.getType();
- if (clazzType.toString().equals("int")){
+ if (clazzType.toString().equals("int")) {
temp = (field.getInt(clazz));
- }
- else {
+ } else {
temp = 4;
}
} catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
- //Utils.LOG_INFO("FATAL ERROR - REFLECTION FAILED FOR GT CABLES - PLEASE REPORT THIS.");
+ // Utils.LOG_INFO("FATAL ERROR - REFLECTION FAILED FOR GT CABLES
+ // - PLEASE REPORT THIS.");
Utils.LOG_WARNING("FATAL ERROR - REFLECTION FAILED FOR GT CABLES - PLEASE REPORT THIS.");
Utils.LOG_ERROR("FATAL ERROR - REFLECTION FAILED FOR GT CABLES - PLEASE REPORT THIS.");
temp = 4;
@@ -99,37 +103,64 @@ public class GregtechMetaPipeEntityBase_Cable extends MetaPipeEntity implements
@Override
public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaPipeEntityBase_Cable(this.mName, this.mThickNess, this.mMaterial, this.mCableLossPerMeter, this.mAmperage, this.mVoltage, this.mInsulated, this.mCanShock);
+ return new GregtechMetaPipeEntityBase_Cable(this.mName, this.mThickNess, this.mMaterial,
+ this.mCableLossPerMeter, this.mAmperage, this.mVoltage, this.mInsulated, this.mCanShock);
}
@Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aConnections, final byte aColorIndex, final boolean aConnected, final boolean aRedstone) {
+ public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide,
+ final byte aConnections, final byte aColorIndex, final boolean aConnected, final boolean aRedstone) {
if (!this.mInsulated) {
- return new ITexture[]{new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], this.mMaterial.mRGBa)};
+ return new ITexture[] { new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
+ this.mMaterial.mRGBa) };
}
if (aConnected) {
final float tThickNess = this.getThickNess();
if (tThickNess < 0.37F) {
- return new ITexture[]{new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], this.mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_TINY, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ return new ITexture[] {
+ new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
+ this.mMaterial.mRGBa),
+ new GT_RenderedTexture(Textures.BlockIcons.INSULATION_TINY,
+ Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) };
}
if (tThickNess < 0.49F) {
- return new ITexture[]{new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], this.mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_SMALL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ return new ITexture[] {
+ new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
+ this.mMaterial.mRGBa),
+ new GT_RenderedTexture(Textures.BlockIcons.INSULATION_SMALL,
+ Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) };
}
if (tThickNess < 0.74F) {
- return new ITexture[]{new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], this.mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_MEDIUM, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ return new ITexture[] {
+ new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
+ this.mMaterial.mRGBa),
+ new GT_RenderedTexture(Textures.BlockIcons.INSULATION_MEDIUM,
+ Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) };
}
if (tThickNess < 0.99F) {
- return new ITexture[]{new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], this.mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_LARGE, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ return new ITexture[] {
+ new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
+ this.mMaterial.mRGBa),
+ new GT_RenderedTexture(Textures.BlockIcons.INSULATION_LARGE,
+ Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) };
}
- return new ITexture[]{new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], this.mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_HUGE, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ return new ITexture[] {
+ new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire],
+ this.mMaterial.mRGBa),
+ new GT_RenderedTexture(Textures.BlockIcons.INSULATION_HUGE,
+ Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) };
}
- return new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.INSULATION_FULL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ return new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.INSULATION_FULL,
+ Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) };
}
@Override
- public void onEntityCollidedWithBlock(final World aWorld, final int aX, final int aY, final int aZ, final Entity aEntity) {
- if (this.mCanShock && ((((BaseMetaPipeEntity) this.getBaseMetaTileEntity()).mConnections & -128) == 0) && (aEntity instanceof EntityLivingBase)) {
- GT_Utility.applyElectricityDamage((EntityLivingBase) aEntity, this.mTransferredVoltageLast20, this.mTransferredAmperageLast20);
+ public void onEntityCollidedWithBlock(final World aWorld, final int aX, final int aY, final int aZ,
+ final Entity aEntity) {
+ if (this.mCanShock && ((((BaseMetaPipeEntity) this.getBaseMetaTileEntity()).mConnections & -128) == 0)
+ && (aEntity instanceof EntityLivingBase)) {
+ GT_Utility.applyElectricityDamage((EntityLivingBase) aEntity, this.mTransferredVoltageLast20,
+ this.mTransferredAmperageLast20);
}
}
@@ -138,7 +169,8 @@ public class GregtechMetaPipeEntityBase_Cable extends MetaPipeEntity implements
if (!this.mCanShock) {
return super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
}
- return AxisAlignedBB.getBoundingBox(aX + 0.125D, aY + 0.125D, aZ + 0.125D, aX + 0.875D, aY + 0.875D, aZ + 0.875D);
+ return AxisAlignedBB.getBoundingBox(aX + 0.125D, aY + 0.125D, aZ + 0.125D, aX + 0.875D, aY + 0.875D,
+ aZ + 0.875D);
}
@Override
@@ -173,19 +205,26 @@ public class GregtechMetaPipeEntityBase_Cable extends MetaPipeEntity implements
@Override
public long injectEnergyUnits(final byte aSide, final long aVoltage, final long aAmperage) {
- if (!this.getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide).letsEnergyIn(aSide, this.getBaseMetaTileEntity().getCoverIDAtSide(aSide), this.getBaseMetaTileEntity().getCoverDataAtSide(aSide), this.getBaseMetaTileEntity())) {
+ if (!this.getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide).letsEnergyIn(aSide,
+ this.getBaseMetaTileEntity().getCoverIDAtSide(aSide),
+ this.getBaseMetaTileEntity().getCoverDataAtSide(aSide), this.getBaseMetaTileEntity())) {
return 0;
}
- return this.transferElectricity(aSide, aVoltage, aAmperage, new ArrayList<>(Arrays.asList((TileEntity) this.getBaseMetaTileEntity())));
+ return this.transferElectricity(aSide, aVoltage, aAmperage,
+ new ArrayList<>(Arrays.asList((TileEntity) this.getBaseMetaTileEntity())));
}
@Override
- public long transferElectricity(final byte aSide, long aVoltage, final long aAmperage, final ArrayList<TileEntity> aAlreadyPassedTileEntityList) {
+ public long transferElectricity(final byte aSide, long aVoltage, final long aAmperage,
+ final ArrayList<TileEntity> aAlreadyPassedTileEntityList) {
long rUsedAmperes = 0;
aVoltage -= this.mCableLossPerMeter;
if (aVoltage > 0) {
for (byte i = 0; (i < 6) && (aAmperage > rUsedAmperes); i++) {
- if ((i != aSide) && ((this.mConnections & (1 << i)) != 0) && this.getBaseMetaTileEntity().getCoverBehaviorAtSide(i).letsEnergyOut(i, this.getBaseMetaTileEntity().getCoverIDAtSide(i), this.getBaseMetaTileEntity().getCoverDataAtSide(i), this.getBaseMetaTileEntity())) {
+ if ((i != aSide) && ((this.mConnections & (1 << i)) != 0)
+ && this.getBaseMetaTileEntity().getCoverBehaviorAtSide(i).letsEnergyOut(i,
+ this.getBaseMetaTileEntity().getCoverIDAtSide(i),
+ this.getBaseMetaTileEntity().getCoverDataAtSide(i), this.getBaseMetaTileEntity())) {
final TileEntity tTileEntity = this.getBaseMetaTileEntity().getTileEntityAtSide(i);
if (!aAlreadyPassedTileEntityList.contains(tTileEntity)) {
aAlreadyPassedTileEntityList.add(tTileEntity);
@@ -196,22 +235,45 @@ public class GregtechMetaPipeEntityBase_Cable extends MetaPipeEntity implements
continue;
}
}
- if ((tTileEntity instanceof IGregTechTileEntity) && (((IGregTechTileEntity) tTileEntity).getMetaTileEntity() instanceof IMetaTileEntityCable) && ((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(GT_Utility.getOppositeSide(i)).letsEnergyIn(GT_Utility.getOppositeSide(i), ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(GT_Utility.getOppositeSide(i)), ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(GT_Utility.getOppositeSide(i)), ((IGregTechTileEntity) tTileEntity))) {
+ if ((tTileEntity instanceof IGregTechTileEntity)
+ && (((IGregTechTileEntity) tTileEntity)
+ .getMetaTileEntity() instanceof IMetaTileEntityCable)
+ && ((IGregTechTileEntity) tTileEntity)
+ .getCoverBehaviorAtSide(GT_Utility.getOppositeSide(i))
+ .letsEnergyIn(GT_Utility.getOppositeSide(i),
+ ((IGregTechTileEntity) tTileEntity)
+ .getCoverIDAtSide(GT_Utility.getOppositeSide(i)),
+ ((IGregTechTileEntity) tTileEntity)
+ .getCoverDataAtSide(GT_Utility.getOppositeSide(i)),
+ ((IGregTechTileEntity) tTileEntity))) {
if (((IGregTechTileEntity) tTileEntity).getTimer() > 50) {
- rUsedAmperes += ((IMetaTileEntityCable) ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()).transferElectricity(GT_Utility.getOppositeSide(i), aVoltage, aAmperage - rUsedAmperes, aAlreadyPassedTileEntityList);
+ rUsedAmperes += ((IMetaTileEntityCable) ((IGregTechTileEntity) tTileEntity)
+ .getMetaTileEntity()).transferElectricity(GT_Utility.getOppositeSide(i),
+ aVoltage, aAmperage - rUsedAmperes, aAlreadyPassedTileEntityList);
}
} else {
- rUsedAmperes += ((IEnergyConnected) tTileEntity).injectEnergyUnits(GT_Utility.getOppositeSide(i), aVoltage, aAmperage - rUsedAmperes);
+ rUsedAmperes += ((IEnergyConnected) tTileEntity).injectEnergyUnits(
+ GT_Utility.getOppositeSide(i), aVoltage, aAmperage - rUsedAmperes);
}
- // } else if (tTileEntity instanceof IEnergySink) {
- // ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite();
- // if (((IEnergySink)tTileEntity).acceptsEnergyFrom((TileEntity)getBaseMetaTileEntity(), tDirection)) {
- // if (((IEnergySink)tTileEntity).demandedEnergyUnits() > 0 && ((IEnergySink)tTileEntity).injectEnergyUnits(tDirection, aVoltage) < aVoltage) rUsedAmperes++;
- // }
+ // } else if (tTileEntity instanceof IEnergySink) {
+ // ForgeDirection tDirection =
+ // ForgeDirection.getOrientation(i).getOpposite();
+ // if
+ // (((IEnergySink)tTileEntity).acceptsEnergyFrom((TileEntity)getBaseMetaTileEntity(),
+ // tDirection)) {
+ // if
+ // (((IEnergySink)tTileEntity).demandedEnergyUnits()
+ // > 0 &&
+ // ((IEnergySink)tTileEntity).injectEnergyUnits(tDirection,
+ // aVoltage) < aVoltage) rUsedAmperes++;
+ // }
} else if (tTileEntity instanceof IEnergySink) {
final ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite();
- if (((IEnergySink) tTileEntity).acceptsEnergyFrom((TileEntity) this.getBaseMetaTileEntity(), tDirection)) {
- if ((((IEnergySink) tTileEntity).getDemandedEnergy() > 0) && (((IEnergySink) tTileEntity).injectEnergy(tDirection, aVoltage, aVoltage) < aVoltage)) {
+ if (((IEnergySink) tTileEntity).acceptsEnergyFrom((TileEntity) this.getBaseMetaTileEntity(),
+ tDirection)) {
+ if ((((IEnergySink) tTileEntity).getDemandedEnergy() > 0)
+ && (((IEnergySink) tTileEntity).injectEnergy(tDirection, aVoltage,
+ aVoltage) < aVoltage)) {
rUsedAmperes++;
}
}
@@ -223,15 +285,18 @@ public class GregtechMetaPipeEntityBase_Cable extends MetaPipeEntity implements
rUsedAmperes++;
} else if (((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, true) > 0) {
if (this.mRestRF == 0) {
- final int RFtrans = ((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, false);
+ final int RFtrans = ((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut,
+ false);
rUsedAmperes++;
this.mRestRF = rfOut - RFtrans;
} else {
- final int RFtrans = ((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, (int) this.mRestRF, false);
+ final int RFtrans = ((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection,
+ (int) this.mRestRF, false);
this.mRestRF = this.mRestRF - RFtrans;
}
}
- if (GregTech_API.mRFExplosions && (((IEnergyReceiver) tTileEntity).getMaxEnergyStored(tDirection) < (rfOut * 600))) {
+ if (GregTech_API.mRFExplosions && (((IEnergyReceiver) tTileEntity)
+ .getMaxEnergyStored(tDirection) < (rfOut * 600))) {
if (rfOut > ((32 * GregTech_API.mEUtoRF) / 100)) {
this.doExplosion(rfOut);
}
@@ -242,24 +307,21 @@ public class GregtechMetaPipeEntityBase_Cable extends MetaPipeEntity implements
}
}
-
this.mTransferredAmperage += rUsedAmperes;
this.mTransferredVoltageLast20 = Math.max(this.mTransferredVoltageLast20, aVoltage);
this.mTransferredAmperageLast20 = Math.max(this.mTransferredAmperageLast20, this.mTransferredAmperage);
-
- if ((aVoltage > this.mVoltage) || (this.mTransferredAmperage > this.mAmperage)){
- //GT 5.09
+ if ((aVoltage > this.mVoltage) || (this.mTransferredAmperage > this.mAmperage)) {
+ // GT 5.09
if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- if(this.mOverheat>(this.mWireHeatingTicks * 100)){
+ if (this.mOverheat > (this.mWireHeatingTicks * 100)) {
this.getBaseMetaTileEntity().setToFire();
- }
- else{
- this.mOverheat +=100;
+ } else {
+ this.mOverheat += 100;
}
return aAmperage;
}
- //GT 5.08
+ // GT 5.08
else {
this.getBaseMetaTileEntity().setToFire();
return aAmperage;
@@ -273,7 +335,7 @@ public class GregtechMetaPipeEntityBase_Cable extends MetaPipeEntity implements
public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
if (aBaseMetaTileEntity.isServerSide()) {
this.mTransferredAmperage = 0;
- if(this.mOverheat>0) {
+ if (this.mOverheat > 0) {
this.mOverheat--;
}
@@ -283,7 +345,15 @@ public class GregtechMetaPipeEntityBase_Cable extends MetaPipeEntity implements
this.mConnections = 0;
for (byte i = 0, j = 0; i < 6; i++) {
j = GT_Utility.getOppositeSide(i);
- if (aBaseMetaTileEntity.getCoverBehaviorAtSide(i).alwaysLookConnected(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), aBaseMetaTileEntity) || aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsEnergyIn(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), aBaseMetaTileEntity) || aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsEnergyOut(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), aBaseMetaTileEntity)) {
+ if (aBaseMetaTileEntity.getCoverBehaviorAtSide(i).alwaysLookConnected(i,
+ aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i),
+ aBaseMetaTileEntity)
+ || aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsEnergyIn(i,
+ aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i),
+ aBaseMetaTileEntity)
+ || aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsEnergyOut(i,
+ aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i),
+ aBaseMetaTileEntity)) {
final TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(i);
if (tTileEntity instanceof IColoredTileEntity) {
if (aBaseMetaTileEntity.getColorization() >= 0) {
@@ -293,29