aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--src/main/java/com/github/technus/tectech/CommonValues.java4
-rw-r--r--src/main/java/com/github/technus/tectech/loader/MainLoader.java7
-rw-r--r--src/main/java/com/github/technus/tectech/loader/thing/CoverLoader.java19
-rw-r--r--src/main/java/com/github/technus/tectech/loader/thing/MachineLoader.java35
-rw-r--r--src/main/java/com/github/technus/tectech/loader/thing/ThingsLoader.java15
-rw-r--r--src/main/java/com/github/technus/tectech/thing/CustomItemList.java9
-rw-r--r--src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsBA0.java178
-rw-r--r--src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsTT.java1
-rw-r--r--src/main/java/com/github/technus/tectech/thing/casing/GT_Item_CasingsBA0.java70
-rw-r--r--src/main/java/com/github/technus/tectech/thing/casing/GT_Item_CasingsTT.java7
-rw-r--r--src/main/java/com/github/technus/tectech/thing/casing/TT_Container_Casings.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_TeslaCoil.java28
-rw-r--r--src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_TeslaCoil_Ultimate.java29
-rw-r--r--src/main/java/com/github/technus/tectech/thing/item/TeslaCoilCapacitor.java104
-rw-r--r--src/main/java/com/github/technus/tectech/thing/item/TeslaCoilCover.java35
-rw-r--r--src/main/java/com/github/technus/tectech/thing/item/TeslaCoilCoverUltimate.java35
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Capacitor.java117
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Capacitor.java34
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Capacitor.java21
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java2
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java4
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java562
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TeslaCoil.java269
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_BASE_SIDES.pngbin0 -> 592 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_BASE_TOP_BOTTOM.pngbin0 -> 606 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_CAPS.pngbin0 -> 527 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_CAPS_ACTIVE.pngbin0 -> 2387 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_TOROID.pngbin0 -> 724 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_0.pngbin0 -> 1156 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_1.pngbin0 -> 1125 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_2.pngbin0 -> 1156 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_3.pngbin0 -> 1145 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_4.pngbin0 -> 1151 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_5.pngbin0 -> 1182 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_0.pngbin0 -> 1145 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_1.pngbin0 -> 1096 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_2.pngbin0 -> 1123 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_3.pngbin0 -> 1137 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_4.pngbin0 -> 1124 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_5.pngbin0 -> 1152 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_SECONDARY_SIDES.pngbin0 -> 1233 bytes
-rw-r--r--src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_SECONDARY_TOP_BOTTOM.pngbin0 -> 1319 bytes
-rw-r--r--src/main/resources/assets/tectech/lang/en_US.lang3
44 files changed, 1466 insertions, 125 deletions
diff --git a/.gitignore b/.gitignore
index 406c4db8dc..4b05cbe9e4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,6 +23,7 @@ SetupDevWorkspaces.bat
*.db
*.log
.idea/
+\.directory
asm/
config/
saves/
diff --git a/src/main/java/com/github/technus/tectech/CommonValues.java b/src/main/java/com/github/technus/tectech/CommonValues.java
index 8ac6188b63..9564643fbe 100644
--- a/src/main/java/com/github/technus/tectech/CommonValues.java
+++ b/src/main/java/com/github/technus/tectech/CommonValues.java
@@ -18,6 +18,10 @@ public final class CommonValues {
EnumChatFormatting.BLUE + "Tec" +
EnumChatFormatting.DARK_BLUE + "Tech" +
EnumChatFormatting.BLUE + ": Theta Movement";
+ public static final String COSMIC_MARK =
+ EnumChatFormatting.BLUE + "Tec" +
+ EnumChatFormatting.DARK_BLUE + "Tech" +
+ EnumChatFormatting.BLUE + ": Cosmic";//TODO get a better name than cosmic for *UNDEFINED* thing
public static final byte DECAY_AT = 0;// hatches compute decays
public static final byte MULTI_PURGE_1_AT = 2;// multiblocks clean their hatches 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 b45e8bd532..1c3ec67972 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.gui.CreativeTabTecTech;
import com.github.technus.tectech.loader.gui.ModGuiHandler;
import com.github.technus.tectech.loader.recipe.RecipeLoader;
import com.github.technus.tectech.loader.thing.ComponentLoader;
+import com.github.technus.tectech.loader.thing.CoverLoader;
import com.github.technus.tectech.loader.thing.MachineLoader;
import com.github.technus.tectech.loader.thing.ThingsLoader;
import com.github.technus.tectech.thing.casing.TT_Container_Casings;
@@ -70,7 +71,7 @@ public final class MainLoader {
}
public static void load() {
- ProgressManager.ProgressBar progressBarLoad = ProgressManager.push("TecTech Loader", 8);
+ ProgressManager.ProgressBar progressBarLoad = ProgressManager.push("TecTech Loader", 9);
progressBarLoad.step("Elemental Things");
new ElementalLoader().run();
@@ -92,6 +93,10 @@ public final class MainLoader {
new MachineLoader().run();
LOGGER.info("Machine Init Done");
+ progressBarLoad.step("Cover Things");
+ new CoverLoader().run();
+ LOGGER.info("Cover Init Done");
+
progressBarLoad.step("Register entities");
new EntityLoader().run();
LOGGER.info("Entities registered");
diff --git a/src/main/java/com/github/technus/tectech/loader/thing/CoverLoader.java b/src/main/java/com/github/technus/tectech/loader/thing/CoverLoader.java
new file mode 100644
index 0000000000..e71489339e
--- /dev/null
+++ b/src/main/java/com/github/technus/tectech/loader/thing/CoverLoader.java
@@ -0,0 +1,19 @@
+package com.github.technus.tectech.loader.thing;
+
+import com.github.technus.tectech.TecTech;
+
+import com.github.technus.tectech.thing.cover.GT_Cover_TM_TeslaCoil;
+import com.github.technus.tectech.thing.cover.GT_Cover_TM_TeslaCoil_Ultimate;
+import com.github.technus.tectech.thing.item.TeslaCoilCover;
+import com.github.technus.tectech.thing.item.TeslaCoilCoverUltimate;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Textures;
+import gregtech.api.objects.GT_RenderedTexture;
+import net.minecraft.item.ItemStack;
+public class CoverLoader implements Runnable {
+ public void run(){
+ GregTech_API.registerCover(new ItemStack(TeslaCoilCover.INSTANCE, 1), new GT_RenderedTexture(Textures.BlockIcons.VENT_NORMAL), new GT_Cover_TM_TeslaCoil());
+ GregTech_API.registerCover(new ItemStack(TeslaCoilCoverUltimate.INSTANCE, 1), new GT_RenderedTexture(Textures.BlockIcons.VENT_ADVANCED), new GT_Cover_TM_TeslaCoil_Ultimate());
+ TecTech.LOGGER.info("Cover functionality registered");
+ }
+}
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 b4867023aa..f44c4f6634 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
@@ -582,6 +582,10 @@ public class MachineLoader implements Runnable {
Machine_OwnerDetector.set(new GT_MetaTileEntity_OwnerDetector(15480, "machine.tt.ownerdetector", "Owner detector", 3).getStackForm(1L));
Machine_DataReader.set(new GT_MetaTileEntity_DataReader(15481, "machine.tt.datareader", "Data Reader", 5).getStackForm(1L));
+ // ===================================================================================================
+ // Buck Converters
+ // ===================================================================================================
+
Machine_BuckConverter_IV.set(new GT_MetaTileEntity_BuckConverter(15485, "machine.tt.buck.05", "Insane Buck Converter", 5).getStackForm(1L));
Machine_BuckConverter_LuV.set(new GT_MetaTileEntity_BuckConverter(15486, "machine.tt.buck.06", "Ludicrous Buck Converter", 6).getStackForm(1L));
Machine_BuckConverter_ZPM.set(new GT_MetaTileEntity_BuckConverter(15487, "machine.tt.buck.07", "ZPM Voltage Buck Converter", 7).getStackForm(1L));
@@ -593,6 +597,34 @@ public class MachineLoader implements Runnable {
Machine_BuckConverter_UXV.set(new GT_MetaTileEntity_BuckConverter(15493, "machine.tt.buck.13", "Extended Mega Ultimate Buck Converter", 13).getStackForm(1L));
// ===================================================================================================
+ // Tesla Transceiver
+ // ===================================================================================================
+
+ Machine_TeslaCoil_LV_1A.set(new GT_MetaTileEntity_TeslaCoil(16000, "machine.tt.tesla.01", "Basic Tesla Transceiver", 1,1).getStackForm(1L));
+ Machine_TeslaCoil_MV_1A.set(new GT_MetaTileEntity_TeslaCoil(16001, "machine.tt.tesla.02", "Advanced Tesla Transceiver", 2, 1).getStackForm(1L));
+ Machine_TeslaCoil_HV_1A.set(new GT_MetaTileEntity_TeslaCoil(16002, "machine.tt.tesla.03", "Epyc Tesla Transceiver", 3, 1).getStackForm(1L));
+ Machine_TeslaCoil_EV_1A.set(new GT_MetaTileEntity_TeslaCoil(16003, "machine.tt.tesla.04", "Ultimate Power Tesla Transceiver", 4, 1).getStackForm(1L));
+ Machine_TeslaCoil_IV_1A.set(new GT_MetaTileEntity_TeslaCoil(16004, "machine.tt.tesla.05", "Insane Tesla Transceiver", 5, 1).getStackForm(1L));
+
+ Machine_TeslaCoil_LV_4A.set(new GT_MetaTileEntity_TeslaCoil(16005, "machine.tt.tesla.01", "Basic Tesla Transceiver", 1,4).getStackForm(1L));
+ Machine_TeslaCoil_MV_4A.set(new GT_MetaTileEntity_TeslaCoil(16006, "machine.tt.tesla.02", "Advanced Tesla Transceiver", 2, 4).getStackForm(1L));
+ Machine_TeslaCoil_HV_4A.set(new GT_MetaTileEntity_TeslaCoil(16007, "machine.tt.tesla.03", "Epyc Tesla Transceiver", 3, 4).getStackForm(1L));
+ Machine_TeslaCoil_EV_4A.set(new GT_MetaTileEntity_TeslaCoil(16008, "machine.tt.tesla.04", "Ultimate Power Tesla Transceiver", 4, 4).getStackForm(1L));
+ Machine_TeslaCoil_IV_4A.set(new GT_MetaTileEntity_TeslaCoil(16009, "machine.tt.tesla.05", "Insane Tesla Transceiver", 5, 4).getStackForm(1L));
+
+ Machine_TeslaCoil_LV_9A.set(new GT_MetaTileEntity_TeslaCoil(16010, "machine.tt.tesla.01", "Basic Tesla Transceiver", 1,9).getStackForm(1L));
+ Machine_TeslaCoil_MV_9A.set(new GT_MetaTileEntity_TeslaCoil(16011, "machine.tt.tesla.02", "Advanced Tesla Transceiver", 2, 9).getStackForm(1L));
+ Machine_TeslaCoil_HV_9A.set(new GT_MetaTileEntity_TeslaCoil(16012, "machine.tt.tesla.03", "Epyc Tesla Transceiver", 3, 9).getStackForm(1L));
+ Machine_TeslaCoil_EV_9A.set(new GT_MetaTileEntity_TeslaCoil(16013, "machine.tt.tesla.04", "Ultimate Power Tesla Transceiver", 4, 9).getStackForm(1L));
+ Machine_TeslaCoil_IV_9A.set(new GT_MetaTileEntity_TeslaCoil(16014, "machine.tt.tesla.05", "Insane Tesla Transceiver", 5, 9).getStackForm(1L));
+
+ Machine_TeslaCoil_LV_16A.set(new GT_MetaTileEntity_TeslaCoil(16015, "machine.tt.tesla.01", "Basic Tesla Transceiver", 1,16).getStackForm(1L));
+ Machine_TeslaCoil_MV_16A.set(new GT_MetaTileEntity_TeslaCoil(16016, "machine.tt.tesla.02", "Advanced Tesla Transceiver", 2, 16).getStackForm(1L));
+ Machine_TeslaCoil_HV_16A.set(new GT_MetaTileEntity_TeslaCoil(16017, "machine.tt.tesla.03", "Epyc Tesla Transceiver", 3, 16).getStackForm(1L));
+ Machine_TeslaCoil_EV_16A.set(new GT_MetaTileEntity_TeslaCoil(16018, "machine.tt.tesla.04", "Ultimate Power Tesla Transceiver", 4, 16).getStackForm(1L));
+ Machine_TeslaCoil_IV_16A.set(new GT_MetaTileEntity_TeslaCoil(16019, "machine.tt.tesla.05", "Insane Tesla Transceiver", 5, 16).getStackForm(1L));
+
+ // ===================================================================================================
// Debug Stuff
// ===================================================================================================
Machine_DebugPollutor.set(new GT_MetaTileEntity_DebugPollutor(15495,"debug.tt.pollutor","Debug Pollution Generator",15).getStackForm(1));
@@ -607,8 +639,11 @@ public class MachineLoader implements Runnable {
// ===================================================================================================
GT_MetaTileEntity_Hatch_Rack.run();
+
GT_MetaTileEntity_DataReader.run();
+ GT_MetaTileEntity_Hatch_Capacitor.run();
+
if (!Loader.isModLoaded(Reference.DREAMCRAFT)) {
new NoDreamCraftMachineLoader().run();
}
diff --git a/src/main/java/com/github/technus/tectech/loader/thing/ThingsLoader.java b/src/main/java/com/github/technus/tectech/loader/thing/ThingsLoader.java
index b422688a70..13d8861d31 100644
--- a/src/main/java/com/github/technus/tectech/loader/thing/ThingsLoader.java
+++ b/src/main/java/com/github/technus/tectech/loader/thing/ThingsLoader.java
@@ -7,10 +7,7 @@ import com.github.technus.tectech.compatibility.openmodularturrets.blocks.turret
import com.github.technus.tectech.thing.block.QuantumGlassBlock;
import com.github.technus.tectech.thing.block.QuantumStuffBlock;
import com.github.technus.tectech.thing.block.ReactorSimBlock;
-import com.github.technus.tectech.thing.casing.GT_Block_CasingsNH;
-import com.github.technus.tectech.thing.casing.GT_Block_CasingsTT;
-import com.github.technus.tectech.thing.casing.GT_Block_HintTT;
-import com.github.technus.tectech.thing.casing.TT_Container_Casings;
+import com.github.technus.tectech.thing.casing.*;
import com.github.technus.tectech.thing.item.*;
import cpw.mods.fml.common.Loader;
import gregtech.api.enums.Textures;
@@ -34,6 +31,8 @@ public class ThingsLoader implements Runnable {
TecTech.LOGGER.info("Added texture page if was null");
TT_Container_Casings.sBlockCasingsTT = new GT_Block_CasingsTT();
TecTech.LOGGER.info("Elemental Casing registered");
+ TT_Container_Casings.sBlockCasingsBA0 = new GT_Block_CasingsBA0();
+ TecTech.LOGGER.info("Nikolai's Casing registered");
TT_Container_Casings.sHintCasingsTT = new GT_Block_HintTT();
TecTech.LOGGER.info("Hint Blocks registered");
@@ -53,11 +52,19 @@ public class ThingsLoader implements Runnable {
ReactorSimBlock.run();
TecTech.LOGGER.info("Reactor Simulator registered");
+ TeslaCoilCover.run();
+ TeslaCoilCoverUltimate.run();
+ TecTech.LOGGER.info("Covers Items registered");
+
ConstructableTriggerItem.run();
FrontRotationTriggerItem.run();
ParametrizerMemoryCard.run();
ElementalDefinitionScanStorage_EM.run();
EuMeterGT.run();
+
+
+ TeslaCoilCapacitor.run();
+
TecTech.LOGGER.info("Useful Items registered");
ElementalDefinitionContainer_EM.run();
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 4657beebb8..fdbda7ecd5 100644
--- a/src/main/java/com/github/technus/tectech/thing/CustomItemList.java
+++ b/src/main/java/com/github/technus/tectech/thing/CustomItemList.java
@@ -77,6 +77,9 @@ public enum CustomItemList implements IItemContainer {
Parametrizer_Hatch, ParametrizerX_Hatch, Uncertainty_Hatch, UncertaintyX_Hatch, dataIn_Hatch, dataOut_Hatch, dataInAss_Hatch, dataOutAss_Hatch,
eM_Containment, eM_Containment_Field, eM_Containment_Advanced, eM_Coil, eM_Teleportation, eM_Dimensional, eM_Ultimate_Containment, eM_Ultimate_Containment_Advanced, eM_Ultimate_Containment_Field, eM_Spacetime, eM_Computer_Casing, eM_Computer_Bus, eM_Computer_Vent, eM_Hollow, eM_Power,
debugBlock,
+
+ tM_TeslaBase, tM_TeslaToroid, tM_TeslaFrame, tM_TeslaPrimary_0, tM_TeslaPrimary_1, tM_TeslaPrimary_2, tM_TeslaPrimary_3, tM_TeslaPrimary_4, tM_TeslaPrimary_5,
+
Machine_Multi_Microwave, Machine_Multi_teslaCoil,
Machine_Multi_Transformer,
Machine_Multi_Computer, Machine_Multi_Switch, Machine_Multi_Research, Machine_Multi_DataBank,
@@ -89,8 +92,12 @@ public enum CustomItemList implements IItemContainer {
Machine_Multi_BHG,
hint_0,hint_1,hint_2,hint_3,hint_4,hint_5,hint_6,hint_7,hint_8,hint_9,hint_10,hint_11, hint_general,hint_air,hint_noAir,hint_error,
- scanContainer,parametrizerMemory;
+ scanContainer,parametrizerMemory,
+ Machine_TeslaCoil_LV_1A, Machine_TeslaCoil_MV_1A, Machine_TeslaCoil_HV_1A, Machine_TeslaCoil_EV_1A, Machine_TeslaCoil_IV_1A,
+ Machine_TeslaCoil_LV_4A, Machine_TeslaCoil_MV_4A, Machine_TeslaCoil_HV_4A, Machine_TeslaCoil_EV_4A, Machine_TeslaCoil_IV_4A,
+ Machine_TeslaCoil_LV_9A, Machine_TeslaCoil_MV_9A, Machine_TeslaCoil_HV_9A, Machine_TeslaCoil_EV_9A, Machine_TeslaCoil_IV_9A,
+ Machine_TeslaCoil_LV_16A, Machine_TeslaCoil_MV_16A, Machine_TeslaCoil_HV_16A, Machine_TeslaCoil_EV_16A, Machine_TeslaCoil_IV_16A;
private ItemStack mStack;
private boolean mHasNotBeenSet = true;
diff --git a/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsBA0.java b/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsBA0.java
new file mode 100644
index 0000000000..5fb1d31652
--- /dev/null
+++ b/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsBA0.java
@@ -0,0 +1,178 @@
+package com.github.technus.tectech.thing.casing;
+
+import com.github.technus.tectech.thing.CustomItemList;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.api.enums.Textures;
+import gregtech.api.objects.GT_CopiedBlockTexture;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.common.blocks.GT_Block_Casings_Abstract;
+import gregtech.common.blocks.GT_Material_Casings;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
+
+import java.util.List;
+
+import static com.github.technus.tectech.TecTech.tectechTexturePage1;
+
+/**
+ * Created by danie_000 on 03.10.2016.
+ */
+public class GT_Block_CasingsBA0 extends GT_Block_Casings_Abstract {
+ public static final byte texturePage=tectechTexturePage1;
+ public static final short textureOffset = (texturePage << 7)+16;//Start of PAGE 8 (which is the 9th page) (8*128)+16
+
+ private static IIcon[] tM0 = new IIcon[2];
+ private static IIcon[] tM1 = new IIcon[2];
+ private static IIcon[] tM2 = new IIcon[2];
+ private static IIcon[] tM3 = new IIcon[2];
+ private static IIcon[] tM4 = new IIcon[2];
+ private static IIcon[] tM5 = new IIcon[2];
+ private static IIcon[] tM6 = new IIcon[2];
+ private static IIcon tM7;
+ private static IIcon[] tM8 = new IIcon[2];
+
+ public GT_Block_CasingsBA0() {
+ super(GT_Item_CasingsBA0.class, "gt.blockcasingsBA0", GT_Material_Casings.INSTANCE);
+ for (byte b = 0; b < 16; b = (byte) (b + 1)) {
+ Textures.BlockIcons.casingTexturePages[texturePage][b+16] = new GT_CopiedBlockTexture(this, 6, b);
+ /*IMPORTANT for block recoloring**/
+ }
+
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "T0 Primary Tesla Windings");//TODO Decide tesla coil winding materials to rename
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "T1 Primary Tesla Windings");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "T2 Primary Tesla Windings");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "T3 Primary Tesla Windings");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "T4 Primary Tesla Windings");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "T5 Primary Tesla Windings");
+
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "Tesla Base Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".7.name", "Tesla Toroid Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "Tesla Secondary Windings");
+
+ CustomItemList.tM_TeslaPrimary_0.set(new ItemStack(this, 1, 0));
+ CustomItemList.tM_TeslaPrimary_1.set(new ItemStack(this, 1, 1));
+ CustomItemList.tM_TeslaPrimary_2.set(new ItemStack(this, 1, 2));
+ CustomItemList.tM_TeslaPrimary_3.set(new ItemStack(this, 1, 3));
+ CustomItemList.tM_TeslaPrimary_4.set(new ItemStack(this, 1, 4));
+ CustomItemList.tM_TeslaPrimary_5.set(new ItemStack(this, 1, 5));
+
+ CustomItemList.tM_TeslaBase.set(new ItemStack(this, 1, 6));
+ CustomItemList.tM_TeslaToroid.set(new ItemStack(this, 1, 7));
+ CustomItemList.tM_TeslaFrame.set(new ItemStack(this, 1, 8));
+ }
+
+ @Override
+ public void registerBlockIcons(IIconRegister aIconRegister) {
+ tM0[0] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_0");
+ tM0[1] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_0");
+ tM1[0] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_1");
+ tM1[1] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_1");
+ tM2[0] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_2");
+ tM2[1] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_2");
+ tM3[0] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_3");
+ tM3[1] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_3");
+ tM4[0] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_4");
+ tM4[1] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_4");
+ tM5[0] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_5");
+ tM5[1] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_5");
+
+ tM6[0] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_BASE_TOP_BOTTOM");
+ tM6[1] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_BASE_SIDES");
+ tM7 = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_TOROID");
+ tM8[0] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_SECONDARY_TOP_BOTTOM");
+ tM8[1] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_SECONDARY_SIDES");
+ }
+
+ @Override
+ public IIcon getIcon(int aSide, int aMeta) {
+ switch (aMeta) {
+ case 0:
+ switch (aSide){
+ case 0:
+ case 1:
+ return tM0[0];
+ default:
+ return tM0[1];
+ }
+ case 1:
+ switch (aSide){
+ case 0:
+ case 1:
+ return tM1[0];
+ default:
+ return tM1[1];
+ }
+ case 2:
+ switch (aSide){
+ case 0:
+ case 1:
+ return tM2[0];
+ default:
+ return tM2[1];
+ }
+ case 3:
+ switch (aSide){
+ case 0:
+ case 1:
+ return tM3[0];
+ default:
+ return tM3[1];
+ }
+ case 4:
+ switch (aSide){
+ case 0:
+ case 1:
+ return tM4[0];
+ default:
+ return tM4[1];
+ }
+ case 5:
+ switch (aSide){
+ case 0:
+ case 1:
+ return tM5[0];
+ default:
+ return tM5[1];
+ }
+ case 6:
+ switch (aSide){
+ case 0:
+ case 1:
+ return tM6[0];
+ default:
+ return tM6[1];
+ }
+ case 7:
+ return tM7;
+ case 8:
+ switch (aSide){
+ case 0:
+ case 1:
+ return tM8[0];
+ default:
+ return tM8[1];
+ }
+ default:
+ return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon();
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, int aSide) {
+ int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord);
+ return getIcon(aSide, tMeta);
+ }
+
+ @Override
+ public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) {
+ for (int i = 0; i <= 8; i++) {
+ aList.add(new ItemStack(aItem, 1, i));
+ }
+ }
+}
diff --git a/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsTT.java b/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsTT.java
index 2ea22b625d..639e68fef6 100644
--- a/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsTT.java
+++ b/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsTT.java
@@ -57,7 +57,6 @@ public class GT_Block_CasingsTT extends GT_Block_Casings_Abstract {
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".15.name", "Debug Sides");//NOT REGISTER AS TEXTURE FOR HATCHES!
-
CustomItemList.eM_Power.set(new ItemStack(this, 1, 0));
CustomItemList.eM_Computer_Casing.set(new ItemStack(this, 1, 1));
diff --git a/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_CasingsBA0.java b/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_CasingsBA0.java
new file mode 100644
index 0000000000..8a494baea1
--- /dev/null
+++ b/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_CasingsBA0.java
@@ -0,0 +1,70 @@
+package com.github.technus.tectech.thing.casing;
+
+import gregtech.common.blocks.GT_Item_Casings_Abstract;
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+
+import java.util.List;
+
+import static com.github.technus.tectech.CommonValues.*;
+
+/**
+ * Created by danie_000 on 03.10.2016.
+ */
+public class GT_Item_CasingsBA0 extends GT_Item_Casings_Abstract {
+ public GT_Item_CasingsBA0(Block par1) {
+ super(par1);
+ }
+
+ @Override
+ public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
+ if(aStack.getItemDamage() < 15) {
+ aList.add(BASS_MARK);
+ } else {
+ aList.add(COSMIC_MARK);
+ }
+ switch (aStack.getItemDamage()) {
+ case 0://"T0 Primary Tesla Windings"
+ aList.add("Well suited for high power applications.");
+ aList.add(EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "The power levels are rising!");
+ break;
+ case 1://"T1 Primary Tesla Windings"
+ aList.add("Nice and clean casing.");
+ aList.add(EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Dust can break it!?");
+ break;
+ case 2://"T2 Primary Tesla Windings"
+ aList.add("Air vent with a filter.");
+ aList.add(EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Perfectly muffled sound!");
+ break;
+ case 3://"T3 Primary Tesla Windings"
+ aList.add("Contains high bandwidth bus");
+ aList.add(EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "couple thousand qubits wide.");
+ break;
+ case 4://"T4 Primary Tesla Windings"
+ aList.add("Stops elemental things.");
+ aList.add(EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Radiation and emotions too...");
+ break;
+ case 5://"T5 Primary Tesla Windings"
+ aList.add("Cooling and stabilization.");
+ aList.add(EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "A comfortable machine bed.");
+ break;
+ case 6://"Tesla Base Casing"
+ aList.add("Creates a field that...");
+ aList.add(EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "can stop even force carriers.");
+ break;
+ case 7://"Tesla Toroid Casing"
+ aList.add("Well it does things too...");
+ aList.add(EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "[Use this coil!]");
+ break;
+ case 8://"Tesla Secondary Windings"
+ aList.add("Reinforced accelerator tunnel.");
+ aList.add(EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Most advanced pipe ever.");
+ break;
+ default://WTF?
+ aList.add("Damn son where did you get that!?");
+ aList.add(EnumChatFormatting.BLUE.toString() + "From outer space... I guess...");
+ }
+ }
+}
diff --git a/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_CasingsTT.java b/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_CasingsTT.java
index 6751e4b24b..2fd58c408f 100644
--- a/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_CasingsTT.java
+++ b/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_CasingsTT.java
@@ -8,8 +8,7 @@ import net.minecraft.util.EnumChatFormatting;
import java.util.List;
-import static com.github.technus.tectech.CommonValues.TEC_MARK_EM;
-import static com.github.technus.tectech.CommonValues.TEC_MARK_GENERAL;
+import static com.github.technus.tectech.CommonValues.*;
/**
* Created by danie_000 on 03.10.2016.
@@ -21,10 +20,10 @@ public class GT_Item_CasingsTT extends GT_Item_Casings_Abstract {
@Override
public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
- if(aStack.getItemDamage()>0 && aStack.getItemDamage()<15) {
+ if(aStack.getItemDamage() < 15) {
aList.add(TEC_MARK_EM);
} else {
- aList.add(TEC_MARK_GENERAL);
+ aList.add(COSMIC_MARK);
}
switch (aStack.getItemDamage()) {
case 0://"High Power Casing"
diff --git a/src/main/java/com/github/technus/tectech/thing/casing/TT_Container_Casings.java b/src/main/java/com/github/technus/tectech/thing/casing/TT_Container_Casings.java
index 851046f34b..071a4ae28f 100644
--- a/src/main/java/com/github/technus/tectech/thing/casing/TT_Container_Casings.java
+++ b/src/main/java/com/github/technus/tectech/thing/casing/TT_Container_Casings.java
@@ -8,6 +8,8 @@ import net.minecraft.block.Block;
public final class TT_Container_Casings {
public static Block sBlockCasingsTT;
public static Block sHintCasingsTT;
+ public static Block sBlockCasingsBA0;
+
public static Block sBlockCasingsNH;
private TT_Container_Casings() {}
diff --git a/src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_TeslaCoil.java b/src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_TeslaCoil.java
new file mode 100644
index 0000000000..721f730960
--- /dev/null
+++ b/src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_TeslaCoil.java
@@ -0,0 +1,28 @@
+package com.github.technus.tectech.thing.cover;
+
+import gregtech.api.interfaces.tileentity.ICoverable;
+import gregtech.api.util.GT_CoverBehavior;
+import gregtech.api.util.GT_Utility;
+import net.minecraft.entity.player.EntityPlayer;
+
+import static ic2.api.info.Info.DMG_ELECTRIC;
+
+public class GT_Cover_TM_TeslaCoil extends GT_CoverBehavior {
+ public GT_Cover_TM_TeslaCoil() {
+ }
+
+ public String getDescription(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return "Do not attempt to use screwdriver!";
+ }
+
+ public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return true;
+ }
+
+ public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if(aTileEntity.getStoredEU() > 0 && !GT_Utility.isWearingFullElectroHazmat(aPlayer)){
+ aPlayer.attackEntityFrom(DMG_ELECTRIC, 20);
+ }
+ return aCoverVariable;
+ }
+} \ No newline at end of file
diff --git a/src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_TeslaCoil_Ultimate.java b/src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_TeslaCoil_Ultimate.java
new file mode 100644
index 0000000000..db7c751fc6
--- /dev/null
+++ b/src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_TeslaCoil_Ultimate.java
@@ -0,0 +1,29 @@
+package com.github.technus.tectech.thing.cover;
+
+import gregtech.api.interfaces.tileentity.ICoverable;
+import net.minecraftforge.fluids.Fluid;
+
+public class GT_Cover_TM_TeslaCoil_Ultimate extends GT_Cover_TM_TeslaCoil {
+ public GT_Cover_TM_TeslaCoil_Ultimate() {
+ }
+
+ public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return true;
+ }
+
+ public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) {
+ return true;
+ }
+
+ public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) {
+ return true;
+ }
+
+ public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) {
+ return true;
+ }
+
+ public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) {
+ return true;
+ }
+} \ No newline at end of file
diff --git a/src/main/java/com/github/technus/tectech/thing/item/TeslaCoilCapacitor.java b/src/main/java/com/github/technus/tectech/thing/item/TeslaCoilCapacitor.java
new file mode 100644
index 0000000000..e09fe79d6c
--- /dev/null
+++ b/src/main/java/com/github/technus/tectech/thing/item/TeslaCoilCapacitor.java
@@ -0,0 +1,104 @@
+package com.github.technus.tectech.thing.item;
+
+import com.github.technus.tectech.CommonValues;
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.api.util.GT_LanguageManager;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.IIcon;
+
+import java.util.List;
+
+import static com.github.technus.tectech.Reference.MODID;
+
+
+public final class TeslaCoilCapacitor extends Item {
+ public static TeslaCoilCapacitor INSTANCE;
+ public static IIcon LVicon, MVicon, HVicon, EVicon, IVicon;
+
+ public TeslaCoilCapacitor() {
+ setUnlocalizedName("tm.teslaCoilCapacitor");
+ setTextureName(MODID + ":itemParametrizerMemoryCardUnlocked");
+
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "LV Tesla Capacitor");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "MV Tesla Capacitor");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "HV Tesla Capacitor");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "EV Tesla Capacitor");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "IV Tesla Capacitor");
+ }
+
+ @Override
+ public void addInformation(ItemStack aStack, EntityPlayer ep, List aList, boolean boo) {
+ aList.add(CommonValues.BASS_MARK);
+ switch (aStack.getItemDamage()) {
+ case 0://"LV"
+ aList.add("Stores energy for tesla towers! (LV)");
+ break;
+ case 1://"MV"
+ aList.add("Stores energy for tesla towers! (MV)");
+ break;
+ case 2://"HV"
+ aList.add("Stores energy for tesla towers! (HV)");
+ break;
+ case 3://"EV"
+ aList.add("Stores energy for tesla towers! (EV)");
+ break;
+ case 4://"IV"
+ aList.add("Stores energy for tesla towers! (IV)");
+ break;
+ default://
+ aList.add("Yeet this broken item into some spicy water!");
+ break;
+ }
+ aList.add(EnumChatFormatting.BLUE + "Insert into a Capacitor hatch of a Tesla Tower");
+ aList.add(EnumChatFormatting.BLUE + "Capacitors are the same thing as batteries, right?");
+ }
+
+ @Override
+ public String getUnlocalizedName(ItemStack aStack) {
+ return getUnlocalizedName() + "." + getDamage(aStack);
+ }
+
+ public static void run() {
+ INSTANCE = new TeslaCoilCapacitor();
+ GameRegistry.registerItem(INSTANCE, INSTANCE.getUnlocalizedName());
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister iconRegister) {
+ LVicon = itemIcon = iconRegister.registerIcon(getIconString());
+ MVicon = iconRegister.registerIcon(MODID + ":itemParametrizerMemoryCardLocked");
+ HVicon = iconRegister.registerIcon(MODID + ":itemParametrizerMemoryCardLocked");
+ EVicon = iconRegister.registerIcon(MODID + ":itemParametrizerMemoryCardLocked");
+ IVicon = iconRegister.registerIcon(MODID + ":itemParametrizerMemoryCardLocked");
+ }
+
+ @Override
+ public IIcon getIconFromDamage(int damage) {
+ switch (damage) {
+ case 1:
+ return MVicon;
+ case 2:
+ return HVicon;
+ case 3:
+ return EVicon;
+ case 4:
+ return IVicon;
+ default:
+ return LVicon;
+ }
+ }
+
+ public void getSubItems(Item aItem, CreativeTabs par2CreativeTabs, List aList) {
+ for (int i = 0; i <= 4; i++) {
+ aList.add(new ItemStack(aItem, 1, i));
+ }
+ }
+}
diff --git a/src/main/java/com/github/technus/tectech/thing/item/TeslaCoilCover.java b/src/main/java/com/github/technus/tectech/thing/item/TeslaCoilCover.java
new file mode 100644
index 0000000000..8f2dfc0951
--- /dev/null
+++ b/src/main/java/com/github/technus/tectech/thing/item/TeslaCoilCover.java
@@ -0,0 +1,35 @@
+package com.github.technus.tectech.thing.item;
+
+import com.github.technus.tectech.CommonValues;
+import cpw.mods.fml.common.registry.GameRegistry;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+
+import java.util.List;
+
+import static com.github.technus.tectech.Reference.MODID;
+
+
+public final class TeslaCoilCover extends Item {
+ public static TeslaCoilCover INSTANCE;
+
+ public TeslaCoilCover() {
+ setUnlocalizedName("tm.teslaCoilCover");
+ setTextureName(MODID + ":itemParametrizerMemoryCardUnlocked");
+ }
+
+ @Override
+ public void addInformation(ItemStack aStack, EntityPlayer ep, List aList, boolean boo) {
+ aList.add(CommonValues.BASS_MARK);
+ aList.add("Tesla-Enables Machines!");
+ aList.add(EnumChatFormatting.BLUE + "Use on a machine to apply Tesla capabilities");
+ aList.add(EnumChatFormatting.BLUE + "Who the hell need cables anyway?");
+ }
+
+ public static void run() {
+ INSTANCE = new TeslaCoilCover();
+ GameRegistry.registerItem(INSTANCE, INSTANCE.getUnlocalizedName());
+ }
+}
diff --git a/src/main/java/com/github/technus/tectech/thing/item/TeslaCoilCoverUltimate.java b/src/main/java/com/github/technus/tectech/thing/item/TeslaCoilCoverUltimate.java
new file mode 100644
index 0000000000..ca6734f8d6
--- /dev/null
+++ b/src/main/java/com/github/technus/tectech/thing/item/TeslaCoilCoverUltimate.java
@@ -0,0 +1,35 @@
+package com.github.technus.tectech.thing.item;
+
+import com.github.technus.tectech.CommonValues;
+import cpw.mods.fml.common.registry.GameRegistry;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+
+import java.util.List;
+
+import static com.github.technus.tectech.Reference.MODID;
+
+
+public final class TeslaCoilCoverUltimate extends Item {
+ public static TeslaCoilCoverUltimate INSTANCE;
+
+ public TeslaCoilCoverUltimate() {
+ setUnlocalizedName("tm.teslaCoilCoverUltimate");
+ setTextureName(MODID + ":itemParametrizerMemoryCardUnlocked");
+ }
+
+ @Override
+ public void addInformation(ItemStack aStack, EntityPlayer ep, List aList, boolean boo) {
+ aList.add(CommonValues.BASS_MARK);
+ aList.add("Tesla-Enables Machines! (BUT LOUDER!!)");
+ aList.add(EnumChatFormatting.BLUE + "Use on a machine to apply Tesla capabilities");
+ aList.add(EnumChatFormatting.BLUE + "Who the hell need cables anyway?");
+ }
+
+ public static void run() {
+ INSTANCE = new TeslaCoilCoverUltimate();
+ GameRegistry.registerItem(INSTANCE, INSTANCE.getUnlocalizedName());
+ }
+}
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..3ea31b537e 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
@@ -1,6 +1,8 @@
package com.github.technus.tectech.thing.metaTileEntity.hatch;
import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.Reference;
+import com.github.technus.tectech.TecTech;
import com.github.technus.tectech.Util;
import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_Capacitor;
import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_Capacitor;
@@ -18,38 +20,51 @@ import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
+import java.util.HashMap;
+import java.util.Map;
+
+import static com.github.technus.tectech.CommonValues.V;
+import static com.github.technus.tectech.Util.getUniqueIdentifier;
+import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE;
+
/**
* Created by Tec on 03.04.2017.
*/
public class GT_MetaTileEntity_Hatch_Capacitor extends GT_MetaTileEntity_Hatch {
- private static Textures.BlockIcons.CustomIcon EM_H;
- private static Textures.BlockIcons.CustomIcon EM_H_ACTIVE;
+ private static Textures.BlockIcons.CustomIcon TM_H;
+ private static Textures.BlockIcons.CustomIcon TM_H_ACTIVE;
+ private static Map<String, GT_MetaTileEntity_Hatch_Capacitor.CapacitorComponent> componentBinds = new HashMap<>();
public GT_MetaTileEntity_Hatch_Capacitor(int aID, String aName, String aNameRegional, int aTier, String descr) {
- super(aID, aName, aNameRegional, aTier, 1, descr);
+ super(aID, aName, aNameRegional, aTier, 16, descr);
Util.setTier(aTier,this);
}
public GT_MetaTileEntity_Hatch_Capacitor(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, 1, aDescription, aTextures);
+ super(aName, aTier, 16, aDescription, aTextures);
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 1;
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister aBlockIconRegister) {
super.registerIcons(aBlockIconRegister);
- EM_H_ACTIVE = new Textures.BlockIcons.CustomIcon("iconsets/EM_HOLDER_ACTIVE");
- EM_H = new Textures.BlockIcons.CustomIcon("iconsets/EM_HOLDER");
+ TM_H_ACTIVE = new Textures.BlockIcons.CustomIcon("iconsets/TM_TESLA_CAPS_ACTIVE");
+ TM_H = new Textures.BlockIcons.CustomIcon("iconsets/TM_TESLA_CAPS");
}
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(EM_H_ACTIVE)};
+ return new ITexture[]{aBaseTexture, new GT_RenderedTexture(TM_H_ACTIVE)};
}
@Override
public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, new GT_RenderedTexture(EM_H)};
+ return new ITexture[]{aBaseTexture, new GT_RenderedTexture(TM_H)};
}
@Override
@@ -102,18 +117,13 @@ public class GT_MetaTileEntity_Hatch_Capacitor extends GT_MetaTileEntity_Hatch {
if (aBaseMetaTileEntity.isClientSide()) {
return true;
}
- //if(aBaseMetaTileEntity.isActive())
- // aPlayer.addChatComponentMessage(new ChatComponentText("It is still active..."));
- //else if(heat>0)
- // aPlayer.addChatComponentMessage(new ChatComponentText("It is still warm..."));
- //else
aBaseMetaTileEntity.openGUI(aPlayer);
return true;
}
@Override
- public int getInventoryStackLimit() {
- return 1;
+ public int getSizeInventory() {
+ return getBaseMetaTileEntity().isActive() ? 0 : mInventory.length;
}
@Override
@@ -124,6 +134,83 @@ public class GT_MetaTileEntity_Hatch_Capacitor extends GT_MetaTileEntity_Hatch {
EnumChatFormatting.AQUA + "Stores 'nergy! (for a while)"
};
}
+
+ public long[] getCapacitors() {
+ long tier = -1;
+ long tCurrent = 0;
+ long tEnergyMax = 0;
+ for (int i = 0; i < mInventory.length; i++) {
+ if (mInventory[i] == null || mInventory[i].stackSize != 1) {
+ continue;
+ }
+ CapacitorComponent cap = componentBinds.get(getUniqueIdentifier(mInventory[i]));
+ if (cap != null && cap.tier > tier) {
+ tier = cap.tier;
+ }
+ }
+ if (tier >= 0) {
+ for (int i = 0; i < mInventory.length; i++) {
+ if (mInventory[i] == null || mInventory[i].stackSize != 1) {
+ continue;
+ }
+ CapacitorComponent cap = componentBinds.get(getUniqueIdentifier(mInventory[i]));
+ if (cap == null) {
+ continue;
+ }
+ if (cap.tier < tier) {
+ if (getBaseMetaTileEntity().isActive()) {
+ mInventory[i] = null;
+ getBaseMetaTileEntity().setOnFire();
+ }
+ } else {
+ tCurrent += cap.current;
+ tEnergyMax += cap.energyMax;
+ }
+ }
+ }
+ return new long[]{tier, tCurrent, tEnergyMax};
+ }
+
+ public static void run() {
+ new GT_MetaTileEntity_Hatch_Capacitor.CapacitorComponent(Reference.MODID+":item.tm.teslaCoilCapacitor.0", 0, 1, V[0]*512);//LV Capacitor
+ new GT_MetaTileEntity_Hatch_Capacitor.CapacitorComponent(Reference.MODID+":item.tm.teslaCoilCapacitor.1", 1, 1, V[1]*512);//MV Capacitor
+ new GT_MetaTileEntity_Hatch_Capacitor.CapacitorComponent(Reference.MODID+":item.tm.teslaCoilCapacitor.2", 2, 1, V[2]*512);//HV Capacitor
+ new GT_MetaTileEntity_Hatch_Capacitor.CapacitorComponent(Reference.MODID+":item.tm.teslaCoilCapacitor.3", 3, 1, V[3]*512);//EV Capacitor
+ new GT_MetaTileEntity_Hatch_Capacitor.CapacitorComponent(Reference.MODID+":item.tm.teslaCoilCapacitor.4", 4, 1, V[4]*512);//IV Capacitor
+ }
+
+ public static class CapacitorComponent implements Comparable<GT_MetaTileEntity_Hatch_Capacitor.CapacitorComponent> {
+ private final String unlocalizedName;
+ private final long tier, current, energyMax;
+
+ CapacitorComponent(ItemStack is, long tier, long current, long energyMax) {
+ this(getUniqueIdentifier(is), tier, current, energyMax);
+ }
+
+ CapacitorComponent(String is, long tier, long current, long energyMax) {
+ unlocalizedName = is;
+ this.tier = tier;
+ this.current = current;
+ this.energyMax = energyMax;
+ componentBinds.put(unlocalizedName, this);
+ if (DEBUG_MODE) {
+ TecTech.LOGGER.info("Tesla Capacitor registered: " + unlocalizedName);
+ }
+ }
+
+ @Override
+ public int compareTo(CapacitorComponent o) {
+ return unlocalizedName.compareTo(o.unlocalizedName);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if(obj instanceof CapacitorComponent) {
+ return compareTo((CapacitorComponent) obj) == 0;
+ }
+ return false;
+ }
+ }
}
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Capacitor.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Capacitor.java
index f368867736..cd29379afc 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Capacitor.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Capacitor.java
@@ -7,9 +7,6 @@ import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
-/**
- * Created by Tec on 09.04.2017.
- */
public class GT_Container_Capacitor extends GT_ContainerMetaTile_Machine {
public GT_Container_Capacitor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
super(aInventoryPlayer, aTileEntity);
@@ -17,17 +14,36 @@ public class GT_Container_Capacitor extends GT_ContainerMetaTile_Machine {
@Override
public void addSlots(InventoryPlayer aInventoryPlayer) {
- addSlotToContainer(new Slot(mTileEntity, 0, 80, 39));
+ this.addSlotToContainer(new Slot(this.mTileEntity, 0, 53, 8));
+ this.addSlotToContainer(new Slot(this.mTileEntity, 1, 71, 8));
+ this.addSlotToContainer(new Slot(this.mTileEntity, 2, 89, 8));
+ this.addSlotToContainer(new Slot(this.mTileEntity, 3, 107, 8));
+ this.addSlotToContainer(new Slot(this.mTileEntity, 4, 53, 26));
+ this.addSlotToContainer(new Slot(this.mTileEntity, 5, 71, 26));
+ this.addSlotToContainer(new Slot(this.mTileEntity, 6, 89, 26));
+ this.addSlotToContainer(new Slot(this.mTileEntity, 7, 107, 26));
+ this.addSlotToContainer(new Slot(this.mTileEntity, 8, 53, 44));
+ this.addSlotToContainer(new Slot(this.mTileEntity, 9, 71, 44));
+ this.addSlotToContainer(new Slot(this.mTileEntity, 10, 89, 44));
+ this.addSlotToContainer(new Slot(this.mTileEntity, 11, 107, 44));
+ this.addSlotToContainer(new Slot(this.mTileEntity, 12, 53, 62));
+ this.addSlotToContainer(new Slot(this.mTileEntity, 13, 71, 62));
+ this.addSlotToContainer(new Slot(this.mTileEntity, 14, 89, 62));
+ this.addSlotToContainer(new Slot(this.mTileEntity, 15, 107, 62));
}
@Override
- public int getSlotCount() {
- return 1;
- }
+ public int getSlotCount() { return 16; }
+
+ @Override
+ public int getShiftClickSlotCount() { return getSlotCount(); }
@Override
- public int getShiftClickSlotCount() {
- return 1;
+ public void detectAndSendChanges() {
+ super.detectAndSendChanges();
+ if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) {
+ return;
+ }
}
@Override
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Capacitor.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Capacitor.java
index fbc34f1e29..3850e7dc30 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Capacitor.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Capacitor.java
@@ -4,17 +4,19 @@ import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.entity.player.InventoryPlayer;
-/**
- * Created by Tec on 09.04.2017.
- */
public class GT_GUIContainer_Capacitor extends GT_GUIContainerMetaTile_Machine {
private final String mName;
public GT_GUIContainer_Capacitor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) {
- super(new GT_Container_Capacitor(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/holder.png");
+ super(new GT_Container_Capacitor(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/4by4.png");
mName = aName;
}
+ public GT_GUIContainer_Capacitor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) {
+ super(new GT_Container_Capacitor(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/" + aBackground + "4by4.png");
+ this.mName = aName;
+ }
+
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
fontRendererObj.drawString(mName, 8, 4, 4210752);
@@ -23,13 +25,8 @@ public class GT_GUIContainer_Capacitor extends GT_GUIContainerMetaTile_Machine {
@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);
- if (mContainer != null) {
- if (((GT_Container_Capacitor) mContainer).mActive == 1) {
- drawTexturedModalRect(x + 151, y + 23, 183, 23, 18, 18);
- }
- }
+ int x = (this.width - this.xSize) / 2;
+ int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
}
}
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 0facf9e949..c39e9e0661 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
@@ -243,7 +243,7 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB
}
}
- @Override
+ @Override//Had a crash bug with breaking a rack and then the multi
public void onRemoval() {
super.onRemoval();
for (GT_MetaTileEntity_Hatch_Rack rack : eRacks) {
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 f609025398..228d549258 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
@@ -61,7 +61,7 @@ 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 INameFunction<GT_MetaTileEntity_TM_microwave> POWER_NAME = (base, p)-> "Power setting";
+ private static final INameFunction<GT_MetaTileEntity_TM_microwave> POWER_SETTING_NAME = (base, p)-> "Power setting";
private static final INameFunction<GT_MetaTileEntity_TM_microwave> TIMER_SETTING_NAME = (base, p)-> "Timer setting";
private static final INameFunction<GT_MetaTileEntity_TM_microwave> TIMER_REMAINING_NAME = (base, p)-> "Timer remaining";
private static final INameFunction<GT_MetaTileEntity_TM_microwave> TIMER_VALUE_NAME = (base, p)-> "Timer value";
@@ -88,7 +88,7 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock
@Override
protected void parametersInstantiation_EM() {
Parameters.Group hatch_0=parametrization.getGroup(0, true);
- powerSetting=hatch_0.makeInParameter(0,1000, POWER_NAME,POWER_STATUS);
+ powerSetting=hatch_0.makeInParameter(0,1000, POWER_SETTING_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(1,360,TIMER_REMAINING_NAME,TIMER_STATUS);
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 bbef798982..7911d67106 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
@@ -1,12 +1,14 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.thing.cover.GT_Cover_TM_TeslaCoil_Ultimate;
import com.github.technus.tectech.thing.metaTileEntity.IConstructable;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Capacitor;
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.IHatchAdder;
+import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Param;
+import com.github.technus.tectech.thing.metaTileEntity.multi.base.*;
+import com.github.technus.tectech.thing.metaTileEntity.single.GT_MetaTileEntity_TeslaCoil;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
@@ -18,31 +20,53 @@ import gregtech.api.objects.GT_RenderedTexture;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
import static com.github.technus.tectech.CommonValues.V;
import static com.github.technus.tectech.Util.StructureBuilder;
+import static com.github.technus.tectech.Util.entriesSortedByValues;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage;
-import static gregtech.api.GregTech_API.*;
+import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsBA0;
+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.
- * edited by Bass on like 2018-02-05
- */
-public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable {//TODO Add capacitors
+public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable {
private static Textures.BlockIcons.CustomIcon ScreenOFF;
private static Textures.BlockIcons.CustomIcon ScreenON;
- private final ArrayList<GT_MetaTileEntity_Hatch_Capacitor> eCaps = new ArrayList<>();
- private int tier = 0;
- private int orientation = 0;
- private int scanTime = 0;
- private int scanRadius = 64;//TODO Generate depending on power stored
- private long euTOutMax = V[9] / 8;//TODO Generate depending on count and kind of capacitors
- private ArrayList<GT_MetaTileEntity_TM_teslaCoil> eTeslaList = new ArrayList<>();
+ private int mTier = 0; //Determines max voltage and efficiency (MV to LuV)
+ private int orientation = 0; //Direction of multi for structure check
+ private int maxTier = 6; //Max tier for efficiency calcuation
+ private int minTier = 1; //Min tier for efficiency calcuation
+
+ private Map<IGregTechTileEntity, Integer> eTeslaMap = new HashMap<>(); //Used to store targets for power transmission
+ private final ArrayList<GT_MetaTileEntity_Hatch_Capacitor> eCapacitorHatches = new ArrayList<>(); //Used to determine count and tier of capacitors present
+
+
+ private int scanTime = 0; //Scan timer used for tesla search intervals
+ private int scanRadius = 40; //Radius of transmission target scan each interval TODO make dynamic!
+ private int transferRadiusTower; //Radius for tower to tower transfers
+ private int transferRadiusTransceiver; //Radius for tower to transceiver transfers
+ private int transferRadiusCoverUltimate; //Radius for tower to ultimate cover transfers
+
+ private long energyCapacity = 0; //Total energy storage limited by capacitors
+ private long outputVoltageMax = 0; //Tesla voltage output limited by capacitors
+ public int vTier = -1; //Tesla voltage tier limited by capacitors
+ private long outputCurrentMax = 0; //Tesla current output limited by capacitors
+ private long outputVoltage = 0; //Tesla voltage output limited by settings
+ private long outputCurrent = 0; //Tesla current output limited by settings
+
+ private long lossPerBlock = 1; //Distance loss of each packet sent
+ private float energyEfficiencyMax = 0.95F; //Max efficiency of each packet sent at highest mTier
+ private float energyEfficiencyMin = 0.75F; //Min efficiency of each packet sent at lowest mTier
+ private float overdriveEfficiency = 0.95F; //Overdrive efficiency added losses
+ private long outputVoltageConsumption = 0; //Packet size consumed including efficiency losses
+ private long outputVoltageInjectable = 0; //Packet size injected into target post losses
//region structure
private static final String[][] shape0 = new String[][]{//3 16 0
@@ -83,19 +107,139 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock
};
private static final String[][][] shapes = new String[][][]{shape0,shape1,shape2,shape3};
- private static final Block[] blockType = new Block[]{sBlockCasings1, sBlockCasings5, sBlockCasings2, sBlockCasings5};//TODO Give it it's own casing type, add a primary coil type, add a secondary coil type and add toroid casing type
- private static final byte[] blockMetaT0 = new byte[]{15, 0, 13, 0};
- 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 Block[] blockType = new Block[]{sBlockCasingsBA0,sBlockCasingsBA0,sBlockCasingsBA0,sBlockCasingsBA0};
+ private static final byte[] blockMetaT0 = new byte[]{7, 0, 6, 8};
+ private static final byte[] blockMetaT1 = new byte[]{7, 1, 6, 8};
+ private static final byte[] blockMetaT2 = new byte[]{7, 2, 6, 8};
+ private static final byte[] blockMetaT3 = new byte[]{7, 3, 6, 8};
+ private static final byte[] blockMetaT4 = new byte[]{7, 4, 6, 8};
+ private static final byte[] blockMetaT5 = new byte[]{7, 5, 6, 8};
+ private static final byte[][] blockMetas = new byte[][]{blockMetaT0,blockMetaT1,blockMetaT2,blockMetaT3,blockMetaT4,blockMetaT5};
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};
+ private static final short[] casingTextures = new short[]{(texturePage << 7)+16+6, 0};
+ private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsBA0, null};
+ private static final byte[] blockMetaFallback = new byte[]{6, 0};
private static final String[] description = new String[]{
EnumChatFormatting.AQUA + "Hint Details:",
"1 - Classic Hatches or Steel Pipe Casing",
"2 - Titanium Frames",
+ };//TODO Update casings + hatches
+ //endregion
+
+ //region parameters
+ protected Parameters.Group.ParameterIn popogaSetting,histLowSetting,histHighSetting,transferRadiusTowerSetting,transferRadiusTransceiverSetting,transferRadiusCoverUltimateSetting,outputVoltageSetting,outputCurrentSetting,scanTimeMinSetting,overDriveSetting;
+ protected Parameters.Group.ParameterOut popogaDisplay,transferRadiusTowerDisplay,transferRadiusTransceiverDisplay,transferRadiusCoverUltimateDisplay,outputVoltageDisplay,outputCurrentDisplay,energyCapacityDisplay,energyStoredDisplay,energyFractionDisplay,scanTimeDisplay;
+
+ private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> HYSTERESIS_LOW_SETTING_NAME = (base, p)-> "Hysteresis low setting";
+ private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> HYSTERESIS_HIGH_SETTING_NAME = (base, p)-> "Hysteresis high setting";
+ private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> TRANSFER_RADIUS_TOWER_SETTING_NAME = (base, p)-> "Tesla Towers transfer radius setting";
+ private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> TRANSFER_RADIUS_TRANSCEIVER_SETTING_NAME = (base, p)-> "Tesla Transceiver transfer radius setting";
+ private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> TRANSFER_RADIUS_COVER_ULTIMATE_SETTING_NAME = (base, p)-> "Tesla Ultimate Cover transfer radius setting";
+ private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> OUTPUT_VOLTAGE_SETTING_NAME = (base, p)-> "Output voltage setting";
+ private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> OUTPUT_CURRENT_SETTING_NAME = (base, p)-> "Output current setting";
+ private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> SCAN_TIME_MIN_SETTING_NAME = (base, p)-> "Scan time Min setting";
+ private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> OVERDRIVE_SETTING_NAME = (base, p)-> "Overdrive setting";
+ private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> POPOGA_NAME = (base, p)-> "Unused";
+
+ private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> TRANSFER_RADIUS_TOWER_DISPLAY_NAME = (base, p)-> "Tesla Towers transfer radius display";
+ private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> TRANSFER_RADIUS_TRANSCEIVER_DISPLAY_NAME = (base, p)-> "Tesla Transceiver transfer radius display";
+ private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> TRANSFER_RADIUS_COVER_ULTIMATE_DISPLAY_NAME = (base, p)-> "Tesla Ultimate Cover transfer radius display";
+ private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> OUTPUT_VOLTAGE_DISPLAY_NAME = (base, p)-> "Output voltage display";
+ private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> OUTPUT_CURRENT_DISPLAY_NAME = (base, p)-> "Output current display";
+ private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> ENERGY_CAPACITY_DISPLAY_NAME = (base, p)-> "Energy Capacity display";
+ private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> ENERGY_STORED_DISPLAY_NAME = (base, p)-> "Energy Stored display";
+ private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> ENERGY_FRACTION_DISPLAY_NAME = (base, p)-> "Energy Fraction display";
+ private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> SCAN_TIME_DISPLAY_NAME = (base, p)-> "Scan time display";
+
+ private static final IStatusFunction<GT_MetaTileEntity_TM_teslaCoil> HYSTERESIS_LOW_STATUS=(base, p)->{
+ double value=p.get();
+ if(Double.isNaN(value)){return STATUS_WRONG;}
+ if(value<=0.05) return STATUS_TOO_LOW;
+ if(value>base.histHighSetting.get()) return STATUS_TOO_HIGH;
+ return STATUS_OK;
+ };
+ private static final IStatusFunction<GT_MetaTileEntity_TM_teslaCoil> HYSTERESIS_HIGH_STATUS=(base, p)->{
+ double value=p.get();
+ if(Double.isNaN(value)) return STATUS_WRONG;
+ if(value<=base.histLowSetting.get()) return STATUS_TOO_LOW;
+ if(value>0.95) return STATUS_TOO_HIGH;
+ return STATUS_OK;
+ };
+ private static final IStatusFunction<GT_MetaTileEntity_TM_teslaCoil> TRANSFER_RADIUS_TOWER_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>40) return STATUS_TOO_HIGH;
+ if(value<32) return STATUS_LOW;
+ return STATUS_OK;
+ };
+ private static final IStatusFunction<GT_MetaTileEntity_TM_teslaCoil> TRANSFER_RADIUS_TRANSCEIVER_OR_COVER_ULTIMATE_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>20) return STATUS_TOO_HIGH;
+ if(value<16) return STATUS_LOW;
+ return STATUS_OK;
+ };
+ private static final IStatusFunction<GT_MetaTileEntity_TM_teslaCoil> OUTPUT_VOLTAGE_OR_CURRENT_STATUS=(base, p)->{
+ double value=p.get();
+ if(Double.isNaN(value)) return STATUS_WRONG;
+ value=(long)value;
+ if(value==-1) return STATUS_OK;
+ if(value<=0) return STATUS_TOO_LOW;
+ return STATUS_OK;
+ };
+ private static final IStatusFunction<GT_MetaTileEntity_TM_teslaCoil> SCAN_TIME_MIN_STATUS=(base, p)->{
+ double value=p.get();
+ if(Double.isNaN(value)) return STATUS_WRONG;
+ value=(int)value;
+ if(value<100) return STATUS_TOO_LOW;
+ if(value==100) return STATUS_OK;
+ return STATUS_HIGH;
+ };
+ private static final IStatusFunction<GT_MetaTileEntity_TM_teslaCoil> OVERDRIVE_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==0) return STATUS_LOW;
+ return STATUS_HIGH;
+ };
+ private static final IStatusFunction<GT_MetaTileEntity_TM_teslaCoil> POPOGA_STATUS=(base, p)->{
+ if(base.getBaseMetaTileEntity().getWorld().isThundering()){
+ return STATUS_WTF;
+ }
+ return STATUS_NEUTRAL;
+ };
+ private static final IStatusFunction<GT_MetaTileEntity_TM_teslaCoil> SCAN_TIME_STATUS=(base, p)->{
+ double value=p.get();
+ if(Double.isNaN(value)) return STATUS_WRONG;
+ value=(int)value;
+ if(value==0) return STATUS_HIGH;
+ return STATUS_LOW;
+ };
+ private static final IStatusFunction<GT_MetaTileEntity_TM_teslaCoil> POWER_STATUS=(base, p)-> {
+ double value = p.get();
+ if (Double.isNaN(value)) return STATUS_WRONG;
+ value=(long)value;
+ if (value > 0) {
+ return STATUS_OK;
+ } else {
+ return STATUS_LOW;
+ }
+ };
+ private static final IStatusFunction<GT_MetaTileEntity_TM_teslaCoil> ENERGY_STATUS=(base, p)->{
+ double value=p.get();
+ if(Double.isNaN(value)) return STATUS_WRONG;
+ if (base.energyFractionDisplay.get() > base.histHighSetting.get()) {
+ return STATUS_HIGH;
+ } else if (base.energyFractionDisplay.get() < base.histLowSetting.get()) {
+ return STATUS_LOW;
+ } else {
+ return STATUS_OK;
+ }
};
//endregion
@@ -108,6 +252,62 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock
}
@Override
+ protected void parametersInstantiation_EM() {
+ Parameters.Group hatch_0=parametrization.getGroup(0, true);
+ Parameters.Group hatch_1=parametrization.getGroup(1, true);
+ Parameters.Group hatch_2=parametrization.getGroup(2, true);
+ Parameters.Group hatch_3=parametrization.getGroup(3, true);
+ Parameters.Group hatch_4=parametrization.getGroup(4, true);
+ Parameters.Group hatch_5=parametrization.getGroup(5, true);
+ Parameters.Group hatch_6=parametrization.getGroup(6, true);
+ Parameters.Group hatch_7=parametrization.getGroup(7, true);
+ Parameters.Group hatch_8=parametrization.getGroup(8, true);
+ Parameters.Group hatch_9=parametrization.getGroup(9, true);
+
+ histLowSetting=hatch_0.makeInParameter(0,0.25, HYSTERESIS_LOW_SETTING_NAME,HYSTERESIS_LOW_STATUS);//TODO Fix Grouping
+ popogaSetting=hatch_0.makeInParameter(1,0, POPOGA_NAME,POPOGA_STATUS);
+ histHighSetting=hatch_1.makeInParameter(0,0.75, HYSTERESIS_HIGH_SETTING_NAME,HYSTERESIS_HIGH_STATUS);
+ popogaSetting=hatch_1.makeInParameter(1,0, POPOGA_NAME,POPOGA_STATUS);
+ transferRadiusTowerSetting=hatch_2.makeInParameter(0,32, TRANSFER_RADIUS_TOWER_SETTING_NAME,TRANSFER_RADIUS_TOWER_STATUS);
+ popogaSetting=hatch_2.makeInParameter(1,0, POPOGA_NAME,POPOGA_STATUS);
+ transferRadiusTransceiverSetting=hatch_3.makeInParameter(0,16, TRANSFER_RADIUS_TRANSCEIVER_SETTING_NAME,TRANSFER_RADIUS_TRANSCEIVER_OR_COVER_ULTIMATE_STATUS);
+ transferRadiusCoverUltimateSetting=hatch_3.makeInParameter(1,16, TRANSFER_RADIUS_COVER_ULTIMATE_SETTING_NAME,TRANSFER_RADIUS_TRANSCEIVER_OR_COVER_ULTIMATE_STATUS);
+ outputVoltageSetting=hatch_4.makeInParameter(0,-1, OUTPUT_VOLTAGE_SETTING_NAME,OUTPUT_VOLTAGE_OR_CURRENT_STATUS);
+ popogaSetting=hatch_4.makeInParameter(1,0, POPOGA_NAME,POPOGA_STATUS);
+ outputCurrentSetting=hatch_5.makeInParameter(0,-1, OUTPUT_CURRENT_SETTING_NAME,OUTPUT_VOLTAGE_OR_CURRENT_STATUS);
+ popogaSetting=hatch_5.makeInParameter(1,0, POPOGA_NAME,POPOGA_STATUS);
+ popogaSetting=hatch_6.makeInParameter(0,0, POPOGA_NAME,POPOGA_STATUS);
+ popogaSetting=hatch_6.makeInParameter(1,0, POPOGA_NAME,POPOGA_STATUS);
+ scanTimeMinSetting=hatch_7.makeInParameter(0,100, SCAN_TIME_MIN_SETTING_NAME,SCAN_TIME_MIN_STATUS);
+ popogaSetting=hatch_7.makeInParameter(1,0, POPOGA_NAME,POPOGA_STATUS);
+ overDriveSetting=hatch_8.makeInParameter(0,0, OVERDRIVE_SETTING_NAME,OVERDRIVE_STATUS);
+ popogaSetting=hatch_8.makeInParameter(1,0, POPOGA_NAME,POPOGA_STATUS);
+ popogaSetting=hatch_9.makeInParameter(0,0, POPOGA_NAME,POPOGA_STATUS);
+ popogaSetting=hatch_9.makeInParameter(1,0, POPOGA_NAME,POPOGA_STATUS);
+
+ popogaDisplay=hatch_0.makeOutParameter(0,0, POPOGA_NAME,POPOGA_STATUS);
+ popogaDisplay=hatch_0.makeOutParameter(1,0, POPOGA_NAME,POPOGA_STATUS);
+ popogaDisplay=hatch_1.makeOutParameter(0,0, POPOGA_NAME,POPOGA_STATUS);
+ popogaDisplay=hatch_1.makeOutParameter(1,0, POPOGA_NAME,POPOGA_STATUS);
+ transferRadiusTowerDisplay=hatch_2.makeOutParameter(0,0, TRANSFER_RADIUS_TOWER_DISPLAY_NAME,TRANSFER_RADIUS_TOWER_STATUS);
+ popogaDisplay=hatch_2.makeOutParameter(1,0, POPOGA_NAME,POPOGA_STATUS);
+ transferRadiusTransceiverDisplay=hatch_3.makeOutParameter(0,0, TRANSFER_RADIUS_TRANSCEIVER_DISPLAY_NAME,TRANSFER_RADIUS_TRANSCEIVER_OR_COVER_ULTIMATE_STATUS);
+ transferRadiusCoverUltimateDisplay=hatch_3.makeOutParameter(1,0, TRANSFER_RADIUS_COVER_ULTIMATE_DISPLAY_NAME,TRANSFER_RADIUS_TRANSCEIVER_OR_COVER_ULTIMATE_STATUS);
+ outputVoltageDisplay=hatch_4.makeOutParameter(0,0, OUTPUT_VOLTAGE_DISPLAY_NAME,POWER_STATUS);
+ popogaDisplay=hatch_4.makeOutParameter(1,0, POPOGA_NAME,POPOGA_STATUS);
+ outputCurrentDisplay=hatch_5.makeOutParameter(0,0, OUTPUT_CURRENT_DISPLAY_NAME,POWER_STATUS);
+ energyCapacityDisplay=hatch_5.makeOutParameter(1,0, ENERGY_CAPACITY_DISPLAY_NAME,ENERGY_STATUS);
+ energyStoredDisplay=hatch_6.makeOutParameter(0,0, ENERGY_STORED_DISPLAY_NAME,ENERGY_STATUS);
+ energyFractionDisplay=hatch_6.makeOutParameter(1,0, ENERGY_FRACTION_DISPLAY_NAME,ENERGY_STATUS);
+ scanTimeDisplay=hatch_7.makeOutParameter(0,0, SCAN_TIME_DISPLAY_NAME,SCAN_TIME_STATUS);
+ popogaDisplay=hatch_7.makeOutParameter(1,0, POPOGA_NAME,POPOGA_STATUS);
+ popogaDisplay=hatch_8.makeOutParameter(0,0, POPOGA_NAME,POPOGA_STATUS);
+ popogaDisplay=hatch_8.makeOutParameter(1,0, POPOGA_NAME,POPOGA_STATUS);
+ popogaDisplay=hatch_9.makeOutParameter(0,0, POPOGA_NAME,POPOGA_STATUS);
+ popogaDisplay=hatch_9.makeOutParameter(1,0, POPOGA_NAME,POPOGA_STATUS);
+ }
+
+ @Override
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new GT_MetaTileEntity_TM_teslaCoil(mName);
}
@@ -117,25 +317,78 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock
public void registerIcons(IIconRegister aBlockIconRegister) {
ScreenOFF = new Textures.BlockIcons.CustomIcon("iconsets/EM_WH");
ScreenON = new Textures.BlockIcons.CustomIcon("iconsets/EM_WH_ACTIVE");
- super.registerIcons(aBlockIconRegister);
+ super.registerIcons(aBlockIconRegister);//TODO front texture
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setLong("energyCapacity",energyCapacity);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ energyCapacity=aNBT.getLong("energyCapacity");
+ }
+
+ private long getEnergyEfficiency(long voltage, int mTier, boolean overDriveToggle){
+ if (overDriveToggle){
+ return (long)(voltage * (2-energyEfficiencyMin + (energyEfficiencyMax - energyEfficiencyMin) / (maxTier - minTier + 1) * mTier)*(2- overdriveEfficiency)); //Sum overdrive efficiency formula
+ } else {
+ return (long)(voltage * energyEfficiencyMin + (energyEfficiencyMax - energyEfficiencyMin) / (maxTier - minTier + 1) * mTier); //Efficiency Formula
+ }
+ }//Efficiency function used on power transfers
+
+ private float getRangeMulti(int mTier, int vTier){
+ if (vTier > mTier){
+ return 1.25F;
+ }
+ return 1F;
}
@Override
public long maxEUStore() {
- return V[9] * 2;
+ return energyCapacity * 2;
}
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
if (aSide == aFacing) {
- return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4], new GT_RenderedTexture(aActive ? ScreenON : ScreenOFF)};
+ return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][16+6], new GT_RenderedTexture(aActive ? ScreenON : ScreenOFF)};
+ }
+ return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][16+6]};
+ }
+
+ @Override
+ public void onRemoval() {
+ super.onRemoval();
+ for (GT_MetaTileEntity_Hatch_Capacitor cap : eCapacitorHatches) {
+ cap.getBaseMetaTileEntity().setActive(false);
+ }
+ }
+
+ @Override
+ public void stopMachine() {
+ super.stopMachine();
+ for (GT_MetaTileEntity_Hatch_Capacitor cap : eCapacitorHatches) {
+ cap.getBaseMetaTileEntity().setActive(false);
}
- return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4]};
+
+ setEUVar(0);
+ energyStoredDisplay.set(0);
+ energyFractionDisplay.set(0);
}
@Override
public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
- eCaps.clear();
+ for (GT_MetaTileEntity_Hatch_Capacitor cap : eCapacitorHatches) {
+ if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(cap)) {
+ cap.getBaseMetaTileEntity().setActive(false);
+ }
+ }
+ eCapacitorHatches.clear();
+
int coilX0 = 0;
int coilX1 = 0;
int coilX2 = 0;
@@ -190,40 +443,48 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock
int yOffset;
int zOffset;
- if (coil0 == sBlockCasings5) {
+ if (coil0 == sBlockCasingsBA0) {
xOffset = 3;
yOffset = 16;
zOffset = 0;
orientation = 0;
- tier = iGregTechTileEntity.getMetaIDOffset(coilX0, coilY0, coilZ0);
- } else if (coil1 == sBlockCasings5) {
+ mTier = iGregTechTileEntity.getMetaIDOffset(coilX0, coilY0, coilZ0);
+ } else if (coil1 == sBlockCasingsBA0) {
xOffset = 3;
yOffset = 0;
zOffset = 0;
orientation = 1;
- tier = iGregTechTileEntity.getMetaIDOffset(coilX0, -coilY0, coilZ0);
- } else if (coil2 == sBlockCasings5) {
+ mTier = iGregTechTileEntity.getMetaIDOffset(coilX0, -coilY0, coilZ0);
+ } else if (coil2 == sBlockCasingsBA0) {
xOffset = 16;
yOffset = 3;
zOffset = 0;
orientation = 2;
- tier = iGregTechTileEntity.getMetaIDOffset(coilX1, coilY1, coilZ1);
- } else if (coil3 == sBlockCasings5) {
+ mTier = iGregTechTileEntity.getMetaIDOffset(coilX1, coilY1, coilZ1);
+ } else if (coil3 == sBlockCasingsBA0) {
xOffset = 0;
yOffset = 3;
zOffset = 0;
orientation = 3;
- tier = iGregTechTileEntity.getMetaIDOffset(coilX2, coilY2, coilZ2);
+ mTier = iGregTechTileEntity.getMetaIDOffset(coilX2, coilY2, coilZ2);
} else {
return false;
}
- return structureCheck_EM(shapes[orientation], blockType, blockMetas[tier], addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, xOffset, yOffset, zOffset);
+ if (structureCheck_EM(shapes[orientation], blockType, blockMetas[mTier], addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, xOffset, yOffset, zOffset) && eCapacitorHatches.size() > 0) {
+ for (GT_MetaTileEntity_Hatch_Capacitor cap : eCapacitorHatches) {
+ if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(cap)) {
+ cap.getBaseMetaTileEntity().setActive(iGregTechTileEntity.isActive());
+ }
+ }
+ return true;
+ }
+ return false;
}
@Override
public void construct(int stackSize, boolean hintsOnly) {
- StructureBuilder(shapes[0], blockType, blockMetas[(stackSize-1)%3], 3, 16, 0, getBaseMetaTileEntity(), hintsOnly);
+ StructureBuilder(shapes[0], blockType, blockMetas[(stackSize-1)%6], 3, 16, 0, getBaseMetaTileEntity(), hintsOnly);
}
@Override
@@ -243,69 +504,216 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock
@Override
public boolean checkRecipe_EM(ItemStack itemStack) {
+ if (!histHighSetting.getStatus(false).isOk||
+ !histLowSetting.getStatus(false).isOk||
+ !transferRadiusTowerSetting.getStatus(false).isOk||
+ !transferRadiusTransceiverSetting.getStatus(false).isOk||
+ !transferRadiusCoverUltimateSetting.getStatus(false).isOk||
+ !outputVoltageSetting.getStatus(false).isOk||
+ !outputCurrentSetting.getStatus(false).isOk||
+ !scanTimeMinSetting.getStatus(false).isOk||
+ !overDriveSetting.getStatus(false).isOk
+ ) return false;
+
mEfficiencyIncrease = 10000;
mMaxProgresstime = 20;
+ vTier = -1;
+ long[] capacitorData;
+ for (GT_MetaTileEntity_Hatch_Capacitor cap : eCapacitorHatches) {
+ if (!GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(cap)) {
+ continue;
+ }
+ if (cap.getCapacitors()[0] > vTier) {
+ vTier = (int) cap.getCapacitors()[0];
+ }
+ }
+
+ if(vTier < 0){
+ return false;
+ } else if (vTier > mTier && getEUVar() > 0){
+ explodeMultiblock();
+ }
+
+ energyCapacity = 0;
+ outputCurrentMax = 0;
+ outputVoltageMax = V[vTier+1];
+ for (GT_MetaTileEntity_Hatch_Capacitor cap : eCapacitorHatches) {
+ if (!GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(cap)) {
+ continue;
+ }
+ cap.getBaseMetaTileEntity().setActive(true);
+ capacitorData = cap.getCapacitors();
+ if (capacitorData[0] < vTier) {
+ if(getEUVar() > 0 && capacitorData[0] != 0){
+ cap.getBaseMetaTileEntity().setToFire();
+ }
+ eCapacitorHatches.remove(cap);
+ } else {
+ outputCurrentMax += capacitorData[1];
+ energyCapacity += capacitorData[2];
+ }
+ }
return true;
}
@Override
public boolean onRunningTick(ItemStack aStack) {
- IGregTechTileEntity mte = getBaseMetaTileEntity();
-
- if (mte.isClientSide()) {
+ if (getBaseMetaTileEntity().isClientSide()) {
return true;
}
- if (!ePowerPass && getEUVar() > maxEUStore() / 2 * 0.8) {
+ //Hysteresis based ePowerPass setting
+ long energyMax = maxEUStore() / 2;
+ long energyStored = getEUVar();
+
+ float energyFrac = (float)energyStored/energyMax;
+ float rangeFrac = (float)((-0.5*Math.pow(energyFrac,2))+(1.5*energyFrac));
+
+ energyCapacityDisplay.set(energyMax);
+ energyStoredDisplay.set(energyStored);
+ energyFractionDisplay.set(energyFrac);
+
+ if (!ePowerPass && energyFrac > histHighSetting.get()) {
ePowerPass = true;
- } else if (ePowerPass && getEUVar() < maxEUStore() / 2 * 0.2) {
+ } else if (ePowerPass && energyFrac < histLowSetting.get()) {
ePowerPass = false;
}
+ //Scan for transmission targets
+ scanTime++;
+ if (scanTime >= 100) {
+ scanTime = 0;
+ scanTimeDisplay.set(scanTime);
+ scanTimeDisplay.updateStatus();
+ eTeslaMap.clear();
+
+ for (int xPosOffset = -scanRadius; xPosOffset <= scanRadius; xPosOffset++) {
+ for (int yPosOffset = -scanRadius; yPosOffset <= scanRadius; yPosOffset++) {
+ for (int zPosOffset = -scanRadius; zPosOffset <= scanRadius; zPosOffset++) {
+ if (xPosOffset == 0 && yPosOffset == 0 && zPosOffset == 0) {
+ continue;
+ }
+ IGregTechTileEntity node = getBaseMetaTileEntity().getIGregTechTileEntityOffset(xPosOffset, yPosOffset, zPosOffset);
+ if (node == null) {
+ continue;
+ }
+ IMetaTileEntity nodeInside = node.getMetaTileEntity();
+ if (nodeInside instanceof GT_MetaTileEntity_TeslaCoil || nodeInside instanceof GT_MetaTileEntity_TM_teslaCoil && node.isActive() || (node.getCoverBehaviorAtSide((byte) 1) instanceof GT_Cover_TM_TeslaCoil_Ultimate)) {
+ eTeslaMap.put(node, (int) Math.ceil(Math.sqrt(xPosOffset * xPosOffset + yPosOffset * yPosOffset + zPosOffset * zPosOffset)));
+ }
+ }
+ }
+ }
+ } else {
+ scanTimeDisplay.set(scanTime);
+ }
+
+ //Power Limit Settings
+ if (outputVoltageSetting.get() > 0){
+ outputVoltage = Math.min(outputVoltageMax,(long)outputVoltageSetting.get());
+ } else {
+ outputVoltage = outputVoltageMax;
+ }
+ outputVoltageDisplay.set(outputVoltage);
+
+ if (outputCurrentSetting.get() > 0){
+ outputCurrent = Math.min(outputCurrentMax,(long)outputCurrentSetting.get());
+ } else {
+ outputCurrent = outputCurrentMax;
+ }
+ outputCurrentDisplay.set(0);
+
+ //Stuff to do if ePowerPass
if (ePowerPass) {
- scanTime++;
- if (scanTime == 100) {
- scanTime = 0;
- eTeslaList.clear();
-
- for (int xPosOffset = -scanRadius; xPosOffset <= scanRadius; xPosOffset++) {
- for (int yPosOffset = -scanRadius; yPosOffset <= scanRadius; yPosOffset++) {
- for (int zPosOffset = -scanRadius; zPosOffset <= scanRadius; zPosOffset++) {
- IGregTechTileEntity node = mte.getIGregTechTileEntityOffset(xPosOffset, yPosOffset, zPosOffset);
- if (node == null) {
+ //Range calculation and display
+ transferRadiusTower = (int)(transferRadiusTowerSetting.get()*getRangeMulti(mTier,vTier)*rangeFrac);
+ transferRadiusTowerDisplay.set(transferRadiusTower);
+ transferRadiusTransceiver = (int)(transferRadiusTransceiverSetting.get()*getRangeMulti(mTier,vTier)*rangeFrac);
+ transferRadiusTransceiverDisplay.set(transferRadiusTransceiver);
+ transferRadiusCoverUltimate=(int)(transferRadiusCoverUltimateSetting.get()*getRangeMulti(mTier,vTier)*rangeFrac);
+ transferRadiusCoverUltimateDisplay.set(transferRadiusCoverUltimate);
+
+ //Clean the eTeslaMap
+ for (Map.Entry<IGregTechTileEntity, Integer> Rx : eTeslaMap.entrySet()) {
+ IGregTechTileEntity node = Rx.getKey();
+ if (node != null) {
+ IMetaTileEntity nodeInside = node.getMetaTileEntity();
+ try {
+ if (nodeInside instanceof GT_MetaTileEntity_TM_teslaCoil && node.isActive()) {
+ GT_MetaTileEntity_TM_teslaCoil teslaTower = (GT_MetaTileEntity_TM_teslaCoil) nodeInside;
+ if (teslaTower.maxEUStore() > 0) {
continue;
}
- IMetaTileEntity nodeInside = node.getMetaTileEntity();
- if (nodeInside instanceof GT_MetaTileEntity_TM_teslaCoil && node.isActive()) {
- eTeslaList.add((GT_MetaTileEntity_TM_teslaCoil) nodeInside);
+ } else if (nodeInside instanceof GT_MetaTileEntity_TeslaCoil) {
+ GT_MetaTileEntity_TeslaCoil teslaCoil = (GT_MetaTileEntity_TeslaCoil) nodeInside;
+ if (teslaCoil.getStoredEnergy()[1] > 0) {
+ continue;
}
+ } else if ((node.getCoverBehaviorAtSide((byte) 1) instanceof GT_Cover_TM_TeslaCoil_Ultimate) && node.getEUCapacity() > 0) {
+ continue;
}
+ } catch (Exception e) {
}
}
+ eTeslaMap.remove(Rx.getKey());
}
- float xPos = mte.getXCoord() + 0.5f;
- 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[0])) {
- try {
- reqSum += Rx.maxEUStore() - Rx.getEUVar();
- } catch (Exception e) {
- eTeslaList.remove(Rx);
- }
- }
+ //Power transfer
+ long sparks = outputCurrent;
+ while (sparks > 0) {
+ boolean idle = true;
+ for (Map.Entry<IGregTechTileEntity, Integer> Rx : entriesSortedByValues(eTeslaMap)) {
+ if(energyStored >= (overDriveSetting.get() > 0 ? outputVoltage*2 : outputVoltage)) {
+ IGregTechTileEntity node = Rx.getKey();
+ IMetaTileEntity nodeInside = node.getMetaTileEntity();
+
+ if (overDriveSetting.get() > 0){
+ outputVoltageInjectable = outputVoltage;
+ outputVoltageConsumption = getEnergyEfficiency(outputVoltage, mTier, true) + (lossPerBlock * Rx.getValue());
+ } else {
+ outputVoltageInjectable = getEnergyEfficiency(outputVoltage, mTier, false) - (lossPerBlock * Rx.getValue());
+ outputVoltageConsumption = outputVoltage;
+ }
- for (GT_MetaTileEntity_TM_teslaCoil Rx : eTeslaList) {
- if (!Rx.ePowerPass) {
- long euTran = (euTOutMax * (Rx.maxEUStore() - Rx.getEUVar())) / reqSum;
- if (Rx.getEUVar() + euTran <= Rx.maxEUStore() && getEUVar() - euTran >= 0) {
- setEUVar(getEUVar() - euTran);
- Rx.getBaseMetaTileEntity().increaseStoredEnergyUnits(euTran, true);//might work QUESTION POINT;
- //mte.getWorld().playSoundEffect(xPos, yPos, zPos, Reference.MODID + ":microwave_ding", 1, 1);
+ if (nodeInside instanceof GT_MetaTileEntity_TM_teslaCoil && Rx.getValue() <= transferRadiusTower) {
+ GT_MetaTileEntity_TM_teslaCoil nodeTesla = (GT_MetaTileEntity_TM_teslaCoil) nodeInside;
+ if (!nodeTesla.ePowerPass) {
+ if (nodeTesla.getEUVar() + outputVoltageInjectable <= (nodeTesla.maxEUStore() / 2)) {
+ setEUVar(getEUVar() - outputVoltageConsumption);
+ node.increaseStoredEnergyUnits(outputVoltageConsumption, true);
+ sparks--;
+ idle = false;
+ }
+ }
+ } else if (nodeInside instanceof GT_MetaTileEntity_TeslaCoil && Rx.getValue() <= transferRadiusTransceiver) {
+ GT_MetaTileEntity_TeslaCoil nodeTesla = (GT_MetaTileEntity_TeslaCoil) nodeInside;
+ if (!nodeTesla.powerPassToggle) {
+ if (node.injectEnergyUnits((byte) 6, outputVoltageInjectable, 1L) > 0L) {
+ setEUVar(getEUVar() - outputVoltageConsumption);
+ sparks--;
+ idle = false;
+ }
+ }
+ } else if ((node.getCoverBehaviorAtSide((byte) 1) instanceof GT_Cover_TM_TeslaCoil_Ultimate) && Rx.getValue() <= transferRadiusCoverUltimate) {
+ if (node.injectEnergyUnits((byte) 1, outputVoltageInjectable, 1L) > 0L) {
+ setEUVar(getEUVar() - outputVoltageConsumption);
+ sparks--;
+ idle = false;
+ }
+ }
+ if (sparks == 0) {
+ break;
+ }
+ } else {
+ idle = true;
+ break;
}
}
+ if (idle) {
+ break;
+ }
}
+ outputCurrentDisplay.set(outputCurrent - sparks);
}
return true;
}
@@ -324,7 +732,7 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock
}
if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Capacitor) {
((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex);
- return eCaps.add((GT_MetaTileEntity_Hatch_Capacitor) aMetaTileEntity);
+ return eCapacitorHatches.add((GT_MetaTileEntity_Hatch_Capacitor) aMetaTileEntity);
}
if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) {
((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex);
@@ -346,6 +754,10 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock
((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex);
return eDynamoMulti.add((GT_MetaTileEntity_Hatch_DynamoMulti) aMetaTileEntity);
}
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Param) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex);
+ return eParamHatches.add((GT_MetaTileEntity_Hatch_Param) aMetaTileEntity);
+ }
return false;
}
}
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TeslaCoil.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TeslaCoil.java
new file mode 100644
index 0000000000..3bb8d8fe22
--- /dev/null
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TeslaCoil.java
@@ -0,0 +1,269 @@
+package com.github.technus.tectech.thing.metaTileEntity.single;
+
+import com.github.technus.tectech.Util;
+import com.github.technus.tectech.thing.cover.GT_Cover_TM_TeslaCoil;
+import com.github.technus.tectech.thing.cover.GT_Cover_TM_TeslaCoil_Ultimate;
+import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_TM_teslaCoil;
+import eu.usrv.yamcore.auxiliary.PlayerChatHelper;
+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_BasicBatteryBuffer;
+import net.minecraft.entity.player.EntityPlayer;
+
+
+import java.util.*;
+
+import static com.github.technus.tectech.CommonValues.V;
+import static com.github.technus.tectech.Util.entriesSortedByValues;
+import static java.lang.Math.round;
+
+
+public class GT_MetaTileEntity_TeslaCoil extends GT_MetaTileEntity_BasicBatteryBuffer {
+ private int maxTier = 4; //Max tier of transceiver
+ private int minTier = 1; //Min tier of transceiver
+
+ private Map<IGregTechTileEntity, Integer> eTeslaMap = new HashMap<IGregTechTileEntity, Integer>();//Tesla Map to map them tesla bois!
+ private int scanTime = 0; //Sets scan time to Z E R O :epic:
+ private int scanTimeMin = 100; //Min scan time in ticks
+ private int scanTimeTill = scanTimeMin; //Set default scan time
+ private int scanRadiusMax = 20; //Tesla scan radius
+ private int scanRadiusMin = 4; //Tesla scan radius
+ private int scanRadiusLimitTop = scanRadiusMin + (scanRadiusMax - scanRadiusMin) / (maxTier - minTier + 1) * (mTier - 1); //Tesla scan radius Formula
+ private int scanRadiusLimitBottom = 1; //Minimum user configurable scanRadius
+ private int scanRadius = scanRadiusLimitTop; //Default scanRadius setting
+ private int transferRadiusTower = 0; //Radius for transceiver to tower transfers
+ private int transferRadiusCover = 0; //Radius for transceiver to cover transfers
+
+ public boolean powerPassToggle = false; //Power Pass for public viewing
+ private int histSteps = 20; //Hysteresis Resolution
+ private int histSettingLow = 3; //Hysteresis Low Limit
+ private int histSettingHigh = 15; //Hysteresis High Limit
+ private int histLowLimit = 1; //How low can you configure it?
+ private int histHighLimit = histSteps - 1; //How high can you configure it?
+ private float histLow = (float) histSettingLow / histSteps; //Power pass is disabled if power is under this fraction
+ private float histHigh = (float) histSettingHigh / histSteps; //Power pass is enabled if power is over this fraction
+
+ private long lossPerBlock = 2; //EU lost per block traveled
+ private float energyEfficiencyMax = 0.95F; //Max efficiency
+ private float energyEfficiencyMin = 0.75F; //Min efficiency
+ private float overdriveEfficiency = 0.95F; //Overdrive efficiency
+ private float energyEfficiency = energyEfficiencyMin + (energyEfficiencyMax - energyEfficiencyMin) / (maxTier - minTier + 1) * (mTier - 1); //Efficiency Formula
+ private float sumOverdriveEfficiency = (2-energyEfficiency)*(2- overdriveEfficiency); //Sum overdrive efficiency formula
+
+ public boolean overDriveToggle = false; //Overdrive toggle
+ private long outputVoltage = V[mTier]; //Tesla Voltage Output
+ private long outputVoltagePostEfficiency = (long) (outputVoltage * energyEfficiency); //Max power a machine can actually receive
+ private long outputVoltagePostOverdrive = (long) (outputVoltage * sumOverdriveEfficiency); //Max power the sender can consume
+ private long outputVoltageInjectable = 0; //How much EU will be received post distance losses
+ private long outputVoltageConsumption = 0; //How much EU will be drained
+ private long outputCurrent = 0; //Tesla Current Output
+
+ public GT_MetaTileEntity_TeslaCoil(int aID, String aName, String aNameRegional, int aTier, int aSlotCount) {
+ super(aID, aName, aNameRegional, aTier, "Tesla Coil Transceiver", aSlotCount);
+ Util.setTier(aTier, this);
+ }
+
+ public GT_MetaTileEntity_TeslaCoil(String aName, int aTier, String aDescription, ITexture[][][] aTextures, int aSlotCount) {
+ super(aName, aTier, aDescription, aTextures, aSlotCount);
+ }
+
+ @Override
+ public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (overDriveToggle) {
+ overDriveToggle = false;
+ PlayerChatHelper.SendInfo(aPlayer, "Overdrive Disengaged");
+ } else {
+ overDriveToggle = true;
+ PlayerChatHelper.SendInfo(aPlayer, "Overdrive Engaged");
+ }
+ return true;
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (aPlayer.isSneaking()) {
+ if (histSettingHigh < histHighLimit) {
+ histSettingHigh++;
+ } else {
+ histSettingHigh = histSettingLow + 1;
+ }
+ histHigh = (float) histSettingHigh / histSteps;
+ PlayerChatHelper.SendInfo(aPlayer, "Hysteresis High Changed to " + round(histHigh * 100F) + "%");
+ } else {
+ if (histSettingLow > histLowLimit) {
+ histSettingLow--;
+ } else {
+ histSettingLow = histSettingHigh - 1;
+ }
+ histLow = (float) histSettingLow / histSteps;
+ PlayerChatHelper.SendInfo(aPlayer, "Hysteresis Low Changed to " + round(histLow * 100F) + "%");
+ }
+ }
+
+ @Override
+ public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (aPlayer.isSneaking()) {
+ if (scanRadius > scanRadiusLimitBottom) {
+ scanRadius--;
+ } else {
+ scanRadius = scanRadiusLimitTop;
+ }
+ } else {
+ if (scanRadius < scanRadiusLimitTop) {
+ scanRadius++;
+ } else {
+ scanRadius = scanRadiusLimitBottom;
+ }
+ }
+ PlayerChatHelper.SendInfo(aPlayer, "Tesla Radius Changed to " + scanRadius + " Blocks");
+ return false;
+ }
+
+ // Cheeky skrub stuff to get machine to switch powerPass on soft mallet
+ @Override
+ public boolean hasAlternativeModeText() {
+ return true;
+ }
+
+ @Override
+ public String getAlternativeModeText() {
+ ////Hysteresis based ePowerPass Config
+ long energyMax = getStoredEnergy()[1];
+ long energyStored = getStoredEnergy()[0];
+ float energyFrac = (float) energyStored / energyMax;
+
+ //ePowerPass hist toggle
+ if (energyFrac > histHigh) {
+ powerPassToggle = true;
+ } else if (energyFrac < histLow) {
+ powerPassToggle = false;
+ } else {
+ powerPassToggle = !powerPassToggle;
+ }
+
+ //And after this cheeky-ness, toss the string XD
+ return powerPassToggle ? "Sending Power!" : "Receiving Power!";
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_TeslaCoil(mName, mTier, mDescription, mTextures, mInventory.length);
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ if (aBaseMetaTileEntity.isServerSide()) {
+
+ ////Hysteresis based ePowerPass Config
+ long energyMax = getStoredEnergy()[1];
+ long energyStored = getStoredEnergy()[0];
+ float energyFraction = (float) energyStored / energyMax;
+
+ //ePowerPass hist toggle
+ if (!powerPassToggle && energyFraction > histHigh) {
+ powerPassToggle = true;
+ } else if (powerPassToggle && energyFraction < histLow) {
+ powerPassToggle = false;
+ }
+
+ ////Scanning for active teslas
+ scanTime++;
+ if (scanTime >= scanTimeTill) {
+ scanTime = 0;
+ eTeslaMap.clear();
+
+ for (int xPosOffset = -scanRadius; xPosOffset <= scanRadius; xPosOffset++) {
+ for (int yPosOffset = -scanRadius; yPosOffset <= scanRadius; yPosOffset++) {
+ for (int zPosOffset = -scanRadius; zPosOffset <= scanRadius; zPosOffset++) {
+ if (xPosOffset == 0 && yPosOffset == 0 && zPosOffset == 0) {
+ continue;
+ }
+ IGregTechTileEntity node = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xPosOffset, yPosOffset, zPosOffset);
+ if (node == null) {
+ continue;
+ }
+ IMetaTileEntity nodeInside = node.getMetaTileEntity();
+ if (nodeInside instanceof GT_MetaTileEntity_TM_teslaCoil && node.isActive() || (node.getCoverBehaviorAtSide((byte) 1) instanceof GT_Cover_TM_TeslaCoil)) {
+ eTeslaMap.put(node, (int) Math.ceil(Math.sqrt(xPosOffset * xPosOffset + yPosOffset * yPosOffset + zPosOffset * zPosOffset)));
+ }
+ }
+ }
+ }
+ }
+
+ //Stuff to do if ePowerPass
+ if (powerPassToggle) {
+ outputCurrent = mBatteryCount;
+ transferRadiusTower = (int) (scanRadius * energyFraction);
+ transferRadiusCover = (int) (transferRadiusTower / 1.5);
+
+ //Clean the eTeslaMap
+ for (Map.Entry<IGregTechTileEntity, Integer> Rx : eTeslaMap.entrySet()) {
+ IGregTechTileEntity node = Rx.getKey();
+ if (node != null) {
+ IMetaTileEntity nodeInside = node.getMetaTileEntity();
+ try {
+ if (nodeInside instanceof GT_MetaTileEntity_TM_teslaCoil && node.isActive()) {
+ GT_MetaTileEntity_TM_teslaCoil teslaTower = (GT_MetaTileEntity_TM_teslaCoil) nodeInside;
+ if (teslaTower.maxEUStore() > 0) {
+ continue;
+ }
+ } else if ((node.getCoverBehaviorAtSide((byte) 1) instanceof GT_Cover_TM_TeslaCoil) && node.getEUCapacity() > 0) {
+ continue;
+ }
+ } catch (Exception e) {
+ }
+ }
+ eTeslaMap.remove(Rx.getKey());
+ }
+
+ //Power transfer
+ while (outputCurrent > 0) {
+ boolean idle = true;
+ for (Map.Entry<IGregTechTileEntity, Integer> Rx : entriesSortedByValues(eTeslaMap)) {
+ if (getEUVar() >= (overDriveToggle ? outputVoltage*2 : outputVoltage)) {
+ IGregTechTileEntity node = Rx.getKey();
+ IMetaTileEntity nodeInside = node.getMetaTileEntity();
+ if (overDriveToggle){
+ outputVoltageInjectable = outputVoltage;
+ outputVoltageConsumption = outputVoltagePostOverdrive + (lossPerBlock * Rx.getValue());
+ } else {
+ outputVoltageInjectable = outputVoltagePostEfficiency - (lossPerBlock * Rx.getValue());
+ outputVoltageConsumption = outputVoltage;
+ }
+ if (nodeInside instanceof GT_MetaTileEntity_TM_teslaCoil && Rx.getValue() <= transferRadiusTower) {
+ GT_MetaTileEntity_TM_teslaCoil nodeTesla = (GT_MetaTileEntity_TM_teslaCoil) nodeInside;
+ if (!nodeTesla.ePowerPass) {
+ if (nodeTesla.getEUVar() + outputVoltageInjectable <= (nodeTesla.maxEUStore() / 2)) {
+ setEUVar(getEUVar() - outputVoltageConsumption);
+ node.increaseStoredEnergyUnits(outputVoltageInjectable, true);
+ outputCurrent--;
+ idle = false;
+ }
+ }
+ } else if ((node.getCoverBehaviorAtSide((byte) 1) instanceof GT_Cover_TM_TeslaCoil) && !(node.getCoverBehaviorAtSide((byte) 1) instanceof GT_Cover_TM_TeslaCoil_Ultimate) && Rx.getValue() <= transferRadiusCover) {
+ if (node.injectEnergyUnits((byte) 1, outputVoltageInjectable, 1L) > 0L) {
+ setEUVar(getEUVar() - outputVoltageConsumption);
+ outputCurrent--;
+ idle = false;
+ }
+ }
+ if (outputCurrent == 0) {
+ break;
+ }
+ } else {
+ idle = true;
+ break;
+ }
+ }
+ if (idle) {
+ break;
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_BASE_SIDES.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_BASE_SIDES.png
new file mode 100644
index 0000000000..52087f837e
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_BASE_SIDES.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_BASE_TOP_BOTTOM.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_BASE_TOP_BOTTOM.png
new file mode 100644
index 0000000000..5ba1e61487
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_BASE_TOP_BOTTOM.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_CAPS.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_CAPS.png
new file mode 100644
index 0000000000..4401341ad7
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_CAPS.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_CAPS_ACTIVE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_CAPS_ACTIVE.png
new file mode 100644
index 0000000000..9ce6223110
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_CAPS_ACTIVE.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_TOROID.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_TOROID.png
new file mode 100644
index 0000000000..aa804773fe
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_TOROID.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_0.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_0.png
new file mode 100644
index 0000000000..266a300698
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_0.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_1.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_1.png
new file mode 100644
index 0000000000..2f547cf220
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_1.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_2.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_2.png
new file mode 100644
index 0000000000..f36d636040
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_2.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_3.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_3.png
new file mode 100644
index 0000000000..503abed157
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_3.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_4.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_4.png
new file mode 100644
index 0000000000..ccfb85c4cd
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_4.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_5.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_5.png
new file mode 100644
index 0000000000..7f2fb33e5f
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_5.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_0.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_0.png
new file mode 100644
index 0000000000..fed9a8e282
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_0.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_1.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_1.png
new file mode 100644
index 0000000000..35a58c88b1
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_1.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_2.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_2.png
new file mode 100644
index 0000000000..737b5e7a33
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_2.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_3.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_3.png
new file mode 100644
index 0000000000..ad847ef247
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_3.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_4.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_4.png
new file mode 100644
index 0000000000..2842d9ce1a
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_4.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_5.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_5.png
new file mode 100644
index 0000000000..00e30e13fe
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_5.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_SECONDARY_SIDES.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_SECONDARY_SIDES.png
new file mode 100644
index 0000000000..55d9bb5d23
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_SECONDARY_SIDES.png
Binary files differ
diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_SECONDARY_TOP_BOTTOM.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_SECONDARY_TOP_BOTTOM.png
new file mode 100644
index 0000000000..b77b4b1e53
--- /dev/null
+++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/TM_TESLA_WINDING_SECONDARY_TOP_BOTTOM.png
Binary files differ
diff --git a/src/main/resources/assets/tectech/lang/en_US.lang b/src/main/resources/assets/tectech/lang/en_US.lang
index 59a0d720de..e097c612ba 100644
--- a/src/main/resources/assets/tectech/lang/en_US.lang
+++ b/src/main/resources/assets/tectech/lang/en_US.lang
@@ -9,6 +9,9 @@ item.em.frontRotate.name=Front Rotation Scrench
item.em.parametrizerMemoryCard.name=Parametrizer Memory Card
item.em.EuMeterGT.name=GT EU meter
+item.tm.teslaCoilCover.name=Tesla Coil Cover
+item.tm.teslaCoilCoverUltimate.name=Tesla Coil Cover Rich Edition
+
death.attack.microwaving=%1$s was dehydrated by radiation.
death.attack.microwaving.player=%1$s was dehydrated by radiation while fighting %2$s.