diff options
Diffstat (limited to 'src/main/java/com')
106 files changed, 7774 insertions, 4579 deletions
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/Converter.java b/src/main/java/com/github/technus/tectech/Converter.java new file mode 100644 index 0000000000..5d1f5c802e --- /dev/null +++ b/src/main/java/com/github/technus/tectech/Converter.java @@ -0,0 +1,59 @@ +package com.github.technus.tectech; + +import java.io.*; + +public final class Converter { + private Converter() {} + + public static void writeInts(int [] array,ByteArrayOutputStream byteArrayOutputStream) { + try { + DataOutputStream dataOutputStream = new DataOutputStream(byteArrayOutputStream); + for (int i = 0; i < array.length; i++) { + dataOutputStream.writeInt(array[i]); + } + dataOutputStream.flush(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + public static void readInts(ByteArrayInputStream byteArrayInputStream,int[] array) { + try { + DataInputStream dataInputStream = new DataInputStream(byteArrayInputStream); + for (int i = 0; i < array.length; i++) { + array[i] = dataInputStream.readInt(); + } + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + public static byte[] writeInts(int[] array) { + try { + ByteArrayOutputStream bos = new ByteArrayOutputStream(array.length * 4); + DataOutputStream dos = new DataOutputStream(bos); + for (int i = 0; i < array.length; i++) { + dos.writeInt(array[i]); + } + + return bos.toByteArray(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + public static int[] readInts(byte[] array) { + try { + ByteArrayInputStream bis = new ByteArrayInputStream(array); + DataInputStream dataInputStream = new DataInputStream(bis); + int size = array.length / Integer.BYTES; + int[] res = new int[size]; + for (int i = 0; i < size; i++) { + res[i] = dataInputStream.readInt(); + } + return res; + } catch (IOException e) { + throw new RuntimeException(e); + } + } +} diff --git a/src/main/java/com/github/technus/tectech/TecTech.java b/src/main/java/com/github/technus/tectech/TecTech.java index f998a9017b..79defc0a1a 100644 --- a/src/main/java/com/github/technus/tectech/TecTech.java +++ b/src/main/java/com/github/technus/tectech/TecTech.java @@ -87,7 +87,7 @@ public class TecTech { FMLCommonHandler.instance().bus().register(playerPersistence); MinecraftForge.EVENT_BUS.register(playerPersistence); - chunkDataHandler=new ChunkDataHandler(); + chunkDataHandler=new ChunkDataHandler(); FMLCommonHandler.instance().bus().register(chunkDataHandler); MinecraftForge.EVENT_BUS.register(chunkDataHandler); @@ -197,7 +197,6 @@ public class TecTech { MainLoader.postLoad(); chunkDataHandler.registerChunkMetaDataHandler(anomalyHandler=new AnomalyHandler()); - } @Mod.EventHandler diff --git a/src/main/java/com/github/technus/tectech/Util.java b/src/main/java/com/github/technus/tectech/Util.java index 75ae4d3807..5bd3ff59a9 100644 --- a/src/main/java/com/github/technus/tectech/Util.java +++ b/src/main/java/com/github/technus/tectech/Util.java @@ -160,6 +160,10 @@ public final class Util { return result.toString(); } + public static float map(float x, float in_min, float in_max, float out_min, float out_max) { + return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; + } + //region junk /* //Check Machine Structure based on string[][] (effectively char[][][]), ond offset of the controller @@ -449,7 +453,6 @@ public final class Util { */ //endregion - //Check Machine Structure based on string[][] (effectively char[][][]), ond offset of the controller //This only checks for REGULAR BLOCKS! public static boolean StructureCheckerExtreme( @@ -492,8 +495,7 @@ public final class Util { if (block < ' ') {//Control chars allow skipping b -= block; break; - } else if (block > '@') //characters allow to skip check A-1 skip, B-2 skips etc. - { + } else if (block > '@') {//characters allow to skip check A-1 skip, B-2 skips etc. a += block - '@'; }//else if (block < '+')//used to mark THINGS // a++; @@ -1450,6 +1452,7 @@ public final class Util { return previousValue; } + @Deprecated public static double receiveDouble(double previousValue, int startIndex, int index, int value){ return Double.longBitsToDouble(receiveLong(Double.doubleToLongBits(previousValue),startIndex,index,value)); } @@ -1495,6 +1498,7 @@ public final class Util { crafter.sendProgressBarUpdate(container, startIndex, (int)((value & 0xFFFF000000000000L)>>>48)); } + @Deprecated public static float receiveFloat(float previousValue, int startIndex, int index, int value){ return Float.intBitsToFloat(receiveInteger(Float.floatToIntBits(previousValue),startIndex,index,value)); } diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java index b23e2f8c01..362c86ab08 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java @@ -61,7 +61,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ CustomItemList.eM_Containment.get(1), GT_ModHandler.getIC2Item("reinforcedGlass", 1L) - }, getOrDefault("Trinium",Materials.Osmium).getMolten(576), new ItemStack(QuantumGlassBlock.INSTANCE, 1), 200, 500000); + }, getOrDefault("Trinium", Materials.Osmium).getMolten(576), new ItemStack(QuantumGlassBlock.INSTANCE, 1), 200, 500000); //region pipes @@ -71,8 +71,6 @@ public class DreamCraftRecipeLoader implements Runnable { GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silver, 8) }, Materials.Polytetrafluoroethylene.getMolten(144), CustomItemList.DATApipe.get(1), 200, 30720); - //endregion - //Tunnel addAssemblerRecipeWithCleanroom(new ItemStack[]{ CustomItemList.DATApipe.get(1), @@ -82,15 +80,15 @@ public class DreamCraftRecipeLoader implements Runnable { ItemList.Field_Generator_MV.get(1), ItemList.Circuit_Quantummainframe.get(1) }, Materials.Osmium.getMolten(288), CustomItemList.EMpipe.get(1), 400, 500000); - + //Laser addAssemblerRecipeWithCleanroom(new ItemStack[]{ CustomItemList.DATApipe.get(1), GT_ModHandler.getIC2Item("reinforcedGlass", 1L), GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Osmiridium, 2) }, null, CustomItemList.LASERpipe.get(1), 100, 500000); - - //endregoin + + //endregion //region casing @@ -118,7 +116,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.StainlessSteel, 2), GT_OreDictUnificator.get(OrePrefixes.pipeTiny, Materials.StainlessSteel, 16), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Copper, 16), - GT_OreDictUnificator.get(OrePrefixes.wireGt01, getOrDefault("SuperconductorIV",Materials.Superconductor), 1) + GT_OreDictUnificator.get(OrePrefixes.wireGt01, getOrDefault("SuperconductorIV", Materials.Superconductor), 1) }, Materials.SolderingAlloy.getMolten(1296), CustomItemList.eM_Computer_Vent.get(1), 100, 1920); //Advanced Computer Casing addAssemblerRecipeWithCleanroom(new ItemStack[]{ @@ -126,14 +124,14 @@ public class DreamCraftRecipeLoader implements Runnable { GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 1), GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Cobalt, 64), GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Electrum, 64), - GT_OreDictUnificator.get(OrePrefixes.wireGt02, getOrDefault("SuperconductorLuV",Materials.Superconductor), 4) + GT_OreDictUnificator.get(OrePrefixes.wireGt02, getOrDefault("SuperconductorLuV", Materials.Superconductor), 4) }, Materials.Iridium.getMolten(1296), CustomItemList.eM_Computer_Bus.get(1), 200, 122880); //Molecular Casing GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ CustomItemList.eM_Power.get(1), GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Osmiridium, 6), - GT_OreDictUnificator.get(OrePrefixes.foil, getOrDefault("Trinium",Materials.Osmium), 12), + GT_OreDictUnificator.get(OrePrefixes.foil, getOrDefault("Trinium", Materials.Osmium), 12), GT_OreDictUnificator.get(OrePrefixes.screw, Materials.TungstenSteel, 24), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.TungstenSteel, 24), ItemList.Field_Generator_IV.get(1) @@ -141,15 +139,15 @@ public class DreamCraftRecipeLoader implements Runnable { //Hollow Casing TT_recipeAdder.addResearchableAssemblylineRecipe(CustomItemList.eM_Containment.get(1), - 12000,32, 500000, 6, new ItemStack[]{ + 12000, 32, 500000, 6, new ItemStack[]{ CustomItemList.eM_Containment.get(1), GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Neutronium, 2), GT_OreDictUnificator.get(OrePrefixes.plateQuadruple, Materials.Plutonium, 4), GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Lead, 8), - GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("BlackPlutonium",Materials.Americium), 16), - GT_OreDictUnificator.get(OrePrefixes.screw, getOrDefault("Quantium",Materials.Neutronium), 16), + GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("BlackPlutonium", Materials.Americium), 16), + GT_OreDictUnificator.get(OrePrefixes.screw, getOrDefault("Quantium", Materials.Neutronium), 16), }, new FluidStack[]{ - getOrDefault("Trinium",Materials.Osmium).getMolten(1296), + getOrDefault("Trinium", Materials.Osmium).getMolten(1296), Materials.Osmium.getMolten(1296), new FluidStack(FluidRegistry.getFluid("ic2coolant"), 2000), Materials.Argon.getGas(1000), @@ -157,21 +155,76 @@ public class DreamCraftRecipeLoader implements Runnable { //EM Coil TT_recipeAdder.addResearchableAssemblylineRecipe(CustomItemList.eM_Hollow.get(1), - 48000,128, 1000000, 16, new ItemStack[]{ + 48000, 128, 1000000, 16, new ItemStack[]{ CustomItemList.eM_Hollow.get(1), ItemList.Casing_Fusion_Coil.get(4), - ItemList.Casing_Coil_NaquadahAlloy.get( 4), + ItemList.Casing_Coil_NaquadahAlloy.get(4), GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64), GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Neutronium, 64), }, new FluidStack[]{ Materials.Glass.getMolten(2304), Materials.Silicone.getMolten(1872), new FluidStack(FluidRegistry.getFluid("ic2coolant"), 2000), - getOrDefault("Trinium",Materials.Osmium).getMolten(1296), + getOrDefault("Trinium", Materials.Osmium).getMolten(1296), }, CustomItemList.eM_Coil.get(4), 800, 2000000); - //endregion + //Tesla Base + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.NickelZincFerrite, 6), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.NickelZincFerrite, 1) + }, null, CustomItemList.tM_TeslaBase.get(1), 50, 16); + GT_ModHandler.addCraftingRecipe(CustomItemList.tM_TeslaBase.get(1), + GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[]{"PhP", "PFP", "PwP", + 'P', OrePrefixes.plate.get(Materials.NickelZincFerrite), + 'F', OrePrefixes.frameGt.get(Materials.NickelZincFerrite)}); + //Tesla Toroid + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 6), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Aluminium, 1) + }, null, CustomItemList.tM_TeslaToroid.get(1), 50, 16); + GT_ModHandler.addCraftingRecipe(CustomItemList.tM_TeslaToroid.get(1), + GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[]{"PhP", "PFP", "PwP", + 'P', OrePrefixes.foil.get(Materials.Aluminium), + 'F', OrePrefixes.frameGt.get(Materials.Aluminium)}); + //Tesla Secondary Windings + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.teslaComponent.getWithDamage(8, 0), + getItemContainer("MicaInsulatorFoil").get(12) + }, Materials.Silver.getMolten(144), CustomItemList.tM_TeslaSecondary.get(1), 200, 120); + //Tesla Primary Coils T0 + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.RedstoneAlloy, 8), + getItemContainer("MicaInsulatorFoil").get(8) + }, Materials.RedAlloy.getMolten(144), CustomItemList.tM_TeslaPrimary_0.get(1), 200, 30); + //Tesla Primary Coils T1 + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.SuperconductorMV, 8), + getItemContainer("MicaInsulatorFoil").get(12) + }, Materials.Magnesium.getMolten(144), CustomItemList.tM_TeslaPrimary_1.get(1), 200, 120); + //Tesla Primary Coils T2 + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.SuperconductorHV, 8), + getItemContainer("MicaInsulatorFoil").get(16) + }, Materials.Barium.getMolten(144), CustomItemList.tM_TeslaPrimary_2.get(1), 200, 480); + //Tesla Primary Coils T3 + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.SuperconductorEV, 8), + getItemContainer("MicaInsulatorFoil").get(20) + }, Materials.Platinum.getMolten(144), CustomItemList.tM_TeslaPrimary_3.get(1), 200, 1920); + //Tesla Primary Coils T4 + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.SuperconductorIV, 8), + getItemContainer("MicaInsulatorFoil").get(24) + }, Materials.Vanadium.getMolten(144), CustomItemList.tM_TeslaPrimary_4.get(1), 200, 7680); + //Tesla Primary Coils T5 + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.SuperconductorLuV, 8), + getItemContainer("MicaInsulatorFoil").get(28) + }, Materials.Indium.getMolten(144), CustomItemList.tM_TeslaPrimary_5.get(1), 50, 30720); + //endregion //region hatches @@ -196,26 +249,26 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Transformer_UEV_UHV").get(1), CustomItemList.eM_dynamoMulti4_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.SuperconductorUHV, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 4)}, Materials.Electrum.getMolten(2304), CustomItemList.eM_dynamoMulti16_UHV.get(1), 200, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("WetTransformer_UEV_UHV").get(1), CustomItemList.eM_dynamoMulti16_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.SuperconductorUHV, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 6)}, Materials.Tungsten.getMolten(2304), CustomItemList.eM_dynamoMulti64_UHV.get(1), 400, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hatch_Dynamo_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Bedrockium",Materials.Neutronium), 2)}, Materials.Silver.getMolten(4608), CustomItemList.eM_dynamoMulti4_UEV.get(1), 100, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Transformer_UIV_UEV").get(1), CustomItemList.eM_dynamoMulti4_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Bedrockium",Materials.Neutronium), 4)}, Materials.Electrum.getMolten(4608), CustomItemList.eM_dynamoMulti16_UEV.get(1), 200, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("WetTransformer_UIV_UEV").get(1), CustomItemList.eM_dynamoMulti16_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Bedrockium",Materials.Neutronium), 6)}, Materials.Tungsten.getMolten(4608), CustomItemList.eM_dynamoMulti64_UEV.get(1), 400, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hatch_Dynamo_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Bedrockium", Materials.Neutronium), 2)}, Materials.Silver.getMolten(4608), CustomItemList.eM_dynamoMulti4_UEV.get(1), 100, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Transformer_UIV_UEV").get(1), CustomItemList.eM_dynamoMulti4_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Bedrockium", Materials.Neutronium), 4)}, Materials.Electrum.getMolten(4608), CustomItemList.eM_dynamoMulti16_UEV.get(1), 200, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("WetTransformer_UIV_UEV").get(1), CustomItemList.eM_dynamoMulti16_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Bedrockium", Materials.Neutronium), 6)}, Materials.Tungsten.getMolten(4608), CustomItemList.eM_dynamoMulti64_UEV.get(1), 400, 2000000); //GT_Values.RA.ADD_ASSEMBLER_RECIPE(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Hatch_Dynamo_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 2)}, Materials.Silver.getMolten(8000), CustomItemList.eM_dynamoMulti4_UIV.get(1), 100, 8000000); //GT_Values.RA.ADD_ASSEMBLER_RECIPE(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Transformer_UMV_UIV.get(1), CustomItemList.eM_dynamoMulti4_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 4)}, Materials.Electrum.getMolten(8000), CustomItemList.eM_dynamoMulti16_UIV.get(1), 200, 8000000); //GT_Values.RA.ADD_ASSEMBLER_RECIPE(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.WetTransformer_UMV_UIV.get(1), CustomItemList.eM_dynamoMulti16_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 6)}, Materials.Tungsten.getMolten(8000), CustomItemList.eM_dynamoMulti64_UIV.get(1), 400, 8000000); //Energy Hatches UV-UIV - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Energy_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 2)}, Materials.Silver.getMolten(1000), CustomItemList.eM_energyMulti4_UV.get(1), 100, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_MAX_UV.get(1), CustomItemList.eM_energyMulti4_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 4)}, Materials.Electrum.getMolten(1000), CustomItemList.eM_energyMulti16_UV.get(1), 200, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("WetTransformer_UHV_UV").get(1), CustomItemList.eM_energyMulti16_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 6)}, Materials.Tungsten.getMolten(1000), CustomItemList.eM_energyMulti64_UV.get(1), 400, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Energy_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 2)}, Materials.Silver.getMolten(1152), CustomItemList.eM_energyMulti4_UV.get(1), 100, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_MAX_UV.get(1), CustomItemList.eM_energyMulti4_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 4)}, Materials.Electrum.getMolten(1152), CustomItemList.eM_energyMulti16_UV.get(1), 200, 122880); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("WetTransformer_UHV_UV").get(1), CustomItemList.eM_energyMulti16_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NaquadahAlloy, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 6)}, Materials.Tungsten.getMolten(1152), CustomItemList.eM_energyMulti64_UV.get(1), 400, 122880); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Energy_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.SuperconductorUHV, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 2)}, Materials.Silver.getMolten(2000), CustomItemList.eM_energyMulti4_UHV.get(1), 100, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Transformer_UEV_UHV").get(1), CustomItemList.eM_energyMulti4_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.SuperconductorUHV, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 4)}, Materials.Electrum.getMolten(2000), CustomItemList.eM_energyMulti16_UHV.get(1), 200, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("WetTransformer_UEV_UHV").get(1), CustomItemList.eM_energyMulti16_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.SuperconductorUHV, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 6)}, Materials.Tungsten.getMolten(2000), CustomItemList.eM_energyMulti64_UHV.get(1), 400, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hatch_Energy_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.SuperconductorUHV, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 2)}, Materials.Silver.getMolten(2304), CustomItemList.eM_energyMulti4_UHV.get(1), 100, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Transformer_UEV_UHV").get(1), CustomItemList.eM_energyMulti4_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.SuperconductorUHV, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 4)}, Materials.Electrum.getMolten(2304), CustomItemList.eM_energyMulti16_UHV.get(1), 200, 500000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("WetTransformer_UEV_UHV").get(1), CustomItemList.eM_energyMulti16_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.SuperconductorUHV, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 6)}, Materials.Tungsten.getMolten(2304), CustomItemList.eM_energyMulti64_UHV.get(1), 400, 500000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hatch_Energy_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Bedrockium",Materials.Neutronium), 2)}, Materials.Silver.getMolten(4000), CustomItemList.eM_energyMulti4_UEV.get(1), 100, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Transformer_UIV_UEV").get(1), CustomItemList.eM_energyMulti4_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Bedrockium",Materials.Neutronium), 4)}, Materials.Electrum.getMolten(4000), CustomItemList.eM_energyMulti16_UEV.get(1), 200, 2000000); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("WetTransformer_UIV_UEV").get(1), CustomItemList.eM_energyMulti16_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Bedrockium",Materials.Neutronium),6)}, Materials.Tungsten.getMolten(4000), CustomItemList.eM_energyMulti64_UEV.get(1), 400, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hatch_Energy_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Bedrockium", Materials.Neutronium), 2)}, Materials.Silver.getMolten(4608), CustomItemList.eM_energyMulti4_UEV.get(1), 100, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Transformer_UIV_UEV").get(1), CustomItemList.eM_energyMulti4_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Bedrockium", Materials.Neutronium), 4)}, Materials.Electrum.getMolten(4608), CustomItemList.eM_energyMulti16_UEV.get(1), 200, 2000000); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("WetTransformer_UIV_UEV").get(1), CustomItemList.eM_energyMulti16_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Draconium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Bedrockium", Materials.Neutronium), 6)}, Materials.Tungsten.getMolten(4608), CustomItemList.eM_energyMulti64_UEV.get(1), 400, 2000000); //GT_Values.RA.ADD_ASSEMBLER_RECIPE(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Hatch_Energy_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 2)}, Materials.Silver.getMolten(8000), CustomItemList.eM_energyMulti4_UIV.get(1), 100, 8000000); //GT_Values.RA.ADD_ASSEMBLER_RECIPE(new ItemStack[]{com.dreammaster.gthandler.CustomItemList.Transformer_UMV_UIV.get(1), CustomItemList.eM_energyMulti4_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlackPlutonium, 4)}, Materials.Electrum.getMolten(8000), CustomItemList.eM_energyMulti16_UIV.get(1), 200, 8000000); @@ -228,7 +281,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_UV.get(1), ItemList.Electric_Pump_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.NaquadahAlloy, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamoTunnel1_UV.get(1), 1000, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_UHV.get(1), ItemList.Electric_Pump_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Bedrockium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamoTunnel1_UHV.get(1), 1000, 2000000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hull_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_UEV.get(1), ItemList.Electric_Pump_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Draconium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamoTunnel1_UEV.get(1), 1000, 8000000); - + //Laser Dynamo IV-UEV 1024/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_IV.get(2), ItemList.Electric_Pump_IV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamoTunnel2_IV.get(1), 2000, 7680); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_LuV.get(2), ItemList.Electric_Pump_LuV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.VanadiumGallium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamoTunnel2_LuV.get(1), 2000, 30720); @@ -236,7 +289,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_UV.get(2), ItemList.Electric_Pump_UV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamoTunnel2_UV.get(1), 2000, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_UHV.get(2), ItemList.Electric_Pump_UHV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Bedrockium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamoTunnel2_UHV.get(1), 2000, 2000000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hull_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_UEV.get(2), ItemList.Electric_Pump_UEV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Draconium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamoTunnel2_UEV.get(1), 2000, 8000000); - + //Laser Dynamo IV-UEV 4096/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_IV.get(4), ItemList.Electric_Pump_IV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamoTunnel3_IV.get(1), 4000, 7680); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_LuV.get(4), ItemList.Electric_Pump_LuV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamoTunnel3_LuV.get(1), 4000, 30720); @@ -244,7 +297,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_UV.get(4), ItemList.Electric_Pump_UV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamoTunnel3_UV.get(1), 4000, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_UHV.get(4), ItemList.Electric_Pump_UHV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Bedrockium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamoTunnel3_UHV.get(1), 4000, 2000000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hull_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_UEV.get(4), ItemList.Electric_Pump_UEV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamoTunnel3_UEV.get(1), 4000, 8000000); - + //Laser Dynamo IV-UEV 16384/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_IV.get(8), ItemList.Electric_Pump_IV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamoTunnel4_IV.get(1), 8000, 7680); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_LuV.get(8), ItemList.Electric_Pump_LuV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamoTunnel4_LuV.get(1), 8000, 30720); @@ -252,7 +305,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_UV.get(8), ItemList.Electric_Pump_UV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamoTunnel4_UV.get(1), 8000, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_UHV.get(8), ItemList.Electric_Pump_UHV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Bedrockium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamoTunnel4_UHV.get(1), 8000, 2000000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hull_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_UEV.get(8), ItemList.Electric_Pump_UEV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamoTunnel4_UEV.get(1), 8000, 8000000); - + //Laser Dynamo IV-UEV 65536/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_IV.get(16), ItemList.Electric_Pump_IV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamoTunnel5_IV.get(1), 16000, 7680); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_LuV.get(16), ItemList.Electric_Pump_LuV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamoTunnel5_LuV.get(1), 16000, 30720); @@ -260,7 +313,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_UV.get(16), ItemList.Electric_Pump_UV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamoTunnel5_UV.get(1), 16000, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_UHV.get(16), ItemList.Electric_Pump_UHV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Bedrockium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamoTunnel5_UHV.get(1), 16000, 2000000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hull_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_UEV.get(16), ItemList.Electric_Pump_UEV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamoTunnel5_UEV.get(1), 16000, 8000000); - + //Laser Dynamo IV-UEV 262144/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_IV.get(32), ItemList.Electric_Pump_IV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamoTunnel6_IV.get(1), 32000, 7680); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_LuV.get(32), ItemList.Electric_Pump_LuV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamoTunnel6_LuV.get(1), 32000, 30720); @@ -268,7 +321,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_UV.get(32), ItemList.Electric_Pump_UV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamoTunnel6_UV.get(1), 32000, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_UHV.get(32), ItemList.Electric_Pump_UHV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Bedrockium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamoTunnel6_UHV.get(1), 32000, 2000000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hull_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_UEV.get(32), ItemList.Electric_Pump_UEV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamoTunnel6_UEV.get(1), 32000, 8000000); - + //Laser Dynamo IV-UEV 1048576/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_IV.get(64), ItemList.Electric_Pump_IV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamoTunnel7_IV.get(1), 64000, 7680); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_LuV.get(64), ItemList.Electric_Pump_LuV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.VanadiumGallium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamoTunnel7_LuV.get(1), 64000, 30720); @@ -276,7 +329,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_UV.get(64), ItemList.Electric_Pump_UV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamoTunnel7_UV.get(1), 64000, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_UHV.get(64), ItemList.Electric_Pump_UHV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Bedrockium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamoTunnel7_UHV.get(1), 64000, 2000000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hull_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_UEV.get(64), ItemList.Electric_Pump_UEV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Draconium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamoTunnel7_UEV.get(1), 64000, 8000000); - + //Laser Target IV-UEV 256/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_IV.get(1), ItemList.Electric_Pump_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.TungstenSteel, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energyTunnel1_IV.get(1), 1000, 7680); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_LuV.get(1), ItemList.Electric_Pump_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.VanadiumGallium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energyTunnel1_LuV.get(1), 1000, 30720); @@ -284,7 +337,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_UV.get(1), ItemList.Electric_Pump_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.NaquadahAlloy, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energyTunnel1_UV.get(1), 1000, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_UHV.get(1), ItemList.Electric_Pump_UHV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Bedrockium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energyTunnel1_UHV.get(1), 1000, 2000000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hull_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_UEV.get(1), ItemList.Electric_Pump_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Draconium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energyTunnel1_UEV.get(1), 1000, 8000000); - + //Laser Target IV-UEV 1024/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_IV.get(2), ItemList.Electric_Pump_IV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energyTunnel2_IV.get(1), 2000, 7680); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_LuV.get(2), ItemList.Electric_Pump_LuV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.VanadiumGallium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energyTunnel2_LuV.get(1), 2000, 30720); @@ -292,7 +345,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_UV.get(2), ItemList.Electric_Pump_UV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energyTunnel2_UV.get(1), 2000, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_UHV.get(2), ItemList.Electric_Pump_UHV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Bedrockium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energyTunnel2_UHV.get(1), 2000, 2000000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hull_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_UEV.get(2), ItemList.Electric_Pump_UEV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Draconium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energyTunnel2_UEV.get(1), 2000, 8000000); - + //Laser Target IV-UEV 4096/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_IV.get(4), ItemList.Electric_Pump_IV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energyTunnel3_IV.get(1), 4000, 7680); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_LuV.get(4), ItemList.Electric_Pump_LuV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energyTunnel3_LuV.get(1), 4000, 30720); @@ -300,7 +353,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_UV.get(4), ItemList.Electric_Pump_UV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energyTunnel3_UV.get(1), 4000, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_UHV.get(4), ItemList.Electric_Pump_UHV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Bedrockium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energyTunnel3_UHV.get(1), 4000, 2000000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hull_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_UEV.get(4), ItemList.Electric_Pump_UEV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energyTunnel3_UEV.get(1), 4000, 8000000); - + //Laser Target IV-UEV 16384/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_IV.get(8), ItemList.Electric_Pump_IV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energyTunnel4_IV.get(1), 8000, 7680); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_LuV.get(8), ItemList.Electric_Pump_LuV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energyTunnel4_LuV.get(1), 8000, 30720); @@ -308,7 +361,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_UV.get(8), ItemList.Electric_Pump_UV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energyTunnel4_UV.get(1), 8000, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_UHV.get(8), ItemList.Electric_Pump_UHV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Bedrockium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energyTunnel4_UHV.get(1), 8000, 2000000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hull_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_UEV.get(8), ItemList.Electric_Pump_UEV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Draconium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energyTunnel4_UEV.get(1), 8000, 8000000); - + //Laser Target IV-UEV 65536/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_IV.get(16), ItemList.Electric_Pump_IV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energyTunnel5_IV.get(1), 16000, 7680); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_LuV.get(16), ItemList.Electric_Pump_LuV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energyTunnel5_LuV.get(1), 16000, 30720); @@ -316,7 +369,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_UV.get(16), ItemList.Electric_Pump_UV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energyTunnel5_UV.get(1), 16000, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_UHV.get(16), ItemList.Electric_Pump_UHV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Bedrockium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energyTunnel5_UHV.get(1), 16000, 2000000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hull_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_UEV.get(16), ItemList.Electric_Pump_UEV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energyTunnel5_UEV.get(1), 16000, 8000000); - + //Laser Target IV-UEV 262144/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_IV.get(32), ItemList.Electric_Pump_IV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energyTunnel6_IV.get(1), 32000, 7680); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_LuV.get(32), ItemList.Electric_Pump_LuV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energyTunnel6_LuV.get(1), 32000, 30720); @@ -324,7 +377,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_UV.get(32), ItemList.Electric_Pump_UV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energyTunnel6_UV.get(1), 32000, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_UHV.get(32), ItemList.Electric_Pump_UHV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Bedrockium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energyTunnel6_UHV.get(1), 32000, 2000000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hull_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_UEV.get(32), ItemList.Electric_Pump_UEV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Draconium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energyTunnel6_UEV.get(1), 32000, 8000000); - + //Laser Target IV-UEV 1048576/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_IV.get(64), ItemList.Electric_Pump_IV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energyTunnel7_IV.get(1), 64000, 7680); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_LuV.get(64), ItemList.Electric_Pump_LuV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.VanadiumGallium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energyTunnel7_LuV.get(1), 64000, 30720); @@ -332,7 +385,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_UV.get(64), ItemList.Electric_Pump_UV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energyTunnel7_UV.get(1), 64000, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_MAX.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_UHV.get(64), ItemList.Electric_Pump_UHV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Bedrockium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energyTunnel7_UHV.get(1), 64000, 2000000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Hull_UEV").get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_UEV.get(64), ItemList.Electric_Pump_UEV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Draconium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energyTunnel7_UEV.get(1), 64000, 8000000); - + //Data Input addAssemblerRecipeWithCleanroom(new ItemStack[]{ CustomItemList.eM_Computer_Casing.get(1), @@ -369,7 +422,7 @@ public class DreamCraftRecipeLoader implements Runnable { CustomItemList.DATApipe.get(2), }, new FluidStack[]{ Materials.UUMatter.getFluid(500), - Materials.Iridium.getMolten(1000), + Materials.Iridium.getMolten(1296), new FluidStack(FluidRegistry.getFluid("ic2coolant"), 1000) }, CustomItemList.holder_Hatch.get(1), 1200, 100000); @@ -378,7 +431,7 @@ public class DreamCraftRecipeLoader implements Runnable { CustomItemList.eM_Computer_Casing.get(1), ItemList.Circuit_Masterquantumcomputer.get(1), CustomItemList.DATApipe.get(4), - ItemList.Cover_Screen.get(1 ), + ItemList.Cover_Screen.get(1), new ItemStack(Blocks.stone_button, 16), }, Materials.Iridium.getMolten(2592), CustomItemList.Parametrizer_Hatch.get(1), 800, 122880); //Uncertainty @@ -386,7 +439,7 @@ public class DreamCraftRecipeLoader implements Runnable { CustomItemList.eM_Computer_Casing.get(1), ItemList.Circuit_Ultimatecrystalcomputer.get(1), CustomItemList.DATApipe.get(16), - ItemList.Cover_Screen.get(1 ), + ItemList.Cover_Screen.get(1), new ItemStack(Blocks.stone_button, 16), }, Materials.Iridium.getMolten(2592), CustomItemList.Uncertainty_Hatch.get(1), 1200, 122880); @@ -412,10 +465,30 @@ public class DreamCraftRecipeLoader implements Runnable { ItemList.Field_Generator_UV.get(1) }, Materials.Osmiridium.getMolten(1296), CustomItemList.eM_muffler_UV.get(1), 800, 500000); + //Capacitor Hatch + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Hatch_Input_Bus_HV.get(1), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.NickelZincFerrite, 4), + GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Gold, 4), + }, Materials.Silver.getMolten(576), CustomItemList.capacitor_Hatch.get(1), 800, 480); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Hatch_Output_Bus_HV.get(1), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.NickelZincFerrite, 4), + GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Gold, 4), + }, Materials.Silver.getMolten(576), CustomItemList.capacitor_Hatch.get(1), 800, 480); + //endregion + //region multiblocks - //region multi blocks + //Tesla Tower + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_ModHandler.getIC2Item("teslaCoil", 1), + CustomItemList.tM_TeslaSecondary.get(4), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.NickelZincFerrite, 4), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 4), + ItemList.Upgrade_Overclocker.get(4), + }, Materials.Silver.getMolten(576), CustomItemList.Machine_Multi_TeslaCoil.get(1), 800, 480); //Microwave Grinder GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ @@ -477,7 +550,7 @@ public class DreamCraftRecipeLoader implements Runnable { //Matter Junction TT_recipeAdder.addResearchableAssemblylineRecipe(CustomItemList.Machine_Multi_Switch.get(1), - 8000,32, 500000, 4, new ItemStack[]{ + 8000, 32, 500000, 4, new ItemStack[]{ CustomItemList.Machine_Multi_Transformer.get(1), GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Naquadah, 4), ItemList.Robot_Arm_LuV.get(2), @@ -493,7 +566,7 @@ public class DreamCraftRecipeLoader implements Runnable { //Matter Quantizer TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Hatch_Input_UV.get(1), - 12000,32, 500000, 6, new ItemStack[]{ + 12000, 32, 500000, 6, new ItemStack[]{ CustomItemList.Machine_Multi_Transformer.get(1), GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Naquadah, 4), ItemList.Emitter_UV.get(2), @@ -508,7 +581,7 @@ public class DreamCraftRecipeLoader implements Runnable { //Matter DeQuantizer TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Hatch_Output_UV.get(1), - 12000,32, 500000, 6, new ItemStack[]{ + 12000, 32, 500000, 6, new ItemStack[]{ CustomItemList.Machine_Multi_Transformer.get(1), GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Naquadah, 4), ItemList.Sensor_UV.get(2), @@ -523,37 +596,37 @@ public class DreamCraftRecipeLoader implements Runnable { //Essentia Quantizer TT_recipeAdder.addResearchableAssemblylineRecipe(CustomItemList.Machine_Multi_MatterToEM.get(1), - 15000,32, 500000, 8, new ItemStack[]{ - CustomItemList.Machine_Multi_MatterToEM.get(1), - GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Neutronium, 4), - ItemList.Emitter_UV.get(2), - ItemList.Circuit_Wetwaresupercomputer.get(1), - GT_OreDictUnificator.get(OrePrefixes.cableGt02, Materials.Draconium, 2), - }, new FluidStack[]{ - Materials.UUMatter.getFluid(2000), - Materials.Void.getMolten(2592), - new FluidStack(FluidRegistry.getFluid("ic2coolant"), 4000), - Materials.Osmium.getMolten(1296), - }, CustomItemList.Machine_Multi_EssentiaToEM.get(1), 24000, 500000); + 15000, 32, 500000, 8, new ItemStack[]{ + CustomItemList.Machine_Multi_MatterToEM.get(1), + GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Neutronium, 4), + ItemList.Emitter_UV.get(2), + ItemList.Circuit_Wetwaresupercomputer.get(1), + GT_OreDictUnificator.get(OrePrefixes.cableGt02, Materials.Draconium, 2), + }, new FluidStack[]{ + Materials.UUMatter.getFluid(2000), + Materials.Void.getMolten(2592), + new FluidStack(FluidRegistry.getFluid("ic2coolant"), 4000), + Materials.Osmium.getMolten(1296), + }, CustomItemList.Machine_Multi_EssentiaToEM.get(1), 24000, 500000); //Essentia DeQuantizer TT_recipeAdder.addResearchableAssemblylineRecipe(CustomItemList.Machine_Multi_EMToMatter.get(1), - 15000,32, 500000, 8, new ItemStack[]{ - CustomItemList.Machine_Multi_EMToMatter.get(1), - GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Neutronium, 4), - ItemList.Sensor_UV.get(2), - ItemList.Circuit_Wetwaresupercomputer.get(1), - GT_OreDictUnificator.get(OrePrefixes.cableGt02, Materials.Draconium, 2), - }, new FluidStack[]{ - Materials.UUMatter.getFluid(2000), - Materials.Void.getMolten(2592), - new FluidStack(FluidRegistry.getFluid("ic2coolant"), 4000), - Materials.Osmium.getMolten(1296), - }, CustomItemList.Machine_Multi_EMToEssentia.get(1), 24000, 500000); + 15000, 32, 500000, 8, new ItemStack[]{ + CustomItemList.Machine_Multi_EMToMatter.get(1), + GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Neutronium, 4), + ItemList.Sensor_UV.get(2), + ItemList.Circuit_Wetwaresupercomputer.get(1), + GT_OreDictUnificator.get(OrePrefixes.cableGt02, Materials.Draconium, 2), + }, new FluidStack[]{ + Materials.UUMatter.getFluid(2000), + Materials.Void.getMolten(2592), + new FluidStack(FluidRegistry.getFluid("ic2coolant"), 4000), + Materials.Osmium.getMolten(1296), + }, CustomItemList.Machine_Multi_EMToEssentia.get(1), 24000, 500000); //EM Scanner TT_recipeAdder.addResearchableAssemblylineRecipe(CustomItemList.Machine_Multi_Research.get(1), - 150000,128, 500000, 16, new ItemStack[]{ + 150000, 128, 500000, 16, new ItemStack[]{ CustomItemList.Machine_Multi_EMjunction.get(1), CustomItemList.eM_Computer_Bus.get(4), ItemList.Field_Generator_UV.get(4), @@ -570,10 +643,10 @@ public class DreamCraftRecipeLoader implements Runnable { //Multi Infuser TT_recipeAdder.addResearchableAssemblylineRecipe(CustomItemList.Machine_Multi_Transformer.get(1), - 192000,512, 2000000, 32, new ItemStack[]{ + 192000, 512, 2000000, 32, new ItemStack[]{ CustomItemList.Machine_Multi_Transformer.get(1), CustomItemList.eM_Coil.get(8), - CustomItemList.eM_Power.get( 8), + CustomItemList.eM_Power.get(8), GT_OreDictUnificator.get(OrePrefixes.screw, Materials.NeodymiumMagnetic, 16), }, new FluidStack[]{ Materials.Electrum.getMolten(2592), @@ -583,158 +656,158 @@ public class DreamCraftRecipeLoader implements Runnable { //Motor UV-UHV TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Electric_Motor_UV.get(1L), - 24000, 32, 100000, 4, new ItemStack[]{ - GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.SamariumMagnetic, 4L), - GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.CosmicNeutronium, 8L), - GT_OreDictUnificator.get(OrePrefixes.ring, Materials.CosmicNeutronium, 8L), - GT_OreDictUnificator.get(OrePrefixes.round, Materials.CosmicNeutronium, 32L), - GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64L), - GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64L), - GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64L), - GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64L), - GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64L), - GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64L), - GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64L), - GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64L), - GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Bedrockium, 2L)}, new FluidStack[]{ - Materials.Naquadria.getMolten(2592), - Materials.SolderingAlloy.getMolten(2592), - Materials.Lubricant.getFluid(4000)}, ItemList.Electric_Motor_UHV.get(1L), 1000, 200000); + 24000, 32, 100000, 4, new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.SamariumMagnetic, 4L), + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.CosmicNeutronium, 8L), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.CosmicNeutronium, 8L), + GT_OreDictUnificator.get(OrePrefixes.round, Materials.CosmicNeutronium, 32L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Bedrockium, 2L)}, new FluidStack[]{ + Materials.Naquadria.getMolten(2592), + Materials.SolderingAlloy.getMolten(2592), + Materials.Lubricant.getFluid(4000)}, ItemList.Electric_Motor_UHV.get(1L), 1000, 200000); TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Electric_Motor_UHV.get(1L), - 48000, 64, 2000000, 8, new ItemStack[]{ - GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.SamariumMagnetic, 8L), - GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Infinity, 16L), - GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Infinity, 8L), - GT_OreDictUnificator.get(OrePrefixes.round, Materials.Infinity, 32L), - GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.CosmicNeutronium, 64L),//TODO Fusion T4 Material - GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.CosmicNeutronium, 64L), - GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.CosmicNeutronium, 64L), - GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.CosmicNeutronium, 64L), - GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.CosmicNeutronium, 64L), - GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.CosmicNeutronium, 64L), - GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.CosmicNeutronium, 64L), - GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.CosmicNeutronium, 64L), - GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Draconium, 2L)}, new FluidStack[]{ - Materials.Quantium.getMolten(2592), - Materials.SolderingAlloy.getMolten(5184), - Materials.Lubricant.getFluid(8000)}, ItemList.Electric_Motor_UEV.get(1L), 2000, 800000); + 48000, 64, 2000000, 8, new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.SamariumMagnetic, 8L), + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Infinity, 16L), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Infinity, 8L), + GT_OreDictUnificator.get(OrePrefixes.round, Materials.Infinity, 32L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.CosmicNeutronium, 64L),//TODO Fusion T4 Material + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.CosmicNeutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.CosmicNeutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.CosmicNeutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.CosmicNeutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.CosmicNeutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.CosmicNeutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.CosmicNeutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Draconium, 2L)}, new FluidStack[]{ + Materials.Quantium.getMolten(2592), + Materials.SolderingAlloy.getMolten(5184), + Materials.Lubricant.getFluid(8000)}, ItemList.Electric_Motor_UEV.get(1L), 2000, 800000); //Pumps UV-UHV TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Electric_Pump_UV.get(1L), - 24000, 32, 100000, 4, new ItemStack[]{ - ItemList.Electric_Motor_UHV.get(1L), - GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Neutronium, 2L), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.CosmicNeutronium, 4L), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.CosmicNeutronium, 16L), - GT_OreDictUnificator.get(OrePrefixes.ring, Materials.AnySyntheticRubber, 32L), - GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.CosmicNeutronium, 4L), - GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Bedrockium, 2L)}, new FluidStack[]{ - Materials.Naquadria.getMolten(2592), - Materials.SolderingAlloy.getMolten(2592), - Materials.Lubricant.getFluid(4000)}, ItemList.Electric_Pump_UHV.get(1), 1000, 200000); + 24000, 32, 100000, 4, new ItemStack[]{ + ItemList.Electric_Motor_UHV.get(1L), + GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Neutronium, 2L), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.CosmicNeutronium, 4L), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.CosmicNeutronium, 16L), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.AnySyntheticRubber, 32L), + GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.CosmicNeutronium, 4L), + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Bedrockium, 2L)}, new FluidStack[]{ + Materials.Naquadria.getMolten(2592), + Materials.SolderingAlloy.getMolten(2592), + Materials.Lubricant.getFluid(4000)}, ItemList.Electric_Pump_UHV.get(1), 1000, 200000); TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Electric_Pump_UHV.get(1L), - 48000, 64, 200000, 8, new ItemStack[]{ - ItemList.Electric_Motor_UEV.get(1L), - GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.NetherStar, 2L), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Infinity, 4L), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Infinity, 16L), - GT_OreDictUnificator.get(OrePrefixes.ring, (Materials.AnySyntheticRubber), 64L), - GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.Infinity, 4L), - GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Draconium, 2L)}, new FluidStack[]{ - Materials.Quantium.getMolten(2592), - Materials.SolderingAlloy.getMolten(5184), - Materials.Lubricant.getFluid(8000)}, ItemList.Electric_Pump_UEV.get(1), 2000, 800000); + 48000, 64, 200000, 8, new ItemStack[]{ + ItemList.Electric_Motor_UEV.get(1L), + GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.NetherStar, 2L), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Infinity, 4L), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Infinity, 16L), + GT_OreDictUnificator.get(OrePrefixes.ring, (Materials.AnySyntheticRubber), 64L), + GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.Infinity, 4L), + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Draconium, 2L)}, new FluidStack[]{ + Materials.Quantium.getMolten(2592), + Materials.SolderingAlloy.getMolten(5184), + Materials.Lubricant.getFluid(8000)}, ItemList.Electric_Pump_UEV.get(1), 2000, 800000); //Conveyor Belt UV-UHV TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Conveyor_Module_UV.get(1L), - 24000, 32, 100000, 4, new ItemStack[]{ - ItemList.Electric_Motor_UHV.get(2L), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.CosmicNeutronium, 2L), - GT_OreDictUnificator.get(OrePrefixes.ring, Materials.CosmicNeutronium, 8L), - GT_OreDictUnificator.get(OrePrefixes.round, Materials.CosmicNeutronium, 64L), - GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Bedrockium, 2L)}, new FluidStack[]{ - Materials.Naquadria.getMolten(2592), - Materials.SolderingAlloy.getMolten(2592), - Materials.Lubricant.getFluid(4000), - Materials.Silicone.getMolten(5760)}, ItemList.Conveyor_Module_UHV.get(1), 1000, 200000); + 24000, 32, 100000, 4, new ItemStack[]{ + ItemList.Electric_Motor_UHV.get(2L), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.CosmicNeutronium, 2L), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.CosmicNeutronium, 8L), + GT_OreDictUnificator.get(OrePrefixes.round, Materials.CosmicNeutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Bedrockium, 2L)}, new FluidStack[]{ + Materials.Naquadria.getMolten(2592), + Materials.SolderingAlloy.getMolten(2592), + Materials.Lubricant.getFluid(4000), + Materials.Silicone.getMolten(5760)}, ItemList.Conveyor_Module_UHV.get(1), 1000, 200000); TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Conveyor_Module_UHV.get(1L), - 48000, 64, 200000, 8, new ItemStack[]{ - ItemList.Electric_Motor_UEV.get(2L), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Infinity, 2L), - GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Infinity, 8L), - GT_OreDictUnificator.get(OrePrefixes.round, Materials.Infinity, 64L), - GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Draconium, 2L)}, new FluidStack[]{ - Materials.Quantium.getMolten(2592), - Materials.SolderingAlloy.getMolten(5184), - Materials.Lubricant.getFluid(8000), - Materials.Silicone.getMolten(11520)}, ItemList.Conveyor_Module_UEV.get(1), 2000, 800000); + 48000, 64, 200000, 8, new ItemStack[]{ + ItemList.Electric_Motor_UEV.get(2L), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Infinity, 2L), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Infinity, 8L), + GT_OreDictUnificator.get(OrePrefixes.round, Materials.Infinity, 64L), + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Draconium, 2L)}, new FluidStack[]{ + Materials.Quantium.getMolten(2592), + Materials.SolderingAlloy.getMolten(5184), + Materials.Lubricant.getFluid(8000), + Materials.Silicone.getMolten(11520)}, ItemList.Conveyor_Module_UEV.get(1), 2000, 800000); //Piston UV-UHV TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Electric_Piston_UV.get(1L), - 24000, 32, 100000, 4, new ItemStack[]{ - ItemList.Electric_Motor_UHV.get(1L), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.CosmicNeutronium, 6L), - GT_OreDictUnificator.get(OrePrefixes.ring, Materials.CosmicNeutronium, 8L), - GT_OreDictUnificator.get(OrePrefixes.round, Materials.CosmicNeutronium, 64L), - GT_OreDictUnificator.get(OrePrefixes.stick, Materials.CosmicNeutronium, 8L), - GT_OreDictUnificator.get(OrePrefixes.gear, Materials.CosmicNeutronium, 2L), - GT_OreDictUnificator.get(OrePrefixes.gearGtSmall, Materials.CosmicNeutronium, 4L), - GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Bedrockium, 4L)}, new FluidStack[]{ - Materials.Naquadria.getMolten(2592), - Materials.SolderingAlloy.getMolten(2592), - Materials.Lubricant.getFluid(4000)}, ItemList.Electric_Piston_UHV.get(1), 1000, 200000); + 24000, 32, 100000, 4, new ItemStack[]{ + ItemList.Electric_Motor_UHV.get(1L), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.CosmicNeutronium, 6L), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.CosmicNeutronium, 8L), + GT_OreDictUnificator.get(OrePrefixes.round, Materials.CosmicNeutronium, 64L), + GT_OreDictUnificator.get(OrePrefixes.stick, Materials.CosmicNeutronium, 8L), + GT_OreDictUnificator.get(OrePrefixes.gear, Materials.CosmicNeutronium, 2L), + GT_OreDictUnificator.get(OrePrefixes.gearGtSmall, Materials.CosmicNeutronium, 4L), + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Bedrockium, 4L)}, new FluidStack[]{ + Materials.Naquadria.getMolten(2592), + Materials.SolderingAlloy.getMolten(2592), + Materials.Lubricant.getFluid(4000)}, ItemList.Electric_Piston_UHV.get(1), 1000, 200000); TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Electric_Piston_UHV.get(1L), - 48000, 64, 200000, 8, new ItemStack[]{ - ItemList.Electric_Motor_UEV.get(1L), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Infinity, 6L), - GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Infinity, 8L), - GT_OreDictUnificator.get(OrePrefixes.round, Materials.Infinity, 64L), - GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Infinity, 8L), - GT_OreDictUnificator.get(OrePrefixes.gear, Materials.Infinity, 2L), - GT_OreDictUnificator.get(OrePrefixes.gearGtSmall, Materials.Infinity, 4L), - GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Draconium, 4L)}, new FluidStack[]{ - Materials.Quantium.getMolten(2592), - Materials.SolderingAlloy.getMolten(5184), - Materials.Lubricant.getFluid(8000)}, ItemList.Electric_Piston_UEV.get(1), 2000, 800000); + 48000, 64, 200000, 8, new ItemStack[]{ + ItemList.Electric_Motor_UEV.get(1L), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Infinity, 6L), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Infinity, 8L), + GT_OreDictUnificator.get(OrePrefixes.round, Materials.Infinity, 64L), + GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Infinity, 8L), + GT_OreDictUnificator.get(OrePrefixes.gear, Materials.Infinity, 2L), + GT_OreDictUnificator.get(OrePrefixes.gearGtSmall, Materials.Infinity, 4L), + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Draconium, 4L)}, new FluidStack[]{ + Materials.Quantium.getMolten(2592), + Materials.SolderingAlloy.getMolten(5184), + Materials.Lubricant.getFluid(8000)}, ItemList.Electric_Piston_UEV.get(1), 2000, 800000); //Robot Arm UV-UHV TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Robot_Arm_UV.get(1L), - 24000, 32, 100000, 4, new Object[]{ - GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.CosmicNeutronium, 8L), - GT_OreDictUnificator.get(OrePrefixes.gear, Materials.CosmicNeutronium, 2L), - GT_OreDictUnificator.get(OrePrefixes.gearGtSmall, Materials.CosmicNeutronium, 6L), - ItemList.Electric_Motor_UHV.get(2L), - ItemList.Electric_Piston_UHV.get(1L), + 24000, 32, 100000, 4, new Object[]{ + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.CosmicNeutronium, 8L), + GT_OreDictUnificator.get(OrePrefixes.gear, Materials.CosmicNeutronium, 2L), + GT_OreDictUnificator.get(OrePrefixes.gearGtSmall, Materials.CosmicNeutronium, 6L), + ItemList.Electric_Motor_UHV.get(2L), + ItemList.Electric_Piston_UHV.get(1L), new Object[]{OrePrefixes.circuit.get(Materials.Infinite), 2L}, new Object[]{OrePrefixes.circuit.get(Materials.Superconductor), 4L}, new Object[]{OrePrefixes.circuit.get(Materials.Ultimate), 8L}, - GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Bedrockium, 6L)}, new FluidStack[]{ - Materials.Naquadria.getMolten(2592), - Materials.SolderingAlloy.getMolten(4608), - Materials.Lubricant.getFluid(4000)}, ItemList.Robot_Arm_UHV.get(1L), 1000, 200000); + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Bedrockium, 6L)}, new FluidStack[]{ + Materials.Naquadria.getMolten(2592), + Materials.SolderingAlloy.getMolten(4608), + Materials.Lubricant.getFluid(4000)}, ItemList.Robot_Arm_UHV.get(1L), 1000, 200000); TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Robot_Arm_UHV.get(1L), - 48000, 64, 200000, 8, new Object[]{ - GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Infinity, 8L), - GT_OreDictUnificator.get(OrePrefixes.gear, Materials.Infinity, 2L), - GT_OreDictUnificator.get(OrePrefixes.gearGtSmall, Materials.Infinity, 6L), - ItemList.Electric_Motor_UEV.get(2L), - ItemList.Electric_Piston_UEV.get(1L), + 48000, 64, 200000, 8, new Object[]{ + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Infinity, 8L), + GT_OreDictUnificator.get(OrePrefixes.gear, Materials.Infinity, 2L), + GT_OreDictUnificator.get(OrePrefixes.gearGtSmall, Materials.Infinity, 6L), + ItemList.Electric_Motor_UEV.get(2L), + ItemList.Electric_Piston_UEV.get(1L), new Object[]{OrePrefixes.circuit.get(Materials.Bio), 2L}, new Object[]{OrePrefixes.circuit.get(Materials.Infinite), 4L}, new Object[]{OrePrefixes.circuit.get(Materials.Superconductor), 8L}, - GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Draconium, 6L)}, new FluidStack[]{ - Materials.Quantium.getMolten(2592), - Materials.SolderingAlloy.getMolten(9216), - Materials.Lubricant.getFluid(8000)}, ItemList.Robot_Arm_UEV.get(1L), 2000, 800000); + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Draconium, 6L)}, new FluidStack[]{ + Materials.Quantium.getMolten(2592), + Materials.SolderingAlloy.getMolten(9216), + Materials.Lubricant.getFluid(8000)}, ItemList.Robot_Arm_UEV.get(1L), 2000, 800000); //Emitter UV-UHV TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Emitter_UV.get(1L), - 24000, 32, 100000, 4, new Object[]{ + 24000, 32, 100000, 4, new Object[]{ GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.CosmicNeutronium, 1L), ItemList.Electric_Motor_UHV.get(1L), GT_OreDictUnificator.get(OrePrefixes.stick, Materials.CosmicNeutronium, 8L), @@ -750,7 +823,7 @@ public class DreamCraftRecipeLoader implements Runnable { ItemList.Emitter_UHV.get(1L), 1000, 200000); TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Emitter_UHV.get(1L), - 48000, 64, 200000, 8, new Object[]{ + 48000, 64, 200000, 8, new Object[]{ GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Infinity, 1L), ItemList.Electric_Motor_UEV.get(1L), GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Infinity, 16L), @@ -767,7 +840,7 @@ public class DreamCraftRecipeLoader implements Runnable { //Sensor UV-UHV TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Sensor_UV.get(1L), - 24000, 32, 100000, 4, new Object[]{ + 24000, 32, 100000, 4, new Object[]{ GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.CosmicNeutronium, 1L), ItemList.Electric_Motor_UHV.get(1L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.CosmicNeutronium, 8L), @@ -783,7 +856,7 @@ public class DreamCraftRecipeLoader implements Runnable { ItemList.Sensor_UHV.get(1L), 1000, 200000); TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Sensor_UHV.get(1L), - 48000, 64, 200000, 8, new Object[]{ + 48000, 64, 200000, 8, new Object[]{ GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Infinity, 1L), ItemList.Electric_Motor_UEV.get(1), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Infinity, 8L), @@ -800,7 +873,7 @@ public class DreamCraftRecipeLoader implements Runnable { //Fieldgen UV and UHV TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Field_Generator_UV.get(1), - 48000, 64, 200000, 8, new Object[]{ + 48000, 64, 200000, 8, new Object[]{ GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.CosmicNeutronium, 1L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.CosmicNeutronium, 6L), new Object[]{OrePrefixes.circuit.get(Materials.Bio), 4L}, @@ -819,7 +892,7 @@ public class DreamCraftRecipeLoader implements Runnable { ItemList.Field_Generator_UHV.get(1L), 2000, 200000); TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Field_Generator_UHV.get(1L), - 96000, 128, 400000, 16, new Object[]{ + 96000, 128, 400000, 16, new Object[]{ GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Infinity, 1L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Infinity, 6L), new Object[]{OrePrefixes.circuit.get(Materials.Bio), 8L}, @@ -839,7 +912,7 @@ public class DreamCraftRecipeLoader implements Runnable { //UHV Energy Hatch TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Hatch_Energy_UV.get(1L), - 24000, 16, 50000, 2, new Object[]{ + 24000, 16, 50000, 2, new Object[]{ ItemList.Hull_MAX.get(1L), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.SuperconductorUHV, 2L), ItemList.Circuit_Chip_QPIC.get(2L), @@ -860,7 +933,7 @@ public class DreamCraftRecipeLoader implements Runnable { }, ItemList.Hatch_Energy_MAX.get(1L), 1000, 2000000); TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Hatch_Dynamo_UV.get(1L), - 48000, 32, 100000, 4, new Object[]{ + 48000, 32, 100000, 4, new Object[]{ ItemList.Hull_MAX.get(1L), GT_OreDictUnificator.get(OrePrefixes.spring, Materials.Longasssuperconductornameforuhvwire, 8L), ItemList.Circuit_Chip_QPIC.get(2L), @@ -882,26 +955,26 @@ public class DreamCraftRecipeLoader implements Runnable { //UHV Circuit TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Circuit_Wetwaresupercomputer.get(1L), - 24000, 64, 50000, 4, new ItemStack[]{ - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Tritanium, 2), - ItemList.Circuit_Wetwaresupercomputer.get(2L), - ItemList.ZPM_Coil.get(16L), - ItemList.Circuit_Parts_CapacitorSMD.get(64L), - ItemList.Circuit_Parts_ResistorSMD.get(64L), - ItemList.Circuit_Parts_TransistorSMD.get(64L), - ItemList.Circuit_Parts_DiodeSMD.get(64L), - ItemList.Circuit_Chip_Ram.get(48L), - GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.SuperconductorZPM, 64L), - GT_OreDictUnificator.get(OrePrefixes.foil, (Materials.AnySyntheticRubber), 64L), - }, new FluidStack[]{ - Materials.SolderingAlloy.getMolten(2880L), - new FluidStack(FluidRegistry.getFluid("ic2coolant"), 10000), - Materials.Radon.getGas(2500L), - }, ItemList.Circuit_Wetwaremainframe.get(1L), 2000, 300000); + 24000, 64, 50000, 4, new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Tritanium, 2), + ItemList.Circuit_Wetwaresupercomputer.get(2L), + ItemList.ZPM_Coil.get(16L), + ItemList.Circuit_Parts_CapacitorSMD.get(64L), + ItemList.Circuit_Parts_ResistorSMD.get(64L), + ItemList.Circuit_Parts_TransistorSMD.get(64L), + ItemList.Circuit_Parts_DiodeSMD.get(64L), + ItemList.Circuit_Chip_Ram.get(48L), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.SuperconductorZPM, 64L), + GT_OreDictUnificator.get(OrePrefixes.foil, (Materials.AnySyntheticRubber), 64L), + }, new FluidStack[]{ + Materials.SolderingAlloy.getMolten(2880L), + new FluidStack(FluidRegistry.getFluid("ic2coolant"), 10000), + Materials.Radon.getGas(2500L), + }, ItemList.Circuit_Wetwaremainframe.get(1L), 2000, 300000); //Bio Chips TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Circuit_Biowarecomputer.get(1L), - 48000, 128, 500000, 8, new ItemStack[]{ + 48000, 128, 500000, 8, new ItemStack[]{ ItemList.Circuit_Board_Bio_Ultra.get(2L), ItemList.Circuit_Biowarecomputer.get(2L), ItemList.Circuit_Parts_TransistorSMD.get(16L), @@ -920,7 +993,7 @@ public class DreamCraftRecipeLoader implements Runnable { ItemList.Circuit_Biowaresupercomputer.get(1L), 4000, 500000); TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Circuit_Biowaresupercomputer.get(1L), - 96000, 256, 1000000, 16, new ItemStack[]{ + 96000, 256, 1000000, 16, new ItemStack[]{ GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Tritanium, 4L), ItemList.Circuit_Biowaresupercomputer.get(2L), ItemList.UV_Coil.get(16L), @@ -940,69 +1013,69 @@ public class DreamCraftRecipeLoader implements Runnable { //GTNH Circuits TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Circuit_Biomainframe.get(1L), - 192000, 512, 2000000, 32, new ItemStack[]{ - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Tritanium, 8), - ItemList.Circuit_Biomainframe.get(2L), - ItemList.Circuit_Parts_CapacitorSMD.get(64L), - ItemList.Circuit_Parts_ResistorSMD.get(64L), - ItemList.Circuit_Parts_TransistorSMD.get(64L), - ItemList.Circuit_Parts_DiodeSMD.get(64L), - ItemList.Circuit_Chip_Ram.get(64L), - ItemList.Circuit_Chip_NPIC.get(64L), - GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Draconium, 64), - GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.SuperconductorUHV, 64), - GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silicone, 64), - GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Polybenzimidazole, 64) - }, new FluidStack[]{ - Materials.SolderingAlloy.getMolten(3760L), - Materials.Naquadria.getMolten(4032L), - new FluidStack(FluidRegistry.getFluid("ic2coolant"), 20000) - }, getItemContainer("NanoCircuit").get(1L), 8000, 8000000); + 192000, 512, 2000000, 32, new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Tritanium, 8), + ItemList.Circuit_Biomainframe.get(2L), + ItemList.Circuit_Parts_CapacitorSMD.get(64L), + ItemList.Circuit_Parts_ResistorSMD.get(64L), + ItemList.Circuit_Parts_TransistorSMD.get(64L), + ItemList.Circuit_Parts_DiodeSMD.get(64L), + ItemList.Circuit_Chip_Ram.get(64L), + ItemList.Circuit_Chip_NPIC.get(64L), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Draconium, 64), + GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.SuperconductorUHV, 64), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silicone, 64), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Polybenzimidazole, 64) + }, new FluidStack[]{ + Materials.SolderingAlloy.getMolten(3760L), + Materials.Naquadria.getMolten(4032L), + new FluidStack(FluidRegistry.getFluid("ic2coolant"), 20000) + }, getItemContainer("NanoCircuit").get(1L), 8000, 8000000); TT_recipeAdder.addResearchableAssemblylineRecipe(getItemContainer("PicoWafer").get(1), - 384000, 1024, 4000000, 64, new ItemStack[]{ - ItemList.Circuit_Board_Bio_Ultra.get(1L), - getItemContainer("PicoWafer").get(4L), - getItemContainer("NanoCircuit").get(2L), - ItemList.Circuit_Parts_TransistorSMD.get(64L), - ItemList.Circuit_Parts_ResistorSMD.get(64L), - ItemList.Circuit_Parts_CapacitorSMD.get(64L), - ItemList.Circuit_Parts_DiodeSMD.get(64L), - ItemList.Circuit_Chip_PPIC.get(64L), - GT_OreDictUnificator.get(OrePrefixes.foil, Materials.NiobiumTitanium, 16), - GT_OreDictUnificator.get(OrePrefixes.bolt, Materials.Osmium, 32), - GT_OreDictUnificator.get(OrePrefixes.bolt, Materials.Neutronium, 16), - GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Lanthanum, 64) - }, new FluidStack[]{ - Materials.SolderingAlloy.getMolten(3760L), - Materials.UUMatter.getFluid(8000L), - Materials.Osmium.getMolten(1152L) - }, getItemContainer("PikoCircuit").get(1L), 10000, 8000000); + 384000, 1024, 4000000, 64, new ItemStack[]{ + ItemList.Circuit_Board_Bio_Ultra.get(1L), + getItemContainer("PicoWafer").get(4L), + getItemContainer("NanoCircuit").get(2L), + ItemList.Circuit_Parts_TransistorSMD.get(64L), + ItemList.Circuit_Parts_ResistorSMD.get(64L), + ItemList.Circuit_Parts_CapacitorSMD.get(64L), + ItemList.Circuit_Parts_DiodeSMD.get(64L), + ItemList.Circuit_Chip_PPIC.get(64L), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.NiobiumTitanium, 16), + GT_OreDictUnificator.get(OrePrefixes.bolt, Materials.Osmium, 32), + GT_OreDictUnificator.get(OrePrefixes.bolt, Materials.Neutronium, 16), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Lanthanum, 64) + }, new FluidStack[]{ + Materials.SolderingAlloy.getMolten(3760L), + Materials.UUMatter.getFluid(8000L), + Materials.Osmium.getMolten(1152L) + }, getItemContainer("PikoCircuit").get(1L), 10000, 8000000); TT_recipeAdder.addResearchableAssemblylineRecipe(getItemContainer("PikoCircuit").get(1L), - 720000, 2048, 8000000, 128, new ItemStack[]{ - GT_OreDictUnificator.get(OrePrefixes.frameGt,Materials.Neutronium, 16), - getItemContainer("PikoCircuit").get(8L), - ItemList.Circuit_Parts_CapacitorSMD.get(64L), - ItemList.Circuit_Parts_DiodeSMD.get(64L), - ItemList.Circuit_Parts_TransistorSMD.get(64L), - ItemList.Circuit_Parts_ResistorSMD.get(64L), - ItemList.Circuit_Chip_QPIC.get(64L), - GT_OreDictUnificator.get(OrePrefixes.foil, Materials.NiobiumTitanium, 64), - GT_OreDictUnificator.get(OrePrefixes.bolt, Materials.Indium, 64), - GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Bedrockium, 8), - GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Lanthanum, 64) - }, new FluidStack[]{ - Materials.SolderingAlloy.getMolten(3760L), - Materials.UUMatter.getFluid(24000L), - Materials.Osmium.getMolten(2304L) - }, getItemContainer("QuantumCircuit").get(1L), 20000, 32000000); + 720000, 2048, 8000000, 128, new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Neutronium, 16), + getItemContainer("PikoCircuit").get(8L), + ItemList.Circuit_Parts_CapacitorSMD.get(64L), + ItemList.Circuit_Parts_DiodeSMD.get(64L), + ItemList.Circuit_Parts_TransistorSMD.get(64L), + ItemList.Circuit_Parts_ResistorSMD.get(64L), + ItemList.Circuit_Chip_QPIC.get(64L), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.NiobiumTitanium, 64), + GT_OreDictUnificator.get(OrePrefixes.bolt, Materials.Indium, 64), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Bedrockium, 8), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Lanthanum, 64) + }, new FluidStack[]{ + Materials.SolderingAlloy.getMolten(3760L), + Materials.UUMatter.getFluid(24000L), + Materials.Osmium.getMolten(2304L) + }, getItemContainer("QuantumCircuit").get(1L), 20000, 32000000); //Stargate Stuff - if (Loader.isModLoaded("eternalsingularity")&&Loader.isModLoaded("SGCraft")) { + if (Loader.isModLoaded("eternalsingularity") && Loader.isModLoaded("SGCraft")) { TT_recipeAdder.addResearchableAssemblylineRecipe(GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Infinity, 1L), - 192000, 512, 2000000, 32, new ItemStack[]{ + 192000, 512, 2000000, 32, new ItemStack[]{ GT_ModHandler.getModItem("eternalsingularity", "eternal_singularity", 1L), ItemList.Sensor_UV.get(16L), GT_OreDictUnificator.get(OrePrefixes.block, Materials.Infinity, 16L), @@ -1021,7 +1094,7 @@ public class DreamCraftRecipeLoader implements Runnable { getItemContainer("StargateShieldingFoil").get(1L), 72000, 2000000); TT_recipeAdder.addResearchableAssemblylineRecipe(getItemContainer("StargateShieldingFoil").get(1L), - 192000, 512, 2000000, 32, new ItemStack[]{ + 192000, 512, 2000000, 32, new ItemStack[]{ ItemList.Electric_Piston_UV.get(16L), ItemList.Electric_Motor_UV.get(64L), GT_OreDictUnificator.get(OrePrefixes.block, Materials.Infinity, 16L), @@ -1043,7 +1116,7 @@ public class DreamCraftRecipeLoader implements Runnable { getItemContainer("StargateChevron").get(1L), 72000, 2000000); TT_recipeAdder.addResearchableAssemblylineRecipe(GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Neutronium, 1L), - 192000, 512, 2000000, 32, new ItemStack[]{ + 192000, 512, 2000000, 32, new ItemStack[]{ GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Infinity, 64L), GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.NaquadahAlloy, 64L), GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.CosmicNeutronium, 64L), @@ -1058,7 +1131,7 @@ public class DreamCraftRecipeLoader implements Runnable { getItemContainer("StargateFramePart").get(1L), 72000, 2000000); //Batteries - TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Energy_Cluster.get(1L),12000,16,100000,3,new Object[]{ + TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Energy_Cluster.get(1L), 12000, 16, 100000, 3, new Object[]{ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Tritanium, 64L), new Object[]{OrePrefixes.circuit.get(Materials.Infinite), 4L}, ItemList.Energy_Cluster.get(8L), @@ -1072,7 +1145,7 @@ public class DreamCraftRecipeLoader implements Runnable { new FluidStack(FluidRegistry.getFluid("ic2coolant"), 16000) }, ItemList.ZPM2.get(1), 3000, 400000); - TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.ZPM2.get(1L),24000,64,200000,6,new Object[]{ + TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.ZPM2.get(1L), 24000, 64, 200000, 6, new Object[]{ GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Neutronium, 32L), GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Neutronium, 32L), new Object[]{OrePrefixes.circuit.get(Materials.Bio), 4L}, @@ -1085,41 +1158,485 @@ public class DreamCraftRecipeLoader implements Runnable { GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Neutronium, 64), }, new FluidStack[]{ Materials.SolderingAlloy.getMolten(3760), - Materials.Naquadria.getMolten(9000), + Materials.Naquadria.getMolten(9216), new FluidStack(FluidRegistry.getFluid("ic2coolant"), 32000) }, ItemList.ZPM3.get(1), 4000, 1600000); } //endregion + //region singleblocks + + //Tesla Transceiver LV 1A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_1by1_LV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_1by1_LV.get(1), 400, 30); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_1by1_LV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_1by1_LV.get(1), 400, 30); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_1by1_LV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_1by1_LV.get(1), 400, 30); + //Tesla Transceiver MV 1A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_1by1_MV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_1by1_MV.get(1), 400, 120); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_1by1_MV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_1by1_MV.get(1), 400, 120); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_1by1_MV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_1by1_MV.get(1), 400, 120); + //Tesla Transceiver HV 1A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_1by1_HV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_1by1_HV.get(1), 400, 480); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_1by1_HV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_1by1_HV.get(1), 400, 480); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_1by1_HV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_1by1_HV.get(1), 400, 480); + //Tesla Transceiver EV 1A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_1by1_EV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_1by1_EV.get(1), 400, 1920); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_1by1_EV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_1by1_EV.get(1), 400, 1920); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_1by1_EV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_1by1_EV.get(1), 400, 1920); + //Tesla Transceiver IV 1A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_1by1_IV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_1by1_IV.get(1), 400, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_1by1_IV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_1by1_IV.get(1), 400, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_1by1_IV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_1by1_IV.get(1), 400, 7680); + //Tesla Transceiver LV 4A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_2by2_LV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_2by2_LV.get(1), 400, 30); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_2by2_LV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_2by2_LV.get(1), 400, 30); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_2by2_LV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_2by2_LV.get(1), 400, 30); + //Tesla Transceiver MV 4A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_2by2_MV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_2by2_MV.get(1), 400, 120); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_2by2_MV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_2by2_MV.get(1), 400, 120); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_2by2_MV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_2by2_MV.get(1), 400, 120); + //Tesla Transceiver HV 4A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_2by2_HV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_2by2_HV.get(1), 400, 480); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_2by2_HV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_2by2_HV.get(1), 400, 480); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_2by2_HV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_2by2_HV.get(1), 400, 480); + //Tesla Transceiver EV 4A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_2by2_EV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_2by2_EV.get(1), 400, 1920); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_2by2_EV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_2by2_EV.get(1), 400, 1920); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_2by2_EV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_2by2_EV.get(1), 400, 1920); + //Tesla Transceiver IV 4A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_2by2_IV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_2by2_IV.get(1), 400, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_2by2_IV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_2by2_IV.get(1), 400, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_2by2_IV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_2by2_IV.get(1), 400, 7680); + //Tesla Transceiver LV 9A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_3by3_LV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_3by3_LV.get(1), 400, 30); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_3by3_LV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_3by3_LV.get(1), 400, 30); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_3by3_LV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_3by3_LV.get(1), 400, 30); + //Tesla Transceiver MV 9A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_3by3_MV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_3by3_MV.get(1), 400, 120); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_3by3_LV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_3by3_MV.get(1), 400, 120); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_3by3_MV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_3by3_MV.get(1), 400, 120); + //Tesla Transceiver HV 9A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_3by3_HV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_3by3_HV.get(1), 400, 480); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_3by3_HV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_3by3_HV.get(1), 400, 480); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_3by3_HV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_3by3_HV.get(1), 400, 480); + //Tesla Transceiver EV 9A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_3by3_EV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_3by3_EV.get(1), 400, 1920); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_3by3_EV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_3by3_EV.get(1), 400, 1920); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_3by3_EV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_3by3_EV.get(1), 400, 1920); + //Tesla Transceiver IV 9A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_3by3_IV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_3by3_IV.get(1), 400, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_3by3_IV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_3by3_IV.get(1), 400, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_3by3_IV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_3by3_IV.get(1), 400, 7680); + //Tesla Transceiver LV 16A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_4by4_LV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_4by4_LV.get(1), 400, 30); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_4by4_LV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_4by4_LV.get(1), 400, 30); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_4by4_LV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_4by4_LV.get(1), 400, 30); + //Tesla Transceiver MV 16A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_4by4_MV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_4by4_MV.get(1), 400, 120); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_4by4_MV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_4by4_MV.get(1), 400, 120); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_4by4_MV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_4by4_MV.get(1), 400, 120); + //Tesla Transceiver HV 16A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_4by4_HV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_4by4_HV.get(1), 400, 480); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_4by4_HV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_4by4_HV.get(1), 400, 480); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_4by4_HV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_4by4_HV.get(1), 400, 480); + //Tesla Transceiver EV 16A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_4by4_EV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_4by4_EV.get(1), 400, 1920); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_4by4_EV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_4by4_EV.get(1), 400, 1920); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_4by4_EV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_4by4_EV.get(1), 400, 1920); + //Tesla Transceiver IV 16A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_4by4_IV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_4by4_IV.get(1), 400, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_4by4_IV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_4by4_IV.get(1), 400, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_4by4_IV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_4by4_IV.get(1), 400, 7680); + + //endregion + + //region components + + //Tesla Winding Components + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Electrum, 32), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.NickelZincFerrite, 8), + }, Materials.Epoxid.getMolten(288), CustomItemList.teslaComponent.getWithDamage(1, 0), 320, 30); + //Tesla Winding Components Ultimate (ADD BLOOD VARIANT) + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.SuperconductorLuV, 4), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.NickelZincFerrite, 8), + }, Materials.Epoxid.getMolten(576), CustomItemList.teslaComponent.getWithDamage(1, 1), 320, 7680); + + //endregion + + //region items + + //LV Tesla Capacitor + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Tin, 4), + GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 4), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 8), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silicone, 8), + }, Materials.Epoxid.getMolten(72), CustomItemList.teslaCapacitor.getWithDamage(1, 0), 320, 30); + //MV Tesla Capacitor + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Copper, 4), + GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 6), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 12), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silicone, 12), + }, Materials.Epoxid.getMolten(144), CustomItemList.teslaCapacitor.getWithDamage(1, 1), 320, 120); + //HV Tesla Capacitor + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Gold, 4), + GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 8), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 16), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silicone, 16), + }, Materials.Epoxid.getMolten(216), CustomItemList.teslaCapacitor.getWithDamage(1, 2), 320, 480); + //EV Tesla Capacitor + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Aluminium, 4), + GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 10), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 20), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silicone, 20), + }, Materials.Epoxid.getMolten(288), CustomItemList.teslaCapacitor.getWithDamage(1, 3), 320, 1920); + //IV Tesla Capacitor + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Tungsten, 4), + GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 12), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 24), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silicone, 24), + }, Materials.Epoxid.getMolten(360), CustomItemList.teslaCapacitor.getWithDamage(1, 4), 320, 7680); + //Tesla Cover + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.teslaComponent.getWithDamage(4, 0), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 2), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Gold, 16), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.NickelZincFerrite, 2), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 8), + }, Materials.Lead.getMolten(288), CustomItemList.teslaCover.getWithDamage(1, 0), 320, 480); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.teslaComponent.getWithDamage(4, 0), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 2), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Gold, 16), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.NickelZincFerrite, 2), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 8), + }, Materials.Tin.getMolten(144), CustomItemList.teslaCover.getWithDamage(1, 0), 320, 480); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.teslaComponent.getWithDamage(4, 0), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 2), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Gold, 16), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.NickelZincFerrite, 2), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 8), + }, Materials.SolderingAlloy.getMolten(72), CustomItemList.teslaCover.getWithDamage(1, 0), 320, 480); + //Ultimate Tesla Cover + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.teslaComponent.getWithDamage(4, 1), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Master, 2), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Tungsten, 16), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.NickelZincFerrite, 2), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 8), + }, Materials.Lead.getMolten(288), CustomItemList.teslaCover.getWithDamage(1, 1), 320, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.teslaComponent.getWithDamage(4, 1), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Master, 2), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Tungsten, 16), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.NickelZincFerrite, 2), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 8), + }, Materials.Tin.getMolten(144), CustomItemList.teslaCover.getWithDamage(1, 1), 320, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.teslaComponent.getWithDamage(4, 1), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Master, 2), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Tungsten, 16), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.NickelZincFerrite, 2), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 8), + }, Materials.SolderingAlloy.getMolten(72), CustomItemList.teslaCover.getWithDamage(1, 1), 320, 7680); + + //endregion + + //region recycling + + //LV Tesla Capacitor + GT_Values.RA.addExtractorRecipe(CustomItemList.teslaCapacitor.getWithDamage(1, 0), + GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 4), 300, 2); + //MV Tesla Capacitor + GT_Values.RA.addExtractorRecipe(CustomItemList.teslaCapacitor.getWithDamage(1, 1), + GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 6), 300, 2); + //HV Tesla Capacitor + GT_Values.RA.addExtractorRecipe(CustomItemList.teslaCapacitor.getWithDamage(1, 2), + GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 8), 300, 2); + //EV Tesla Capacitor + GT_Values.RA.addExtractorRecipe(CustomItemList.teslaCapacitor.getWithDamage(1, 3), + GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 10), 300, 2); + //IV Tesla Capacitor + GT_Values.RA.addExtractorRecipe(CustomItemList.teslaCapacitor.getWithDamage(1, 4), + GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 12), 300, 2); + + //endregion + register_machine_EM_behaviours(); } - private void register_machine_EM_behaviours(){ - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(5),ItemList.Machine_IV_Centrifuge.get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(6),getItemContainer("CentrifugeLuV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(7),getItemContainer("CentrifugeZPM").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(8),getItemContainer("CentrifugeUV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(9),getItemContainer("CentrifugeUHV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(10),getItemContainer("CentrifugeUEV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(11),getItemContainer("CentrifugeUIV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(12),getItemContainer("CentrifugeUMV").get(1)); - - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(5),ItemList.Machine_IV_ElectromagneticSeparator.get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(6),getItemContainer("ElectromagneticSeparatorLuV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(7),getItemContainer("ElectromagneticSeparatorZPM").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(8),getItemContainer("ElectromagneticSeparatorUV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(9),getItemContainer("ElectromagneticSeparatorUHV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(10),getItemContainer("ElectromagneticSeparatorUEV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(11),getItemContainer("ElectromagneticSeparatorUIV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(12),getItemContainer("ElectromagneticSeparatorUMV").get(1)); - - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(5),ItemList.Machine_IV_Recycler.get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(6),getItemContainer("RecyclerLuV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(7),getItemContainer("RecyclerZPM").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(8),getItemContainer("RecyclerUV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(9),getItemContainer("RecyclerUHV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(10),getItemContainer("RecyclerUEV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(11),getItemContainer("RecyclerUIV").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(12),getItemContainer("RecyclerUMV").get(1)); + private void register_machine_EM_behaviours() { + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Centrifuge(5), ItemList.Machine_IV_Centrifuge.get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Centrifuge(6), getItemContainer("CentrifugeLuV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Centrifuge(7), getItemContainer("CentrifugeZPM").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Centrifuge(8), getItemContainer("CentrifugeUV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Centrifuge(9), getItemContainer("CentrifugeUHV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Centrifuge(10), getItemContainer("CentrifugeUEV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Centrifuge(11), getItemContainer("CentrifugeUIV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Centrifuge(12), getItemContainer("CentrifugeUMV").get(1)); + + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_ElectromagneticSeparator(5), ItemList.Machine_IV_ElectromagneticSeparator.get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_ElectromagneticSeparator(6), getItemContainer("ElectromagneticSeparatorLuV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_ElectromagneticSeparator(7), getItemContainer("ElectromagneticSeparatorZPM").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_ElectromagneticSeparator(8), getItemContainer("ElectromagneticSeparatorUV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_ElectromagneticSeparator(9), getItemContainer("ElectromagneticSeparatorUHV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_ElectromagneticSeparator(10), getItemContainer("ElectromagneticSeparatorUEV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_ElectromagneticSeparator(11), getItemContainer("ElectromagneticSeparatorUIV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_ElectromagneticSeparator(12), getItemContainer("ElectromagneticSeparatorUMV").get(1)); + + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Recycler(5), ItemList.Machine_IV_Recycler.get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Recycler(6), getItemContainer("RecyclerLuV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Recycler(7), getItemContainer("RecyclerZPM").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Recycler(8), getItemContainer("RecyclerUV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Recycler(9), getItemContainer("RecyclerUHV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Recycler(10), getItemContainer("RecyclerUEV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Recycler(11), getItemContainer("RecyclerUIV").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Recycler(12), getItemContainer("RecyclerUMV").get(1)); } } diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/NoDreamCraftMachineLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/NoDreamCraftMachineLoader.java index 53a64a52ae..adf5d37876 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/NoDreamCraftMachineLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/NoDreamCraftMachineLoader.java @@ -4,6 +4,7 @@ import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.Util; import com.github.technus.tectech.thing.CustomItemList; +import com.github.technus.tectech.thing.metaTileEntity.single.GT_MetaTileEntity_TT_Transformer; import com.github.technus.tectech.thing.metaTileEntity.single.GT_MetaTileEntity_WetTransformer; import cpw.mods.fml.common.Loader; import gregtech.api.enums.GT_Values; @@ -11,7 +12,6 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Transformer; import net.minecraft.util.EnumChatFormatting; import java.lang.reflect.Constructor; @@ -19,9 +19,10 @@ import java.lang.reflect.Field; import java.lang.reflect.Method; import static gregtech.api.GregTech_API.METATILEENTITIES; +import static net.minecraft.util.StatCollector.translateToLocal; public class NoDreamCraftMachineLoader implements Runnable { - public final static String imagination=EnumChatFormatting.RESET + + public final static String imagination = EnumChatFormatting.RESET + "You just need " + EnumChatFormatting.DARK_PURPLE + "I" + EnumChatFormatting.LIGHT_PURPLE + "m" + EnumChatFormatting.DARK_RED + @@ -40,70 +41,55 @@ public class NoDreamCraftMachineLoader implements Runnable { public void run() { try { CustomItemList.WetTransformer_LV_ULV.set(new GT_MetaTileEntity_WetTransformer( - 12000, "wettransformer.tier.00", "Ultra Low Voltage Power Transformer", 0, - "LV -> ULV (Use Soft Mallet to invert)").getStackForm(1L)); - }catch (IllegalArgumentException e){ + 12000, "wettransformer.tier.00", "Ultra Low Voltage Power Transformer", 0).getStackForm(1L));//LV -> ULV (Use Soft Mallet to invert) + } catch (IllegalArgumentException e) { System.out.println(METATILEENTITIES[12000].getClass().getCanonicalName()); TecTech.LOGGER.error(e); e.printStackTrace(); - throw new Error(METATILEENTITIES[12000].getClass().getCanonicalName(),e); + throw new Error(METATILEENTITIES[12000].getClass().getCanonicalName(), e); } CustomItemList.WetTransformer_MV_LV.set(new GT_MetaTileEntity_WetTransformer( - 12001, "wetransformer.tier.01", "Low Voltage Power Transformer", 1, - "MV -> LV (Use Soft Mallet to invert)").getStackForm(1L)); + 12001, "wetransformer.tier.01", "Low Voltage Power Transformer", 1).getStackForm(1L));//MV -> LV (Use Soft Mallet to invert) CustomItemList.WetTransformer_HV_MV.set(new GT_MetaTileEntity_WetTransformer( - 12002, "wettransformer.tier.02", "Medium Voltage Power Transformer", 2, - "HV -> MV (Use Soft Mallet to invert)").getStackForm(1L)); + 12002, "wettransformer.tier.02", "Medium Voltage Power Transformer", 2).getStackForm(1L));//HV -> MV (Use Soft Mallet to invert) CustomItemList.WetTransformer_EV_HV.set(new GT_MetaTileEntity_WetTransformer( - 12003, "wettransformer.tier.03", "High Voltage Power Transformer", 3, - "EV -> HV (Use Soft Mallet to invert)").getStackForm(1L)); + 12003, "wettransformer.tier.03", "High Voltage Power Transformer", 3).getStackForm(1L));//EV -> HV (Use Soft Mallet to invert) CustomItemList.WetTransformer_IV_EV.set(new GT_MetaTileEntity_WetTransformer( - 12004, "wettransformer.tier.04", "Extreme Power Transformer", 4, - "IV -> EV (Use Soft Mallet to invert)").getStackForm(1L)); + 12004, "wettransformer.tier.04", "Extreme Power Transformer", 4).getStackForm(1L));//IV -> EV (Use Soft Mallet to invert) CustomItemList.WetTransformer_LuV_IV.set(new GT_MetaTileEntity_WetTransformer( - 12005, "wettransformer.tier.05", "Insane Power Transformer", 5, - "LuV -> IV (Use Soft Mallet to invert)").getStackForm(1L)); + 12005, "wettransformer.tier.05", "Insane Power Transformer", 5).getStackForm(1L));//LuV -> IV (Use Soft Mallet to invert) CustomItemList.WetTransformer_ZPM_LuV.set(new GT_MetaTileEntity_WetTransformer( - 12006, "wettransformer.tier.06", "Ludicrous Power Transformer", 6, - "ZPM -> LuV (Use Soft Mallet to invert)").getStackForm(1L)); + 12006, "wettransformer.tier.06", "Ludicrous Power Transformer", 6).getStackForm(1L));//ZPM -> LuV (Use Soft Mallet to invert) CustomItemList.WetTransformer_UV_ZPM.set(new GT_MetaTileEntity_WetTransformer( - 12007, "wettransformer.tier.07", "ZPM Voltage Power Transformer", 7, - "UV -> ZPM (Use Soft Mallet to invert)").getStackForm(1L)); + 12007, "wettransformer.tier.07", "ZPM Voltage Power Transformer", 7).getStackForm(1L));//UV -> ZPM (Use Soft Mallet to invert) CustomItemList.WetTransformer_UHV_UV.set(new GT_MetaTileEntity_WetTransformer( - 12008, "wettransformer.tier.08", "Ultimate Power Transformer", 8, - "UHV -> UV (Use Soft Mallet to invert)").getStackForm(1L)); + 12008, "wettransformer.tier.08", "Ultimate Power Transformer", 8).getStackForm(1L));//UHV -> UV (Use Soft Mallet to invert) CustomItemList.WetTransformer_UEV_UHV.set(new GT_MetaTileEntity_WetTransformer( - 12009, "wettransformer.tier.09", "Highly Ultimate Power Transformer", 9, - "UEV -> UHV (Use Soft Mallet to invert)").getStackForm(1L)); + 12009, "wettransformer.tier.09", "Highly Ultimate Power Transformer", 9).getStackForm(1L));//UEV -> UHV (Use Soft Mallet to invert) CustomItemList.WetTransformer_UIV_UEV.set(new GT_MetaTileEntity_WetTransformer( - 12010, "wettransformer.tier.10", "Extremely Ultimate Power Transformer", 10, - "UIV -> UEV (Use Soft Mallet to invert)").getStackForm(1L)); + 12010, "wettransformer.tier.10", "Extremely Ultimate Power Transformer", 10).getStackForm(1L));//UIV -> UEV (Use Soft Mallet to invert) CustomItemList.WetTransformer_UMV_UIV.set(new GT_MetaTileEntity_WetTransformer( - 12011, "wettransformer.tier.11", "Insanely Ultimate Power Transformer", 11, - "UMV -> UIV (Use Soft Mallet to invert)").getStackForm(1L)); + 12011, "wettransformer.tier.11", "Insanely Ultimate Power Transformer", 11).getStackForm(1L));//UMV -> UIV (Use Soft Mallet to invert) CustomItemList.WetTransformer_UXV_UMV.set(new GT_MetaTileEntity_WetTransformer( - 12012, "wettransformer.tier.12", "Mega Ultimate Power Transformer", 12, - "UXV -> UMV (Use Soft Mallet to invert)").getStackForm(1L)); + 12012, "wettransformer.tier.12", "Mega Ultimate Power Transformer", 12).getStackForm(1L));//UXV -> UMV (Use Soft Mallet to invert) CustomItemList.WetTransformer_OPV_UXV.set(new GT_MetaTileEntity_WetTransformer( - 12013, "wettransformer.tier.13", "Extended Mega Ultimate Power Transformer", 13, - "OPV -> UXV (Use Soft Mallet to invert)").getStackForm(1L)); + 12013, "wettransformer.tier.13", "Extended Mega Ultimate Power Transformer", 13).getStackForm(1L));//OPV -> UXV (Use Soft Mallet to invert) CustomItemList.WetTransformer_MAXV_OPV.set(new GT_MetaTileEntity_WetTransformer( - 12014, "wettransformer.tier.14", "Overpowered Power Transformer", 14, - "MAX -> OPV (Use Soft Mallet to invert)").getStackForm(1L)); + 12014, "wettransformer.tier.14", "Overpowered Power Transformer", 14).getStackForm(1L));//MAX -> OPV (Use Soft Mallet to invert) try { MetaTileEntity temp; @@ -117,7 +103,7 @@ public class NoDreamCraftMachineLoader implements Runnable { } temp = new GT_MetaTileEntity_BasicHull( - 11230, "hull.tier.10", "UEV Machine Hull",10, + 11230, "hull.tier.10", "UEV Machine Hull", 10, imagination); Util.setTier(10, temp); if (GT_Values.GT.isClientSide()) { @@ -126,7 +112,7 @@ public class NoDreamCraftMachineLoader implements Runnable { CustomItemList.Hull_UEV.set(temp.getStackForm(1L)); temp = new GT_MetaTileEntity_BasicHull( - 11231, "hull.tier.11", "UIV Machine Hull",11, + 11231, "hull.tier.11", "UIV Machine Hull", 11, imagination); Util.setTier(11, temp); if (GT_Values.GT.isClientSide()) { @@ -135,7 +121,7 @@ public class NoDreamCraftMachineLoader implements Runnable { CustomItemList.Hull_UIV.set(temp.getStackForm(1L)); temp = new GT_MetaTileEntity_BasicHull( - 11232, "hull.tier.12", "UMV Machine Hull",12, + 11232, "hull.tier.12", "UMV Machine Hull", 12, imagination); Util.setTier(12, temp); if (GT_Values.GT.isClientSide()) { @@ -144,7 +130,7 @@ public class NoDreamCraftMachineLoader implements Runnable { CustomItemList.Hull_UMV.set(temp.getStackForm(1L)); temp = new GT_MetaTileEntity_BasicHull( - 11233, "hull.tier.13", "UXV Machine Hull",13, + 11233, "hull.tier.13", "UXV Machine Hull", 13, imagination); Util.setTier(13, temp); if (GT_Values.GT.isClientSide()) { @@ -153,7 +139,7 @@ public class NoDreamCraftMachineLoader implements Runnable { CustomItemList.Hull_UXV.set(temp.getStackForm(1L)); temp = new GT_MetaTileEntity_BasicHull( - 11234, "hull.tier.14", "OPV Machine Hull",14, + 11234, "hull.tier.14", "OPV Machine Hull", 14, imagination); Util.setTier(14, temp); if (GT_Values.GT.isClientSide()) { @@ -162,7 +148,7 @@ public class NoDreamCraftMachineLoader implements Runnable { CustomItemList.Hull_OPV.set(temp.getStackForm(1L)); temp = new GT_MetaTileEntity_BasicHull( - 11235, "hull.tier.15", "MAX Machine Hull",15, + 11235, "hull.tier.15", "MAX Machine Hull", 15, imagination); Util.setTier(15, temp); if (GT_Values.GT.isClientSide()) { @@ -170,51 +156,44 @@ public class NoDreamCraftMachineLoader implements Runnable { } CustomItemList.Hull_MAXV.set(temp.getStackForm(1L)); - - temp = new GT_MetaTileEntity_Transformer( - 11220, "transformer.tier.09", "Highly Ultimate Transformer", 9, - "UEV -> UHV (Use Soft Mallet to invert)"); + temp = new GT_MetaTileEntity_TT_Transformer( + 11220, "tt.transformer.tier.09", "Highly Ultimate Transformer", 9);//UEV -> UHV (Use Soft Mallet to invert) CustomItemList.Transformer_UEV_UHV.set(temp.getStackForm(1L)); - temp = new GT_MetaTileEntity_Transformer( - 11221, "transformer.tier.10", "Extremely Ultimate Transformer", 10, - "UIV -> UEV (Use Soft Mallet to invert)"); + temp = new GT_MetaTileEntity_TT_Transformer( + 11221, "tt.transformer.tier.10", "Extremely Ultimate Transformer", 10);//UIV -> UEV (Use Soft Mallet to invert) Util.setTier(10, temp); if (GT_Values.GT.isClientSide()) { field.set(temp, method.invoke(temp, iTexture)); } CustomItemList.Transformer_UIV_UEV.set(temp.getStackForm(1L)); - temp = new GT_MetaTileEntity_Transformer( - 11222, "transformer.tier.11", "Insanely Ultimate Transformer", 11, - "UMV -> UIV (Use Soft Mallet to invert)"); + temp = new GT_MetaTileEntity_TT_Transformer( + 11222, "tt.transformer.tier.11", "Insanely Ultimate Transformer", 11);//UMV -> UIV (Use Soft Mallet to invert) Util.setTier(11, temp); if (GT_Values.GT.isClientSide()) { field.set(temp, method.invoke(temp, iTexture)); } CustomItemList.Transformer_UMV_UIV.set(temp.getStackForm(1L)); - temp = new GT_MetaTileEntity_Transformer( - 11223, "transformer.tier.12", "Mega Ultimate Transformer", 12, - "UXV -> UMV (Use Soft Mallet to invert)"); + temp = new GT_MetaTileEntity_TT_Transformer( + 11223, "tt.transformer.tier.12", "Mega Ultimate Transformer", 12);//UXV -> UMV (Use Soft Mallet to invert) Util.setTier(12, temp); if (GT_Values.GT.isClientSide()) { field.set(temp, method.invoke(temp, iTexture)); } CustomItemList.Transformer_UXV_UMV.set(temp.getStackForm(1L)); - temp = new GT_MetaTileEntity_Transformer( - 11224, "transformer.tier.13", "Extended Mega Ultimate Transformer", 13, - "OPV -> UXV (Use Soft Mallet to invert)"); + temp = new GT_MetaTileEntity_TT_Transformer( + 11224, "tt.transformer.tier.13", "Extended Mega Ultimate Transformer", 13);//OPV -> UXV (Use Soft Mallet to invert) Util.setTier(13, temp); if (GT_Values.GT.isClientSide()) { field.set(temp, method.invoke(temp, iTexture)); } CustomItemList.Transformer_OPV_UXV.set(temp.getStackForm(1L)); - temp = new GT_MetaTileEntity_Transformer( - 11225, "transformer.tier.14", "Overpowered Transformer", 14, - "MAX -> OPV (Use Soft Mallet to invert)"); + temp = new GT_MetaTileEntity_TT_Transformer( + 11225, "tt.transformer.tier.14", "Overpowered Transformer", 14);//MAX -> OPV (Use Soft Mallet to invert) Util.setTier(14, temp); if (GT_Values.GT.isClientSide()) { field.set(temp, method.invoke(temp, iTexture)); @@ -228,12 +207,14 @@ public class NoDreamCraftMachineLoader implements Runnable { temp = constructor.newInstance( 11989, "transformer.ha.tier.09", "Highly Ultimate Hi-Amp Transformer", 9, - "UEV -> UHV (Use Soft Mallet to invert)"); + //UEV -> UHV (Use Soft Mallet to invert + translateToLocal("gt.blockmachines.transformer.ha.tier.09.desc")); CustomItemList.Transformer_HA_UEV_UHV.set(temp.getStackForm(1)); temp = constructor.newInstance( 11910, "transformer.ha.tier.10", "Extremely Ultimate Hi-Amp Transformer", 10, - "UIV -> UEV (Use Soft Mallet to invert)"); + //UIV -> UEV (Use Soft Mallet to invert) + translateToLocal("gt.blockmachines.transformer.ha.tier.10.desc")); Util.setTier(10, temp); if (GT_Values.GT.isClientSide()) { field.set(temp, method.invoke(temp, iTexture)); @@ -242,7 +223,8 @@ public class NoDreamCraftMachineLoader implements Runnable { temp = constructor.newInstance( 11911, "transformer.ha.tier.11", "Insanely Ultimate Hi-Amp Transformer", 11, - "UMV -> UIV (Use Soft Mallet to invert)"); + //UMV -> UIV (Use Soft Mallet to invert) + translateToLocal("gt.blockmachines.transformer.ha.tier.11.desc")); Util.setTier(11, temp); if (GT_Values.GT.isClientSide()) { field.set(temp, method.invoke(temp, iTexture)); @@ -251,7 +233,8 @@ public class NoDreamCraftMachineLoader implements Runnable { temp = constructor.newInstance( 11912, "transformer.ha.tier.12", "Mega Ultimate Hi-Amp Transformer", 12, - "UXV -> UMV (Use Soft Mallet to invert)"); + //UXV -> UMV (Use Soft Mallet to invert) + translateToLocal("gt.blockmachines.transformer.ha.tier.12.desc")); Util.setTier(12, temp); if (GT_Values.GT.isClientSide()) { field.set(temp, method.invoke(temp, iTexture)); @@ -260,7 +243,8 @@ public class NoDreamCraftMachineLoader implements Runnable { temp = constructor.newInstance( 11913, "transformer.ha.tier.13", "Extended Mega Ultimate Hi-Amp Transformer", 13, - "OPV -> UXV (Use Soft Mallet to invert)"); + //OPV -> UXV (Use Soft Mallet to invert) + translateToLocal("gt.blockmachines.transformer.ha.tier.13.desc")); Util.setTier(13, temp); if (GT_Values.GT.isClientSide()) { field.set(temp, method.invoke(temp, iTexture)); @@ -269,7 +253,8 @@ public class NoDreamCraftMachineLoader implements Runnable { temp = constructor.newInstance( 11914, "transformer.ha.tier.14", "Overpowered Hi-Amp Transformer", 14, - "MAX -> OPV (Use Soft Mallet to invert)"); + //MAX -> OPV (Use Soft Mallet to invert) + translateToLocal("gt.blockmachines.transformer.ha.tier.14.desc")); Util.setTier(14, temp); if (GT_Values.GT.isClientSide()) { field.set(temp, method.invoke(temp, iTexture)); @@ -280,4 +265,4 @@ public class NoDreamCraftMachineLoader implements Runnable { e.printStackTrace(); } } -} +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/compatibility/openComputers/AvrArchitecture.java b/src/main/java/com/github/technus/tectech/compatibility/openComputers/AvrArchitecture.java new file mode 100644 index 0000000000..fcbb65d609 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/compatibility/openComputers/AvrArchitecture.java @@ -0,0 +1,267 @@ +package com.github.technus.tectech.compatibility.openComputers; + +import com.github.technus.avrClone.AvrCore; +import com.github.technus.avrClone.instructions.ExecutionEvent; +import com.github.technus.avrClone.instructions.InstructionRegistry; +import com.github.technus.avrClone.instructions.exceptions.DebugEvent; +import com.github.technus.avrClone.instructions.exceptions.DelayEvent; +import com.github.technus.avrClone.memory.EepromMemory; +import com.github.technus.avrClone.memory.RemovableMemory; +import com.github.technus.avrClone.memory.program.ProgramMemory; +import com.github.technus.tectech.Converter; +import com.github.technus.tectech.TecTech; +import li.cil.oc.Settings; +import li.cil.oc.api.Driver; +import li.cil.oc.api.driver.Item; +import li.cil.oc.api.driver.item.Memory; +import li.cil.oc.api.machine.Architecture; +import li.cil.oc.api.machine.ExecutionResult; +import li.cil.oc.api.machine.Machine; +import li.cil.oc.api.machine.Signal; +import li.cil.oc.common.SaveHandler; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import org.apache.commons.io.IOUtils; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.zip.GZIPInputStream; +import java.util.zip.GZIPOutputStream; + +@Architecture.Name("AVR 32Bit Clone") +@Architecture.NoMemoryRequirements +public class AvrArchitecture implements Architecture { + private final Machine machine; + private AvrCore core; + private boolean debugRun; + private int delay; + private int[] tempData; + private int memSize; + + public AvrArchitecture(Machine machine) { + this.machine = machine; + } + + @Override + public boolean isInitialized() { + return core!=null && core.checkValid(); + } + + @Override + public boolean recomputeMemory(Iterable<ItemStack> components) { + computeMemory(components); + return true; + } + + private void computeMemory(Iterable<ItemStack> components) { + int memory = 0; + for (ItemStack component : components) { + Item driver = Driver.driverFor(component); + if (driver instanceof Memory) { + Memory memoryDriver = (Memory) driver; + memory += memoryDriver.amount(component) * 256;//in integers + }// else if (driver instanceof DriverEEPROM$) { + + //} + } + memory = Math.min(Math.max(memory, 0), Settings.get().maxTotalRam()); + if(memory!=memSize){ + + } + } + + @Override + public boolean initialize() { + core=new AvrCore(); + + computeMemory(this.machine.host().internalComponents()); + + if(isInitialized()) { + machine.beep("."); + return true; + } + return false; + } + + @Override + public void close() { + core=null; + tempData=null; + delay=0; + } + + @Override + public void runSynchronized() { + core.cycle(); + } + + @Override + public ExecutionResult runThreaded(boolean isSynchronizedReturn) { + if (core.awoken) { + delay=0; + for (int load=0; load < 512;) { + load+=core.getInstruction().getCost(core); + ExecutionEvent executionEvent = core.cpuCycleForce(); + if (executionEvent != null) { + if (executionEvent.throwable instanceof DelayEvent) { + delay = executionEvent.data[0]; + break; + } else if (executionEvent.throwable instanceof DebugEvent) { + if(debugRun) { + //aBaseMetaTileEntity.setActive(false); + break; + } + } + } + } + }else if(delay>0){ + delay--; + if(delay==0){ + core.awoken=true; + } + } + return null; + } + + @Override + public void onSignal() { + Signal signal=machine.popSignal(); + + core.interruptsHandle(); + } + + @Override + public void onConnect() { + //init network components, in case init was called from load logic (pre first tick?) + } + + @Override + public void load(NBTTagCompound avr) { + debugRun = avr.getBoolean("debugRun"); + delay = avr.getInteger("delay"); + core.active = avr.getBoolean("active"); + core.awoken = (avr.getBoolean("awoken")); + core.programCounter = avr.getInteger("programCounter"); + InstructionRegistry registry = + InstructionRegistry.REGISTRIES. + get(avr.getString("instructionRegistry")); + if (registry != null) { + byte[] instructions = SaveHandler.load(avr, this.machine.node().address() + "_instructionsMemory"); + byte[] param0 = SaveHandler.load(avr, this.machine.node().address() + "_param0Memory"); + byte[] param1 = SaveHandler.load(avr, this.machine.node().address() + "_param1Memory"); + if (instructions != null && param0 != null && param1 != null && + instructions.length > 0 && param0.length > 0 && param1.length > 0) { + int[] instr = null, par0 = null, par1 = null; + try { + GZIPInputStream gzis = new GZIPInputStream(new ByteArrayInputStream(instructions)); + instr = Converter.readInts(IOUtils.toByteArray(gzis)); + IOUtils.closeQuietly(gzis); + } catch (IOException e) { + TecTech.LOGGER.error("Failed to decompress instructions memory from disk."); + e.printStackTrace(); + } + try { + GZIPInputStream gzis = new GZIPInputStream(new ByteArrayInputStream(param0)); + par0 = Converter.readInts(IOUtils.toByteArray(gzis)); + IOUtils.closeQuietly(gzis); + } catch (IOException e) { + TecTech.LOGGER.error("Failed to decompress param0 memory from disk."); + e.printStackTrace(); + } + try { + GZIPInputStream gzis = new GZIPInputStream(new ByteArrayInputStream(param1)); + par1 = Converter.readInts(IOUtils.toByteArray(gzis)); + IOUtils.closeQuietly(gzis); + } catch (IOException e) { + TecTech.LOGGER.error("Failed to decompress param1 memory from disk."); + e.printStackTrace(); + } + if (instr != null && par0 != null && par1 != null && + instr.length==par0.length && instr.length==par1.length) { + core.setProgramMemory(new ProgramMemory( + registry, + avr.getBoolean("immersive"), + instr, + par0, + par1)); + } + } + } + if(avr.hasKey("eepromSize")){ + core.restoreEepromDefinition(EepromMemory.make(avr.getInteger("eepromSize"))); + } + byte[] data = SaveHandler.load(avr, this.machine.node().address() + "_dataMemory"); + if(data!=null && data.length > 0) { + try { + GZIPInputStream gzis = new GZIPInputStream(new ByteArrayInputStream(data)); + tempData = Converter.readInts(IOUtils.toByteArray(gzis)); + IOUtils.closeQuietly(gzis); + } catch (IOException e) { + TecTech.LOGGER.error("Failed to decompress data memory from disk."); + e.printStackTrace(); + } + } + core.checkValid(); + } + + @Override + public void save(NBTTagCompound avr) { + avr.setBoolean("debugRun",debugRun); + avr.setInteger("delay",delay); + avr.setBoolean("active",core.active); + avr.setBoolean("awoken",core.awoken); + avr.setInteger("programCounter",core.programCounter); + ProgramMemory programMemory=core.getProgramMemory(); + if(programMemory!=null){ + try { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + GZIPOutputStream gzos = new GZIPOutputStream(baos); + gzos.write(Converter.writeInts(programMemory.instructions)); + gzos.close(); + SaveHandler.scheduleSave(machine.host(), avr, machine.node().address() + "_instructionsMemory", baos.toByteArray()); + } catch (IOException e) { + TecTech.LOGGER.error("Failed to compress instructions memory to disk"); + e.printStackTrace(); + } + try { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + GZIPOutputStream gzos = new GZIPOutputStream(baos); + gzos.write(Converter.writeInts(programMemory.param0)); + gzos.close(); + SaveHandler.scheduleSave(machine.host(), avr, machine.node().address() + "_param0Memory", baos.toByteArray()); + } catch (IOException e) { + TecTech.LOGGER.error("Failed to compress param0 memory to disk"); + e.printStackTrace(); + } + try { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + GZIPOutputStream gzos = new GZIPOutputStream(baos); + gzos.write(Converter.writeInts(programMemory.param1)); + gzos.close(); + SaveHandler.scheduleSave(machine.host(), avr, machine.node().address() + "_param1Memory", baos.toByteArray()); + } catch (IOException e) { + TecTech.LOGGER.error("Failed to compress param1 memory to disk"); + e.printStackTrace(); + } + avr.setBoolean("immersive",programMemory.immersiveOperands); + avr.setString("instructionRegistry",programMemory.registry.toString()); + } + RemovableMemory<EepromMemory> eeprom=core.getEepromMemory(); + if(eeprom!=null){ + avr.setInteger("eepromSize",eeprom.getDefinition().getSize()); + } + if(core.dataMemory!=null) { + try { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + GZIPOutputStream gzos = new GZIPOutputStream(baos); + gzos.write(Converter.writeInts(core.dataMemory)); + gzos.close(); + SaveHandler.scheduleSave(machine.host(), avr, machine.node().address() + "_dataMemory", baos.toByteArray()); + } catch (IOException e) { + TecTech.LOGGER.error("Failed to compress data memory to disk"); + e.printStackTrace(); + } + } + } +} diff --git a/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/TT_turret_loader.java b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/TT_turret_loader.java index d03f1bd1c6..d66232671a 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/TT_turret_loader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/TT_turret_loader.java @@ -14,7 +14,7 @@ import net.minecraftforge.client.MinecraftForgeClient; public class TT_turret_loader implements Runnable { @Override public void run() { - TurretHeadRenderEM turretHeadRenderEM=new TurretHeadRenderEM(); + TurretHeadRenderEM turretHeadRenderEM = new TurretHeadRenderEM(); ClientRegistry.bindTileEntitySpecialRenderer(TileTurretHeadEM.class, turretHeadRenderEM); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(TurretHeadEM.INSTANCE), new TurretHeadItemRenderEM(turretHeadRenderEM, new TileTurretHeadEM())); diff --git a/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/blocks/turretbases/TurretBaseItemEM.java b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/blocks/turretbases/TurretBaseItemEM.java index af0be0e1f5..97fc8132a2 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/blocks/turretbases/TurretBaseItemEM.java +++ b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/blocks/turretbases/TurretBaseItemEM.java @@ -6,10 +6,11 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; import java.util.List; +import static net.minecraft.util.StatCollector.translateToLocal; + /** * Created by Tec on 28/07/2017. */ @@ -22,13 +23,14 @@ public class TurretBaseItemEM extends ItemBlock { public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List list, boolean p_77624_4_) { list.add(CommonValues.TEC_MARK_EM); list.add(""); - list.add(EnumChatFormatting.AQUA + "--" + StatCollector.translateToLocal("tooptip.energy.label") + "--"); - list.add(StatCollector.translateToLocal("tooltip.rf.max") + ": " + EnumChatFormatting.WHITE + 1000000000); - list.add(StatCollector.translateToLocal("tooltip.rf.io") + ": " + EnumChatFormatting.WHITE + 50000); + list.add(EnumChatFormatting.AQUA + "--" + translateToLocal("tooptip.energy.label") + "--"); + list.add(translateToLocal("tooltip.rf.max") + ": " + EnumChatFormatting.WHITE + 1000000000); + list.add(translateToLocal("tooltip.rf.io") + ": " + EnumChatFormatting.WHITE + 50000); list.add(""); - list.add(EnumChatFormatting.GREEN + "--" + StatCollector.translateToLocal("tooltip.extras.label") + "--"); - list.add(StatCollector.translateToLocal("tooltip.extras.addons.0")); + list.add(EnumChatFormatting.GREEN + "--" + translateToLocal("tooltip.extras.label") + "--"); + list.add(translateToLocal("tooltip.extras.addons.2")); + list.add(translateToLocal("tooltip.extras.upgrade.2")); list.add(""); - list.add(EnumChatFormatting.DARK_GRAY + StatCollector.translateToLocal("flavour.base.0")); + list.add(EnumChatFormatting.DARK_GRAY + translateToLocal("flavour.base.0")); } -} +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/blocks/turretheads/TurretHeadItemEM.java b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/blocks/turretheads/TurretHeadItemEM.java index 8aa598c440..422b931df5 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/blocks/turretheads/TurretHeadItemEM.java +++ b/src/main/java/com/github/technus/tectech/compatibility/openmodularturrets/blocks/turretheads/TurretHeadItemEM.java @@ -5,13 +5,13 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; import openmodularturrets.handler.ConfigHandler; import java.text.DecimalFormat; import java.util.List; import static com.github.technus.tectech.CommonValues.TEC_MARK_EM; +import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by Tec on 28/07/2017. @@ -27,19 +27,19 @@ public class TurretHeadItemEM extends ItemBlock { public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List list, boolean p_77624_4_) { list.add(TEC_MARK_EM); list.add(""); - list.add(EnumChatFormatting.GOLD + "--" + StatCollector.translateToLocal("tooltip.info") + "--"); - list.add(StatCollector.translateToLocal("tooltip.tier") + ": " + EnumChatFormatting.WHITE + '5'); - list.add(StatCollector.translateToLocal("tooltip.range") + ": " + EnumChatFormatting.WHITE + ConfigHandler.getLaserTurretSettings().getRange()); - list.add(StatCollector.translateToLocal("tooltip.accuracy") + ": " + EnumChatFormatting.WHITE + StatCollector.translateToLocal("turret.accuracy.high")); - list.add(StatCollector.translateToLocal("tooltip.ammo") + ": " + EnumChatFormatting.WHITE + StatCollector.translateToLocal("turret.ammo.4")); - list.add(StatCollector.translateToLocal("tooltip.tierRequired") + ": " + EnumChatFormatting.WHITE + StatCollector.translateToLocal("base.tier.5")); + list.add(EnumChatFormatting.GOLD + "--" + translateToLocal("tooltip.info") + "--"); + list.add(translateToLocal("tooltip.tier") + ": " + EnumChatFormatting.WHITE + '5'); + list.add(translateToLocal("tooltip.range") + ": " + EnumChatFormatting.WHITE + ConfigHandler.getLaserTurretSettings().getRange()); + list.add(translateToLocal("tooltip.accuracy") + ": " + EnumChatFormatting.WHITE + translateToLocal("turret.accuracy.high")); + list.add(translateToLocal("tooltip.ammo") + ": " + EnumChatFormatting.WHITE + translateToLocal("turret.ammo.4")); + list.add(translateToLocal("tooltip.tierRequired") + ": " + EnumChatFormatting.WHITE + translateToLocal("base.tier.5")); list.add(""); - list.add(EnumChatFormatting.DARK_PURPLE + "--" + StatCollector.translateToLocal("tooltip.damage.label") + "--"); - list.add(StatCollector.translateToLocal("tooltip.damage.stat") + ": " + EnumChatFormatting.WHITE + (float)ConfigHandler.getLaserTurretSettings().getDamage() / 2.0F + ' ' + StatCollector.translateToLocal("tooltip.health")); - list.add(StatCollector.translateToLocal("tooltip.aoe") + ": " + EnumChatFormatting.WHITE + '0'); - list.add(StatCollector.translateToLocal("tooltip.firerate") + ": " + EnumChatFormatting.WHITE + df.format((double)(20.0F / (float)ConfigHandler.getLaserTurretSettings().getFireRate()))); - list.add(StatCollector.translateToLocal("tooltip.energy.stat") + ": " + EnumChatFormatting.WHITE + ConfigHandler.getLaserTurretSettings().getPowerUsage() + " RF"); + list.add(EnumChatFormatting.DARK_PURPLE + "--" + translateToLocal("tooltip.damage.label") + "--"); + list.add(translateToLocal("tooltip.damage.stat") + ": " + EnumChatFormatting.WHITE + (float)ConfigHandler.getLaserTurretSettings().getDamage() / 2.0F + ' ' + translateToLocal("tooltip.health")); + list.add(translateToLocal("tooltip.aoe") + ": " + EnumChatFormatting.WHITE + '0'); + list.add(translateToLocal("tooltip.firerate") + ": " + EnumChatFormatting.WHITE + df.format((double)(20.0F / (float)ConfigHandler.getLaserTurretSettings().getFireRate()))); + list.add(translateToLocal("tooltip.energy.stat") + ": " + EnumChatFormatting.WHITE + ConfigHandler.getLaserTurretSettings().getPowerUsage() + " RF"); list.add(""); - list.add(EnumChatFormatting.DARK_GRAY + StatCollector.translateToLocal("flavour.turret.4")); + list.add(EnumChatFormatting.DARK_GRAY + translateToLocal("flavour.turret.4")); } } diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/dComplexAspectDefinition.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/dComplexAspectDefinition.java index 059ac44da3..8961215354 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/dComplexAspectDefinition.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/dComplexAspectDefinition.java @@ -19,6 +19,7 @@ import java.util.ArrayList; import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDecay.noDecay; import static com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_scanner.*; +import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by Tec on 06.05.2017. @@ -58,12 +59,12 @@ public final class dComplexAspectDefinition extends cElementalDefinition impleme throw new tElementalException("Hadron Definition error"); } aspectStacks = aspects; - float mass=0; - for(cElementalDefinitionStack stack:aspects.values()){ - mass+=stack.getMass(); + float mass = 0; + for (cElementalDefinitionStack stack : aspects.values()) { + mass += stack.getMass(); } - this.mass=mass; - hash=super.hashCode(); + this.mass = mass; + hash = super.hashCode(); } //public but u can just try{}catch(){} the constructor it still calls this method @@ -75,18 +76,18 @@ public final class dComplexAspectDefinition extends cElementalDefinition impleme } amount += aspects.amount; } - return amount==2; + return amount == 2; } @Override public String getName() { - String name= AspectDefinitionCompat.aspectDefinitionCompat.getAspectTag(this); - if(name!=null){ - name=name.substring(0,1).toUpperCase()+name.substring(1); - }else{ - name=getSymbol(); + String name = AspectDefinitionCompat.aspectDefinitionCompat.getAspectTag(this); + if (name != null) { + name = name.substring(0, 1).toUpperCase() + name.substring(1); + } else { + name = getSymbol(); } - return "Aspect: "+name; + return translateToLocal("tt.keyword.Aspect") + ": " + name; } @Override @@ -195,7 +196,7 @@ public final class dComplexAspectDefinition extends cElementalDefinition impleme @Override public float getEnergyDiffBetweenStates(long currentEnergyLevel, long newEnergyLevel) { - return iElementalDefinition.DEFAULT_ENERGY_REQUIREMENT *(newEnergyLevel-currentEnergyLevel); + return iElementalDefinition.DEFAULT_ENERGY_REQUIREMENT * (newEnergyLevel - currentEnergyLevel); } @Override @@ -260,13 +261,13 @@ public final class dComplexAspectDefinition extends cElementalDefinition impleme public static void run() { try { - cElementalDefinition.addCreatorFromNBT(nbtType, dComplexAspectDefinition.class.getMethod("fromNBT", NBTTagCompound.class),(byte)-96); + cElementalDefinition.addCreatorFromNBT(nbtType, dComplexAspectDefinition.class.getMethod("fromNBT", NBTTagCompound.class), (byte) -96); } catch (Exception e) { if (DEBUG_MODE) { e.printStackTrace(); } } - if(DEBUG_MODE) { + if (DEBUG_MODE) { TecTech.LOGGER.info("Registered Elemental Matter Class: ComplexAspect " + nbtType + ' ' + -96); } } @@ -276,7 +277,7 @@ public final class dComplexAspectDefinition extends cElementalDefinition impleme return -96; } - public static byte getClassTypeStatic(){ + public static byte getClassTypeStatic() { return -96; } @@ -287,32 +288,32 @@ public final class dComplexAspectDefinition extends cElementalDefinition impleme @Override public void addScanShortSymbols(ArrayList<String> lines, int capabilities, long energyLevel) { - if(Util.areBitsSet(SCAN_GET_NOMENCLATURE|SCAN_GET_CHARGE|SCAN_GET_MASS, capabilities)) { + if (Util.areBitsSet(SCAN_GET_NOMENCLATURE | SCAN_GET_CHARGE | SCAN_GET_MASS, capabilities)) { lines.add(getShortSymbol()); } } @Override public void addScanResults(ArrayList<String> lines, int capabilities, long energyLevel) { - if(Util.areBitsSet(SCAN_GET_CLASS_TYPE, capabilities)) { - lines.add("CLASS = " + nbtType + ' ' + getClassType()); + if (Util.areBitsSet(SCAN_GET_CLASS_TYPE, capabilities)) { + lines.add(translateToLocal("tt.keyword.CLASS") + " = " + nbtType + ' ' + getClassType()); } - if(Util.areBitsSet(SCAN_GET_NOMENCLATURE|SCAN_GET_CHARGE|SCAN_GET_MASS, capabilities)) { - lines.add("NAME = "+getName()); + if (Util.areBitsSet(SCAN_GET_NOMENCLATURE | SCAN_GET_CHARGE | SCAN_GET_MASS, capabilities)) { + lines.add(translateToLocal("tt.keyword.NAME") + " = " + getName()); //lines.add("SYMBOL = "+getSymbol()); } - if(Util.areBitsSet(SCAN_GET_CHARGE,capabilities)) { - lines.add("CHARGE = " + getCharge() / 3f + " e"); + if (Util.areBitsSet(SCAN_GET_CHARGE, capabilities)) { + lines.add(translateToLocal("tt.keyword.CHARGE") + " = " + getCharge() / 3f + " e"); } - if(Util.areBitsSet(SCAN_GET_COLOR,capabilities)) { - lines.add(getColor() < 0 ? "COLORLESS" : "CARRIES COLOR"); + if (Util.areBitsSet(SCAN_GET_COLOR, capabilities)) { + lines.add(getColor() < 0 ? translateToLocal("tt.keyword.COLORLESS") : translateToLocal("tt.keyphrase.CARRIES_COLOR")); } - if(Util.areBitsSet(SCAN_GET_MASS,capabilities)) { - lines.add("MASS = " + getMass() + " eV/c\u00b2"); + if (Util.areBitsSet(SCAN_GET_MASS, capabilities)) { + lines.add(translateToLocal("tt.keyword.MASS") + " = " + getMass() + " eV/c\u00b2"); } - if(Util.areBitsSet(SCAN_GET_TIMESPAN_INFO, capabilities)){ - lines.add("LIFE TIME = "+getRawTimeSpan(energyLevel)+ " s"); - lines.add(" "+"At current energy level"); + if (Util.areBitsSet(SCAN_GET_TIMESPAN_INFO, capabilities)) { + lines.add(translateToLocal("tt.keyphrase.LIFE_TIME") + " = " + getRawTimeSpan(energyLevel) + " s"); + lines.add(" " + translateToLocal("tt.keyphrase.At_current_energy_level")); } } } diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/ePrimalAspectDefinition.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/ePrimalAspectDefinition.java index 7ca125cd5e..bcb6e3f6fc 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/ePrimalAspectDefinition.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/elementalMatter/definitions/ePrimalAspectDefinition.java @@ -3,18 +3,19 @@ package com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.defi import com.github.technus.tectech.mechanics.elementalMatter.core.templates.cElementalPrimitive; import static com.github.technus.tectech.mechanics.elementalMatter.core.cElementalDecay.noDecay; +import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by Tec on 06.05.2017. */ public final class ePrimalAspectDefinition extends cElementalPrimitive implements iElementalAspect { public static final ePrimalAspectDefinition - magic_air = new ePrimalAspectDefinition("Air", "a`", 1e1F, 35), - magic_earth = new ePrimalAspectDefinition("Earth", "e`", 1e9F, 34), - magic_fire = new ePrimalAspectDefinition("Fire", "f`", 1e3F, 33), - magic_water = new ePrimalAspectDefinition("Water", "w`", 1e7F, 32), - magic_order = new ePrimalAspectDefinition("Order", "o`", 1e5F, 30), - magic_entropy = new ePrimalAspectDefinition("Entropy", "e`", 1e5F, 31); + magic_air = new ePrimalAspectDefinition(translateToLocal("tt.keyword.Air"), "a`", 1e1F, 35), + magic_earth = new ePrimalAspectDefinition(translateToLocal("tt.keyword.Earth"), "e`", 1e9F, 34), + magic_fire = new ePrimalAspectDefinition(translateToLocal("tt.keyword.Fire"), "f`", 1e3F, 33), + magic_water = new ePrimalAspectDefinition(translateToLocal("tt.keyword.Water"), "w`", 1e7F, 32), + magic_order = new ePrimalAspectDefinition(translateToLocal("tt.keyword.Order"), "o`", 1e5F, 30), + magic_entropy = new ePrimalAspectDefinition(translateToLocal("tt.keyword.Entropy"), "e`", 1e5F, 31); private ePrimalAspectDefinition(String name, String symbol, float mass, int ID) { super(name, symbol, 0, mass, 0, -1, ID); @@ -31,7 +32,7 @@ public final class ePrimalAspectDefinition extends cElementalPrimitive implement @Override public String getName() { - return "Primal: " + name; + return translateToLocal("tt.keyword.Primal") + ": " + name; } @Override @@ -43,5 +44,4 @@ public final class ePrimalAspectDefinition extends cElementalPrimitive implement public boolean isTimeSpanHalfLife() { return false; } -} - +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java index 3d64ceee62..4074f2d6db 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaDequantizer.java @@ -29,23 +29,23 @@ import static com.github.technus.tectech.compatibility.thaumcraft.thing.metaTile import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; import static gregtech.api.enums.GT_Values.E; +import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by danie_000 on 17.12.2016. */ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { - - //region Structure + //region structure //use multi A energy inputs, use less power the longer it runs private static final String[][] shape = new String[][]{ - {" "," . "," ",}, - {"0A0",E,"0A0",}, - {"121","232","121",}, - {"\"\"\"","\"2\"","\"\"\"",}, - {"202","0!0","202",}, + {" ", " . ", " ",}, + {"0A0", E, "0A0",}, + {"121", "232", "121",}, + {"\"\"\"", "\"2\"", "\"\"\"",}, + {"202", "0!0", "202",}, }; private static final Block[] blockType = new Block[]{QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; - private static final byte[] blockMeta = new byte[]{0,0,4,8}; + private static final byte[] blockMeta = new byte[]{0, 0, 4, 8}; private final IHatchAdder[] addingMethods = new IHatchAdder[]{ this::addClassicToMachineList, this::addElementalInputToMachineList, @@ -54,11 +54,11 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_ private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4, 4}; private static final String[] description = new String[]{ - EnumChatFormatting.AQUA+"Hint Details:", - "1 - Classic Hatches or High Power Casing", - "2 - Elemental Input Hatch", - "3 - Elemental Overflow Hatches or Elemental Casing", - "General - Some sort of Essentia Storage", + EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", + translateToLocal("gt.blockmachines.multimachine.em.emtoessentia.hint.0"),//1 - Classic Hatches or High Power Casing + translateToLocal("gt.blockmachines.multimachine.em.emtoessentia.hint.1"),//2 - Elemental Input Hatch + translateToLocal("gt.blockmachines.multimachine.em.emtoessentia.hint.2"),//3 - Elemental Overflow Hatches or Elemental Casing + translateToLocal("gt.blockmachines.multimachine.em.emtoessentia.hint.3"),//General - Some sort of Essentia Storage }; //endregion @@ -76,58 +76,27 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_ } @Override - @SideOnly(Side.CLIENT) - protected ResourceLocation getActivitySound(){ - return GT_MetaTileEntity_EM_quantizer.activitySound; - } - - @Override public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { return essentiaContainerCompat.check(this) && structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 1, 0); } @Override - public void construct(int stackSize, boolean hintsOnly) { - IGregTechTileEntity iGregTechTileEntity=getBaseMetaTileEntity(); - int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX; - int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY; - int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ; - if(hintsOnly){ - TecTech.proxy.hint_particle(iGregTechTileEntity.getWorld(), - iGregTechTileEntity.getXCoord()+xDir, - iGregTechTileEntity.getYCoord()+yDir, - iGregTechTileEntity.getZCoord()+zDir, - TT_Container_Casings.sHintCasingsTT,12); - } else{ - if(iGregTechTileEntity.getBlockOffset(xDir,0,zDir).getMaterial() == Material.air) { - iGregTechTileEntity.getWorld().setBlock(iGregTechTileEntity.getXCoord() + xDir, iGregTechTileEntity.getYCoord() + yDir, iGregTechTileEntity.getZCoord() + zDir, TT_Container_Casings.sHintCasingsTT, 12, 2); - } - } - StructureBuilderExtreme(shape, blockType, blockMeta,1, 1, 0, iGregTechTileEntity,this,hintsOnly); - } - - @Override - public String[] getStructureDescription(int stackSize) { - return description; - } - - @Override public boolean checkRecipe_EM(ItemStack itemStack) { TileEntity container = essentiaContainerCompat.getContainer(this); - if (eInputHatches.size() < 1 || container ==null) { + if (eInputHatches.size() < 1 || container == null) { stopMachine(); return false; } - cElementalInstanceStackMap inputHatchContainer=eInputHatches.get(0).getContainerHandler(); - if(inputHatchContainer.hasStacks()){ + cElementalInstanceStackMap inputHatchContainer = eInputHatches.get(0).getContainerHandler(); + if (inputHatchContainer.hasStacks()) { cElementalInstanceStack stack = inputHatchContainer.getFirst(); - inputHatchContainer.removeAmount(false,new cElementalInstanceStack(stack.definition,1)); - if(!essentiaContainerCompat.putElementalInstanceStack(container,stack)) { + inputHatchContainer.removeAmount(false, new cElementalInstanceStack(stack.definition, 1)); + if (!essentiaContainerCompat.putElementalInstanceStack(container, stack)) { cleanStackEM_EM(stack); } mMaxProgresstime = 20; mEfficiencyIncrease = 10000; - eAmpereFlow=1; + eAmpereFlow = 1; if (stack.definition instanceof ePrimalAspectDefinition) { mEUt = (int) -V[8]; } else { @@ -142,8 +111,39 @@ public class GT_MetaTileEntity_EM_essentiaDequantizer extends GT_MetaTileEntity_ public String[] getDescription() { return new String[]{ CommonValues.TEC_MARK_EM, - "Transform quantum form back to...", - EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "regular one, but why?" + translateToLocal("gt.blockmachines.multimachine.em.emtoessentia.desc.0"),//Transform quantum form back to... + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.em.emtoessentia.desc.1")//regular one, but why? }; } -} + + @Override + @SideOnly(Side.CLIENT) + protected ResourceLocation getActivitySound() { + return GT_MetaTileEntity_EM_quantizer.activitySound; + } + + @Override + public void construct(int stackSize, boolean hintsOnly) { + IGregTechTileEntity iGregTechTileEntity = getBaseMetaTileEntity(); + int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX; + int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY; + int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ; + if (hintsOnly) { + TecTech.proxy.hint_particle(iGregTechTileEntity.getWorld(), + iGregTechTileEntity.getXCoord() + xDir, + iGregTechTileEntity.getYCoord() + yDir, + iGregTechTileEntity.getZCoord() + zDir, + TT_Container_Casings.sHintCasingsTT, 12); + } else { + if (iGregTechTileEntity.getBlockOffset(xDir, 0, zDir).getMaterial() == Material.air) { + iGregTechTileEntity.getWorld().setBlock(iGregTechTileEntity.getXCoord() + xDir, iGregTechTileEntity.getYCoord() + yDir, iGregTechTileEntity.getZCoord() + zDir, TT_Container_Casings.sHintCasingsTT, 12, 2); + } + } + StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, iGregTechTileEntity, this, hintsOnly); + } + + @Override + public String[] getStructureDescription(int stackSize) { + return description; + } +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java index 9bd16c959b..0caf4be6d6 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_essentiaQuantizer.java @@ -29,36 +29,36 @@ import static com.github.technus.tectech.compatibility.thaumcraft.thing.metaTile import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; import static gregtech.api.enums.GT_Values.E; +import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by danie_000 on 17.12.2016. */ public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { - - //region Structure + //region structure //use multi A energy inputs, use less power the longer it runs private static final String[][] shape = new String[][]{ - {" "," . "," ",}, - {"0A0",E,"0A0",}, - {"121","232","121",}, - {"\"\"\"","\"1\"","\"\"\"",}, - {"010","1!1","010",}, + {" ", " . ", " ",}, + {"0A0", E, "0A0",}, + {"121", "232", "121",}, + {"\"\"\"", "\"1\"", "\"\"\"",}, + {"010", "1!1", "010",}, }; private static final Block[] blockType = new Block[]{QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; - private static final byte[] blockMeta = new byte[]{0,4,0,8}; + private static final byte[] blockMeta = new byte[]{0, 4, 0, 8}; private final IHatchAdder[] addingMethods = new IHatchAdder[]{ this::addClassicToMachineList, this::addElementalOutputToMachineList, this::addElementalMufflerToMachineList}; - private static final short[] casingTextures = new short[]{textureOffset, textureOffset+4, textureOffset + 4}; + private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4, 4}; private static final String[] description = new String[]{ - EnumChatFormatting.AQUA+"Hint Details:", - "1 - Classic Hatches or High Power Casing", - "2 - Elemental Output Hatch", - "3 - Elemental Overflow Hatches or Elemental Casing", - "General - Some sort of Essentia Storage", + EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", + translateToLocal("gt.blockmachines.multimachine.em.essentiatoem.hint.0"),//1 - Classic Hatches or High Power Casing + translateToLocal("gt.blockmachines.multimachine.em.essentiatoem.hint.1"),//2 - Elemental Output Hatch + translateToLocal("gt.blockmachines.multimachine.em.essentiatoem.hint.2"),//3 - Elemental Overflow Hatches or Elemental Casing + translateToLocal("gt.blockmachines.multimachine.em.essentiatoem.hint.3"),//General - Some sort of Essentia Storage }; //endregion @@ -71,12 +71,6 @@ public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_Mu } @Override - @SideOnly(Side.CLIENT) - protected ResourceLocation getActivitySound(){ - return GT_MetaTileEntity_EM_quantizer.activitySound; - } - - @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_EM_essentiaQuantizer(mName); } @@ -87,47 +81,13 @@ public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_Mu } @Override - public void construct(int stackSize, boolean hintsOnly) { - IGregTechTileEntity iGregTechTileEntity=getBaseMetaTileEntity(); - int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX; - int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY; - int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ; - if(hintsOnly){ - TecTech.proxy.hint_particle(iGregTechTileEntity.getWorld(), - iGregTechTileEntity.getXCoord()+xDir, - iGregTechTileEntity.getYCoord()+yDir, - iGregTechTileEntity.getZCoord()+zDir, - TT_Container_Casings.sHintCasingsTT,12); - } else{ - if(iGregTechTileEntity.getBlockOffset(xDir,0,zDir).getMaterial() == Material.air) { - iGregTechTileEntity.getWorld().setBlock(iGregTechTileEntity.getXCoord() + xDir, iGregTechTileEntity.getYCoord() + yDir, iGregTechTileEntity.getZCoord() + zDir, TT_Container_Casings.sHintCasingsTT, 12, 2); - } - } - StructureBuilderExtreme(shape, blockType, blockMeta,1, 1, 0, iGregTechTileEntity,this,hintsOnly); - } - - @Override - public String[] getStructureDescription(int stackSize) { - return description; - } - - @Override - public String[] getDescription() { - return new String[]{ - CommonValues.TEC_MARK_EM, - "Conveniently convert regular stuff into quantum form.", - EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "To make it more inconvenient." - }; - } - - @Override public boolean checkRecipe_EM(ItemStack itemStack) { TileEntity container = essentiaContainerCompat.getContainer(this); - cElementalInstanceStack newStack=essentiaContainerCompat.getFromContainer(container); - if(newStack!=null){ + cElementalInstanceStack newStack = essentiaContainerCompat.getFromContainer(container); + if (newStack != null) { mMaxProgresstime = 20; mEfficiencyIncrease = 10000; - eAmpereFlow=1; + eAmpereFlow = 1; outputEM = new cElementalInstanceStackMap[]{ new cElementalInstanceStackMap(newStack) }; @@ -148,6 +108,46 @@ public class GT_MetaTileEntity_EM_essentiaQuantizer extends GT_MetaTileEntity_Mu return; } eOutputHatches.get(0).getContainerHandler().putUnifyAll(outputEM[0]); - outputEM=null; + outputEM = null; + } + + @Override + public String[] getDescription() { + return new String[]{ + CommonValues.TEC_MARK_EM, + translateToLocal("gt.blockmachines.multimachine.em.essentiatoem.desc.0"),//Conveniently convert regular stuff into quantum form. + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.em.essentiatoem.desc.1")//To make it more inconvenient. + }; + } + + @Override + @SideOnly(Side.CLIENT) + protected ResourceLocation getActivitySound() { + return GT_MetaTileEntity_EM_quantizer.activitySound; + } + + @Override + public void construct(int stackSize, boolean hintsOnly) { + IGregTechTileEntity iGregTechTileEntity = getBaseMetaTileEntity(); + int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX; + int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY; + int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ; + if (hintsOnly) { + TecTech.proxy.hint_particle(iGregTechTileEntity.getWorld(), + iGregTechTileEntity.getXCoord() + xDir, + iGregTechTileEntity.getYCoord() + yDir, + iGregTechTileEntity.getZCoord() + zDir, + TT_Container_Casings.sHintCasingsTT, 12); + } else { + if (iGregTechTileEntity.getBlockOffset(xDir, 0, zDir).getMaterial() == Material.air) { + iGregTechTileEntity.getWorld().setBlock(iGregTechTileEntity.getXCoord() + xDir, iGregTechTileEntity.getYCoord() + yDir, iGregTechTileEntity.getZCoord() + zDir, TT_Container_Casings.sHintCasingsTT, 12, 2); + } + } + StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, iGregTechTileEntity, this, hintsOnly); + } + + @Override + public String[] getStructureDescription(int stackSize) { + return description; } -} +}
\ No newline at end of file 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..d7d23d7461 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; @@ -60,6 +61,7 @@ public final class MainLoader { } public static void preLoad(){ + creativeTabTecTech =new CreativeTabTecTech("TecTech"); //set expanded texture arrays for tiers try { @@ -70,7 +72,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 +94,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"); @@ -115,7 +121,7 @@ public final class MainLoader { } public static void postLoad() { - ProgressManager.ProgressBar progressBarPostLoad = ProgressManager.push("TecTech Post Loader", 6); + ProgressManager.ProgressBar progressBarPostLoad = ProgressManager.push("TecTech Post Loader", 5); progressBarPostLoad.step("Dreamcraft Compatibility"); if(Loader.isModLoaded(Reference.DREAMCRAFT)){ @@ -141,13 +147,8 @@ public final class MainLoader { progressBarPostLoad.step("Recipes"); new RecipeLoader().run(); - TecTech.LOGGER.info("Recipe Init Done"); - progressBarPostLoad.step("Creative Tab"); - creativeTabTecTech =new CreativeTabTecTech("TecTech"); - TecTech.LOGGER.info("CreativeTab initiation complete"); - progressBarPostLoad.step("Register Extra Hazmat Suits"); registerExtraHazmats(); TecTech.LOGGER.info("Hazmat additions done"); diff --git a/src/main/java/com/github/technus/tectech/loader/NetworkDispatcher.java b/src/main/java/com/github/technus/tectech/loader/NetworkDispatcher.java index 4cfb3697fa..71478f3ad8 100644 --- a/src/main/java/com/github/technus/tectech/loader/NetworkDispatcher.java +++ b/src/main/java/com/github/technus/tectech/loader/NetworkDispatcher.java @@ -5,6 +5,7 @@ import com.github.technus.tectech.thing.metaTileEntity.pipe.PipeActivityMessage; import com.github.technus.tectech.thing.metaTileEntity.RotationMessage; import com.github.technus.tectech.mechanics.data.ChunkDataMessage; import com.github.technus.tectech.mechanics.data.PlayerDataMessage; +import com.github.technus.tectech.mechanics.data.RendererMessage; import static com.github.technus.tectech.Reference.MODID; @@ -31,6 +32,8 @@ public class NetworkDispatcher extends eu.usrv.yamcore.network.PacketDispatcher registerMessage(PlayerDataMessage.ServerHandler.class, PlayerDataMessage.PlayerDataQuery.class); registerMessage(PlayerDataMessage.ClientHandler.class, PlayerDataMessage.PlayerDataData.class); + registerMessage(RendererMessage.ClientHandler.class, RendererMessage.RendererData.class); + registerMessage(TextParametersMessage.ServerHandler.class, TextParametersMessage.ParametersTextQuery.class); registerMessage(TextParametersMessage.ServerUpdateHandler.class, TextParametersMessage.ParametersTextUpdate.class); registerMessage(TextParametersMessage.ClientHandler.class, TextParametersMessage.ParametersTextData.class); diff --git a/src/main/java/com/github/technus/tectech/loader/TecTechConfig.java b/src/main/java/com/github/technus/tectech/loader/TecTechConfig.java index e7eb0c0945..e16580befe 100644 --- a/src/main/java/com/github/technus/tectech/loader/TecTechConfig.java +++ b/src/main/java/com/github/technus/tectech/loader/TecTechConfig.java @@ -20,6 +20,14 @@ public class TecTechConfig extends ConfigManager { public boolean DISABLE_MATERIAL_LOADING_FFS; public float TURRET_DAMAGE_FACTOR; public float TURRET_EXPLOSION_FACTOR; + public float TESLA_MULTI_MIN_EFFICIENCY; + public float TESLA_MULTI_MAX_EFFICIENCY; + public float TESLA_MULTI_OVERDRIVE_LOSS; + public float TESLA_SINGLE_MIN_EFFICIENCY; + public float TESLA_SINGLE_MAX_EFFICIENCY; + public float TESLA_SINGLE_OVERDRIVE_LOSS; + + /** * This loading phases do not correspond to mod loading phases! @@ -34,6 +42,12 @@ public class TecTechConfig extends ConfigManager { DISABLE_MATERIAL_LOADING_FFS=false; TURRET_DAMAGE_FACTOR = 10; TURRET_EXPLOSION_FACTOR = 1; + TESLA_MULTI_MIN_EFFICIENCY = 0.955F; + TESLA_MULTI_MAX_EFFICIENCY = 0.98F; + TESLA_MULTI_OVERDRIVE_LOSS = 0.005F; + TESLA_SINGLE_MIN_EFFICIENCY = 0.91F; + TESLA_SINGLE_MAX_EFFICIENCY = 0.95F; + TESLA_SINGLE_OVERDRIVE_LOSS = 0.010F; } @@ -60,6 +74,18 @@ public class TecTechConfig extends ConfigManager { "Explosion strength is multiplied by this number"); DISABLE_MATERIAL_LOADING_FFS = _mainConfig.getBoolean("DisableMaterialLoading", "Debug", DISABLE_MATERIAL_LOADING_FFS, "Set to true to disable gregtech material processing"); + TESLA_MULTI_MIN_EFFICIENCY = _mainConfig.getFloat("teslaMultiMinEfficency", "Features", TESLA_MULTI_MIN_EFFICIENCY, 0, 1, + "Worst possible power loss per block for the multi block tesla"); + TESLA_MULTI_MAX_EFFICIENCY = _mainConfig.getFloat("teslaMultiMaxEfficency", "Features", TESLA_MULTI_MAX_EFFICIENCY, 0, 1, + "Best possible power loss per block for the multi block tesla"); + TESLA_MULTI_OVERDRIVE_LOSS = _mainConfig.getFloat("teslaMultiOverdriveLoss", "Features", TESLA_MULTI_OVERDRIVE_LOSS, 0, 1, + "Additional losses for overdrive use on the multi block tesla"); + TESLA_SINGLE_MIN_EFFICIENCY = _mainConfig.getFloat("teslaSingleMinEfficency", "Features", TESLA_SINGLE_MIN_EFFICIENCY, 0, 1, + "Worst possible power loss per block for the single block tesla"); + TESLA_SINGLE_MAX_EFFICIENCY = _mainConfig.getFloat("teslaSingleMaxEfficency", "Features", TESLA_SINGLE_MAX_EFFICIENCY, 0, 1, + "Best possible power loss per block for the single block tesla"); + TESLA_SINGLE_OVERDRIVE_LOSS = _mainConfig.getFloat("teslaSingleOverdriveLoss", "Features", TESLA_SINGLE_OVERDRIVE_LOSS, 0, 1, + "Additional losses for overdrive use on the single block tesla"); } /** diff --git a/src/main/java/com/github/technus/tectech/loader/gui/CreativeTabTecTech.java b/src/main/java/com/github/technus/tectech/loader/gui/CreativeTabTecTech.java index 295e1aeb7d..d360162fb6 100644 --- a/src/main/java/com/github/technus/tectech/loader/gui/CreativeTabTecTech.java +++ b/src/main/java/com/github/technus/tectech/loader/gui/CreativeTabTecTech.java @@ -1,12 +1,7 @@ package com.github.technus.tectech.loader.gui; import com.github.technus.tectech.thing.CustomItemList; -import com.github.technus.tectech.thing.block.QuantumGlassBlock; -import com.github.technus.tectech.thing.casing.TT_Container_Casings; -import com.github.technus.tectech.thing.item.ConstructableTriggerItem; import com.github.technus.tectech.thing.item.DebugElementalInstanceContainer_EM; -import com.github.technus.tectech.thing.item.ElementalDefinitionScanStorage_EM; -import com.github.technus.tectech.thing.item.ParametrizerMemoryCard; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; @@ -20,7 +15,6 @@ public class CreativeTabTecTech extends CreativeTabs { public CreativeTabTecTech(String name) { super(name); - registerThingsInTabs(); } @SideOnly(Side.CLIENT) @@ -38,14 +32,4 @@ public class CreativeTabTecTech extends CreativeTabs { } super.displayAllReleventItems(stuffToShow); } - - private static void registerThingsInTabs() { - QuantumGlassBlock.INSTANCE.setCreativeTab(creativeTabTecTech); - TT_Container_Casings.sBlockCasingsTT.setCreativeTab(creativeTabTecTech); - TT_Container_Casings.sHintCasingsTT.setCreativeTab(creativeTabTecTech); - DebugElementalInstanceContainer_EM.INSTANCE.setCreativeTab(creativeTabTecTech); - ConstructableTriggerItem.INSTANCE.setCreativeTab(creativeTabTecTech); - ParametrizerMemoryCard.INSTANCE.setCreativeTab(creativeTabTecTech); - ElementalDefinitionScanStorage_EM.INSTANCE.setCreativeTab(creativeTabTecTech); - } } diff --git a/src/main/java/com/github/technus/tectech/loader/gui/ModGuiHandler.java b/src/main/java/com/github/technus/tectech/loader/gui/ModGuiHandler.java index 44585d1b91..e555437104 100644 --- a/src/main/java/com/github/technus/tectech/loader/gui/ModGuiHandler.java +++ b/src/main/java/com/github/technus/tectech/loader/gui/ModGuiHandler.java @@ -1,5 +1,6 @@ package com.github.technus.tectech.loader.gui; +import com.github.technus.tectech.thing.item.gui.ProgrammerScreen; import com.github.technus.tectech.thing.item.gui.ScanDisplayScreen; import cpw.mods.fml.common.network.IGuiHandler; import net.minecraft.entity.player.EntityPlayer; @@ -10,6 +11,7 @@ import net.minecraft.world.World; */ public class ModGuiHandler implements IGuiHandler { public static final int SCAN_DISPLAY_SCREEN_ID =0; + public static final int PROGRAMMER_DISPLAY_SCREEN_ID =1; @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { @@ -20,6 +22,8 @@ public class ModGuiHandler implements IGuiHandler { public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { if (ID == SCAN_DISPLAY_SCREEN_ID) { return new ScanDisplayScreen(player); + }else if(ID==PROGRAMMER_DISPLAY_SCREEN_ID){ + return new ProgrammerScreen(player); } return null; } diff --git a/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java b/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java index 89b6eb1a56..a1d400ed54 100644 --- a/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java @@ -39,8 +39,6 @@ public class BloodyRecipeLoader implements Runnable { GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Silver, 6) }, Materials.Polytetrafluoroethylene.getMolten(144), CustomItemList.DATApipe.get(1), 200, 30720); - //endregion - //Tunnel GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ CustomItemList.DATApipe.get(1), @@ -50,16 +48,15 @@ public class BloodyRecipeLoader implements Runnable { ItemList.Field_Generator_MV.get(1), ItemList.Circuit_Quantummainframe.get(1) }, Materials.Osmium.getMolten(288), CustomItemList.EMpipe.get(1), 400, 491520); - + //Laser GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ CustomItemList.DATApipe.get(1), GT_ModHandler.getIC2Item("reinforcedGlass", 1L), GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Osmium, 2) }, null, CustomItemList.LASERpipe.get(1), 100, 500000); - - //endregoin + //endregion //region casing @@ -110,7 +107,7 @@ public class BloodyRecipeLoader implements Runnable { //Hollow Casing TT_recipeAdder.addResearchableAssemblylineRecipe(CustomItemList.eM_Containment.get(1), - 12000,32, 500000, 6, new ItemStack[]{ + 12000, 32, 500000, 6, new ItemStack[]{ CustomItemList.eM_Containment.get(1), GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Neutronium, 8), GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Plutonium, 2), @@ -126,10 +123,10 @@ public class BloodyRecipeLoader implements Runnable { //EM Coil TT_recipeAdder.addResearchableAssemblylineRecipe(CustomItemList.eM_Hollow.get(1), - 48000,128, 1000000, 16, new ItemStack[]{ + 48000, 128, 1000000, 16, new ItemStack[]{ CustomItemList.eM_Hollow.get(1), ItemList.Casing_Fusion_Coil.get(4), - ItemList.Casing_Coil_NaquadahAlloy.get( 4), + ItemList.Casing_Coil_NaquadahAlloy.get(4), GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Neutronium, 8), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Americium, 16), }, new FluidStack[]{ @@ -139,123 +136,178 @@ public class BloodyRecipeLoader implements Runnable { Materials.Americium.getMolten(1296), }, CustomItemList.eM_Coil.get(4), 800, 2000000); - //endregion + //Tesla Base + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.NickelZincFerrite, 6), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.NickelZincFerrite, 1) + }, null, CustomItemList.tM_TeslaBase.get(1), 50, 16); + GT_ModHandler.addCraftingRecipe(CustomItemList.tM_TeslaBase.get(1), + GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[]{"PhP", "PFP", "PwP", + 'P', OrePrefixes.plate.get(Materials.NickelZincFerrite), + 'F', OrePrefixes.frameGt.get(Materials.NickelZincFerrite)}); + //Tesla Toroid + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 6), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Aluminium, 1) + }, null, CustomItemList.tM_TeslaToroid.get(1), 50, 16); + GT_ModHandler.addCraftingRecipe(CustomItemList.tM_TeslaToroid.get(1), + GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[]{"PhP", "PFP", "PwP", + 'P', OrePrefixes.foil.get(Materials.Aluminium), + 'F', OrePrefixes.frameGt.get(Materials.Aluminium)}); + //Tesla Secondary Windings + GT_ModHandler.addCraftingRecipe(CustomItemList.tM_TeslaSecondary.get(1), + GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[]{"WWW", "WwW", "WWW", + 'W', CustomItemList.teslaComponent.getWithDamage(1, 0)}); + //Tesla Primary Coils T0 + GT_ModHandler.addCraftingRecipe(CustomItemList.tM_TeslaPrimary_0.get(1), + GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[]{"WWW", "WwW", "WWW", + 'W', OrePrefixes.wireGt02.get(Materials.RedstoneAlloy)}); + //Tesla Primary Coils T1 + GT_ModHandler.addCraftingRecipe(CustomItemList.tM_TeslaPrimary_1.get(1), + GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[]{"WWW", "WwW", "WWW", + 'W', OrePrefixes.wireGt02.get(Materials.SuperconductorMV)}); + //Tesla Primary Coils T2 + GT_ModHandler.addCraftingRecipe(CustomItemList.tM_TeslaPrimary_2.get(1), + GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[]{"WWW", "WwW", "WWW", + 'W', OrePrefixes.wireGt02.get(Materials.SuperconductorHV)}); + //Tesla Primary Coils T3 + GT_ModHandler.addCraftingRecipe(CustomItemList.tM_TeslaPrimary_3.get(1), + GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[]{"WWW", "WwW", "WWW", + 'W', OrePrefixes.wireGt02.get(Materials.SuperconductorEV)}); + //Tesla Primary Coils T4 + GT_ModHandler.addCraftingRecipe(CustomItemList.tM_TeslaPrimary_4.get(1), + GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[]{"WWW", "WwW", "WWW", + 'W', OrePrefixes.wireGt02.get(Materials.SuperconductorIV)}); + //Tesla Primary Coils T5 + GT_ModHandler.addCraftingRecipe(CustomItemList.tM_TeslaPrimary_5.get(1), + GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, + new Object[]{"WWW", "WwW", "WWW", + 'W', OrePrefixes.wireGt02.get(Materials.SuperconductorLuV)}); + //endregion //region hatches //Dynamo Hatches IV-UIV GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - ItemList.Hatch_Dynamo_IV.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Tungsten, 2), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 2)}, + ItemList.Hatch_Dynamo_IV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Tungsten, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 2)}, Materials.Silver.getMolten(144), CustomItemList.eM_dynamoMulti4_IV.get(1), 100, 1920); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_dynamoMulti4_IV.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Tungsten, 2), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 4)}, + CustomItemList.eM_dynamoMulti4_IV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Tungsten, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 4)}, Materials.Electrum.getMolten(144), CustomItemList.eM_dynamoMulti16_IV.get(1), 200, 1920); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_dynamoMulti16_IV.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Tungsten, 2), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 6)}, + CustomItemList.eM_dynamoMulti16_IV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Tungsten, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 6)}, Materials.Tungsten.getMolten(144), CustomItemList.eM_dynamoMulti64_IV.get(1), 400, 1920); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - ItemList.Hatch_Dynamo_LuV.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 2), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 2)}, + ItemList.Hatch_Dynamo_LuV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 2)}, Materials.Silver.getMolten(288), CustomItemList.eM_dynamoMulti4_LuV.get(1), 100, 7860); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_dynamoMulti4_LuV.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 2), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 4)}, + CustomItemList.eM_dynamoMulti4_LuV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 4)}, Materials.Electrum.getMolten(288), CustomItemList.eM_dynamoMulti16_LuV.get(1), 200, 7860); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_dynamoMulti16_LuV.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.VanadiumGallium, 2), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 6)}, + CustomItemList.eM_dynamoMulti16_LuV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.VanadiumGallium, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 6)}, Materials.Tungsten.getMolten(288), CustomItemList.eM_dynamoMulti64_LuV.get(1), 400, 7860); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - ItemList.Hatch_Dynamo_ZPM.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 2), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 2)}, + ItemList.Hatch_Dynamo_ZPM.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 2)}, Materials.Silver.getMolten(576), CustomItemList.eM_dynamoMulti4_ZPM.get(1), 100, 30720); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_dynamoMulti4_ZPM.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 2), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 4)}, + CustomItemList.eM_dynamoMulti4_ZPM.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 4)}, Materials.Electrum.getMolten(576), CustomItemList.eM_dynamoMulti16_ZPM.get(1), 200, 30720); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_dynamoMulti16_ZPM.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Naquadah, 2), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 6)}, + CustomItemList.eM_dynamoMulti16_ZPM.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Naquadah, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 6)}, Materials.Tungsten.getMolten(576), CustomItemList.eM_dynamoMulti64_ZPM.get(1), 400, 30720); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - ItemList.Hatch_Dynamo_UV.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 2), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 2)}, + ItemList.Hatch_Dynamo_UV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 2)}, Materials.Silver.getMolten(1152), CustomItemList.eM_dynamoMulti4_UV.get(1), 100, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_dynamoMulti4_UV.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 2), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 4)}, + CustomItemList.eM_dynamoMulti4_UV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 4)}, Materials.Electrum.getMolten(1152), CustomItemList.eM_dynamoMulti16_UV.get(1), 200, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_dynamoMulti16_UV.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NaquadahAlloy, 2), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 6)}, + CustomItemList.eM_dynamoMulti16_UV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NaquadahAlloy, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 6)}, Materials.Tungsten.getMolten(1152), CustomItemList.eM_dynamoMulti64_UV.get(1), 400, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - ItemList.Hatch_Dynamo_MAX.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 2), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 2)}, + ItemList.Hatch_Dynamo_MAX.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 2)}, Materials.Silver.getMolten(2304), CustomItemList.eM_dynamoMulti4_UHV.get(1), 100, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_dynamoMulti4_UHV.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Superconductor, 2), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 4)}, + CustomItemList.eM_dynamoMulti4_UHV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Superconductor, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 4)}, Materials.Electrum.getMolten(2304), CustomItemList.eM_dynamoMulti16_UHV.get(1), 200, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_dynamoMulti16_UHV.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Superconductor, 2), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 6)}, + CustomItemList.eM_dynamoMulti16_UHV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Superconductor, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 6)}, Materials.Tungsten.getMolten(2304), CustomItemList.eM_dynamoMulti64_UHV.get(1), 400, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - ItemList.Hatch_Dynamo_MAX.get(4), - GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 8), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 8)}, + ItemList.Hatch_Dynamo_MAX.get(4), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 8), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 8)}, Materials.Silver.getMolten(4608), CustomItemList.eM_dynamoMulti4_UEV.get(1), 500, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_dynamoMulti4_UEV.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Superconductor, 8), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 16)}, + CustomItemList.eM_dynamoMulti4_UEV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Superconductor, 8), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 16)}, Materials.Electrum.getMolten(4608), CustomItemList.eM_dynamoMulti16_UEV.get(1), 1000, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_dynamoMulti16_UEV.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Superconductor, 8), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 24)}, + CustomItemList.eM_dynamoMulti16_UEV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Superconductor, 8), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 24)}, Materials.Tungsten.getMolten(4608), CustomItemList.eM_dynamoMulti64_UEV.get(1), 2000, 500000); @@ -280,184 +332,184 @@ public class BloodyRecipeLoader implements Runnable { CustomItemList.eM_energyMulti64_IV.get(1), 400, 7680); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - ItemList.Hatch_Energy_LuV.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 2), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 2)}, + ItemList.Hatch_Energy_LuV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 2)}, Materials.Silver.getMolten(288), CustomItemList.eM_energyMulti4_LuV.get(1), 100, 30720); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_energyMulti4_LuV.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 2), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 4)}, + CustomItemList.eM_energyMulti4_LuV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 4)}, Materials.Electrum.getMolten(288), CustomItemList.eM_energyMulti16_LuV.get(1), 200, 30720); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_energyMulti16_LuV.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.VanadiumGallium, 2), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 6)}, + CustomItemList.eM_energyMulti16_LuV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.VanadiumGallium, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 6)}, Materials.Tungsten.getMolten(288), CustomItemList.eM_energyMulti64_LuV.get(1), 400, 30720); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - ItemList.Hatch_Energy_ZPM.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 2), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 2)}, + ItemList.Hatch_Energy_ZPM.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 2)}, Materials.Silver.getMolten(576), CustomItemList.eM_energyMulti4_ZPM.get(1), 100, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_energyMulti4_ZPM.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 2), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 4)}, + CustomItemList.eM_energyMulti4_ZPM.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 4)}, Materials.Electrum.getMolten(576), CustomItemList.eM_energyMulti16_ZPM.get(1), 200, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_energyMulti16_ZPM.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Naquadah, 2), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 6)}, + CustomItemList.eM_energyMulti16_ZPM.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Naquadah, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 6)}, Materials.Tungsten.getMolten(576), CustomItemList.eM_energyMulti64_ZPM.get(1), 400, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - ItemList.Hatch_Energy_UV.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 2), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 2)}, + ItemList.Hatch_Energy_UV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 2)}, Materials.Silver.getMolten(1152), CustomItemList.eM_energyMulti4_UV.get(1), 100, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_energyMulti4_UV.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 2), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 4)}, + CustomItemList.eM_energyMulti4_UV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 4)}, Materials.Electrum.getMolten(1152), CustomItemList.eM_energyMulti16_UV.get(1), 200, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_energyMulti16_UV.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NaquadahAlloy, 2), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 6)}, + CustomItemList.eM_energyMulti16_UV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NaquadahAlloy, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 6)}, Materials.Tungsten.getMolten(1152), CustomItemList.eM_energyMulti64_UV.get(1), 400, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - ItemList.Hatch_Energy_MAX.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 2), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 2)}, + ItemList.Hatch_Energy_MAX.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 2)}, Materials.Silver.getMolten(2304), CustomItemList.eM_energyMulti4_UHV.get(1), 100, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_energyMulti4_UHV.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Superconductor, 2), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 4)}, + CustomItemList.eM_energyMulti4_UHV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Superconductor, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 4)}, Materials.Electrum.getMolten(2304), CustomItemList.eM_energyMulti16_UHV.get(1), 200, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_energyMulti16_UHV.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Superconductor, 2), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 6)}, + CustomItemList.eM_energyMulti16_UHV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Superconductor, 2), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 6)}, Materials.Tungsten.getMolten(2304), CustomItemList.eM_energyMulti64_UHV.get(1), 400, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - ItemList.Hatch_Energy_MAX.get(4), - GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 8), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 8)}, - Materials.Silver.getMolten(4608), - CustomItemList.eM_energyMulti4_UEV.get(1), 100, 2000000); + ItemList.Hatch_Energy_MAX.get(4), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 8), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 8)}, + Materials.Silver.getMolten(4608), + CustomItemList.eM_energyMulti4_UEV.get(1), 100, 2000000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_energyMulti4_UEV.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Superconductor, 8), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 16)}, - Materials.Electrum.getMolten(4608), - CustomItemList.eM_energyMulti16_UEV.get(1), 200, 2000000); + CustomItemList.eM_energyMulti4_UEV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Superconductor, 8), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 16)}, + Materials.Electrum.getMolten(4608), + CustomItemList.eM_energyMulti16_UEV.get(1), 200, 2000000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - CustomItemList.eM_energyMulti16_UEV.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Superconductor, 8), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 24)}, - Materials.Tungsten.getMolten(4608), - CustomItemList.eM_energyMulti64_UEV.get(1), 400, 2000000); + CustomItemList.eM_energyMulti16_UEV.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.Superconductor, 8), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 24)}, + Materials.Tungsten.getMolten(4608), + CustomItemList.eM_energyMulti64_UEV.get(1), 400, 2000000); //Laser Dynamo IV-UV 256/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_IV.get(1), ItemList.Electric_Pump_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.TungstenSteel, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamoTunnel1_IV.get(1), 1000, 7680); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_LuV.get(1), ItemList.Electric_Pump_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.VanadiumGallium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamoTunnel1_LuV.get(1), 1000, 30720); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_ZPM.get(1), ItemList.Electric_Pump_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Naquadah, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamoTunnel1_ZPM.get(1), 1000, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Emitter_UV.get(1), ItemList.Electric_Pump_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.NaquadahAlloy, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_dynamoTunnel1_UV.get(1), 1000, 500000); - + //Laser Dynamo IV-UV 1024/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_IV.get(2), ItemList.Electric_Pump_IV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamoTunnel2_IV.get(1), 2000, 7680); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_LuV.get(2), ItemList.Electric_Pump_LuV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.VanadiumGallium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamoTunnel2_LuV.get(1), 2000, 30720); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_ZPM.get(2), ItemList.Electric_Pump_ZPM.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Naquadah, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamoTunnel2_ZPM.get(1), 2000, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Emitter_UV.get(2), ItemList.Electric_Pump_UV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_dynamoTunnel2_UV.get(1), 2000, 500000); - + //Laser Dynamo IV-UV 4096/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_IV.get(4), ItemList.Electric_Pump_IV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamoTunnel3_IV.get(1), 4000, 7680); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_LuV.get(4), ItemList.Electric_Pump_LuV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamoTunnel3_LuV.get(1), 4000, 30720); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_ZPM.get(4), ItemList.Electric_Pump_ZPM.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamoTunnel3_ZPM.get(1), 4000, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Emitter_UV.get(4), ItemList.Electric_Pump_UV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_dynamoTunnel3_UV.get(1), 4000, 500000); - + //Laser Dynamo IV-UV 16384/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_IV.get(8), ItemList.Electric_Pump_IV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamoTunnel4_IV.get(1), 8000, 7680); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_LuV.get(8), ItemList.Electric_Pump_LuV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamoTunnel4_LuV.get(1), 8000, 30720); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_ZPM.get(8), ItemList.Electric_Pump_ZPM.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamoTunnel4_ZPM.get(1), 8000, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Emitter_UV.get(8), ItemList.Electric_Pump_UV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_dynamoTunnel4_UV.get(1), 8000, 500000); - + //Laser Dynamo IV-UV 65536/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_IV.get(16), ItemList.Electric_Pump_IV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamoTunnel5_IV.get(1), 16000, 7680); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_LuV.get(16), ItemList.Electric_Pump_LuV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamoTunnel5_LuV.get(1), 16000, 30720); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_ZPM.get(16), ItemList.Electric_Pump_ZPM.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamoTunnel5_ZPM.get(1), 16000, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Emitter_UV.get(16), ItemList.Electric_Pump_UV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_dynamoTunnel5_UV.get(1), 16000, 500000); - + //Laser Dynamo IV-UV 262144/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_IV.get(32), ItemList.Electric_Pump_IV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamoTunnel6_IV.get(1), 32000, 7680); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_LuV.get(32), ItemList.Electric_Pump_LuV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamoTunnel6_LuV.get(1), 32000, 30720); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_ZPM.get(32), ItemList.Electric_Pump_ZPM.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamoTunnel6_ZPM.get(1), 32000, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Emitter_UV.get(32), ItemList.Electric_Pump_UV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_dynamoTunnel6_UV.get(1), 32000, 500000); - + //Laser Dynamo IV-UV 1048576/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_IV.get(64), ItemList.Electric_Pump_IV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamoTunnel7_IV.get(1), 64000, 7680); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_LuV.get(64), ItemList.Electric_Pump_LuV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.VanadiumGallium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamoTunnel7_LuV.get(1), 64000, 30720); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_ZPM.get(64), ItemList.Electric_Pump_ZPM.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Naquadah, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamoTunnel7_ZPM.get(1), 64000, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Emitter_UV.get(64), ItemList.Electric_Pump_UV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_dynamoTunnel7_UV.get(1), 64000, 500000); - + //Laser Target IV-UV 256/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_IV.get(1), ItemList.Electric_Pump_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.TungstenSteel, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energyTunnel1_IV.get(1), 1000, 7680); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_LuV.get(1), ItemList.Electric_Pump_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.VanadiumGallium, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energyTunnel1_LuV.get(1), 1000, 30720); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_ZPM.get(1), ItemList.Electric_Pump_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Naquadah, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energyTunnel1_ZPM.get(1), 1000, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 1), ItemList.Sensor_UV.get(1), ItemList.Electric_Pump_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.NaquadahAlloy, 2), GT_Utility.getIntegratedCircuit(1)}, null, CustomItemList.eM_energyTunnel1_UV.get(1), 1000, 500000); - + //Laser Target IV-UV 1024/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_IV.get(2), ItemList.Electric_Pump_IV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energyTunnel2_IV.get(1), 2000, 7680); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_LuV.get(2), ItemList.Electric_Pump_LuV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.VanadiumGallium, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energyTunnel2_LuV.get(1), 2000, 30720); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_ZPM.get(2), ItemList.Electric_Pump_ZPM.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.Naquadah, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energyTunnel2_ZPM.get(1), 2000, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 2), ItemList.Sensor_UV.get(2), ItemList.Electric_Pump_UV.get(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(2)}, null, CustomItemList.eM_energyTunnel2_UV.get(1), 2000, 500000); - + //Laser Target IV-UV 4096/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_IV.get(4), ItemList.Electric_Pump_IV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energyTunnel3_IV.get(1), 4000, 7680); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_LuV.get(4), ItemList.Electric_Pump_LuV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energyTunnel3_LuV.get(1), 4000, 30720); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_ZPM.get(4), ItemList.Electric_Pump_ZPM.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energyTunnel3_ZPM.get(1), 4000, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 4), ItemList.Sensor_UV.get(4), ItemList.Electric_Pump_UV.get(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 4), GT_Utility.getIntegratedCircuit(3)}, null, CustomItemList.eM_energyTunnel3_UV.get(1), 4000, 500000); - + //Laser Target IV-UV 16384/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_IV.get(8), ItemList.Electric_Pump_IV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energyTunnel4_IV.get(1), 8000, 7680); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_LuV.get(8), ItemList.Electric_Pump_LuV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.VanadiumGallium, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energyTunnel4_LuV.get(1), 8000, 30720); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_ZPM.get(8), ItemList.Electric_Pump_ZPM.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energyTunnel4_ZPM.get(1), 8000, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 8), ItemList.Sensor_UV.get(8), ItemList.Electric_Pump_UV.get(8), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(4)}, null, CustomItemList.eM_energyTunnel4_UV.get(1), 8000, 500000); - + //Laser Target IV-UV 65536/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_IV.get(16), ItemList.Electric_Pump_IV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energyTunnel5_IV.get(1), 16000, 7680); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_LuV.get(16), ItemList.Electric_Pump_LuV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energyTunnel5_LuV.get(1), 16000, 30720); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_ZPM.get(16), ItemList.Electric_Pump_ZPM.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energyTunnel5_ZPM.get(1), 16000, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 16), ItemList.Sensor_UV.get(16), ItemList.Electric_Pump_UV.get(16), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 8), GT_Utility.getIntegratedCircuit(5)}, null, CustomItemList.eM_energyTunnel5_UV.get(1), 16000, 500000); - + //Laser Target IV-UV 262144/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_IV.get(32), ItemList.Electric_Pump_IV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energyTunnel6_IV.get(1), 32000, 7680); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_LuV.get(32), ItemList.Electric_Pump_LuV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energyTunnel6_LuV.get(1), 32000, 30720); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_ZPM.get(32), ItemList.Electric_Pump_ZPM.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energyTunnel6_ZPM.get(1), 32000, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), ItemList.Sensor_UV.get(32), ItemList.Electric_Pump_UV.get(32), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(6)}, null, CustomItemList.eM_energyTunnel6_UV.get(1), 32000, 500000); - + //Laser Target IV-UV 1048576/t GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_IV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_IV.get(64), ItemList.Electric_Pump_IV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.TungstenSteel, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energyTunnel7_IV.get(1), 64000, 7680); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_LuV.get(64), ItemList.Electric_Pump_LuV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.VanadiumGallium, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energyTunnel7_LuV.get(1), 64000, 30720); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_ZPM.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_ZPM.get(64), ItemList.Electric_Pump_ZPM.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Naquadah, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energyTunnel7_ZPM.get(1), 64000, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Hull_UV.get(1), GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 64), ItemList.Sensor_UV.get(64), ItemList.Electric_Pump_UV.get(64), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.NaquadahAlloy, 16), GT_Utility.getIntegratedCircuit(7)}, null, CustomItemList.eM_energyTunnel7_UV.get(1), 64000, 500000); - + //Data Input GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ CustomItemList.eM_Computer_Casing.get(1), @@ -503,7 +555,7 @@ public class BloodyRecipeLoader implements Runnable { CustomItemList.eM_Computer_Casing.get(1), ItemList.Circuit_Masterquantumcomputer.get(1), CustomItemList.DATApipe.get(4), - ItemList.Cover_Screen.get(1 ), + ItemList.Cover_Screen.get(1), new ItemStack(Blocks.stone_button, 16), }, Materials.Iridium.getMolten(2592), CustomItemList.Parametrizer_Hatch.get(1), 800, 122880); //Uncertainty @@ -511,7 +563,7 @@ public class BloodyRecipeLoader implements Runnable { CustomItemList.eM_Computer_Casing.get(1), ItemList.Circuit_Ultimatecrystalcomputer.get(1), CustomItemList.DATApipe.get(16), - ItemList.Cover_Screen.get(1 ), + ItemList.Cover_Screen.get(1), new ItemStack(Blocks.stone_button, 16), }, Materials.Iridium.getMolten(2592), CustomItemList.Uncertainty_Hatch.get(1), 1200, 122880); @@ -537,11 +589,31 @@ public class BloodyRecipeLoader implements Runnable { ItemList.Field_Generator_UV.get(1) }, Materials.Osmiridium.getMolten(1296), CustomItemList.eM_muffler_UV.get(1), 800, 500000); - //endregion + //Capacitor Hatch + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Hatch_Input_Bus_HV.get(1), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.NickelZincFerrite, 4), + GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Gold, 4), + }, Materials.Silver.getMolten(576), CustomItemList.capacitor_Hatch.get(1), 800, 480); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Hatch_Output_Bus_HV.get(1), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.NickelZincFerrite, 4), + GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Gold, 4), + }, Materials.Silver.getMolten(576), CustomItemList.capacitor_Hatch.get(1), 800, 480); + //endregion //region multiblocks + //Tesla Coil + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_ModHandler.getIC2Item("teslaCoil", 1), + CustomItemList.tM_TeslaSecondary.get(4), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.NickelZincFerrite, 4), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 4), + ItemList.Upgrade_Overclocker.get(4), + }, Materials.Silver.getMolten(576), CustomItemList.Machine_Multi_TeslaCoil.get(1), 800, 480); + //Microwave Grinder GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ ItemList.Machine_HV_Microwave.get(1), @@ -602,7 +674,7 @@ public class BloodyRecipeLoader implements Runnable { //Matter Junction TT_recipeAdder.addResearchableAssemblylineRecipe(CustomItemList.Machine_Multi_Switch.get(1), - 8000,32, 500000, 4, new ItemStack[]{ + 8000, 32, 500000, 4, new ItemStack[]{ CustomItemList.Machine_Multi_Transformer.get(1), GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Naquadah, 16), ItemList.Robot_Arm_LuV.get(2), @@ -618,7 +690,7 @@ public class BloodyRecipeLoader implements Runnable { //Matter Quantizer TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Hatch_Input_UV.get(1), - 12000,32, 500000, 6, new ItemStack[]{ + 12000, 32, 500000, 6, new ItemStack[]{ CustomItemList.Machine_Multi_Transformer.get(1), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Naquadah, 16), ItemList.Emitter_UV.get(2), @@ -633,7 +705,7 @@ public class BloodyRecipeLoader implements Runnable { //Matter DeQuantizer TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Hatch_Output_UV.get(1), - 12000,32, 500000, 6, new ItemStack[]{ + 12000, 32, 500000, 6, new ItemStack[]{ CustomItemList.Machine_Multi_Transformer.get(1), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Naquadah, 16), ItemList.Sensor_UV.get(2), @@ -648,7 +720,7 @@ public class BloodyRecipeLoader implements Runnable { //Essentia Quantizer TT_recipeAdder.addResearchableAssemblylineRecipe(CustomItemList.Machine_Multi_MatterToEM.get(1), - 15000,32, 500000, 8, new ItemStack[]{ + 15000, 32, 500000, 8, new ItemStack[]{ CustomItemList.Machine_Multi_MatterToEM.get(1), GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Neutronium, 8), ItemList.Emitter_UV.get(2), @@ -663,7 +735,7 @@ public class BloodyRecipeLoader implements Runnable { //Essentia DeQuantizer TT_recipeAdder.addResearchableAssemblylineRecipe(CustomItemList.Machine_Multi_EMToMatter.get(1), - 15000,32, 500000, 8, new ItemStack[]{ + 15000, 32, 500000, 8, new ItemStack[]{ CustomItemList.Machine_Multi_EMToMatter.get(1), GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Neutronium, 8), ItemList.Sensor_UV.get(2), @@ -678,13 +750,13 @@ public class BloodyRecipeLoader implements Runnable { //EM Scanner TT_recipeAdder.addResearchableAssemblylineRecipe(CustomItemList.Machine_Multi_Research.get(1), - 150000,128, 500000, 16, new ItemStack[]{ + 150000, 128, 500000, 16, new ItemStack[]{ CustomItemList.Machine_Multi_EMjunction.get(1), CustomItemList.eM_Computer_Bus.get(4), ItemList.Field_Generator_UV.get(4), ItemList.Sensor_UV.get(4), ItemList.Circuit_Wetwaresupercomputer.get(4),//? - GT_OreDictUnificator.get(OrePrefixes.lens,Materials.Diamond,32), + GT_OreDictUnificator.get(OrePrefixes.lens, Materials.Diamond, 32), GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Superconductor, 16), }, new FluidStack[]{ Materials.UUMatter.getFluid(2000), @@ -695,10 +767,10 @@ public class BloodyRecipeLoader implements Runnable { //Multi Infuser TT_recipeAdder.addResearchableAssemblylineRecipe(CustomItemList.Machine_Multi_Transformer.get(1), - 192000,512, 2000000, 32, new ItemStack[]{ + 192000, 512, 2000000, 32, new ItemStack[]{ CustomItemList.Machine_Multi_Transformer.get(1), CustomItemList.eM_Coil.get(8), - CustomItemList.eM_Power.get( 8), + CustomItemList.eM_Power.get(8), GT_OreDictUnificator.get(OrePrefixes.screw, Materials.NeodymiumMagnetic, 16), }, new FluidStack[]{ Materials.Electrum.getMolten(2592), @@ -708,6 +780,450 @@ public class BloodyRecipeLoader implements Runnable { //endregion + //region singleblocks + + //Tesla Transceiver LV 1A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_1by1_LV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_1by1_LV.get(1), 400, 30); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_1by1_LV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_1by1_LV.get(1), 400, 30); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_1by1_LV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_1by1_LV.get(1), 400, 30); + //Tesla Transceiver MV 1A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_1by1_MV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_1by1_MV.get(1), 400, 120); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_1by1_MV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_1by1_MV.get(1), 400, 120); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_1by1_MV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_1by1_MV.get(1), 400, 120); + //Tesla Transceiver HV 1A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_1by1_HV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_1by1_HV.get(1), 400, 480); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_1by1_HV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_1by1_HV.get(1), 400, 480); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_1by1_HV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_1by1_HV.get(1), 400, 480); + //Tesla Transceiver EV 1A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_1by1_EV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_1by1_EV.get(1), 400, 1920); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_1by1_EV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_1by1_EV.get(1), 400, 1920); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_1by1_EV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_1by1_EV.get(1), 400, 1920); + //Tesla Transceiver IV 1A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_1by1_IV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_1by1_IV.get(1), 400, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_1by1_IV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_1by1_IV.get(1), 400, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_1by1_IV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_1by1_IV.get(1), 400, 7680); + //Tesla Transceiver LV 4A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_2by2_LV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_2by2_LV.get(1), 400, 30); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_2by2_LV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_2by2_LV.get(1), 400, 30); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_2by2_LV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_2by2_LV.get(1), 400, 30); + //Tesla Transceiver MV 4A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_2by2_MV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_2by2_MV.get(1), 400, 120); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_2by2_MV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_2by2_MV.get(1), 400, 120); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_2by2_MV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_2by2_MV.get(1), 400, 120); + //Tesla Transceiver HV 4A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_2by2_HV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_2by2_HV.get(1), 400, 480); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_2by2_HV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_2by2_HV.get(1), 400, 480); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_2by2_HV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_2by2_HV.get(1), 400, 480); + //Tesla Transceiver EV 4A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_2by2_EV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_2by2_EV.get(1), 400, 1920); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_2by2_EV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_2by2_EV.get(1), 400, 1920); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_2by2_EV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_2by2_EV.get(1), 400, 1920); + //Tesla Transceiver IV 4A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_2by2_IV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_2by2_IV.get(1), 400, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_2by2_IV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_2by2_IV.get(1), 400, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_2by2_IV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_2by2_IV.get(1), 400, 7680); + //Tesla Transceiver LV 9A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_3by3_LV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_3by3_LV.get(1), 400, 30); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_3by3_LV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_3by3_LV.get(1), 400, 30); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_3by3_LV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_3by3_LV.get(1), 400, 30); + //Tesla Transceiver MV 9A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_3by3_MV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_3by3_MV.get(1), 400, 120); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_3by3_LV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_3by3_MV.get(1), 400, 120); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_3by3_MV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_3by3_MV.get(1), 400, 120); + //Tesla Transceiver HV 9A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_3by3_HV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_3by3_HV.get(1), 400, 480); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_3by3_HV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_3by3_HV.get(1), 400, 480); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_3by3_HV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_3by3_HV.get(1), 400, 480); + //Tesla Transceiver EV 9A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_3by3_EV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_3by3_EV.get(1), 400, 1920); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_3by3_EV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_3by3_EV.get(1), 400, 1920); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_3by3_EV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_3by3_EV.get(1), 400, 1920); + //Tesla Transceiver IV 9A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_3by3_IV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_3by3_IV.get(1), 400, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_3by3_IV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_3by3_IV.get(1), 400, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_3by3_IV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_3by3_IV.get(1), 400, 7680); + //Tesla Transceiver LV 16A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_4by4_LV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_4by4_LV.get(1), 400, 30); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_4by4_LV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_4by4_LV.get(1), 400, 30); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_4by4_LV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_4by4_LV.get(1), 400, 30); + //Tesla Transceiver MV 16A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_4by4_MV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_4by4_MV.get(1), 400, 120); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_4by4_MV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_4by4_MV.get(1), 400, 120); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_4by4_MV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_4by4_MV.get(1), 400, 120); + //Tesla Transceiver HV 16A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_4by4_HV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_4by4_HV.get(1), 400, 480); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_4by4_HV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_4by4_HV.get(1), 400, 480); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_4by4_HV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_4by4_HV.get(1), 400, 480); + //Tesla Transceiver EV 16A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_4by4_EV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_4by4_EV.get(1), 400, 1920); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_4by4_EV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_4by4_EV.get(1), 400, 1920); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_4by4_EV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_4by4_EV.get(1), 400, 1920); + //Tesla Transceiver IV 16A + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_4by4_IV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Lead.getMolten(576), + CustomItemList.Machine_TeslaCoil_4by4_IV.get(1), 400, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_4by4_IV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.Tin.getMolten(288), + CustomItemList.Machine_TeslaCoil_4by4_IV.get(1), 400, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + ItemList.Battery_Buffer_4by4_IV.get(1), + CustomItemList.teslaCover.getWithDamage(1, 0)}, + Materials.SolderingAlloy.getMolten(144), + CustomItemList.Machine_TeslaCoil_4by4_IV.get(1), 400, 7680); + + //endregion + + //region components + + //Tesla Winding Components + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Electrum, 32), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.NickelZincFerrite, 8), + }, Materials.Epoxid.getMolten(288), CustomItemList.teslaComponent.getWithDamage(1, 0), 320, 30); + //Tesla Winding Components Ultimate + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.SuperconductorLuV, 16), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.NickelZincFerrite, 8), + }, Materials.Epoxid.getMolten(576), CustomItemList.teslaComponent.getWithDamage(1, 1), 320, 7680); + + //endregion + + //region items + + //LV Tesla Capacitor + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Tin, 4), + GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 4), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 8), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silicone, 8), + }, Materials.Epoxid.getMolten(72), CustomItemList.teslaCapacitor.getWithDamage(1, 0), 320, 30); + //MV Tesla Capacitor + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Copper, 4), + GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 6), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 12), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silicone, 12), + }, Materials.Epoxid.getMolten(144), CustomItemList.teslaCapacitor.getWithDamage(1, 1), 320, 120); + //HV Tesla Capacitor + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Gold, 4), + GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 8), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 16), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silicone, 16), + }, Materials.Epoxid.getMolten(216), CustomItemList.teslaCapacitor.getWithDamage(1, 2), 320, 480); + //EV Tesla Capacitor + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Aluminium, 4), + GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 10), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 20), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silicone, 20), + }, Materials.Epoxid.getMolten(288), CustomItemList.teslaCapacitor.getWithDamage(1, 3), 320, 1920); + //IV Tesla Capacitor + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Tungsten, 4), + GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 12), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 24), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silicone, 24), + }, Materials.Epoxid.getMolten(360), CustomItemList.teslaCapacitor.getWithDamage(1, 4), 320, 7680); + //Tesla Cover + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.teslaComponent.getWithDamage(4, 0), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 2), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Gold, 16), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.NickelZincFerrite, 2), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 8), + }, Materials.Lead.getMolten(288), CustomItemList.teslaCover.getWithDamage(1, 0), 320, 480); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.teslaComponent.getWithDamage(4, 0), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 2), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Gold, 16), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.NickelZincFerrite, 2), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 8), + }, Materials.Tin.getMolten(144), CustomItemList.teslaCover.getWithDamage(1, 0), 320, 480); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.teslaComponent.getWithDamage(4, 0), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 2), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Gold, 16), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.NickelZincFerrite, 2), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 8), + }, Materials.SolderingAlloy.getMolten(72), CustomItemList.teslaCover.getWithDamage(1, 0), 320, 480); + //Ultimate Tesla Cover + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.teslaComponent.getWithDamage(4, 1), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Master, 2), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Tungsten, 16), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.NickelZincFerrite, 2), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 8), + }, Materials.Lead.getMolten(288), CustomItemList.teslaCover.getWithDamage(1, 1), 320, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.teslaComponent.getWithDamage(4, 1), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Master, 2), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Tungsten, 16), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.NickelZincFerrite, 2), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 8), + }, Materials.Tin.getMolten(144), CustomItemList.teslaCover.getWithDamage(1, 1), 320, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + CustomItemList.teslaComponent.getWithDamage(4, 1), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Master, 2), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Tungsten, 16), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.NickelZincFerrite, 2), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 8), + }, Materials.SolderingAlloy.getMolten(72), CustomItemList.teslaCover.getWithDamage(1, 1), 320, 7680); + + //endregion + + //region recycling + + //LV Tesla Capacitor + GT_Values.RA.addExtractorRecipe(CustomItemList.teslaCapacitor.getWithDamage(1, 0), + GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 4), 300, 2); + //MV Tesla Capacitor + GT_Values.RA.addExtractorRecipe(CustomItemList.teslaCapacitor.getWithDamage(1, 1), + GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 6), 300, 2); + //HV Tesla Capacitor + GT_Values.RA.addExtractorRecipe(CustomItemList.teslaCapacitor.getWithDamage(1, 2), + GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 8), 300, 2); + //EV Tesla Capacitor + GT_Values.RA.addExtractorRecipe(CustomItemList.teslaCapacitor.getWithDamage(1, 3), + GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 10), 300, 2); + //IV Tesla Capacitor + GT_Values.RA.addExtractorRecipe(CustomItemList.teslaCapacitor.getWithDamage(1, 4), + GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 12), 300, 2); + + //endregion + //ha trafos //if(Loader.isModLoaded(Reference.GTPLUSPLUS)){ // GT_Values.RA.addAssemblerRecipe(CustomItemList.HA) @@ -719,62 +1235,62 @@ public class BloodyRecipeLoader implements Runnable { register_machine_EM_behaviours(); } - private void register_machine_EM_behaviours(){ - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(5),ItemList.Machine_IV_Centrifuge.get(1)); + private void register_machine_EM_behaviours() { + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Centrifuge(5), ItemList.Machine_IV_Centrifuge.get(1)); try { - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(6),ItemList.valueOf("Machine_LuV_Centrifuge").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(7),ItemList.valueOf("Machine_ZPM_Centrifuge").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(8),ItemList.valueOf("Machine_UV_Centrifuge").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(9),ItemList.valueOf("Machine_UV_Centrifuge").get(4)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(10),ItemList.valueOf("Machine_UV_Centrifuge").get(16)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(11),ItemList.valueOf("Machine_UV_Centrifuge").get(40)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(12),ItemList.valueOf("Machine_UV_Centrifuge").get(64)); - }catch (IllegalArgumentException|NullPointerException e){ - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(6),ItemList.Machine_IV_Centrifuge.get(2)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(7),ItemList.Machine_IV_Centrifuge.get(4)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(8),ItemList.Machine_IV_Centrifuge.get(8)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(9),ItemList.Machine_IV_Centrifuge.get(16)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(10),ItemList.Machine_IV_Centrifuge.get(32)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(11),ItemList.Machine_IV_Centrifuge.get(48)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Centrifuge(12),ItemList.Machine_IV_Centrifuge.get(64)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Centrifuge(6), ItemList.valueOf("Machine_LuV_Centrifuge").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Centrifuge(7), ItemList.valueOf("Machine_ZPM_Centrifuge").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Centrifuge(8), ItemList.valueOf("Machine_UV_Centrifuge").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Centrifuge(9), ItemList.valueOf("Machine_UV_Centrifuge").get(4)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Centrifuge(10), ItemList.valueOf("Machine_UV_Centrifuge").get(16)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Centrifuge(11), ItemList.valueOf("Machine_UV_Centrifuge").get(40)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Centrifuge(12), ItemList.valueOf("Machine_UV_Centrifuge").get(64)); + } catch (IllegalArgumentException | NullPointerException e) { + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Centrifuge(6), ItemList.Machine_IV_Centrifuge.get(2)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Centrifuge(7), ItemList.Machine_IV_Centrifuge.get(4)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Centrifuge(8), ItemList.Machine_IV_Centrifuge.get(8)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Centrifuge(9), ItemList.Machine_IV_Centrifuge.get(16)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Centrifuge(10), ItemList.Machine_IV_Centrifuge.get(32)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Centrifuge(11), ItemList.Machine_IV_Centrifuge.get(48)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Centrifuge(12), ItemList.Machine_IV_Centrifuge.get(64)); } - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(5),ItemList.Machine_IV_ElectromagneticSeparator.get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_ElectromagneticSeparator(5), ItemList.Machine_IV_ElectromagneticSeparator.get(1)); try { - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(6),ItemList.valueOf("Machine_LuV_ElectromagneticSeparator").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(7),ItemList.valueOf("Machine_ZPM_ElectromagneticSeparator").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(8),ItemList.valueOf("Machine_UV_ElectromagneticSeparator").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(9),ItemList.valueOf("Machine_UV_ElectromagneticSeparator").get(4)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(10),ItemList.valueOf("Machine_UV_ElectromagneticSeparator").get(16)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(11),ItemList.valueOf("Machine_UV_ElectromagneticSeparator").get(40)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(12),ItemList.valueOf("Machine_UV_ElectromagneticSeparator").get(64)); - }catch (IllegalArgumentException|NullPointerException e){ - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(6),ItemList.Machine_IV_ElectromagneticSeparator.get(2)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(7),ItemList.Machine_IV_ElectromagneticSeparator.get(4)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(8),ItemList.Machine_IV_ElectromagneticSeparator.get(8)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(9),ItemList.Machine_IV_ElectromagneticSeparator.get(16)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(10),ItemList.Machine_IV_ElectromagneticSeparator.get(32)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(11),ItemList.Machine_IV_ElectromagneticSeparator.get(48)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_ElectromagneticSeparator(12),ItemList.Machine_IV_ElectromagneticSeparator.get(64)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_ElectromagneticSeparator(6), ItemList.valueOf("Machine_LuV_ElectromagneticSeparator").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_ElectromagneticSeparator(7), ItemList.valueOf("Machine_ZPM_ElectromagneticSeparator").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_ElectromagneticSeparator(8), ItemList.valueOf("Machine_UV_ElectromagneticSeparator").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_ElectromagneticSeparator(9), ItemList.valueOf("Machine_UV_ElectromagneticSeparator").get(4)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_ElectromagneticSeparator(10), ItemList.valueOf("Machine_UV_ElectromagneticSeparator").get(16)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_ElectromagneticSeparator(11), ItemList.valueOf("Machine_UV_ElectromagneticSeparator").get(40)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_ElectromagneticSeparator(12), ItemList.valueOf("Machine_UV_ElectromagneticSeparator").get(64)); + } catch (IllegalArgumentException | NullPointerException e) { + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_ElectromagneticSeparator(6), ItemList.Machine_IV_ElectromagneticSeparator.get(2)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_ElectromagneticSeparator(7), ItemList.Machine_IV_ElectromagneticSeparator.get(4)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_ElectromagneticSeparator(8), ItemList.Machine_IV_ElectromagneticSeparator.get(8)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_ElectromagneticSeparator(9), ItemList.Machine_IV_ElectromagneticSeparator.get(16)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_ElectromagneticSeparator(10), ItemList.Machine_IV_ElectromagneticSeparator.get(32)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_ElectromagneticSeparator(11), ItemList.Machine_IV_ElectromagneticSeparator.get(48)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_ElectromagneticSeparator(12), ItemList.Machine_IV_ElectromagneticSeparator.get(64)); } - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(5),ItemList.Machine_IV_Recycler.get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Recycler(5), ItemList.Machine_IV_Recycler.get(1)); try { - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(6),ItemList.valueOf("Machine_LuV_Recycler").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(7),ItemList.valueOf("Machine_ZPM_Recycler").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(8),ItemList.valueOf("Machine_UV_Recycler").get(1)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(9),ItemList.valueOf("Machine_UV_Recycler").get(4)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(10),ItemList.valueOf("Machine_UV_Recycler").get(16)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(11),ItemList.valueOf("Machine_UV_Recycler").get(40)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(12),ItemList.valueOf("Machine_UV_Recycler").get(64)); - }catch (IllegalArgumentException|NullPointerException e){ - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(6),ItemList.Machine_IV_Recycler.get(2)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(7),ItemList.Machine_IV_Recycler.get(4)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(8),ItemList.Machine_IV_Recycler.get(8)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(9),ItemList.Machine_IV_Recycler.get(16)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(10),ItemList.Machine_IV_Recycler.get(32)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(11),ItemList.Machine_IV_Recycler.get(48)); - GT_MetaTileEntity_EM_machine.registerBehaviour(()->new Behaviour_Recycler(12),ItemList.Machine_IV_Recycler.get(64)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Recycler(6), ItemList.valueOf("Machine_LuV_Recycler").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Recycler(7), ItemList.valueOf("Machine_ZPM_Recycler").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Recycler(8), ItemList.valueOf("Machine_UV_Recycler").get(1)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Recycler(9), ItemList.valueOf("Machine_UV_Recycler").get(4)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Recycler(10), ItemList.valueOf("Machine_UV_Recycler").get(16)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Recycler(11), ItemList.valueOf("Machine_UV_Recycler").get(40)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Recycler(12), ItemList.valueOf("Machine_UV_Recycler").get(64)); + } catch (IllegalArgumentException | NullPointerException e) { + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Recycler(6), ItemList.Machine_IV_Recycler.get(2)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Recycler(7), ItemList.Machine_IV_Recycler.get(4)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Recycler(8), ItemList.Machine_IV_Recycler.get(8)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Recycler(9), ItemList.Machine_IV_Recycler.get(16)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Recycler(10), ItemList.Machine_IV_Recycler.get(32)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Recycler(11), ItemList.Machine_IV_Recycler.get(48)); + GT_MetaTileEntity_EM_machine.registerBehaviour(() -> new Behaviour_Recycler(12), ItemList.Machine_IV_Recycler.get(64)); } } -} +}
\ No newline at end of file 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..d7e9a21a67 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/loader/thing/CoverLoader.java @@ -0,0 +1,24 @@ +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 gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.objects.GT_RenderedTexture; +import net.minecraft.item.ItemStack; + + + +public class CoverLoader implements Runnable { + public void run() { + final IIconContainer TESLA_OVERLAY = new Textures.BlockIcons.CustomIcon("iconsets/TESLA_OVERLAY"); + final IIconContainer TESLA_OVERLAY_ULTIMATE = new Textures.BlockIcons.CustomIcon("iconsets/TESLA_OVERLAY_ULTIMATE"); + + GregTech_API.registerCover(new ItemStack(TeslaCoilCover.INSTANCE, 1, 0), new GT_RenderedTexture(TESLA_OVERLAY), new GT_Cover_TM_TeslaCoil()); + GregTech_API.registerCover(new ItemStack(TeslaCoilCover.INSTANCE, 1, 1), new GT_RenderedTexture(TESLA_OVERLAY_ULTIMATE), 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 988fd30031..0f127f9f6f 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 @@ -90,6 +90,42 @@ public class MachineLoader implements Runnable { eM_muffler_UXV.set(new GT_MetaTileEntity_Hatch_OverflowElemental( 15025, "hatch.emmuffler.tier.13", "UXV Overflow Output Hatch", 13, 125e12f).getStackForm(1L)); + + // =================================================================================================== + // Microcontrollers + // =================================================================================================== + + eM_avr_HV.set(new GT_MetaTileEntity_MicroController( + 15030, "machine.avr.tier.08", "HV AVR Micro-controller", 3).getStackForm(1L)); + + eM_avr_EV.set(new GT_MetaTileEntity_MicroController( + 15031, "machine.avr.tier.08", "EV AVR Micro-controller", 4).getStackForm(1L)); + + eM_avr_IV.set(new GT_MetaTileEntity_MicroController( + 15032, "machine.avr.tier.08", "IV AVR Micro-controller", 5).getStackForm(1L)); + + eM_avr_LuV.set(new GT_MetaTileEntity_MicroController( + 15033, "machine.avr.tier.08", "LuV AVR Micro-controller", 6).getStackForm(1L)); + + eM_avr_ZPM.set(new GT_MetaTileEntity_MicroController( + 15034, "machine.avr.tier.08", "ZPM AVR Micro-controller", 7).getStackForm(1L)); + + eM_avr_UV.set(new GT_MetaTileEntity_MicroController( + 15035, "machine.avr.tier.08", "UV AVR Micro-controller", 8).getStackForm(1L)); + + eM_avr_UHV.set(new GT_MetaTileEntity_MicroController( + 15036, "machine.avr.tier.09", "UHV AVR Micro-controller", 9).getStackForm(1L)); + + eM_avr_UEV.set(new GT_MetaTileEntity_MicroController( + 15037, "machine.avr.tier.10", "UEV AVR Micro-controller", 10).getStackForm(1L)); + + eM_avr_UIV.set(new GT_MetaTileEntity_MicroController( + 15038, "machine.avr.tier.11", "UIV AVR Micro-controller", 11).getStackForm(1L)); + + eM_avr_UMV.set(new GT_MetaTileEntity_MicroController( + 15039, "machine.avr.tier.12", "UMV AVR Micro-controller", 12).getStackForm(1L)); + + // =================================================================================================== // Multi AMP Power INPUTS // =================================================================================================== @@ -157,7 +193,6 @@ public class MachineLoader implements Runnable { eM_energyMulti64_UXV.set(new GT_MetaTileEntity_Hatch_EnergyMulti( 15128, "hatch.energymulti64.tier.13", "UXV 64A Energy Hatch", 13, 64).getStackForm(1L)); - // =================================================================================================== // Multi AMP Laser INPUTS // =================================================================================================== @@ -297,13 +332,12 @@ public class MachineLoader implements Runnable { eM_energyTunnel7_UXV.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( 15198, "hatch.energytunnel7.tier.13", "UXV 1048576/t Laser Target Hatch", 13, 1048576).getStackForm(1L)); eM_energyTunnel9001.set(new GT_MetaTileEntity_Hatch_EnergyTunnel( - 15199, "hatch.energytunnel.tier.14", "Legendary Laser Target Hatch", 14, (int)V[14]).getStackForm(1L)); + 15199, "hatch.energytunnel.tier.14", "Legendary Laser Target Hatch", 14, (int) V[14]).getStackForm(1L)); // =================================================================================================== // Multi AMP Power OUTPUTS // =================================================================================================== - eM_dynamoMulti4_IV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( 15200, "hatch.dynamomulti04.tier.05", "IV 4A Dynamo Hatch", 5, 4).getStackForm(1L)); eM_dynamoMulti16_IV.set(new GT_MetaTileEntity_Hatch_DynamoMulti( @@ -506,19 +540,19 @@ public class MachineLoader implements Runnable { eM_dynamoTunnel7_UXV.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( 15298, "hatch.dynamotunnel7.tier.13", "UXV 1048576/t Laser Source Hatch", 13, 1048576).getStackForm(1L)); eM_dynamoTunnel9001.set(new GT_MetaTileEntity_Hatch_DynamoTunnel( - 15299, "hatch.dynamotunnel.tier.14", "Legendary Laser Source Hatch", 14, (int)V[14]).getStackForm(1L)); - + 15299, "hatch.dynamotunnel.tier.14", "Legendary Laser Source Hatch", 14, (int) V[14]).getStackForm(1L)); + // =================================================================================================== // MULTIBLOCKS // =================================================================================================== Machine_Multi_Transformer.set(new GT_MetaTileEntity_EM_transformer(15300, "multimachine.em.transformer", "Active Transformer").getStackForm(1L)); + Machine_Multi_Microwave.set(new GT_MetaTileEntity_TM_microwave(15312, "multimachine.tm.microwave", "Microwave Grinder").getStackForm(1L)); + Machine_Multi_TeslaCoil.set(new GT_MetaTileEntity_TM_teslaCoil(15314, "multimachine.tm.teslaCoil", "Tesla Tower").getStackForm(1L)); Machine_Multi_Switch.set(new GT_MetaTileEntity_EM_switch(15310, "multimachine.em.switch", "Network Switch With QoS").getStackForm(1L)); Machine_Multi_Computer.set(new GT_MetaTileEntity_EM_computer(15311, "multimachine.em.computer", "Quantum Computer").getStackForm(1L)); - Machine_Multi_Microwave.set(new GT_MetaTileEntity_TM_microwave(15312, "multimachine.tm.microwave", "Microwave Grinder").getStackForm(1L)); Machine_Multi_DataBank.set(new GT_MetaTileEntity_EM_dataBank(15313, "multimachine.em.databank", "Data Bank").getStackForm(1L)); - Machine_Multi_teslaCoil.set(new GT_MetaTileEntity_TM_teslaCoil(15314, "multimachine.tm.teslaCoil", "Tesla Coil").getStackForm(1L)); Machine_Multi_EMjunction.set(new GT_MetaTileEntity_EM_junction(15320, "multimachine.em.junction", "Matter Junction").getStackForm(1L)); Machine_Multi_MatterToEM.set(new GT_MetaTileEntity_EM_quantizer(15321, "multimachine.em.mattertoem", "Matter Quantizer").getStackForm(1L)); @@ -566,7 +600,7 @@ public class MachineLoader implements Runnable { rack_Hatch.set(new GT_MetaTileEntity_Hatch_Rack(15450, "hatch.rack.tier.08", "Computer Rack", 8, "4 Slot Rack").getStackForm(1L)); holder_Hatch.set(new GT_MetaTileEntity_Hatch_Holder(15451, "hatch.holder.tier.09", "Object Holder", 8, "For Research Station").getStackForm(1L)); - capacitor_Hatch.set(new GT_MetaTileEntity_Hatch_Capacitor(15452, "hatch.capacitor.tier.05", "Capacitor Hatch", 5, "For Tesla Coil").getStackForm(1L)); + capacitor_Hatch.set(new GT_MetaTileEntity_Hatch_Capacitor(15452, "hatch.capacitor.tier.03", "Capacitor Hatch", 3, "For Tesla Tower").getStackForm(1L)); // =================================================================================================== // Pipes @@ -583,6 +617,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)); @@ -594,10 +632,38 @@ 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_1by1_LV.set(new GT_MetaTileEntity_TeslaCoil(16000, "machine.tt.tesla.01", "Basic Tesla Transceiver", 1, 1).getStackForm(1L)); + Machine_TeslaCoil_1by1_MV.set(new GT_MetaTileEntity_TeslaCoil(16001, "machine.tt.tesla.02", "Advanced Tesla Transceiver", 2, 1).getStackForm(1L)); + Machine_TeslaCoil_1by1_HV.set(new GT_MetaTileEntity_TeslaCoil(16002, "machine.tt.tesla.03", "Epyc Tesla Transceiver", 3, 1).getStackForm(1L)); + Machine_TeslaCoil_1by1_EV.set(new GT_MetaTileEntity_TeslaCoil(16003, "machine.tt.tesla.04", "Ultimate Power Tesla Transceiver", 4, 1).getStackForm(1L)); + Machine_TeslaCoil_1by1_IV.set(new GT_MetaTileEntity_TeslaCoil(16004, "machine.tt.tesla.05", "Insane Tesla Transceiver", 5, 1).getStackForm(1L)); + + Machine_TeslaCoil_2by2_LV.set(new GT_MetaTileEntity_TeslaCoil(16005, "machine.tt.tesla.01", "Basic Tesla Transceiver", 1, 4).getStackForm(1L)); + Machine_TeslaCoil_2by2_MV.set(new GT_MetaTileEntity_TeslaCoil(16006, "machine.tt.tesla.02", "Advanced Tesla Transceiver", 2, 4).getStackForm(1L)); + Machine_TeslaCoil_2by2_HV.set(new GT_MetaTileEntity_TeslaCoil(16007, "machine.tt.tesla.03", "Epyc Tesla Transceiver", 3, 4).getStackForm(1L)); + Machine_TeslaCoil_2by2_EV.set(new GT_MetaTileEntity_TeslaCoil(16008, "machine.tt.tesla.04", "Ultimate Power Tesla Transceiver", 4, 4).getStackForm(1L)); + Machine_TeslaCoil_2by2_IV.set(new GT_MetaTileEntity_TeslaCoil(16009, "machine.tt.tesla.05", "Insane Tesla Transceiver", 5, 4).getStackForm(1L)); + + Machine_TeslaCoil_3by3_LV.set(new GT_MetaTileEntity_TeslaCoil(16010, "machine.tt.tesla.01", "Basic Tesla Transceiver", 1, 9).getStackForm(1L)); + Machine_TeslaCoil_3by3_MV.set(new GT_MetaTileEntity_TeslaCoil(16011, "machine.tt.tesla.02", "Advanced Tesla Transceiver", 2, 9).getStackForm(1L)); + Machine_TeslaCoil_3by3_HV.set(new GT_MetaTileEntity_TeslaCoil(16012, "machine.tt.tesla.03", "Epyc Tesla Transceiver", 3, 9).getStackForm(1L)); + Machine_TeslaCoil_3by3_EV.set(new GT_MetaTileEntity_TeslaCoil(16013, "machine.tt.tesla.04", "Ultimate Power Tesla Transceiver", 4, 9).getStackForm(1L)); + Machine_TeslaCoil_3by3_IV.set(new GT_MetaTileEntity_TeslaCoil(16014, "machine.tt.tesla.05", "Insane Tesla Transceiver", 5, 9).getStackForm(1L)); + + Machine_TeslaCoil_4by4_LV.set(new GT_MetaTileEntity_TeslaCoil(16015, "machine.tt.tesla.01", "Basic Tesla Transceiver", 1, 16).getStackForm(1L)); + Machine_TeslaCoil_4by4_MV.set(new GT_MetaTileEntity_TeslaCoil(16016, "machine.tt.tesla.02", "Advanced Tesla Transceiver", 2, 16).getStackForm(1L)); + Machine_TeslaCoil_4by4_HV.set(new GT_MetaTileEntity_TeslaCoil(16017, "machine.tt.tesla.03", "Epyc Tesla Transceiver", 3, 16).getStackForm(1L)); + Machine_TeslaCoil_4by4_EV.set(new GT_MetaTileEntity_TeslaCoil(16018, "machine.tt.tesla.04", "Ultimate Power Tesla Transceiver", 4, 16).getStackForm(1L)); + Machine_TeslaCoil_4by4_IV.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)); - hatch_CreativeData.set(new GT_MetaTileEntity_Hatch_CreativeData(15496,"debug.tt.data","Debug Data Hatch",15).getStackForm(1)); + Machine_DebugPollutor.set(new GT_MetaTileEntity_DebugPollutor(15495, "debug.tt.pollutor", "Debug Pollution Generator", 15).getStackForm(1)); + hatch_CreativeData.set(new GT_MetaTileEntity_Hatch_CreativeData(15496, "debug.tt.data", "Debug Data Hatch", 15).getStackForm(1)); hatch_CreativeMaintenance.set(new GT_MetaTileEntity_Hatch_CreativeMaintenance(15497, "debug.tt.maintenance", "Debug Maintenance Hatch", 15).getStackForm(1L)); Machine_DebugGenny.set(new GT_MetaTileEntity_DebugPowerGenerator(15498, "debug.tt.genny", "Debug Power Generator", 15).getStackForm(1L)); Machine_DebugWriter.set(new GT_MetaTileEntity_DebugStructureWriter(15499, "debug.tt.writer", "Debug Structure Writer", 15).getStackForm(1L)); @@ -608,10 +674,13 @@ 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(); } } -} +}
\ No newline at end of file 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..4596e8a2c8 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"); @@ -58,8 +57,14 @@ public class ThingsLoader implements Runnable { ParametrizerMemoryCard.run(); ElementalDefinitionScanStorage_EM.run(); EuMeterGT.run(); + TeslaStaff.run(); + TeslaCoilCover.run(); + TeslaCoilCapacitor.run(); TecTech.LOGGER.info("Useful Items registered"); + TeslaCoilComponent.run(); + TecTech.LOGGER.info("Crafting Components registered"); + ElementalDefinitionContainer_EM.run(); DebugElementalInstanceContainer_EM.run(); TecTech.LOGGER.info("Debug Items registered"); diff --git a/src/main/java/com/github/technus/tectech/mechanics/avr/SidedRedstone.java b/src/main/java/com/github/technus/tectech/mechanics/avr/SidedRedstone.java new file mode 100644 index 0000000000..fd351631f3 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/avr/SidedRedstone.java @@ -0,0 +1,248 @@ +package com.github.technus.tectech.mechanics.avr; + +import com.github.technus.avrClone.AvrCore; +import com.github.technus.avrClone.registerPackages.*; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; + +public class SidedRedstone extends RegisterPackageSync<IGregTechTileEntity> { + public static final RSINT RSINT =new RSINT(); + + public SidedRedstone(int offset) { + super(offset, Register.values().length); + addRegisters(Register.values()); + addBits(RegisterBitsPCMSK.values()); + addBits(RegisterBitsPCFR.values()); + addBits(RegisterBitsPCINT.values()); + addBits(RegisterBitsPNEW.values()); + addBits(RegisterBitsPOLD.values()); + addInterrupts(RSINT); + } + + @Override + public void preSync(AvrCore core,IGregTechTileEntity iGregTechTileEntity) { + int addr=this.getOffset(); + int sides=0; + for(byte i=0;i<6;i++){ + int val=iGregTechTileEntity.getInternalInputRedstoneSignal(i); + sides|=(val > 0?1:0)<<i; + core.setDataValue(addr++,iGregTechTileEntity.getInputRedstoneSignal(i)); + core.setDataValue(addr++,val); + addr++; + } + int sidesOld = core.getDataValue(Register.PNEW.getAddress(this)); + core.setDataValue(Register.POLD.getAddress(this),sidesOld); + core.setDataValue(Register.PNEW.getAddress(this),sides); + + if(core.getInterruptEnable()) { + int pcint=core.getDataValue(Register.PCINT.getAddress(this)); + int changesDetected=0; + switch (pcint&0b1100){//PCISC1 PCISC0 + case 0b0000://low + changesDetected= ~sides & core.getDataValue(Register.PCMSK.getAddress(this)); + break; + case 0b0100://any + changesDetected= (sides ^ sidesOld) & core.getDataValue(Register.PCMSK.getAddress(this)); + break; + case 0b1000://falling + changesDetected= ~sides & sidesOld & core.getDataValue(Register.PCMSK.getAddress(this)); + break; + case 0b1100://rising + changesDetected= sides & ~sidesOld & core.getDataValue(Register.PCMSK.getAddress(this)); + break; + } + + core.setDataValue(Register.PCFR.getAddress(this), + core.getDataValue(Register.PCFR.getAddress(this) | changesDetected)); + + if (changesDetected > 0) { + if (core.getDataBitsOr(Register.PCINT.getAddress(this), RegisterBitsPCINT.PCEN.mask)) { + core.setDataBits(Register.PCINT.getAddress(this), RegisterBitsPCINT.PCIF.mask); + } + } + } + } + + @Override + public void postSync(AvrCore core,IGregTechTileEntity iGregTechTileEntity) { + int addr=this.getOffset(); + for(byte i=0;i<6;i++){ + iGregTechTileEntity.setOutputRedstoneSignal(i,(byte)core.getDataValue(addr));//allows edge detection hack? + addr+=3; + } + } + + public enum Register implements IRegister<SidedRedstone>{ + PIN0,PINT0,PORT0, + PIN1,PINT1,PORT1, + PIN2,PINT2,PORT2, + PIN3,PINT3,PORT3, + PIN4,PINT4,PORT4, + PIN5,PINT5,PORT5, + PCMSK,PCFR,PCINT,PNEW,POLD; + + public final int relativeOffset; + + Register(){ + this.relativeOffset =ordinal(); + } + + @Override + public int getAddress(SidedRedstone registerPackage) { + return registerPackage.getOffset()+relativeOffset; + } + } + + public enum RegisterBitsPCMSK implements IRegisterBit<SidedRedstone>{ + PCINT0,PCINT1,PCINT2,PCINT3,PCINT4,PCINT5; + + private final int bit,mask; + + RegisterBitsPCMSK(){ + bit=ordinal(); + mask=1<<bit; + } + + @Override + public int getBitPosition() { + return bit; + } + + @Override + public int getBitMask() { + return mask; + } + + @Override + public int getOffset(SidedRedstone registerPackage) { + return 18; + } + } + + public enum RegisterBitsPCFR implements IRegisterBit<SidedRedstone>{ + PCF0,PCF1,PCF2,PCF3,PCF4,PCF5; + + private final int bit,mask; + + RegisterBitsPCFR(){ + bit=ordinal(); + mask=1<<bit; + } + + @Override + public int getBitPosition() { + return bit; + } + + @Override + public int getBitMask() { + return mask; + } + + @Override + public int getOffset(SidedRedstone registerPackage) { + return 19; + } + } + + public enum RegisterBitsPCINT implements IRegisterBit<SidedRedstone>{ + PCIF,PCEN,PCISC0,PCISC1; + + private final int bit,mask; + + RegisterBitsPCINT(){ + bit=ordinal(); + mask=1<<bit; + } + + @Override + public int getBitPosition() { + return bit; + } + + @Override + public int getBitMask() { + return mask; + } + + @Override + public int getOffset(SidedRedstone registerPackage) { + return 20; + } + } + + public enum RegisterBitsPNEW implements IRegisterBit<SidedRedstone>{ + PNEW0,PNEW1,PNEW2,PNEW3,PNEW4,PNEW5; + + private final int bit,mask; + + RegisterBitsPNEW(){ + bit=ordinal(); + mask=1<<bit; + } + + @Override + public int getBitPosition() { + return bit; + } + + @Override + public int getBitMask() { + return mask; + } + + @Override + public int getOffset(SidedRedstone registerPackage) { + return 21; + } + } + + public enum RegisterBitsPOLD implements IRegisterBit<SidedRedstone>{ + POLD0,POLD1,POLD2,POLD3,POLD4,POLD5; + + private final int bit,mask; + + RegisterBitsPOLD(){ + bit=ordinal(); + mask=1<<bit; + } + + @Override + public int getBitPosition() { + return bit; + } + + @Override + public int getBitMask() { + return mask; + } + + @Override + public int getOffset(SidedRedstone registerPackage) { + return 22; + } + } + + public static class RSINT implements IInterrupt<SidedRedstone>{ + @Override + public int getVector() { + return 1; + } + + @Override + public boolean getTrigger(AvrCore core, SidedRedstone registerPackage) { + return (core.getDataValue(Register.PCINT.getAddress(registerPackage))&1)==1; + } + + @Override + public void setTrigger(AvrCore core, SidedRedstone registerPackage, boolean value) { + int val=core.getDataValue(Register.PCINT.getAddress(registerPackage)); + core.setDataValue(Register.PCINT.getAddress(registerPackage), + value?val|RegisterBitsPCINT.PCIF.mask:val&~RegisterBitsPCINT.PCIF.mask); + } + + @Override + public String name() { + return "RSINT"; + } + } +} diff --git a/src/main/java/com/github/technus/tectech/mechanics/data/RendererMessage.java b/src/main/java/com/github/technus/tectech/mechanics/data/RendererMessage.java new file mode 100644 index 0000000000..514b8b88ad --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/data/RendererMessage.java @@ -0,0 +1,82 @@ +package com.github.technus.tectech.mechanics.data; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import cpw.mods.fml.common.network.simpleimpl.MessageContext; +import eu.usrv.yamcore.network.client.AbstractClientMessageHandler; +import io.netty.buffer.ByteBuf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; +import net.minecraftforge.common.DimensionManager; +import thaumcraft.client.fx.bolt.FXLightningBolt; + +import java.io.*; +import java.util.Arrays; +import java.util.HashSet; + +public class RendererMessage implements IMessage { + HashSet<ThaumSpark> sparkList = new HashSet<ThaumSpark>(); + + public RendererMessage() { + } + + @Override + public void fromBytes(ByteBuf pBuffer) { + try { + //I'd love to know why I need to offset by one byte for this to work + byte[] boop = pBuffer.array(); + boop = Arrays.copyOfRange(boop, 1, boop.length); + InputStream is = new ByteArrayInputStream(boop); + ObjectInputStream ois = new ObjectInputStream(is); + Object data = ois.readObject(); + sparkList = (HashSet<ThaumSpark>) data; + } catch (IOException | ClassNotFoundException ex) { + } + } + + @Override + public void toBytes(ByteBuf pBuffer) { + try { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(baos); + oos.writeObject(sparkList); + oos.flush(); + InputStream is = new ByteArrayInputStream(baos.toByteArray()); + pBuffer.writeBytes(is, baos.toByteArray().length); + } catch (IOException ex) { + } + } + + public static class RendererData extends RendererMessage { + public RendererData() { + } + + public RendererData(HashSet<ThaumSpark> eSparkList) { + sparkList = eSparkList; + } + } + + + public static class ClientHandler extends AbstractClientMessageHandler<RendererData> { + @Override + public IMessage handleClientMessage(EntityPlayer pPlayer, RendererData pMessage, MessageContext pCtx) { + for (ThaumSpark sp : pMessage.sparkList) { + thaumLightning(sp.x, sp.y, sp.z, sp.xR, sp.yR, sp.zR, sp.wID); + } + pMessage.sparkList.clear(); + return null; + } + } + + private static void thaumLightning(int tX, int tY, int tZ, int tXN, int tYN, int tZN, int wID) { + //This is enough to check for thaum, since it only ever matters for client side effects (Tested not to crash) + if (Loader.isModLoaded("Thaumcraft")) { + World world = DimensionManager.getWorld(wID); + FXLightningBolt bolt = new FXLightningBolt(world, tX + 0.5F, tY + 0.5F, tZ + 0.5F, tX + tXN + 0.5F, tY + tYN + 0.5F, tZ + tZN + 0.5F, world.rand.nextLong(), 6, 0.5F, 8); + bolt.defaultFractal(); + bolt.setType(2); + bolt.setWidth(0.125F); + bolt.finalizeBolt(); + } + } +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/mechanics/data/ThaumSpark.java b/src/main/java/com/github/technus/tectech/mechanics/data/ThaumSpark.java new file mode 100644 index 0000000000..99f3696aa9 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/mechanics/data/ThaumSpark.java @@ -0,0 +1,54 @@ +package com.github.technus.tectech.mechanics.data;
+
+import java.io.Serializable;
+import java.util.Objects;
+
+public class ThaumSpark implements Serializable {
+ //This works regardless of if TC is loaded
+ private static final long serialVersionUID = -7037856938316679566L;
+ public int x, y, z, wID;
+ public byte xR, yR, zR;
+
+ public ThaumSpark(){
+ this.x = 0;
+ this.z = 0;
+ this.y = 0;
+
+ this.xR = 0;
+ this.yR = 0;
+ this.zR = 0;
+
+ this.wID = 0;
+ }
+
+ public ThaumSpark(int x, int y, int z, byte xR, byte yR, byte zR, int wID) {
+ this.x = x;
+ this.z = z;
+ this.y = y;
+
+ this.xR = xR;
+ this.yR = yR;
+ this.zR = zR;
+
+ this.wID = wID;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ ThaumSpark that = (ThaumSpark) o;
+ return x == that.x &&
+ y == that.y &&
+ z == that.z &&
+ wID == that.wID &&
+ xR == that.xR &&
+ yR == that.yR &&
+ zR == that.zR;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(x, y, z, wID, xR, yR, zR);
+ }
+}
diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/templates/cElementalPrimitive.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/templates/cElementalPrimitive.java index 63642d6dbd..24033ba945 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/templates/cElementalPrimitive.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/templates/cElementalPrimitive.java @@ -18,7 +18,7 @@ import java.util.Map; import static com.github.technus.tectech.Util.areBitsSet; import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.cPrimitiveDefinition.null__; -import static com.github.technus.tectech.thing.item.DebugElementalInstanceContainer_EM.stacksRegistered; +import static com.github.technus.tectech.thing.item.DebugElementalInstanceContainer_EM.STACKS_REGISTERED; import static com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_scanner.*; /** @@ -68,7 +68,7 @@ public abstract class cElementalPrimitive extends cElementalDefinition { if (bindsBO.put(ID, this) != null) { Minecraft.getMinecraft().crashed(new CrashReport("Primitive definition", new tElementalException("Duplicate ID"))); } - stacksRegistered.add(this); + STACKS_REGISTERED.add(this); } // diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/transformations/bTransformationInfo.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/transformations/bTransformationInfo.java index d0c0bf04aa..c23894d6b1 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/transformations/bTransformationInfo.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/transformations/bTransformationInfo.java @@ -11,7 +11,7 @@ import net.minecraftforge.oredict.OreDictionary; import java.util.HashMap; -import static com.github.technus.tectech.thing.item.DebugElementalInstanceContainer_EM.stacksRegistered; +import static com.github.technus.tectech.thing.item.DebugElementalInstanceContainer_EM.STACKS_REGISTERED; /** * Created by Tec on 26.05.2017. @@ -41,22 +41,22 @@ public class bTransformationInfo { public void addFluid(iHasElementalDefinition em, FluidStack fluidStack){ fluidQuantization.put(fluidStack.getFluidID(),new aFluidQuantizationInfo(fluidStack,em)); fluidDequantization.put(em.getDefinition(),new aFluidDequantizationInfo(em,fluidStack)); - stacksRegistered.add(em.getDefinition()); - stacksRegistered.add(em.getDefinition().getAnti()); + STACKS_REGISTERED.add(em.getDefinition()); + STACKS_REGISTERED.add(em.getDefinition().getAnti()); } public void addFluid(iHasElementalDefinition em ,int fluidID,int fluidAmount) { fluidQuantization.put(fluidID,new aFluidQuantizationInfo(fluidID,fluidAmount,em)); fluidDequantization.put(em.getDefinition(),new aFluidDequantizationInfo(em,fluidID,fluidAmount)); - stacksRegistered.add(em.getDefinition()); - stacksRegistered.add(em.getDefinition().getAnti()); + STACKS_REGISTERED.add(em.getDefinition()); + STACKS_REGISTERED.add(em.getDefinition().getAnti()); } public void addFluid(iHasElementalDefinition em, Fluid fluid, int fluidAmount){ fluidQuantization.put(fluid.getID(),new aFluidQuantizationInfo(fluid,fluidAmount,em)); fluidDequantization.put(em.getDefinition(),new aFluidDequantizationInfo(em,fluid,fluidAmount)); - stacksRegistered.add(em.getDefinition()); - stacksRegistered.add(em.getDefinition().getAnti()); + STACKS_REGISTERED.add(em.getDefinition()); + STACKS_REGISTERED.add(em.getDefinition().getAnti()); } private void addItemQuantization(aItemQuantizationInfo aIQI){ @@ -66,42 +66,42 @@ public class bTransformationInfo { public void addItem(iHasElementalDefinition em, ItemStack itemStack, boolean skipNBT){ addItemQuantization(new aItemQuantizationInfo(itemStack,skipNBT,em)); itemDequantization.put(em.getDefinition(),new aItemDequantizationInfo(em,itemStack)); - stacksRegistered.add(em.getDefinition()); - stacksRegistered.add(em.getDefinition().getAnti()); + STACKS_REGISTERED.add(em.getDefinition()); + STACKS_REGISTERED.add(em.getDefinition().getAnti()); } public void addItem(iHasElementalDefinition em, OrePrefixes prefix, Materials material, int amount, boolean skipNBT){ addItemQuantization(new aItemQuantizationInfo(prefix,material,amount,skipNBT,em)); itemDequantization.put(em.getDefinition(),new aItemDequantizationInfo(em,prefix,material,amount)); - stacksRegistered.add(em.getDefinition()); - stacksRegistered.add(em.getDefinition().getAnti()); + STACKS_REGISTERED.add(em.getDefinition()); + STACKS_REGISTERED.add(em.getDefinition().getAnti()); } public void addOredict(iHasElementalDefinition em, int id, int qty){ oredictQuantization.put(id,new aOredictQuantizationInfo(id,qty,em)); oredictDequantization.put(em.getDefinition(),new aOredictDequantizationInfo(em,id,qty)); - stacksRegistered.add(em.getDefinition()); - stacksRegistered.add(em.getDefinition().getAnti()); + STACKS_REGISTERED.add(em.getDefinition()); + STACKS_REGISTERED.add(em.getDefinition().getAnti()); } public void addOredict(iHasElementalDefinition em, String name, int qty){ oredictQuantization.put(OreDictionary.getOreID(name),new aOredictQuantizationInfo(name,qty,em)); oredictDequantization.put(em.getDefinition(),new aOredictDequantizationInfo(em,name,qty)); - stacksRegistered.add(em.getDefinition()); - stacksRegistered.add(em.getDefinition().getAnti()); + STACKS_REGISTERED.add(em.getDefinition()); + STACKS_REGISTERED.add(em.getDefinition().getAnti()); } public void addOredict(iHasElementalDefinition em, OrePrefixes prefix, Materials material, int qty){ oredictQuantization.put(OreDictionary.getOreID(prefix.name() + material.mName),new aOredictQuantizationInfo(prefix,material,qty,em)); oredictDequantization.put(em.getDefinition(),new aOredictDequantizationInfo(em,prefix,material,qty)); - stacksRegistered.add(em.getDefinition()); - stacksRegistered.add(em.getDefinition().getAnti()); + STACKS_REGISTERED.add(em.getDefinition()); + STACKS_REGISTERED.add(em.getDefinition().getAnti()); } public void addOredict(iHasElementalDefinition em, OrePrefixes prefix, String materialName, int qty){ oredictQuantization.put(OreDictionary.getOreID(prefix.name() + materialName),new aOredictQuantizationInfo(prefix,materialName,qty,em)); oredictDequantization.put(em.getDefinition(),new aOredictDequantizationInfo(em,prefix,materialName,qty)); - stacksRegistered.add(em.getDefinition()); - stacksRegistered.add(em.getDefinition().getAnti()); + STACKS_REGISTERED.add(em.getDefinition()); + STACKS_REGISTERED.add(em.getDefinition().getAnti()); } } diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/dHadronDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/dHadronDefinition.java index a1380526eb..404f116adf 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/dHadronDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/dHadronDefinition.java @@ -12,12 +12,16 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.templates.iElem import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.*; import com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.eBosonDefinition; import com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.eQuarkDefinition; +import com.github.technus.tectech.thing.item.DebugElementalInstanceContainer_EM; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.oredict.OreDictionary; import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.TreeMap; import static com.github.technus.tectech.compatibility.thaumcraft.elementalMatter.definitions.dComplexAspectDefinition.getNbtTagCompound; import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; @@ -34,6 +38,8 @@ public final class dHadronDefinition extends cElementalDefinition {//TODO Optimi private static final byte nbtType = (byte) 'h'; //Helpers + public static final Map<dHadronDefinition,String> SYMBOL_MAP =new HashMap<>(); + public static final Map<dHadronDefinition,String> NAME_MAP =new HashMap<>(); public static dHadronDefinition hadron_p, hadron_n, hadron_p_, hadron_n_; public static cElementalDefinitionStack hadron_p1, hadron_n1, hadron_p2, hadron_n2, hadron_p3, hadron_n3, hadron_p5; private static float protonMass = 0F; @@ -137,8 +143,13 @@ public final class dHadronDefinition extends cElementalDefinition {//TODO Optimi public String getName() { StringBuilder name= new StringBuilder(getSimpleName()); name.append(':'); - for (cElementalDefinitionStack quark : quarkStacks.values()) { - name.append(' ').append(quark.definition.getSymbol()).append(quark.amount); + String sym= NAME_MAP.get(this); + if(sym!=null){ + name.append(' ').append(sym); + }else { + for (cElementalDefinitionStack quark : quarkStacks.values()) { + name.append(' ').append(quark.definition.getSymbol()).append(quark.amount); + } } return name.toString(); } @@ -162,24 +173,34 @@ public final class dHadronDefinition extends cElementalDefinition {//TODO Optimi @Override public String getSymbol() { - StringBuilder symbol = new StringBuilder(8); - for (cElementalDefinitionStack quark : quarkStacks.values()) { - for (int i = 0; i < quark.amount; i++) { - symbol.append(quark.definition.getSymbol()); + String sym=SYMBOL_MAP.get(this); + if(sym!=null){ + return sym; + }else { + StringBuilder symbol = new StringBuilder(8); + for (cElementalDefinitionStack quark : quarkStacks.values()) { + for (int i = 0; i < quark.amount; i++) { + symbol.append(quark.definition.getSymbol()); + } } + return symbol.toString(); } - return symbol.toString(); } @Override public String getShortSymbol() { - StringBuilder symbol = new StringBuilder(8); - for (cElementalDefinitionStack quark : quarkStacks.values()) { - for (int i = 0; i < quark.amount; i++) { - symbol.append(quark.definition.getShortSymbol()); + String sym=SYMBOL_MAP.get(this); + if(sym!=null){ + return sym; + }else { + StringBuilder symbol = new StringBuilder(8); + for (cElementalDefinitionStack quark : quarkStacks.values()) { + for (int i = 0; i < quark.amount; i++) { + symbol.append(quark.definition.getShortSymbol()); + } } + return symbol.toString(); } - return symbol.toString(); } @Override @@ -391,12 +412,24 @@ public final class dHadronDefinition extends cElementalDefinition {//TODO Optimi protonMass = hadron_p.mass; //redefine the proton with proper lifetime (the lifetime is based on mass comparison) hadron_p = new dHadronDefinition(new cElementalDefinitionStackMap(eQuarkDefinition.quark_u.getStackForm(2), eQuarkDefinition.quark_d.getStackForm(1))); + SYMBOL_MAP.put(hadron_p,"p"); + NAME_MAP.put(hadron_p,"Proton"); + DebugElementalInstanceContainer_EM.STACKS_REGISTERED.add(hadron_p); hadron_p_ = (dHadronDefinition) hadron_p.getAnti(); + SYMBOL_MAP.put(hadron_p_,"~p"); + NAME_MAP.put(hadron_p_,"Anti Proton"); + DebugElementalInstanceContainer_EM.STACKS_REGISTERED.add(hadron_p_); hadron_n = new dHadronDefinition(new cElementalDefinitionStackMap(eQuarkDefinition.quark_u.getStackForm(1), eQuarkDefinition.quark_d.getStackForm(2))); neutronMass = hadron_n.mass; //redefine the neutron with proper lifetime (the lifetime is based on mass comparison) hadron_n = new dHadronDefinition(new cElementalDefinitionStackMap(eQuarkDefinition.quark_u.getStackForm(1), eQuarkDefinition.quark_d.getStackForm(2))); + SYMBOL_MAP.put(hadron_n, "n"); + NAME_MAP.put(hadron_n, "Neutron"); + DebugElementalInstanceContainer_EM.STACKS_REGISTERED.add(hadron_n); hadron_n_ = (dHadronDefinition) hadron_n.getAnti(); + SYMBOL_MAP.put(hadron_n_,"~n"); + NAME_MAP.put(hadron_n_,"Anti Neutron"); + DebugElementalInstanceContainer_EM.STACKS_REGISTERED.add(hadron_n_); } catch (tElementalException e) { if (DEBUG_MODE) { e.printStackTrace(); diff --git a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java index 74911fe67e..358d55be0e 100644 --- a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java +++ b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ResearchHandler.java @@ -37,9 +37,6 @@ import static com.github.technus.tectech.recipe.TT_recipeAdder.nullItem; import static gregtech.api.enums.ItemList.Display_Fluid; public class TT_NEI_ResearchHandler extends TemplateRecipeHandler { - public static final int sOffsetX = 5; - public static final int sOffsetY = 11; - static { GuiContainerManager.addInputHandler(new GT_RectHandler()); GuiContainerManager.addTooltipHandler(new GT_RectHandler()); @@ -118,7 +115,6 @@ public class TT_NEI_ResearchHandler extends TemplateRecipeHandler { } } } - CachedDefaultRecipe tNEIRecipe; } @Override @@ -153,7 +149,6 @@ public class TT_NEI_ResearchHandler extends TemplateRecipeHandler { } } } - CachedDefaultRecipe tNEIRecipe; } @Override @@ -386,439 +381,17 @@ public class TT_NEI_ResearchHandler extends TemplateRecipeHandler { mOutputs = new ArrayList<>(); mInputs = new ArrayList<>(); - + int tStartIndex = 0; - //switch (mRecipeMap.mUsualInputCount) { - //case 0: - // break; - //case 1: - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14+9)); - } - //tStartIndex++; - //break; - //case 2: - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); - // } - // tStartIndex++; - // break; - //case 3: - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 14)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); - // } - // tStartIndex++; - // break; - //case 4: - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 5)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 5)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 23)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 23)); - // } - // tStartIndex++; - // break; - //case 5: - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 5)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 5)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 5)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 23)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 23)); - // } - // tStartIndex++; - // break; - //case 6: - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 5)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 5)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 5)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 23)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 23)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 23)); - // } - // tStartIndex++; - // break; - //case 7: - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, -4)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, -4)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, -4)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 14)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 32)); - // } - // tStartIndex++; - // break; - //case 8: - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, -4)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, -4)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, -4)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 14)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 32)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 32)); - // } - // tStartIndex++; - // break; - //default: - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, -4)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, -4)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, -4)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 14)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 32)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 32)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 32)); - // } - // tStartIndex++; - //} + if (aRecipe.getRepresentativeInput(tStartIndex) != null) { + mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14 + 9)); + } if (aRecipe.mSpecialItems != null) { mInputs.add(new FixedPositionedStack(aRecipe.mSpecialItems, 120, 52)); } - //tStartIndex = 0; - //switch (mRecipeMap.mUsualOutputCount) { - //case 0: - // break; - //case 1: - if (aRecipe.getOutput(tStartIndex) != null) { - mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14+9, aRecipe.getOutputChance(tStartIndex))); - } - //tStartIndex++; - //break; - //case 2: - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // break; - //case 3: - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // break; - //case 4: - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // break; - //case 5: - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 5, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // break; - //case 6: - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 5, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 23, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // break; - //case 7: - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, -4, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, -4, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, -4, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 32, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // break; - //case 8: - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, -4, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, -4, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, -4, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 32, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 32, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // break; - //default: - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, -4, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, -4, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, -4, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 32, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 32, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 32, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - //} - //if ((aRecipe.mFluidInputs.length > 0) && (aRecipe.mFluidInputs[0] != null) && (aRecipe.mFluidInputs[0].getFluid() != null)) { - // this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[0], true), 48, 52)); - // if ((aRecipe.mFluidInputs.length > 1) && (aRecipe.mFluidInputs[1] != null) && (aRecipe.mFluidInputs[1].getFluid() != null)) { - // this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[1], true), 30, 52)); - // } - //} - //if (aRecipe.mFluidOutputs.length > 1) { - // if (aRecipe.mFluidOutputs[0] != null && (aRecipe.mFluidOutputs[0].getFluid() != null)) { - // this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[0], true), 120, 5)); - // } - // if (aRecipe.mFluidOutputs[1] != null && (aRecipe.mFluidOutputs[1].getFluid() != null)) { - // this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[1], true), 138, 5)); - // } - // if (aRecipe.mFluidOutputs.length > 2 && aRecipe.mFluidOutputs[2] != null && (aRecipe.mFluidOutputs[2].getFluid() != null)) { - // this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[2], true), 102, 23)); - // } - // if (aRecipe.mFluidOutputs.length > 3 && aRecipe.mFluidOutputs[3] != null && (aRecipe.mFluidOutputs[3].getFluid() != null)) { - // this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[3], true), 120, 23)); - // } - // if (aRecipe.mFluidOutputs.length > 4 && aRecipe.mFluidOutputs[4] != null && (aRecipe.mFluidOutputs[4].getFluid() != null)) { - // this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[4], true), 138, 23)); - // } - //} else if ((aRecipe.mFluidOutputs.length > 0) && (aRecipe.mFluidOutputs[0] != null) && (aRecipe.mFluidOutputs[0].getFluid() != null)) { - // this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[0], true), 102, 52)); - //} + if (aRecipe.getOutput(tStartIndex) != null) { + mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14 + 9, aRecipe.getOutputChance(tStartIndex))); + } } @Override diff --git a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java index 4ab8d46f5c..0c7651977e 100644 --- a/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java +++ b/src/main/java/com/github/technus/tectech/nei/TT_NEI_ScannerHandler.java @@ -37,9 +37,6 @@ import static com.github.technus.tectech.recipe.TT_recipeAdder.nullItem; import static gregtech.api.enums.ItemList.Display_Fluid; public class TT_NEI_ScannerHandler extends TemplateRecipeHandler { - public static final int sOffsetX = 5; - public static final int sOffsetY = 11; - static { GuiContainerManager.addInputHandler(new GT_RectHandler()); GuiContainerManager.addTooltipHandler(new GT_RectHandler()); @@ -118,7 +115,6 @@ public class TT_NEI_ScannerHandler extends TemplateRecipeHandler { } } } - CachedDefaultRecipe tNEIRecipe; } @Override @@ -153,7 +149,6 @@ public class TT_NEI_ScannerHandler extends TemplateRecipeHandler { } } } - CachedDefaultRecipe tNEIRecipe; } @Override @@ -386,439 +381,17 @@ public class TT_NEI_ScannerHandler extends TemplateRecipeHandler { mOutputs = new ArrayList<>(); mInputs = new ArrayList<>(); - + int tStartIndex = 0; - //switch (mRecipeMap.mUsualInputCount) { - //case 0: - // break; - //case 1: - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14+9)); - } - //tStartIndex++; - //break; - //case 2: - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); - // } - // tStartIndex++; - // break; - //case 3: - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 14)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); - // } - // tStartIndex++; - // break; - //case 4: - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 5)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 5)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 23)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 23)); - // } - // tStartIndex++; - // break; - //case 5: - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 5)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 5)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 5)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 23)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 23)); - // } - // tStartIndex++; - // break; - //case 6: - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 5)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 5)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 5)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 23)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 23)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 23)); - // } - // tStartIndex++; - // break; - //case 7: - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, -4)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, -4)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, -4)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 14)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 32)); - // } - // tStartIndex++; - // break; - //case 8: - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, -4)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, -4)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, -4)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 14)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 32)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 32)); - // } - // tStartIndex++; - // break; - //default: - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, -4)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, -4)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, -4)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 14)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 32)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 32)); - // } - // tStartIndex++; - // if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - // this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 32)); - // } - // tStartIndex++; - //} + if (aRecipe.getRepresentativeInput(tStartIndex) != null) { + mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14 + 9)); + } if (aRecipe.mSpecialItems != null) { mInputs.add(new FixedPositionedStack(aRecipe.mSpecialItems, 120, 52)); } - //tStartIndex = 0; - //switch (mRecipeMap.mUsualOutputCount) { - //case 0: - // break; - //case 1: - if (aRecipe.getOutput(tStartIndex) != null) { - mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14+9, aRecipe.getOutputChance(tStartIndex))); - } - //tStartIndex++; - //break; - //case 2: - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // break; - //case 3: - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // break; - //case 4: - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // break; - //case 5: - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 5, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // break; - //case 6: - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 5, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 23, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // break; - //case 7: - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, -4, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, -4, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, -4, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 32, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // break; - //case 8: - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, -4, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, -4, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, -4, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 32, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 32, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // break; - //default: - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, -4, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, -4, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, -4, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 32, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 32, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - // if (aRecipe.getOutput(tStartIndex) != null) { - // this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 32, aRecipe.getOutputChance(tStartIndex))); - // } - // tStartIndex++; - //} - //if ((aRecipe.mFluidInputs.length > 0) && (aRecipe.mFluidInputs[0] != null) && (aRecipe.mFluidInputs[0].getFluid() != null)) { - // this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[0], true), 48, 52)); - // if ((aRecipe.mFluidInputs.length > 1) && (aRecipe.mFluidInputs[1] != null) && (aRecipe.mFluidInputs[1].getFluid() != null)) { - // this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[1], true), 30, 52)); - // } - //} - //if (aRecipe.mFluidOutputs.length > 1) { - // if (aRecipe.mFluidOutputs[0] != null && (aRecipe.mFluidOutputs[0].getFluid() != null)) { - // this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[0], true), 120, 5)); - // } - // if (aRecipe.mFluidOutputs[1] != null && (aRecipe.mFluidOutputs[1].getFluid() != null)) { - // this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[1], true), 138, 5)); - // } - // if (aRecipe.mFluidOutputs.length > 2 && aRecipe.mFluidOutputs[2] != null && (aRecipe.mFluidOutputs[2].getFluid() != null)) { - // this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[2], true), 102, 23)); - // } - // if (aRecipe.mFluidOutputs.length > 3 && aRecipe.mFluidOutputs[3] != null && (aRecipe.mFluidOutputs[3].getFluid() != null)) { - // this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[3], true), 120, 23)); - // } - // if (aRecipe.mFluidOutputs.length > 4 && aRecipe.mFluidOutputs[4] != null && (aRecipe.mFluidOutputs[4].getFluid() != null)) { - // this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[4], true), 138, 23)); - // } - //} else if ((aRecipe.mFluidOutputs.length > 0) && (aRecipe.mFluidOutputs[0] != null) && (aRecipe.mFluidOutputs[0].getFluid() != null)) { - // this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[0], true), 102, 52)); - //} + if (aRecipe.getOutput(tStartIndex) != null) { + mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14 + 9, aRecipe.getOutputChance(tStartIndex))); + } } @Override diff --git a/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java b/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java index b4dc5775d7..b0b349a268 100644 --- a/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java +++ b/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java @@ -9,6 +9,7 @@ import gregtech.api.util.GT_Recipe; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; +import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; @@ -167,6 +168,7 @@ public class TT_recipe extends GT_Recipe { public static class GT_Recipe_MapTT extends GT_Recipe.GT_Recipe_Map { public static GT_Recipe_MapTT sResearchableFakeRecipes =new GT_Recipe_MapTT(new HashSet<>(32), "gt.recipe.researchStation", "Research station", null, "gregtech:textures/gui/multimachines/ResearchFake", 1, 1,1,0,1,"", 1, "", true, false);//nei to false - using custom handler public static GT_Recipe_MapTT sScannableFakeRecipes = new GT_Recipe_MapTT(new HashSet<>(32),"gt.recipe.em_scanner","EM Scanner Research", null,"gregtech:textures/gui/multimachines/ResearchFake",1,1,1,0,1,"",1,"",true,false); + public static ArrayList<GT_Recipe_AssemblyLine> sAssemblylineRecipes=new ArrayList<>(); public GT_Recipe_MapTT(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); diff --git a/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java b/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java index 88e57fc3ab..b08265d2c5 100644 --- a/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java +++ b/src/main/java/com/github/technus/tectech/recipe/TT_recipeAdder.java @@ -52,6 +52,7 @@ public class TT_recipeAdder extends GT_RecipeAdder { TT_recipe.GT_Recipe_MapTT.sResearchableFakeRecipes.addFakeRecipe(false, new ItemStack[]{aResearchItem}, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Writes Research result")}, null, null, totalComputationRequired, researchEUt, researchAmperage| computationRequiredPerSec<<16); GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.addFakeRecipe(false, aInputs, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Reads Research result")}, aFluidInputs, null, assDuration, assEUt, 0,true); GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.add(new GT_Recipe.GT_Recipe_AssemblyLine(CustomItemList.UnusedStuff.get(1), totalComputationRequired/computationRequiredPerSec, aInputs, aFluidInputs, aOutput, assDuration, assEUt)); + TT_recipe.GT_Recipe_MapTT.sAssemblylineRecipes.add(new GT_Recipe.GT_Recipe_AssemblyLine(aResearchItem, totalComputationRequired/computationRequiredPerSec, aInputs, aFluidInputs, aOutput, assDuration, assEUt)); return true; } @@ -117,6 +118,7 @@ public class TT_recipeAdder extends GT_RecipeAdder { TT_recipe.GT_Recipe_MapTT.sResearchableFakeRecipes.addFakeRecipe(false, new ItemStack[]{aResearchItem}, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Writes Research result")}, null, null, totalComputationRequired, researchEUt, researchAmperage| computationRequiredPerSec<<16); GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.addFakeRecipe(false,tInputs,new ItemStack[]{aOutput},new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Reads Research result")},aFluidInputs,null,assDuration,assEUt,0,tAlts,true); GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.add(new GT_Recipe.GT_Recipe_AssemblyLine( CustomItemList.UnusedStuff.get(1), totalComputationRequired/computationRequiredPerSec, tInputs, aFluidInputs, aOutput, assDuration, assEUt, tAlts)); + TT_recipe.GT_Recipe_MapTT.sAssemblylineRecipes.add(new GT_Recipe.GT_Recipe_AssemblyLine( aResearchItem, totalComputationRequired/computationRequiredPerSec, tInputs, aFluidInputs, aOutput, assDuration, assEUt, tAlts)); return true; } 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 969283fa15..5265ad25c6 100644 --- a/src/main/java/com/github/technus/tectech/thing/CustomItemList.java +++ b/src/main/java/com/github/technus/tectech/thing/CustomItemList.java @@ -11,24 +11,24 @@ import net.minecraft.item.ItemStack; import static gregtech.api.enums.GT_Values.W; public enum CustomItemList implements IItemContainer { - Casing_UEV,Casing_UIV,Casing_UMV,Casing_UXV,Casing_OPV,Casing_MAXV, - Hull_UEV,Hull_UIV,Hull_UMV,Hull_UXV,Hull_OPV,Hull_MAXV, - Transformer_UEV_UHV,Transformer_UIV_UEV,Transformer_UMV_UIV, - Transformer_UXV_UMV,Transformer_OPV_UXV,Transformer_MAXV_OPV, - WetTransformer_LV_ULV,WetTransformer_MV_LV,WetTransformer_HV_MV,WetTransformer_EV_HV, - WetTransformer_IV_EV,WetTransformer_LuV_IV,WetTransformer_ZPM_LuV,WetTransformer_UV_ZPM, - WetTransformer_UHV_UV,WetTransformer_UEV_UHV,WetTransformer_UIV_UEV,WetTransformer_UMV_UIV, - WetTransformer_UXV_UMV,WetTransformer_OPV_UXV,WetTransformer_MAXV_OPV, - - Transformer_HA_UEV_UHV,Transformer_HA_UIV_UEV,Transformer_HA_UMV_UIV,Transformer_HA_UXV_UMV, - Transformer_HA_OPV_UXV,Transformer_HA_MAXV_OPV, - - hatch_CreativeMaintenance,hatch_CreativeData, - Machine_OwnerDetector,Machine_DataReader, - Machine_BuckConverter_IV,Machine_BuckConverter_LuV,Machine_BuckConverter_ZPM, - Machine_BuckConverter_UV,Machine_BuckConverter_UHV,Machine_BuckConverter_UEV, - Machine_BuckConverter_UIV,Machine_BuckConverter_UMV, Machine_BuckConverter_UXV, - Machine_DebugWriter,Machine_DebugGenny,UnusedStuff, Machine_DebugPollutor, + Casing_UEV, Casing_UIV, Casing_UMV, Casing_UXV, Casing_OPV, Casing_MAXV, + Hull_UEV, Hull_UIV, Hull_UMV, Hull_UXV, Hull_OPV, Hull_MAXV, + Transformer_UEV_UHV, Transformer_UIV_UEV, Transformer_UMV_UIV, + Transformer_UXV_UMV, Transformer_OPV_UXV, Transformer_MAXV_OPV, + WetTransformer_LV_ULV, WetTransformer_MV_LV, WetTransformer_HV_MV, WetTransformer_EV_HV, + WetTransformer_IV_EV, WetTransformer_LuV_IV, WetTransformer_ZPM_LuV, WetTransformer_UV_ZPM, + WetTransformer_UHV_UV, WetTransformer_UEV_UHV, WetTransformer_UIV_UEV, WetTransformer_UMV_UIV, + WetTransformer_UXV_UMV, WetTransformer_OPV_UXV, WetTransformer_MAXV_OPV, + + Transformer_HA_UEV_UHV, Transformer_HA_UIV_UEV, Transformer_HA_UMV_UIV, Transformer_HA_UXV_UMV, + Transformer_HA_OPV_UXV, Transformer_HA_MAXV_OPV, + + hatch_CreativeMaintenance, hatch_CreativeData, + Machine_OwnerDetector, Machine_DataReader, + Machine_BuckConverter_IV, Machine_BuckConverter_LuV, Machine_BuckConverter_ZPM, + Machine_BuckConverter_UV, Machine_BuckConverter_UHV, Machine_BuckConverter_UEV, + Machine_BuckConverter_UIV, Machine_BuckConverter_UMV, Machine_BuckConverter_UXV, + Machine_DebugWriter, Machine_DebugGenny, UnusedStuff, Machine_DebugPollutor, EMpipe, DATApipe, LASERpipe, rack_Hatch, holder_Hatch, capacitor_Hatch, eM_dynamoMulti4_IV, eM_dynamoMulti16_IV, eM_dynamoMulti64_IV, @@ -40,15 +40,15 @@ public enum CustomItemList implements IItemContainer { eM_dynamoMulti4_UIV, eM_dynamoMulti16_UIV, eM_dynamoMulti64_UIV, eM_dynamoMulti4_UMV, eM_dynamoMulti16_UMV, eM_dynamoMulti64_UMV, eM_dynamoMulti4_UXV, eM_dynamoMulti16_UXV, eM_dynamoMulti64_UXV, - eM_dynamoTunnel1_IV,eM_dynamoTunnel2_IV,eM_dynamoTunnel3_IV,eM_dynamoTunnel4_IV,eM_dynamoTunnel5_IV,eM_dynamoTunnel6_IV,eM_dynamoTunnel7_IV, - eM_dynamoTunnel1_LuV,eM_dynamoTunnel2_LuV,eM_dynamoTunnel3_LuV,eM_dynamoTunnel4_LuV,eM_dynamoTunnel5_LuV,eM_dynamoTunnel6_LuV,eM_dynamoTunnel7_LuV, - eM_dynamoTunnel1_ZPM,eM_dynamoTunnel2_ZPM,eM_dynamoTunnel3_ZPM,eM_dynamoTunnel4_ZPM,eM_dynamoTunnel5_ZPM,eM_dynamoTunnel6_ZPM,eM_dynamoTunnel7_ZPM, - eM_dynamoTunnel1_UV,eM_dynamoTunnel2_UV,eM_dynamoTunnel3_UV,eM_dynamoTunnel4_UV,eM_dynamoTunnel5_UV,eM_dynamoTunnel6_UV,eM_dynamoTunnel7_UV, - eM_dynamoTunnel1_UHV,eM_dynamoTunnel2_UHV,eM_dynamoTunnel3_UHV,eM_dynamoTunnel4_UHV,eM_dynamoTunnel5_UHV,eM_dynamoTunnel6_UHV,eM_dynamoTunnel7_UHV, - eM_dynamoTunnel1_UEV,eM_dynamoTunnel2_UEV,eM_dynamoTunnel3_UEV,eM_dynamoTunnel4_UEV,eM_dynamoTunnel5_UEV,eM_dynamoTunnel6_UEV,eM_dynamoTunnel7_UEV, - eM_dynamoTunnel1_UIV,eM_dynamoTunnel2_UIV,eM_dynamoTunnel3_UIV,eM_dynamoTunnel4_UIV,eM_dynamoTunnel5_UIV,eM_dynamoTunnel6_UIV,eM_dynamoTunnel7_UIV, - eM_dynamoTunnel1_UMV,eM_dynamoTunnel2_UMV,eM_dynamoTunnel3_UMV,eM_dynamoTunnel4_UMV,eM_dynamoTunnel5_UMV,eM_dynamoTunnel6_UMV,eM_dynamoTunnel7_UMV, - eM_dynamoTunnel1_UXV,eM_dynamoTunnel2_UXV,eM_dynamoTunnel3_UXV,eM_dynamoTunnel4_UXV,eM_dynamoTunnel5_UXV,eM_dynamoTunnel6_UXV,eM_dynamoTunnel7_UXV, + eM_dynamoTunnel1_IV, eM_dynamoTunnel2_IV, eM_dynamoTunnel3_IV, eM_dynamoTunnel4_IV, eM_dynamoTunnel5_IV, eM_dynamoTunnel6_IV, eM_dynamoTunnel7_IV, + eM_dynamoTunnel1_LuV, eM_dynamoTunnel2_LuV, eM_dynamoTunnel3_LuV, eM_dynamoTunnel4_LuV, eM_dynamoTunnel5_LuV, eM_dynamoTunnel6_LuV, eM_dynamoTunnel7_LuV, + eM_dynamoTunnel1_ZPM, eM_dynamoTunnel2_ZPM, eM_dynamoTunnel3_ZPM, eM_dynamoTunnel4_ZPM, eM_dynamoTunnel5_ZPM, eM_dynamoTunnel6_ZPM, eM_dynamoTunnel7_ZPM, + eM_dynamoTunnel1_UV, eM_dynamoTunnel2_UV, eM_dynamoTunnel3_UV, eM_dynamoTunnel4_UV, eM_dynamoTunnel5_UV, eM_dynamoTunnel6_UV, eM_dynamoTunnel7_UV, + eM_dynamoTunnel1_UHV, eM_dynamoTunnel2_UHV, eM_dynamoTunnel3_UHV, eM_dynamoTunnel4_UHV, eM_dynamoTunnel5_UHV, eM_dynamoTunnel6_UHV, eM_dynamoTunnel7_UHV, + eM_dynamoTunnel1_UEV, eM_dynamoTunnel2_UEV, eM_dynamoTunnel3_UEV, eM_dynamoTunnel4_UEV, eM_dynamoTunnel5_UEV, eM_dynamoTunnel6_UEV, eM_dynamoTunnel7_UEV, + eM_dynamoTunnel1_UIV, eM_dynamoTunnel2_UIV, eM_dynamoTunnel3_UIV, eM_dynamoTunnel4_UIV, eM_dynamoTunnel5_UIV, eM_dynamoTunnel6_UIV, eM_dynamoTunnel7_UIV, + eM_dynamoTunnel1_UMV, eM_dynamoTunnel2_UMV, eM_dynamoTunnel3_UMV, eM_dynamoTunnel4_UMV, eM_dynamoTunnel5_UMV, eM_dynamoTunnel6_UMV, eM_dynamoTunnel7_UMV, + eM_dynamoTunnel1_UXV, eM_dynamoTunnel2_UXV, eM_dynamoTunnel3_UXV, eM_dynamoTunnel4_UXV, eM_dynamoTunnel5_UXV, eM_dynamoTunnel6_UXV, eM_dynamoTunnel7_UXV, eM_dynamoTunnel9001, eM_energyMulti4_IV, eM_energyMulti16_IV, eM_energyMulti64_IV, @@ -60,15 +60,15 @@ public enum CustomItemList implements IItemContainer { eM_energyMulti4_UIV, eM_energyMulti16_UIV, eM_energyMulti64_UIV, eM_energyMulti4_UMV, eM_energyMulti16_UMV, eM_energyMulti64_UMV, eM_energyMulti4_UXV, eM_energyMulti16_UXV, eM_energyMulti64_UXV, - eM_energyTunnel1_IV,eM_energyTunnel2_IV,eM_energyTunnel3_IV,eM_energyTunnel4_IV,eM_energyTunnel5_IV,eM_energyTunnel6_IV,eM_energyTunnel7_IV, - eM_energyTunnel1_LuV,eM_energyTunnel2_LuV,eM_energyTunnel3_LuV,eM_energyTunnel4_LuV,eM_energyTunnel5_LuV,eM_energyTunnel6_LuV,eM_energyTunnel7_LuV, - eM_energyTunnel1_ZPM,eM_energyTunnel2_ZPM,eM_energyTunnel3_ZPM,eM_energyTunnel4_ZPM,eM_energyTunnel5_ZPM,eM_energyTunnel6_ZPM,eM_energyTunnel7_ZPM, - eM_energyTunnel1_UV,eM_energyTunnel2_UV,eM_energyTunnel3_UV,eM_energyTunnel4_UV,eM_energyTunnel5_UV,eM_energyTunnel6_UV,eM_energyTunnel7_UV, - eM_energyTunnel1_UHV,eM_energyTunnel2_UHV,eM_energyTunnel3_UHV,eM_energyTunnel4_UHV,eM_energyTunnel5_UHV,eM_energyTunnel6_UHV,eM_energyTunnel7_UHV, - eM_energyTunnel1_UEV,eM_energyTunnel2_UEV,eM_energyTunnel3_UEV,eM_energyTunnel4_UEV,eM_energyTunnel5_UEV,eM_energyTunnel6_UEV,eM_energyTunnel7_UEV, - eM_energyTunnel1_UIV,eM_energyTunnel2_UIV,eM_energyTunnel3_UIV,eM_energyTunnel4_UIV,eM_energyTunnel5_UIV,eM_energyTunnel6_UIV,eM_energyTunnel7_UIV, - eM_energyTunnel1_UMV,eM_energyTunnel2_UMV,eM_energyTunnel3_UMV,eM_energyTunnel4_UMV,eM_energyTunnel5_UMV,eM_energyTunnel6_UMV,eM_energyTunnel7_UMV, - eM_energyTunnel1_UXV,eM_energyTunnel2_UXV,eM_energyTunnel3_UXV,eM_energyTunnel4_UXV,eM_energyTunnel5_UXV,eM_energyTunnel6_UXV,eM_energyTunnel7_UXV, + eM_energyTunnel1_IV, eM_energyTunnel2_IV, eM_energyTunnel3_IV, eM_energyTunnel4_IV, eM_energyTunnel5_IV, eM_energyTunnel6_IV, eM_energyTunnel7_IV, + eM_energyTunnel1_LuV, eM_energyTunnel2_LuV, eM_energyTunnel3_LuV, eM_energyTunnel4_LuV, eM_energyTunnel5_LuV, eM_energyTunnel6_LuV, eM_energyTunnel7_LuV, + eM_energyTunnel1_ZPM, eM_energyTunnel2_ZPM, eM_energyTunnel3_ZPM, eM_energyTunnel4_ZPM, eM_energyTunnel5_ZPM, eM_energyTunnel6_ZPM, eM_energyTunnel7_ZPM, + eM_energyTunnel1_UV, eM_energyTunnel2_UV, eM_energyTunnel3_UV, eM_energyTunnel4_UV, eM_energyTunnel5_UV, eM_energyTunnel6_UV, eM_energyTunnel7_UV, + eM_energyTunnel1_UHV, eM_energyTunnel2_UHV, eM_energyTunnel3_UHV, eM_energyTunnel4_UHV, eM_energyTunnel5_UHV, eM_energyTunnel6_UHV, eM_energyTunnel7_UHV, + eM_energyTunnel1_UEV, eM_energyTunnel2_UEV, eM_energyTunnel3_UEV, eM_energyTunnel4_UEV, eM_energyTunnel5_UEV, eM_energyTunnel6_UEV, eM_energyTunnel7_UEV, + eM_energyTunnel1_UIV, eM_energyTunnel2_UIV, eM_energyTunnel3_UIV, eM_energyTunnel4_UIV, eM_energyTunnel5_UIV, eM_energyTunnel6_UIV, eM_energyTunnel7_UIV, + eM_energyTunnel1_UMV, eM_energyTunnel2_UMV, eM_energyTunnel3_UMV, eM_energyTunnel4_UMV, eM_energyTunnel5_UMV, eM_energyTunnel6_UMV, eM_energyTunnel7_UMV, + eM_energyTunnel1_UXV, eM_energyTunnel2_UXV, eM_energyTunnel3_UXV, eM_energyTunnel4_UXV, eM_energyTunnel5_UXV, eM_energyTunnel6_UXV, eM_energyTunnel7_UXV, eM_energyTunnel9001, eM_in_UV, eM_in_UHV, eM_in_UEV, eM_in_UIV, eM_in_UMV, eM_in_UXV, @@ -77,7 +77,10 @@ public enum CustomItemList implements IItemContainer { Parametrizer_Hatch, ParametrizerX_Hatch, ParametrizerTXT_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, - Machine_Multi_Microwave, Machine_Multi_teslaCoil, + + tM_TeslaBase, tM_TeslaToroid, tM_TeslaSecondary, 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, Machine_Multi_MatterToEM, Machine_Multi_EMToMatter, Machine_Multi_EMjunction, Machine_Multi_Scanner, @@ -87,10 +90,16 @@ public enum CustomItemList implements IItemContainer { Machine_Multi_Stabilizer, Machine_Multi_EMCrafter, Machine_Multi_Wormhole, Machine_Multi_Annihilation, 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, + 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, + + eM_avr_HV, eM_avr_EV, eM_avr_IV, eM_avr_LuV, eM_avr_ZPM, eM_avr_UV, eM_avr_UHV, eM_avr_UEV, eM_avr_UIV, eM_avr_UMV, - scanContainer,parametrizerMemory; + scanContainer, parametrizerMemory, teslaCapacitor, teslaCover, teslaComponent, teslaStaff, + Machine_TeslaCoil_1by1_LV, Machine_TeslaCoil_1by1_MV, Machine_TeslaCoil_1by1_HV, Machine_TeslaCoil_1by1_EV, Machine_TeslaCoil_1by1_IV, + Machine_TeslaCoil_2by2_LV, Machine_TeslaCoil_2by2_MV, Machine_TeslaCoil_2by2_HV, Machine_TeslaCoil_2by2_EV, Machine_TeslaCoil_2by2_IV, + Machine_TeslaCoil_3by3_LV, Machine_TeslaCoil_3by3_MV, Machine_TeslaCoil_3by3_HV, Machine_TeslaCoil_3by3_EV, Machine_TeslaCoil_3by3_IV, + Machine_TeslaCoil_4by4_LV, Machine_TeslaCoil_4by4_MV, Machine_TeslaCoil_4by4_HV, Machine_TeslaCoil_4by4_EV, Machine_TeslaCoil_4by4_IV; private ItemStack mStack; private boolean mHasNotBeenSet = true; diff --git a/src/main/java/com/github/technus/tectech/thing/block/QuantumGlassBlock.java b/src/main/java/com/github/technus/tectech/thing/block/QuantumGlassBlock.java index 1a08bdbeec..d34d12c754 100644 --- a/src/main/java/com/github/technus/tectech/thing/block/QuantumGlassBlock.java +++ b/src/main/java/com/github/technus/tectech/thing/block/QuantumGlassBlock.java @@ -13,6 +13,7 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import static com.github.technus.tectech.Reference.MODID; +import static com.github.technus.tectech.loader.gui.CreativeTabTecTech.creativeTabTecTech; /** * Created by danie_000 on 17.12.2016. @@ -32,6 +33,7 @@ public final class QuantumGlassBlock extends BlockBase { setLightOpacity(0); setStepSound(Block.soundTypeMetal); setBlockTextureName(MODID + ":blockQuantumGlass"); + setCreativeTab(creativeTabTecTech); } @Override 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..6d5bcd2b04 --- /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", "Redstone Alloy Primary Tesla Windings"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "MV Superconductor Primary Tesla Windings"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "HV Superconductor Primary Tesla Windings"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "EV Superconductor Primary Tesla Windings"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "IV Superconductor Primary Tesla Windings"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "LuV Superconductor 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_TeslaSecondary.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_CasingsNH.java b/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsNH.java index 78b0a2a6a9..bac2dfb9ac 100644 --- a/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsNH.java +++ b/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsNH.java @@ -10,6 +10,7 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; +import static com.github.technus.tectech.loader.gui.CreativeTabTecTech.creativeTabTecTech; import static com.github.technus.tectech.thing.metaTileEntity.Textures.*; /** @@ -21,6 +22,8 @@ public class GT_Block_CasingsNH public GT_Block_CasingsNH() { super(GT_Item_CasingsNH.class, "gt.blockcasingsNH", GT_Material_Casings.INSTANCE); + setCreativeTab(creativeTabTecTech); + for (byte b = 0; b < 16; b = (byte) (b + 1)) { Textures.BlockIcons.casingTexturePages[8][b+64] = new GT_CopiedBlockTexture(this, 6, b); /*IMPORTANT for block recoloring*/ 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..eb590ab2e2 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 @@ -18,6 +18,7 @@ import net.minecraft.world.IBlockAccess; import java.util.List; import static com.github.technus.tectech.TecTech.tectechTexturePage1; +import static com.github.technus.tectech.loader.gui.CreativeTabTecTech.creativeTabTecTech; /** * Created by danie_000 on 03.10.2016. @@ -30,6 +31,8 @@ public class GT_Block_CasingsTT extends GT_Block_Casings_Abstract { public GT_Block_CasingsTT() { super(GT_Item_CasingsTT.class, "gt.blockcasingsTT", GT_Material_Casings.INSTANCE); + setCreativeTab(creativeTabTecTech); + for (byte b = 0; b < 16; b = (byte) (b + 1)) { Textures.BlockIcons.casingTexturePages[texturePage][b] = new GT_CopiedBlockTexture(this, 6, b); /*IMPORTANT for block recoloring**/ @@ -57,7 +60,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_Block_HintTT.java b/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_HintTT.java index dc9e809b46..c65870eeb7 100644 --- a/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_HintTT.java +++ b/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_HintTT.java @@ -16,6 +16,8 @@ import net.minecraft.world.IBlockAccess; import java.util.List; +import static com.github.technus.tectech.loader.gui.CreativeTabTecTech.creativeTabTecTech; + /** * Created by danie_000 on 03.10.2016. */ @@ -24,6 +26,7 @@ public class GT_Block_HintTT extends GT_Block_Casings_Abstract { public GT_Block_HintTT() { super(GT_Item_HintTT.class, "gt.blockhintTT", GT_Material_Casings.INSTANCE); + setCreativeTab(creativeTabTecTech); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Hint 1 dot");//id is -1 GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Hint 2 dots"); 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..7decce34ae --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_CasingsBA0.java @@ -0,0 +1,67 @@ +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.*; + +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://"Redstone Alloy Primary Tesla Windings" + aList.add("Handles up to 32 EU/t"); + aList.add(EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "What one man calls God, another calls the laws of physics."); + break; + case 1://"MV Superconductor Primary Tesla Windings" + aList.add("Handles up to 128 EU/t"); + aList.add(EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "What one man calls God, another calls the laws of physics."); + break; + case 2://"HV Superconductor Primary Tesla Windings" + aList.add("Handles up to 512 EU/t"); + aList.add(EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "What one man calls God, another calls the laws of physics."); + break; + case 3://"EV Superconductor Primary Tesla Windings" + aList.add("Handles up to 2048 EU/t"); + aList.add(EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "What one man calls God, another calls the laws of physics."); + break; + case 4://"IV Superconductor Primary Tesla Windings" + aList.add("Handles up to 8192 EU/t"); + aList.add(EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "What one man calls God, another calls the laws of physics."); + break; + case 5://"LuV Superconductor Primary Tesla Windings" + aList.add("Handles up to 32768 EU/t"); + aList.add(EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "What one man calls God, another calls the laws of physics."); + break; + case 6://"Tesla Base Casing" + aList.add("The base of a wondrous contraption"); + aList.add(EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "it's alive, IT'S ALIVE!"); + break; + case 7://"Tesla Toroid Casing" + aList.add("Made out of the finest tin foil!"); + aList.add(EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Faraday suits might come later"); + break; + case 8://"Tesla Secondary Windings" + aList.add("Picks up power from a primary coil"); + aList.add(EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Who wouldn't want a 32k epoxy multi?"); + 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/AvrProgrammer.java b/src/main/java/com/github/technus/tectech/thing/item/AvrProgrammer.java new file mode 100644 index 0000000000..277c2de355 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/item/AvrProgrammer.java @@ -0,0 +1,215 @@ +package com.github.technus.tectech.thing.item; + +import com.github.technus.avrClone.AvrCore; +import com.github.technus.avrClone.instructions.InstructionRegistry; +import com.github.technus.avrClone.memory.program.ProgramMemory; +import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.loader.gui.ModGuiHandler; +import com.github.technus.tectech.thing.metaTileEntity.single.GT_MetaTileEntity_MicroController; +import cpw.mods.fml.common.Optional; +import dan200.computercraft.api.filesystem.IMount; +import dan200.computercraft.api.filesystem.IWritableMount; +import dan200.computercraft.api.media.IMedia; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.util.FakePlayer; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; + +import static com.github.technus.tectech.Reference.MODID; +import static com.github.technus.tectech.loader.gui.CreativeTabTecTech.creativeTabTecTech; + +@Optional.InterfaceList( + {@Optional.Interface(iface="dan200.computercraft.api.media.IMedia",modid = "ComputerCraft"), + @Optional.Interface(iface="li.cil.oc.api.fs.FileSystem",modid="OpenComputers")}) +public class AvrProgrammer extends Item implements IMedia { + public static AvrProgrammer INSTANCE=new AvrProgrammer(); + + private AvrProgrammer(){ + setMaxStackSize(1); + setHasSubtypes(true); + setUnlocalizedName("em.programmer"); + setTextureName(MODID + ":itemProgrammer"); + setCreativeTab(creativeTabTecTech); + } + + @Override + public boolean onItemUseFirst(ItemStack stack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int side, float hitX, float hitY, float hitZ) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if(tTileEntity==null || aPlayer instanceof FakePlayer) { + return aPlayer instanceof EntityPlayerMP; + } + if (aPlayer instanceof EntityPlayerMP) { + if (tTileEntity instanceof IGregTechTileEntity) { + IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); + if (metaTE instanceof GT_MetaTileEntity_MicroController) { + if (aPlayer.isSneaking()) { + if(stack.stackTagCompound.hasKey("pgm")) { + NBTTagCompound pgm = stack.stackTagCompound.getCompoundTag("pgm"); + if (pgm.hasKey("instructions")) { + AvrCore core = ((GT_MetaTileEntity_MicroController) metaTE).core; + InstructionRegistry registry = InstructionRegistry.REGISTRIES. + get(pgm.getString("instructionRegistry")); + if (registry != null) { + core.setProgramMemory(new ProgramMemory( + registry, + pgm.getBoolean("immersive"), + pgm.getIntArray("instructions"), + pgm.getIntArray("param0"), + pgm.getIntArray("param1"))); + } + } + } + } else { + NBTTagCompound tag=new NBTTagCompound(); + metaTE.saveNBTData(tag); + stack.stackTagCompound.setTag("avr",tag.getCompoundTag("avr")); + } + return true; + } + } + } + return false; + } + + public void writeToProgrammer(ItemStack stack,InstructionRegistry registry, boolean immersive, List<String> strings) throws Exception{ + writeToProgrammer(stack,new ProgramMemory(registry,immersive,strings)); + } + + public void writeToProgrammer(ItemStack stack,InstructionRegistry registry, boolean immersive, String... strings)throws Exception{ + writeToProgrammer(stack,new ProgramMemory(registry,immersive,strings)); + } + + public void writeToProgrammer(ItemStack stack, ProgramMemory programMemory) { + NBTTagCompound pgm=new NBTTagCompound(); + pgm.setIntArray("instructions",programMemory.instructions); + pgm.setIntArray("param0",programMemory.param0); + pgm.setIntArray("param1",programMemory.param1); + pgm.setBoolean("immersive",programMemory.immersiveOperands); + pgm.setString("instructionRegistry",programMemory.registry.toString()); + stack.stackTagCompound.setTag("pgm",pgm); + } + + @Override + public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { + if(world.isRemote){ + player.openGui(TecTech.instance, ModGuiHandler.PROGRAMMER_DISPLAY_SCREEN_ID, world, 0, 0, 0); + } + return itemStack; + } + + @Override + public void addInformation(ItemStack aStack, EntityPlayer ep, List aList, boolean boo) { + if(aStack.stackTagCompound.hasKey("avr")) { + NBTTagCompound avr=aStack.stackTagCompound.getCompoundTag("avr"); + aList.add("Current PC: " +avr.getInteger("programCounter")); + aList.add("Awoken: " +avr.getBoolean("awoken")); + aList.add("Active: " +avr.getBoolean("active")); + aList.add("Debug: " +avr.getBoolean("debugRun")); + aList.add("Delay: " +avr.getBoolean("delay")); + } + } + + @Override + @Optional.Method(modid = "ComputerCraft") + public String getLabel(ItemStack itemStack) { + return itemStack.getDisplayName(); + } + + @Override + @Optional.Method(modid = "ComputerCraft") + public boolean setLabel(ItemStack itemStack, String s) { + itemStack.setStackDisplayName(s); + return true; + } + + @Override + @Optional.Method(modid = "ComputerCraft") + public String getAudioTitle(ItemStack itemStack) { + return null; + } + + @Override + @Optional.Method(modid = "ComputerCraft") + public String getAudioRecordName(ItemStack itemStack) { + return null; + } + + @Override + @Optional.Method(modid = "ComputerCraft") + public IMount createDataMount(ItemStack itemStack, World world) { + return new IWritableMount() { + @Override + public void makeDirectory(String s) throws IOException { + throw new IOException("Cannot make dir!"); + } + + @Override + public void delete(String s) throws IOException { + if("avr".equals(s)) { + itemStack.stackTagCompound.removeTag("avr"); + }else { + throw new IOException("Cannot remove file!"); + } + } + + @Override + public OutputStream openForWrite(String s) throws IOException { + return null; + } + + @Override + public OutputStream openForAppend(String s) throws IOException { + return null; + } + + @Override + public long getRemainingSpace() throws IOException { + return 1024000-getSize("avr"); + } + + @Override + public boolean exists(String s) throws IOException { + return "avr".equals(s) && itemStack.getTagCompound().hasKey(s); + } + + @Override + public boolean isDirectory(String s) throws IOException { + return false; + } + + @Override + public void list(String s, List<String> list) throws IOException { + + } + + @Override + public long getSize(String s) throws IOException { + return "avr".equals(s)?1:0; + } + + @Override + public InputStream openForRead(String s) throws IOException { + return null; + } + }; + } + + @Override + public void getSubItems(Item item, CreativeTabs tab, List list) { + ItemStack stack=new ItemStack(item, 1, 0); + stack.setTagCompound(new NBTTagCompound()); + list.add(stack); + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java b/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java index 33f0d34ad5..57f3bbade1 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ConstructableTriggerItem.java @@ -24,6 +24,7 @@ import java.util.List; import static com.github.technus.tectech.Reference.MODID; import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.loader.gui.CreativeTabTecTech.creativeTabTecTech; import static gregtech.api.GregTech_API.sBlockCasings1; /** @@ -37,6 +38,7 @@ public final class ConstructableTriggerItem extends Item { private ConstructableTriggerItem() { setUnlocalizedName("em.constructable"); setTextureName(MODID + ":itemConstructable"); + setCreativeTab(creativeTabTecTech); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/item/DebugElementalInstanceContainer_EM.java b/src/main/java/com/github/technus/tectech/thing/item/DebugElementalInstanceContainer_EM.java index f2e5101305..4d88f321ed 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/DebugElementalInstanceContainer_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/item/DebugElementalInstanceContainer_EM.java @@ -30,13 +30,14 @@ import java.util.TreeSet; import static com.github.technus.tectech.Reference.MODID; import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; +import static com.github.technus.tectech.loader.gui.CreativeTabTecTech.creativeTabTecTech; import static cpw.mods.fml.relauncher.Side.CLIENT; /** * Created by Tec on 15.03.2017. */ public final class DebugElementalInstanceContainer_EM extends Item implements IElementalItem { - public static final TreeSet<iElementalDefinition> stacksRegistered=new TreeSet<>(); + public static final TreeSet<iElementalDefinition> STACKS_REGISTERED =new TreeSet<>(); public static DebugElementalInstanceContainer_EM INSTANCE; @@ -44,6 +45,7 @@ public final class DebugElementalInstanceContainer_EM extends Item implements IE setMaxStackSize(1); setUnlocalizedName("em.debugContainer"); setTextureName(MODID + ":itemDebugContainer"); + setCreativeTab(creativeTabTecTech); } @Override @@ -137,7 +139,7 @@ public final class DebugElementalInstanceContainer_EM extends Item implements IE ItemStack that = new ItemStack(this, 1); that.setTagCompound(new NBTTagCompound()); list.add(that); - for(iElementalDefinition defintion:stacksRegistered){ + for(iElementalDefinition defintion: STACKS_REGISTERED){ list.add(setContent(new ItemStack(this).setStackDisplayName(defintion.getName()+" x"+1),new cElementalInstanceStackMap(new cElementalInstanceStack(defintion,1)))); list.add(setContent(new ItemStack(this).setStackDisplayName(defintion.getName()+" x"+144),new cElementalInstanceStackMap(new cElementalInstanceStack(defintion,144)))); list.add(setContent(new ItemStack(this).setStackDisplayName(defintion.getName()+" x"+1000),new cElementalInstanceStackMap(new cElementalInstanceStack(defintion,1000)))); diff --git a/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionContainer_EM.java b/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionContainer_EM.java index e1f09bfa69..c14e231fc9 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionContainer_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionContainer_EM.java @@ -20,6 +20,7 @@ import java.util.List; import static com.github.technus.tectech.Reference.MODID; import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; +import static com.github.technus.tectech.loader.gui.CreativeTabTecTech.creativeTabTecTech; import static cpw.mods.fml.relauncher.Side.CLIENT; /** @@ -32,6 +33,7 @@ public final class ElementalDefinitionContainer_EM extends Item implements IElem setMaxStackSize(1); setUnlocalizedName("em.definitionContainer"); setTextureName(MODID + ":itemDefinitionContainer"); + setCreativeTab(creativeTabTecTech); } //return previous thing diff --git a/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionScanStorage_EM.java b/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionScanStorage_EM.java index 8cd3f850e7..a8f8a083a5 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionScanStorage_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionScanStorage_EM.java @@ -25,6 +25,7 @@ import net.minecraft.world.World; import java.util.List; import static com.github.technus.tectech.Reference.MODID; +import static com.github.technus.tectech.loader.gui.CreativeTabTecTech.creativeTabTecTech; import static cpw.mods.fml.relauncher.Side.CLIENT; /** @@ -38,6 +39,7 @@ public final class ElementalDefinitionScanStorage_EM extends Item implements IEl setMaxStackSize(1); setUnlocalizedName("em.definitionScanStorage"); setTextureName(MODID + ":itemDefinitionScanStorage"); + setCreativeTab(creativeTabTecTech); } //return previous thing diff --git a/src/main/java/com/github/technus/tectech/thing/item/EuMeterGT.java b/src/main/java/com/github/technus/tectech/thing/item/EuMeterGT.java index 8edcd32bdb..4ff7c6991b 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/EuMeterGT.java +++ b/src/main/java/com/github/technus/tectech/thing/item/EuMeterGT.java @@ -21,46 +21,48 @@ import java.util.ArrayList; import java.util.List; import static com.github.technus.tectech.Reference.MODID; +import static com.github.technus.tectech.loader.gui.CreativeTabTecTech.creativeTabTecTech; public class EuMeterGT extends Item { public static EuMeterGT INSTANCE; private EuMeterGT() { + setMaxStackSize(1); setUnlocalizedName("em.EuMeterGT"); setTextureName(MODID + ":itemEuMeterGT"); - setMaxStackSize(1); + setCreativeTab(creativeTabTecTech); } @Override public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if(tTileEntity==null || aPlayer instanceof FakePlayer) { + if (tTileEntity == null || aPlayer instanceof FakePlayer) { return aPlayer instanceof EntityPlayerMP; } if (aPlayer instanceof EntityPlayerMP && !aPlayer.isSneaking() && tTileEntity instanceof IGregTechTileEntity) { if (tTileEntity instanceof BaseMetaTileEntity) { - GT_Utility.sendChatToPlayer(aPlayer, EnumChatFormatting.AQUA+"----- X:"+aX+" Y:"+aY+" Z:"+aZ+" D:"+aWorld.provider.dimensionId+" S:"+aSide + " -----"); - GT_Utility.sendChatToPlayer(aPlayer, "Stored energy: "+EnumChatFormatting.YELLOW+(((BaseMetaTileEntity) tTileEntity).getUniversalEnergyStored())+EnumChatFormatting.RESET+'/'+EnumChatFormatting.GREEN+(((BaseMetaTileEntity) tTileEntity).getUniversalEnergyCapacity())); - GT_Utility.sendChatToPlayer(aPlayer, "Stored EU: "+EnumChatFormatting.YELLOW+(((BaseMetaTileEntity) tTileEntity).getStoredEU())+EnumChatFormatting.RESET+'/'+EnumChatFormatting.GREEN+(((BaseMetaTileEntity) tTileEntity).getEUCapacity())); - GT_Utility.sendChatToPlayer(aPlayer, "Average I/O: "+EnumChatFormatting.YELLOW+(((BaseMetaTileEntity) tTileEntity).getAverageElectricInput())+EnumChatFormatting.RESET+'/'+EnumChatFormatting.YELLOW+(((BaseMetaTileEntity) tTileEntity).getAverageElectricOutput())); - GT_Utility.sendChatToPlayer(aPlayer, "Voltage I/O (max): "+EnumChatFormatting.GOLD+(((BaseMetaTileEntity) tTileEntity).getInputVoltage())+EnumChatFormatting.RESET+'/'+EnumChatFormatting.GOLD+(((BaseMetaTileEntity) tTileEntity).getOutputVoltage())); - GT_Utility.sendChatToPlayer(aPlayer, "Voltage I/O max: "+EnumChatFormatting.RED+(((BaseMetaTileEntity) tTileEntity).getMaxSafeInput())+EnumChatFormatting.RESET+'/'+EnumChatFormatting.RED+(((BaseMetaTileEntity) tTileEntity).getMaxEnergyOutput())); - GT_Utility.sendChatToPlayer(aPlayer, "Amperage I/O (max): "+EnumChatFormatting.GOLD+(((BaseMetaTileEntity) tTileEntity).getInputAmperage())+EnumChatFormatting.RESET+'/'+EnumChatFormatting.GOLD+(((BaseMetaTileEntity) tTileEntity).getOutputAmperage())); - GT_Utility.sendChatToPlayer(aPlayer, "Side capabilities: "+(((BaseMetaTileEntity) tTileEntity).inputEnergyFrom((byte) aSide)?"input ":"")+(((BaseMetaTileEntity) tTileEntity).outputsEnergyTo((byte) aSide)?"output ":"")); + GT_Utility.sendChatToPlayer(aPlayer, EnumChatFormatting.AQUA + "----- X:" + aX + " Y:" + aY + " Z:" + aZ + " D:" + aWorld.provider.dimensionId + " S:" + aSide + " -----"); + GT_Utility.sendChatToPlayer(aPlayer, "Stored energy: " + EnumChatFormatting.YELLOW + (((BaseMetaTileEntity) tTileEntity).getUniversalEnergyStored()) + EnumChatFormatting.RESET + '/' + EnumChatFormatting.GREEN + (((BaseMetaTileEntity) tTileEntity).getUniversalEnergyCapacity())); + GT_Utility.sendChatToPlayer(aPlayer, "Stored EU: " + EnumChatFormatting.YELLOW + (((BaseMetaTileEntity) tTileEntity).getStoredEU()) + EnumChatFormatting.RESET + '/' + EnumChatFormatting.GREEN + (((BaseMetaTileEntity) tTileEntity).getEUCapacity())); + GT_Utility.sendChatToPlayer(aPlayer, "Average I/O: " + EnumChatFormatting.YELLOW + (((BaseMetaTileEntity) tTileEntity).getAverageElectricInput()) + EnumChatFormatting.RESET + '/' + EnumChatFormatting.YELLOW + (((BaseMetaTileEntity) tTileEntity).getAverageElectricOutput())); + GT_Utility.sendChatToPlayer(aPlayer, "Voltage I/O (max): " + EnumChatFormatting.GOLD + (((BaseMetaTileEntity) tTileEntity).getInputVoltage()) + EnumChatFormatting.RESET + '/' + EnumChatFormatting.GOLD + (((BaseMetaTileEntity) tTileEntity).getOutputVoltage())); + GT_Utility.sendChatToPlayer(aPlayer, "Voltage I/O max: " + EnumChatFormatting.RED + (((BaseMetaTileEntity) tTileEntity).getMaxSafeInput()) + EnumChatFormatting.RESET + '/' + EnumChatFormatting.RED + (((BaseMetaTileEntity) tTileEntity).getMaxEnergyOutput())); + GT_Utility.sendChatToPlayer(aPlayer, "Amperage I/O (max): " + EnumChatFormatting.GOLD + (((BaseMetaTileEntity) tTileEntity).getInputAmperage()) + EnumChatFormatting.RESET + '/' + EnumChatFormatting.GOLD + (((BaseMetaTileEntity) tTileEntity).getOutputAmperage())); + GT_Utility.sendChatToPlayer(aPlayer, "Side capabilities: " + (((BaseMetaTileEntity) tTileEntity).inputEnergyFrom((byte) aSide) ? "input " : "") + (((BaseMetaTileEntity) tTileEntity).outputsEnergyTo((byte) aSide) ? "output " : "")); return true; } else if (tTileEntity instanceof BaseMetaPipeEntity) { - if(((BaseMetaPipeEntity) tTileEntity).getMetaTileEntity() instanceof GT_MetaPipeEntity_Cable){ + if (((BaseMetaPipeEntity) tTileEntity).getMetaTileEntity() instanceof GT_MetaPipeEntity_Cable) { ArrayList<String> tList = new ArrayList<>(); GT_Utility.getCoordinateScan(tList, aPlayer, aWorld, 1, aX, aY, aZ, aSide, hitX, hitY, hitZ); - for(String str:tList){ - GT_Utility.sendChatToPlayer(aPlayer,str); + for (String str : tList) { + GT_Utility.sendChatToPlayer(aPlayer, str); } } return true; } } - if(!(aPlayer instanceof EntityPlayerMP)){ - GT_Utility.doSoundAtClient(Reference.MODID+":fx_scan", 1, 1.0F, (double)aX, (double)aY, (double)aZ); + if (!(aPlayer instanceof EntityPlayerMP)) { + GT_Utility.doSoundAtClient(Reference.MODID + ":fx_scan", 1, 1.0F, (double) aX, (double) aY, (double) aZ); } return false; } @@ -76,4 +78,4 @@ public class EuMeterGT extends Item { INSTANCE = new EuMeterGT(); GameRegistry.registerItem(INSTANCE, INSTANCE.getUnlocalizedName()); } -} +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/item/FrontRotationTriggerItem.java b/src/main/java/com/github/technus/tectech/thing/item/FrontRotationTriggerItem.java index 15567bc477..014c8b6721 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/FrontRotationTriggerItem.java +++ b/src/main/java/com/github/technus/tectech/thing/item/FrontRotationTriggerItem.java @@ -17,6 +17,7 @@ import net.minecraftforge.common.util.FakePlayer; import java.util.List; import static com.github.technus.tectech.Reference.MODID; +import static com.github.technus.tectech.loader.gui.CreativeTabTecTech.creativeTabTecTech; /** * Created by Tec on 15.03.2017. @@ -25,8 +26,10 @@ public final class FrontRotationTriggerItem extends Item { public static FrontRotationTriggerItem INSTANCE; private FrontRotationTriggerItem() { + setMaxStackSize(1); setUnlocalizedName("em.frontRotate"); setTextureName(MODID + ":itemFrontRotate"); + setCreativeTab(creativeTabTecTech); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java b/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java index b13ef6b574..92215af921 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ParametrizerMemoryCard.java @@ -25,6 +25,7 @@ import net.minecraft.world.World; import java.util.List; import static com.github.technus.tectech.Reference.MODID; +import static com.github.technus.tectech.loader.gui.CreativeTabTecTech.creativeTabTecTech; import static com.github.technus.tectech.thing.CustomItemList.parametrizerMemory; /** @@ -32,13 +33,14 @@ import static com.github.technus.tectech.thing.CustomItemList.parametrizerMemory */ public final class ParametrizerMemoryCard extends Item { public static ParametrizerMemoryCard INSTANCE; - public static IIcon locked,unlocked; + private static IIcon locked, unlocked; private ParametrizerMemoryCard() { setMaxStackSize(1); setHasSubtypes(true); setUnlocalizedName("em.parametrizerMemoryCard"); setTextureName(MODID + ":itemParametrizerMemoryCardUnlocked"); + setCreativeTab(creativeTabTecTech); } @Override @@ -69,13 +71,13 @@ public final class ParametrizerMemoryCard extends Item { tNBT.removeTag("value1s"); } return true; - }else if(metaTE instanceof GT_MetaTileEntity_MultiblockBase_EM){ + } else if (metaTE instanceof GT_MetaTileEntity_MultiblockBase_EM) { GT_MetaTileEntity_MultiblockBase_EM base = (GT_MetaTileEntity_MultiblockBase_EM) metaTE; if (aStack.getTagCompound() == null) { aStack.setTagCompound(new NBTTagCompound()); } NBTTagCompound tNBT = aStack.getTagCompound(); - if(aStack.getItemDamage()== 1){ + if (aStack.getItemDamage() == 1) { base.parametrization.trySetParameters( tNBT.getInteger("param"), tNBT.getDouble("value0D"), @@ -115,9 +117,9 @@ public final class ParametrizerMemoryCard extends Item { public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { if (aPlayer instanceof EntityPlayerMP && aPlayer.isSneaking()) { aStack.stackSize = 1; - if(aStack.getItemDamage()==1) { + if (aStack.getItemDamage() == 1) { aStack.setItemDamage(0); - }else{ + } else { aStack.setItemDamage(1); } return aStack; @@ -131,9 +133,9 @@ public final class ParametrizerMemoryCard extends Item { aList.add(CommonValues.BASS_MARK); aList.add("Stores Parameters"); - if(aStack.getItemDamage()==1) { + if (aStack.getItemDamage() == 1) { aList.add(EnumChatFormatting.BLUE + "Use on Parametrizer/Controller to configure it"); - }else{ + } else { aList.add(EnumChatFormatting.BLUE + "Use on Parametrizer to store parameters"); } aList.add(EnumChatFormatting.BLUE + "Sneak right click to lock/unlock"); @@ -166,17 +168,16 @@ public final class ParametrizerMemoryCard extends Item { @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { - locked =iconRegister.registerIcon(MODID + ":itemParametrizerMemoryCardLocked"); + locked = iconRegister.registerIcon(MODID + ":itemParametrizerMemoryCardLocked"); unlocked = itemIcon = iconRegister.registerIcon(getIconString()); } @Override public IIcon getIconFromDamage(int damage) { - if(damage==1) { + if (damage == 1) { return locked; - }else{ - return unlocked; } + return unlocked; } @Override 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..557b356d52 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/item/TeslaCoilCapacitor.java @@ -0,0 +1,87 @@ +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 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.CommonValues.V; +import static com.github.technus.tectech.Reference.MODID; +import static com.github.technus.tectech.thing.CustomItemList.teslaCapacitor; + + +public final class TeslaCoilCapacitor extends Item { + public static TeslaCoilCapacitor INSTANCE; + private static IIcon LVicon, MVicon, HVicon, EVicon, IVicon; + + private TeslaCoilCapacitor() { + setHasSubtypes(true); + setUnlocalizedName("tm.teslaCoilCapacitor"); + setTextureName(MODID + ":itemCapacitorLV"); + } + + @Override + public void addInformation(ItemStack aStack, EntityPlayer ep, List aList, boolean boo) { + aList.add(CommonValues.BASS_MARK); + if (aStack.getItemDamage() >= 0 && aStack.getItemDamage() <= 4) { + aList.add("Stores " + V[aStack.getItemDamage() + 1] * 512 + " EU in a tesla tower at " + V[aStack.getItemDamage() + 1] + " EU/t"); + } else { + aList.add("Yeet this broken item into some spicy water!"); + } + 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()); + teslaCapacitor.set(INSTANCE); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) { + LVicon = itemIcon = iconRegister.registerIcon(getIconString()); + MVicon = iconRegister.registerIcon(MODID + ":itemCapacitorMV"); + HVicon = iconRegister.registerIcon(MODID + ":itemCapacitorHV"); + EVicon = iconRegister.registerIcon(MODID + ":itemCapacitorEV"); + IVicon = iconRegister.registerIcon(MODID + ":itemCapacitorIV"); + } + + @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; + } + } + + @Override + 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/TeslaCoilComponent.java b/src/main/java/com/github/technus/tectech/thing/item/TeslaCoilComponent.java new file mode 100644 index 0000000000..cfd6b3b653 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/item/TeslaCoilComponent.java @@ -0,0 +1,68 @@ +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 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; +import static com.github.technus.tectech.thing.CustomItemList.teslaComponent; + + +public final class TeslaCoilComponent extends Item { + public static TeslaCoilComponent INSTANCE; + private static IIcon ultItemIcon; + + private TeslaCoilComponent() { + setHasSubtypes(true); + setUnlocalizedName("tm.itemTeslaComponent"); + setTextureName(MODID + ":itemTeslaComponent"); + } + + @Override + public void addInformation(ItemStack aStack, EntityPlayer ep, List aList, boolean boo) { + aList.add(CommonValues.BASS_MARK); + aList.add(EnumChatFormatting.BLUE + "Tesla bois need these!"); + } + + @Override + public String getUnlocalizedName(ItemStack aStack) { + return getUnlocalizedName() + "." + getDamage(aStack); + } + + public static void run() { + INSTANCE = new TeslaCoilComponent(); + GameRegistry.registerItem(INSTANCE, INSTANCE.getUnlocalizedName()); + teslaComponent.set(INSTANCE); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) { + itemIcon = iconRegister.registerIcon(getIconString()); + ultItemIcon = iconRegister.registerIcon(MODID + ":itemTeslaComponentUltimate"); + } + + @Override + public IIcon getIconFromDamage(int damage) { + if (damage == 1) { + return ultItemIcon; + } + return itemIcon; + } + + @Override + public void getSubItems(Item aItem, CreativeTabs par2CreativeTabs, List aList) { + aList.add(new ItemStack(aItem, 1, 0)); + aList.add(new ItemStack(aItem, 1, 1)); + } +} 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..2a1fff39a3 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/item/TeslaCoilCover.java @@ -0,0 +1,80 @@ +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 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; +import static com.github.technus.tectech.thing.CustomItemList.teslaCover; + + +public final class TeslaCoilCover extends Item { + public static TeslaCoilCover INSTANCE; + private static IIcon ultItemIcon; + + private TeslaCoilCover() { + setHasSubtypes(true); + setUnlocalizedName("tm.teslaCover"); + setTextureName(MODID + ":itemTeslaCover"); + } + + @Override + public void addInformation(ItemStack aStack, EntityPlayer ep, List aList, boolean boo) { + aList.add(CommonValues.BASS_MARK); + switch (aStack.getItemDamage()) { + case 0: + aList.add("Tesla-Enables Machines!"); + break; + case 1: + aList.add("Tesla-Enables Machines! (BUT LOUDER!!)"); + break; + default: + aList.add("Yeet this broken item into some spicy water!"); + break; + } + aList.add(EnumChatFormatting.BLUE + "Use on top of a machine to enable Tesla capabilities"); + aList.add(EnumChatFormatting.BLUE + "Who the hell uses cables anyway?"); + } + + @Override + public String getUnlocalizedName(ItemStack aStack) { + return getUnlocalizedName() + "." + getDamage(aStack); + } + + public static void run() { + INSTANCE = new TeslaCoilCover(); + GameRegistry.registerItem(INSTANCE, INSTANCE.getUnlocalizedName()); + teslaCover.set(INSTANCE); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) { + itemIcon = iconRegister.registerIcon(getIconString()); + ultItemIcon = iconRegister.registerIcon(MODID + ":itemTeslaCoverUltimate"); + } + + @Override + public IIcon getIconFromDamage(int damage) { + if (damage == 1) { + return ultItemIcon; + } + return itemIcon; + } + + @Override + public void getSubItems(Item aItem, CreativeTabs par2CreativeTabs, List aList) { + aList.add(new ItemStack(aItem, 1, 0)); + aList.add(new ItemStack(aItem, 1, 1)); + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/item/TeslaStaff.java b/src/main/java/com/github/technus/tectech/thing/item/TeslaStaff.java new file mode 100644 index 0000000000..0102d367c3 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/item/TeslaStaff.java @@ -0,0 +1,50 @@ +package com.github.technus.tectech.thing.item; + +import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.Reference; +import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +import java.util.List; + +import static com.github.technus.tectech.Reference.MODID; +import static com.github.technus.tectech.thing.CustomItemList.teslaStaff; + + +public final class TeslaStaff extends Item { + public static TeslaStaff INSTANCE; + + private TeslaStaff() { + setUnlocalizedName("tm.teslaStaff"); + setTextureName(MODID + ":itemTeslaStaff"); + } + + @Override + public void addInformation(ItemStack aStack, EntityPlayer ep, List aList, boolean boo) { + aList.add(CommonValues.BASS_MARK); + aList.add("Power of the gods, at the whim of a mortal!"); + } + + @Override + public boolean onLeftClickEntity(ItemStack stack, EntityPlayer aPlayer, Entity entity) { + GT_Utility.sendChatToPlayer(aPlayer, "Zapperoni!"); + if (!(aPlayer instanceof EntityPlayerMP)) { + double aX = aPlayer.posX; + double aY = aPlayer.posY; + double aZ = aPlayer.posZ; + GT_Utility.doSoundAtClient(Reference.MODID + ":fx_scan", 1, 1.0F, aX, aY, aZ); + } + return false; + } + + public static void run() { + INSTANCE = new TeslaStaff(); + GameRegistry.registerItem(INSTANCE, INSTANCE.getUnlocalizedName()); + teslaStaff.set(INSTANCE); + } +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/item/gui/ProgrammerScreen.java b/src/main/java/com/github/technus/tectech/thing/item/gui/ProgrammerScreen.java new file mode 100644 index 0000000000..8584f28d45 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/item/gui/ProgrammerScreen.java @@ -0,0 +1,13 @@ +package com.github.technus.tectech.thing.item.gui; + +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; + +public class ProgrammerScreen extends GuiScreen { + private NBTTagCompound tag; + + public ProgrammerScreen(EntityPlayer player){ + tag=player.getHeldItem().getTagCompound(); + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/Textures.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/Textures.java index d77749d130..69ff06e9e7 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/Textures.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/Textures.java @@ -33,6 +33,8 @@ public class Textures { private static final IIconContainer MACHINE_OPV_BOTTOM = new CustomIcon("iconsets/MACHINE_OPV_BOTTOM"); private static final IIconContainer MACHINE_MAXV_BOTTOM = new CustomIcon("iconsets/MACHINE_MAXV_BOTTOM"); + private static final IIconContainer TESLA_TRANSCEIVER_TOP = new CustomIcon("iconsets/TESLA_TRANSCEIVER_TOP"); + public static IIconContainer[] MACHINECASINGS_SIDE_TT = new IIconContainer[]{ MACHINE_8V_SIDE, MACHINE_LV_SIDE, MACHINE_MV_SIDE, MACHINE_HV_SIDE, MACHINE_EV_SIDE, MACHINE_IV_SIDE, MACHINE_LuV_SIDE, MACHINE_ZPM_SIDE, @@ -189,6 +191,8 @@ public class Textures { public static ITexture[][] MACHINE_CASINGS_TT = new ITexture[16][17]; + public static ITexture TESLA_TRANSCEIVER_TOP_BA = new GT_RenderedTexture(TESLA_TRANSCEIVER_TOP); + public Textures(){ for (byte i = 0; i < MACHINE_CASINGS_TT.length; i++) { for (byte j = 0; j < MACHINE_CASINGS_TT[i].length; j++) { 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..44612f0c9b 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 @@ -64,7 +79,7 @@ public class GT_MetaTileEntity_Hatch_Capacitor extends GT_MetaTileEntity_Hatch { @Override public boolean isFacingValid(byte aFacing) { - return aFacing >= 2; + return true; } @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[1]*512);//LV Capacitor + new GT_MetaTileEntity_Hatch_Capacitor.CapacitorComponent(Reference.MODID+":item.tm.teslaCoilCapacitor.1", 1, 1, V[2]*512);//MV Capacitor + new GT_MetaTileEntity_Hatch_Capacitor.CapacitorComponent(Reference.MODID+":item.tm.teslaCoilCapacitor.2", 2, 1, V[3]*512);//HV Capacitor + new GT_MetaTileEntity_Hatch_Capacitor.CapacitorComponent(Reference.MODID+":item.tm.teslaCoilCapacitor.3", 3, 1, V[4]*512);//EV Capacitor + new GT_MetaTileEntity_Hatch_Capacitor.CapacitorComponent(Reference.MODID+":item.tm.teslaCoilCapacitor.4", 4, 1, V[5]*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/GT_MetaTileEntity_Hatch_DynamoMulti.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java index 1ba4854b62..aeaa54d241 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoMulti.java @@ -11,6 +11,7 @@ import net.minecraft.item.ItemStack; import static com.github.technus.tectech.CommonValues.V; import static com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_POWER_TT; +import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by danie_000 on 16.12.2016. @@ -19,9 +20,9 @@ public class GT_MetaTileEntity_Hatch_DynamoMulti extends GT_MetaTileEntity_Hatch public final int Amperes; public GT_MetaTileEntity_Hatch_DynamoMulti(int aID, String aName, String aNameRegional, int aTier, int aAmp) { - super(aID, aName, aNameRegional, aTier, 0, "Multiple Ampere Energy Extractor for Multiblocks"); + super(aID, aName, aNameRegional, aTier, 0, translateToLocal("gt.blockmachines.hatch.dynamomulti.desc.0"));//Multiple Ampere Energy Extractor for Multiblocks Amperes = aAmp; - Util.setTier(aTier,this); + Util.setTier(aTier, this); } public GT_MetaTileEntity_Hatch_DynamoMulti(String aName, int aTier, int aAmp, String aDescription, ITexture[][][] aTextures) { @@ -117,4 +118,4 @@ public class GT_MetaTileEntity_Hatch_DynamoMulti extends GT_MetaTileEntity_Hatch //"Amperes Out: "+ EnumChatFormatting.AQUA+Amperes+" A" }; } -} +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java index 2e1a62f46d..60a663e0c7 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DynamoTunnel.java @@ -16,14 +16,15 @@ import net.minecraft.util.EnumChatFormatting; import static com.github.technus.tectech.CommonValues.TRANSFER_AT; import static com.github.technus.tectech.CommonValues.V; import static com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT; +import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by danie_000 on 16.12.2016. */ public class GT_MetaTileEntity_Hatch_DynamoTunnel extends GT_MetaTileEntity_Hatch_DynamoMulti implements IConnectsToEnergyTunnel { public GT_MetaTileEntity_Hatch_DynamoTunnel(int aID, String aName, String aNameRegional, int aTier, int aAmp) { - super(aID, aName, aNameRegional, aTier, 0, "Energy extracting terminal for Multiblocks",aAmp); - Util.setTier(aTier,this); + super(aID, aName, aNameRegional, aTier, 0, translateToLocal("gt.blockmachines.hatch.dynamotunnel.desc.0"), aAmp);//Energy extracting terminal for Multiblocks + Util.setTier(aTier, this); } public GT_MetaTileEntity_Hatch_DynamoTunnel(String aName, int aTier, int aAmp, String aDescription, ITexture[][][] aTextures) { @@ -104,8 +105,8 @@ public class GT_MetaTileEntity_Hatch_DynamoTunnel extends GT_MetaTileEntity_Hatc public String[] getDescription() { return new String[]{ CommonValues.TEC_MARK_GENERAL, - mDescription, - "Throughput: "+ EnumChatFormatting.YELLOW +(Amperes*maxEUOutput())+EnumChatFormatting.RESET+" EU/t" + mDescription,//TODO NOT PASS DESCRIPTION + translateToLocal("gt.blockmachines.hatch.dynamotunnel.desc.1") + ": " + EnumChatFormatting.YELLOW + (Amperes * maxEUOutput()) + EnumChatFormatting.RESET + " EU/t"//Throughput }; } @@ -114,13 +115,13 @@ public class GT_MetaTileEntity_Hatch_DynamoTunnel extends GT_MetaTileEntity_Hatc if (aBaseMetaTileEntity.isServerSide()) { byte Tick = (byte) (aTick % 20); if (TRANSFER_AT == Tick) { - if(aBaseMetaTileEntity.getStoredEU()>0){ - setEUVar(aBaseMetaTileEntity.getStoredEU()-Amperes); - if(aBaseMetaTileEntity.getStoredEU()<0){ + if (aBaseMetaTileEntity.getStoredEU() > 0) { + setEUVar(aBaseMetaTileEntity.getStoredEU() - Amperes); + if (aBaseMetaTileEntity.getStoredEU() < 0) { setEUVar(0); } } - if(aBaseMetaTileEntity.getStoredEU()>getMinimumStoredEU()){ + if (aBaseMetaTileEntity.getStoredEU() > getMinimumStoredEU()) { moveAround(aBaseMetaTileEntity); } } @@ -141,30 +142,30 @@ public class GT_MetaTileEntity_Hatch_DynamoTunnel extends GT_MetaTileEntity_Hatc if (aMetaTileEntity != null) { if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_EnergyTunnel && opposite == tGTTileEntity.getFrontFacing()) { - if(maxEUOutput()>((GT_MetaTileEntity_Hatch_EnergyTunnel) aMetaTileEntity).maxEUInput()){ + if (maxEUOutput() > ((GT_MetaTileEntity_Hatch_EnergyTunnel) aMetaTileEntity).maxEUInput()) { aMetaTileEntity.doExplosion(maxEUOutput()); - setEUVar(aBaseMetaTileEntity.getStoredEU()-maxEUOutput()); + setEUVar(aBaseMetaTileEntity.getStoredEU() - maxEUOutput()); return; - }else if(maxEUOutput()==((GT_MetaTileEntity_Hatch_EnergyTunnel) aMetaTileEntity).maxEUInput()) { - long diff=Math.min( - Amperes*20, + } else if (maxEUOutput() == ((GT_MetaTileEntity_Hatch_EnergyTunnel) aMetaTileEntity).maxEUInput()) { + long diff = Math.min( + Amperes * 20, Math.min( - ((GT_MetaTileEntity_Hatch_EnergyTunnel) aMetaTileEntity).maxEUStore()- + ((GT_MetaTileEntity_Hatch_EnergyTunnel) aMetaTileEntity).maxEUStore() - aMetaTileEntity.getBaseMetaTileEntity().getStoredEU(), - maxEUStore()-aBaseMetaTileEntity.getStoredEU() - )/maxEUOutput() - )*maxEUOutput(); + maxEUStore() - aBaseMetaTileEntity.getStoredEU() + ) / maxEUOutput() + ) * maxEUOutput(); - setEUVar(aBaseMetaTileEntity.getStoredEU()-diff); + setEUVar(aBaseMetaTileEntity.getStoredEU() - diff); ((GT_MetaTileEntity_Hatch_EnergyTunnel) aMetaTileEntity) - .setEUVar(aMetaTileEntity.getBaseMetaTileEntity().getStoredEU()+diff); + .setEUVar(aMetaTileEntity.getBaseMetaTileEntity().getStoredEU() + diff); } return; } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Pipe_Energy) { if (((GT_MetaTileEntity_Pipe_Energy) aMetaTileEntity).connectionCount < 2) { return; - }else { + } else { ((GT_MetaTileEntity_Pipe_Energy) aMetaTileEntity).markUsed(); } } else { @@ -183,4 +184,4 @@ public class GT_MetaTileEntity_Hatch_DynamoTunnel extends GT_MetaTileEntity_Hatc public boolean canConnect(byte side) { return isOutputFacing(side); } -} +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java index 066bcaa166..1498dafecc 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java @@ -16,15 +16,19 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.objects.GT_RenderedTexture; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.fluids.FluidStack; +import org.apache.commons.lang3.reflect.FieldUtils; import static com.github.technus.tectech.CommonValues.*; import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; import static gregtech.api.enums.Dyes.MACHINE_METAL; import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity; +import static net.minecraft.util.StatCollector.translateToLocal; +import static net.minecraft.util.StatCollector.translateToLocalFormatted; /** * Created by danie_000 on 11.12.2016. @@ -34,6 +38,8 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta private static Textures.BlockIcons.CustomIcon EM_T_ACTIVE; private static Textures.BlockIcons.CustomIcon EM_T_CONN; + private String clientLocale = "en_US"; + protected cElementalInstanceStackMap content = new cElementalInstanceStackMap(); //float lifeTimeMult=1f; public int postEnergize = 0; @@ -43,7 +49,7 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta protected GT_MetaTileEntity_Hatch_ElementalContainer(int aID, String aName, String aNameRegional, int aTier, String descr) { super(aID, aName, aNameRegional, aTier, 0, descr); - Util.setTier(aTier,this); + Util.setTier(aTier, this); } protected GT_MetaTileEntity_Hatch_ElementalContainer(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -104,7 +110,7 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta byte Tick = (byte) (aTick % 20); if (DECAY_AT == Tick) { purgeOverflow(); - content.tickContentByOneSecond(1,postEnergize);//Hatches don't life time mult things + content.tickContentByOneSecond(1, postEnergize);//Hatches don't life time mult things purgeOverflow(); } else if (OVERFLOW_AT == Tick) { if (overflowMatter <= 0) { @@ -124,8 +130,8 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta if (TecTech.configTecTech.BOOM_ENABLE) { tGTTileEntity.doExplosion(V[14]); } else { - TecTech.anomalyHandler.addAnomaly(aBaseMetaTileEntity,overflowMatter*32D); - TecTech.proxy.broadcast("Container1 BOOM! " +aBaseMetaTileEntity.getXCoord() + ' ' + aBaseMetaTileEntity.getYCoord() + ' ' + aBaseMetaTileEntity.getZCoord()); + TecTech.anomalyHandler.addAnomaly(aBaseMetaTileEntity, overflowMatter * 32D); + TecTech.proxy.broadcast("Container1 " + translateToLocal("tt.keyword.BOOM") + " " + aBaseMetaTileEntity.getXCoord() + ' ' + aBaseMetaTileEntity.getYCoord() + ' ' + aBaseMetaTileEntity.getZCoord()); } } deathDelay = 3;//needed in some cases like repetitive failures. Should be 4 since there is -- at end but meh... @@ -135,10 +141,10 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta if (TecTech.configTecTech.BOOM_ENABLE) { aBaseMetaTileEntity.doExplosion(V[14]); } else { - TecTech.anomalyHandler.addAnomaly(aBaseMetaTileEntity,overflowMatter*32D); - deathDelay=3; - overflowMatter=0; - TecTech.proxy.broadcast("Container0 BOOM! " + aBaseMetaTileEntity.getXCoord() + ' ' + aBaseMetaTileEntity.getYCoord() + ' ' + aBaseMetaTileEntity.getZCoord()); + TecTech.anomalyHandler.addAnomaly(aBaseMetaTileEntity, overflowMatter * 32D); + deathDelay = 3; + overflowMatter = 0; + TecTech.proxy.broadcast("Container0 " + translateToLocal("tt.keyword.BOOM") + " " + aBaseMetaTileEntity.getXCoord() + ' ' + aBaseMetaTileEntity.getYCoord() + ' ' + aBaseMetaTileEntity.getZCoord()); } } deathDelay--; @@ -160,10 +166,6 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta return content; } - @Override - public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - return true; - } @Override public boolean isFacingValid(byte aFacing) { @@ -214,39 +216,57 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta } @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + super.onRightclick(aBaseMetaTileEntity, aPlayer); + + if (!aBaseMetaTileEntity.isClientSide() && aPlayer instanceof EntityPlayerMP) { + try { + EntityPlayerMP player = (EntityPlayerMP) aPlayer; + clientLocale = (String) FieldUtils.readField(player, "translator", true); + } catch (Exception e) { + clientLocale = "en_US"; + } + } else { + return true; + } + System.out.println(clientLocale); + return true; + } + + @Override public boolean isGivingInformation() { return true; } @Override public String[] getInfoData() { - if(TecTech.configTecTech.EASY_SCAN) { + if (TecTech.configTecTech.EASY_SCAN) { if (id > 0) { if (content == null || content.size() == 0) { - return new String[]{"ID: " + EnumChatFormatting.AQUA + id, "No Stacks"}; + return new String[]{translateToLocalFormatted("tt.keyword.ID", clientLocale) + ": " + EnumChatFormatting.AQUA + id, translateToLocalFormatted("tt.keyphrase.No_Stacks", clientLocale)}; } else { String[] lines = content.getElementalInfo(); String[] output = new String[lines.length + 1]; - output[0] = "ID: " + EnumChatFormatting.AQUA + id; + output[0] = translateToLocalFormatted("tt.keyword.ID", clientLocale) + ": " + EnumChatFormatting.AQUA + id; System.arraycopy(lines, 0, output, 1, lines.length); return output; } } if (content == null || content.size() == 0) { - return new String[]{"No Stacks"}; + return new String[]{translateToLocalFormatted("tt.keyphrase.No_Stacks", clientLocale)}; } return content.getElementalInfo(); } else { - if(id>0){ + if (id > 0) { if (content == null || content.size() == 0) { - return new String[]{"ID: " + EnumChatFormatting.AQUA + id, "No Stacks"}; + return new String[]{translateToLocalFormatted("tt.keyword.ID", clientLocale) + ": " + EnumChatFormatting.AQUA + id, translateToLocalFormatted("tt.keyphrase.No_Stacks", clientLocale)}; } - return new String[]{"ID: " + EnumChatFormatting.AQUA + id, "Contains EM"}; + return new String[]{translateToLocalFormatted("tt.keyword.ID", clientLocale) + ": " + EnumChatFormatting.AQUA + id, translateToLocalFormatted("tt.keyphrase.Contains_EM", clientLocale)}; } if (content == null || content.size() == 0) { - return new String[]{"No Stacks"}; + return new String[]{translateToLocalFormatted("tt.keyphrase.No_Stacks", clientLocale)}; } - return new String[]{"Contains EM"}; + return new String[]{translateToLocalFormatted("tt.keyphrase.Contains_EM", clientLocale)}; } } @@ -259,27 +279,27 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta return new String[]{ TEC_MARK_EM, mDescription, - "Max stacks amount: " + EnumChatFormatting.AQUA + getMaxStacksCount(), - "Stack capacity: " + EnumChatFormatting.AQUA + getMaxStackSize(), - "Place Overflow Hatch behind,on top or below", - "to provide overflow protection while this block", - "is not attached to multi block.", - "Transport range can be extended in straight", - "line up to 15 blocks with quantum tunnels.", - EnumChatFormatting.AQUA + "Must be painted to work" + translateToLocal("tt.base.emhatch.desc.0") + " " + EnumChatFormatting.AQUA + getMaxStacksCount(),//Max stacks amount: + translateToLocal("tt.base.emhatch.desc.1") + " " + EnumChatFormatting.AQUA + getMaxStackSize(),//Stack capacity: + translateToLocal("tt.base.emhatch.desc.2"),//Place Overflow Hatch behind,on top or below + translateToLocal("tt.base.emhatch.desc.3"),//to provide overflow protection while this block + translateToLocal("tt.base.emhatch.desc.4"),//is not attached to multi block. + translateToLocal("tt.base.emhatch.desc.5"),//Transport range can be extended in straight + translateToLocal("tt.base.emhatch.desc.6"),//line up to 15 blocks with quantum tunnels. + EnumChatFormatting.AQUA + translateToLocal("tt.base.emhatch.desc.7")//Must be painted to work }; } @Override public void onRemoval() { if (isValidMetaTileEntity(this) && getBaseMetaTileEntity().isActive()) { - TecTech.anomalyHandler.addAnomaly(getBaseMetaTileEntity(),(overflowMatter+content.getMass())*16D); - IGregTechTileEntity base=getBaseMetaTileEntity(); + TecTech.anomalyHandler.addAnomaly(getBaseMetaTileEntity(), (overflowMatter + content.getMass()) * 16D); + IGregTechTileEntity base = getBaseMetaTileEntity(); if (TecTech.configTecTech.BOOM_ENABLE) { base.doExplosion(V[15]); } else { - TecTech.proxy.broadcast("BOOM! " +base.getXCoord() + ' ' + base.getYCoord() + ' ' + base.getZCoord()); + TecTech.proxy.broadcast(translateToLocal("tt.keyword.BOOM") + " " + base.getXCoord() + ' ' + base.getYCoord() + ' ' + base.getZCoord()); } } } -} +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java index 06bdd4faba..9a16aa1339 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyMulti.java @@ -12,6 +12,7 @@ import net.minecraft.util.EnumChatFormatting; import static com.github.technus.tectech.CommonValues.V; import static com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_POWER_TT; +import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by danie_000 on 16.12.2016. @@ -20,9 +21,9 @@ public class GT_MetaTileEntity_Hatch_EnergyMulti extends GT_MetaTileEntity_Hatch public final int Amperes; public GT_MetaTileEntity_Hatch_EnergyMulti(int aID, String aName, String aNameRegional, int aTier, int aAmp) { - super(aID, aName, aNameRegional, aTier, 0, "Multiple Ampere Energy Injector for Multiblocks"); + super(aID, aName, aNameRegional, aTier, 0, translateToLocal("gt.blockmachines.hatch.energymulti.desc.0"));//Multiple Ampere Energy Injector for Multiblocks Amperes = aAmp; - Util.setTier(aTier,this); + Util.setTier(aTier, this); } public GT_MetaTileEntity_Hatch_EnergyMulti(String aName, int aTier, int aAmp, String aDescription, ITexture[][][] aTextures) { @@ -30,7 +31,7 @@ public class GT_MetaTileEntity_Hatch_EnergyMulti extends GT_MetaTileEntity_Hatch Amperes = aAmp; } - public GT_MetaTileEntity_Hatch_EnergyMulti(int aID, String aName, String aNameRegional, int aTier, int i, String description,int aAmp) { + public GT_MetaTileEntity_Hatch_EnergyMulti(int aID, String aName, String aNameRegional, int aTier, int i, String description, int aAmp) { super(aID, aName, aNameRegional, aTier, 0, description); Amperes = aAmp; } @@ -115,7 +116,7 @@ public class GT_MetaTileEntity_Hatch_EnergyMulti extends GT_MetaTileEntity_Hatch return new String[]{ CommonValues.TEC_MARK_GENERAL, mDescription, - "Amperes In: " + EnumChatFormatting.AQUA + maxAmperesIn() + " A" + translateToLocal("gt.blockmachines.hatch.energymulti.desc.1") + ": " + EnumChatFormatting.AQUA + maxAmperesIn() + " A"//Amperes In }; } -} +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java index e074f9dabb..6034e51a98 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_EnergyTunnel.java @@ -14,14 +14,15 @@ import net.minecraft.util.EnumChatFormatting; import static com.github.technus.tectech.CommonValues.TRANSFER_AT; import static com.github.technus.tectech.CommonValues.V; import static com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT; +import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by danie_000 on 16.12.2016. */ public class GT_MetaTileEntity_Hatch_EnergyTunnel extends GT_MetaTileEntity_Hatch_EnergyMulti implements IConnectsToEnergyTunnel { public GT_MetaTileEntity_Hatch_EnergyTunnel(int aID, String aName, String aNameRegional, int aTier, int aAmp) { - super(aID, aName, aNameRegional, aTier, 0, "Energy injecting terminal for Multiblocks",aAmp); - Util.setTier(aTier,this); + super(aID, aName, aNameRegional, aTier, 0, translateToLocal("gt.blockmachines.hatch.energytunnel.desc.0"), aAmp);//Energy injecting terminal for Multiblocks + Util.setTier(aTier, this); } public GT_MetaTileEntity_Hatch_EnergyTunnel(String aName, int aTier, int aAmp, String aDescription, ITexture[][][] aTextures) { @@ -113,7 +114,7 @@ public class GT_MetaTileEntity_Hatch_EnergyTunnel extends GT_MetaTileEntity_Hatc return new String[]{ CommonValues.TEC_MARK_GENERAL, mDescription, - "Throughput: "+ EnumChatFormatting.YELLOW +(Amperes*maxEUInput())+EnumChatFormatting.RESET+" EU/t" + translateToLocal("gt.blockmachines.hatch.energytunnel.desc.1") + ": " + EnumChatFormatting.YELLOW + (Amperes * maxEUInput()) + EnumChatFormatting.RESET + " EU/t"//Throughput }; } @@ -127,13 +128,13 @@ public class GT_MetaTileEntity_Hatch_EnergyTunnel extends GT_MetaTileEntity_Hatc if (aBaseMetaTileEntity.isServerSide()) { byte Tick = (byte) (aTick % 20); if (TRANSFER_AT == Tick) { - if(aBaseMetaTileEntity.getStoredEU()>0){ - setEUVar(aBaseMetaTileEntity.getStoredEU()-Amperes); - if(aBaseMetaTileEntity.getStoredEU()<0){ + if (aBaseMetaTileEntity.getStoredEU() > 0) { + setEUVar(aBaseMetaTileEntity.getStoredEU() - Amperes); + if (aBaseMetaTileEntity.getStoredEU() < 0) { setEUVar(0); } } } } } -} +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java index 6078c6379a..cfa15b4cf3 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java @@ -5,13 +5,15 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; +import static net.minecraft.util.StatCollector.translateToLocal; + /** * Created by danie_000 on 27.10.2016. */ public class GT_MetaTileEntity_Hatch_InputElemental extends GT_MetaTileEntity_Hatch_ElementalContainer { public GT_MetaTileEntity_Hatch_InputElemental(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, "Elemental Input for Multiblocks"); - Util.setTier(aTier,this); + super(aID, aName, aNameRegional, aTier, translateToLocal("gt.blockmachines.emin.desc"));//Elemental Input for Multiblocks + Util.setTier(aTier, this); } //public GT_MetaTileEntity_Hatch_InputElemental(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -46,4 +48,4 @@ public class GT_MetaTileEntity_Hatch_InputElemental extends GT_MetaTileEntity_Ha public boolean canConnect(byte side) { return isInputFacing(side); } -} +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java index adfcb1d464..d826daf355 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java @@ -8,13 +8,15 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.util.GT_Utility; +import static net.minecraft.util.StatCollector.translateToLocal; + /** * Created by danie_000 on 27.10.2016. */ public class GT_MetaTileEntity_Hatch_OutputElemental extends GT_MetaTileEntity_Hatch_ElementalContainer { public GT_MetaTileEntity_Hatch_OutputElemental(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, "Elemental Output for Multiblocks"); - Util.setTier(aTier,this); + super(aID, aName, aNameRegional, aTier, translateToLocal("gt.blockmachines.emout.desc"));//Elemental Output for Multiblocks + Util.setTier(aTier, this); } //public GT_MetaTileEntity_Hatch_OutputElemental(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -27,7 +29,7 @@ public class GT_MetaTileEntity_Hatch_OutputElemental extends GT_MetaTileEntity_H @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_OutputElemental(mName, mTier, mDescription, mTextures); + return new GT_MetaTileEntity_Hatch_OutputElemental(mName, mTier, mDescription, mTextures); } @Override @@ -67,7 +69,7 @@ public class GT_MetaTileEntity_Hatch_OutputElemental extends GT_MetaTileEntity_H } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Pipe_EM) { if (((GT_MetaTileEntity_Pipe_EM) aMetaTileEntity).connectionCount != 2) { return; - }else { + } else { ((GT_MetaTileEntity_Pipe_EM) aMetaTileEntity).markUsed(); } } else { @@ -86,4 +88,4 @@ public class GT_MetaTileEntity_Hatch_OutputElemental extends GT_MetaTileEntity_H public boolean canConnect(byte side) { return isOutputFacing(side); } -} +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OverflowElemental.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OverflowElemental.java index 18eb8b8c72..8000298443 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OverflowElemental.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OverflowElemental.java @@ -15,6 +15,7 @@ import gregtech.api.objects.GT_RenderedTexture; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.Potion; @@ -23,6 +24,7 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.EnumSkyBlock; import net.minecraftforge.common.util.ForgeDirection; +import org.apache.commons.lang3.reflect.FieldUtils; import java.util.Locale; @@ -31,6 +33,8 @@ import static com.github.technus.tectech.CommonValues.V; import static com.github.technus.tectech.loader.MainLoader.elementalPollution; import static gregtech.api.enums.Dyes.MACHINE_METAL; import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity; +import static net.minecraft.util.StatCollector.translateToLocal; +import static net.minecraft.util.StatCollector.translateToLocalFormatted; /** * Created by danie_000 on 12.12.2016. @@ -44,12 +48,14 @@ public class GT_MetaTileEntity_Hatch_OverflowElemental extends GT_MetaTileEntity public final float overflowMax; private final float overflowDisperse; + private String clientLocale = "en_US"; + public GT_MetaTileEntity_Hatch_OverflowElemental(int aID, String aName, String aNameRegional, int aTier, float max) { - super(aID, aName, aNameRegional, aTier, 0, "Disposes excess elemental Matter"); + super(aID, aName, aNameRegional, aTier, 0, translateToLocal("gt.blockmachines.hatch.emmuffler.desc.0"));//Disposes excess elemental Matter overflowMatter = max / 2; overflowMax = max; overflowDisperse = overflowMax / (float) (30 - aTier); - Util.setTier(aTier,this); + Util.setTier(aTier, this); } public GT_MetaTileEntity_Hatch_OverflowElemental(String aName, int aTier, float max, String aDescription, ITexture[][][] aTextures) { @@ -84,9 +90,9 @@ public class GT_MetaTileEntity_Hatch_OverflowElemental extends GT_MetaTileEntity return new String[]{ CommonValues.TEC_MARK_EM, mDescription, - "Mass capacity: " + EnumChatFormatting.AQUA + String.format(Locale.ENGLISH, "%+.2E", overflowMax) + " eV/c\u00b2", - "Disposal Speed: " + EnumChatFormatting.AQUA + String.format(Locale.ENGLISH, "%+.2E", overflowDisperse) + " (eV/c\u00b2)/s", - "DO NOT OBSTRUCT THE OUTPUT!" + translateToLocal("gt.blockmachines.hatch.emmuffler.desc.1") + ": " + EnumChatFormatting.AQUA + String.format(Locale.ENGLISH, "%+.2E", overflowMax) + " eV/c\u00b2", + translateToLocal("gt.blockmachines.hatch.emmuffler.desc.2") + ": " + EnumChatFormatting.AQUA + String.format(Locale.ENGLISH, "%+.2E", overflowDisperse) + " (eV/c\u00b2)/s", + translateToLocal("gt.blockmachines.hatch.emmuffler.desc.3") }; } @@ -142,10 +148,10 @@ public class GT_MetaTileEntity_Hatch_OverflowElemental extends GT_MetaTileEntity if (aBaseMetaTileEntity.isServerSide() && aTick % 20 == DISPERSE_AT) { if (aBaseMetaTileEntity.isActive()) { if (overflowMatter > overflowDisperse) { - TecTech.anomalyHandler.addAnomaly(aBaseMetaTileEntity,overflowDisperse); + TecTech.anomalyHandler.addAnomaly(aBaseMetaTileEntity, overflowDisperse); overflowMatter -= overflowDisperse; } else { - TecTech.anomalyHandler.addAnomaly(aBaseMetaTileEntity,overflowMatter); + TecTech.anomalyHandler.addAnomaly(aBaseMetaTileEntity, overflowMatter); overflowMatter = 0; aBaseMetaTileEntity.setActive(false); aBaseMetaTileEntity.setLightValue((byte) 0); @@ -166,25 +172,43 @@ public class GT_MetaTileEntity_Hatch_OverflowElemental extends GT_MetaTileEntity //DOES NOT CHECK FOR TOO MUCH, it is done only while putting stuff in (OPTIMIZATION!!!) } - private void vapePollution(IGregTechTileEntity mte){ - float xPos=mte.getXCoord()+0.5f; - float yPos=mte.getYCoord()+0.5f; - float zPos=mte.getZCoord()+0.5f; + private void vapePollution(IGregTechTileEntity mte) { + float xPos = mte.getXCoord() + 0.5f; + float yPos = mte.getYCoord() + 0.5f; + float zPos = mte.getZCoord() + 0.5f; int xDirShift = ForgeDirection.getOrientation(mte.getFrontFacing()).offsetX; int yDirShift = ForgeDirection.getOrientation(mte.getFrontFacing()).offsetY; int zDirShift = ForgeDirection.getOrientation(mte.getFrontFacing()).offsetZ; - AxisAlignedBB aabb=AxisAlignedBB.getBoundingBox(xPos-.5+xDirShift,yPos-.5+yDirShift,zPos-.5+zDirShift,xPos+.5+xDirShift,yPos+1.5+yDirShift,zPos+.5+zDirShift); + AxisAlignedBB aabb = AxisAlignedBB.getBoundingBox(xPos - .5 + xDirShift, yPos - .5 + yDirShift, zPos - .5 + zDirShift, xPos + .5 + xDirShift, yPos + 1.5 + yDirShift, zPos + .5 + zDirShift); for (Object entity : mte.getWorld().getEntitiesWithinAABB(EntityLivingBase.class, aabb)) { - float damagingFactor = (float)Math.log(overflowDisperse); - ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.confusion.id,1,(int)(damagingFactor*20))); - ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.wither.id,2,(int)(damagingFactor*15))); + float damagingFactor = (float) Math.log(overflowDisperse); + ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.confusion.id, 1, (int) (damagingFactor * 20))); + ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.wither.id, 2, (int) (damagingFactor * 15))); ((EntityLivingBase) entity).attackEntityFrom(elementalPollution, damagingFactor); } } @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + super.onRightclick(aBaseMetaTileEntity, aPlayer); + + if (!aBaseMetaTileEntity.isClientSide() && aPlayer instanceof EntityPlayerMP) { + try { + EntityPlayerMP player = (EntityPlayerMP) aPlayer; + clientLocale = (String) FieldUtils.readField(player, "translator", true); + } catch (Exception e) { + clientLocale = "en_US"; + } + } else { + return true; + } + System.out.println(clientLocale); + return true; + } + + @Override public boolean isGivingInformation() { return true; } @@ -192,28 +216,28 @@ public class GT_MetaTileEntity_Hatch_OverflowElemental extends GT_MetaTileEntity @Override public String[] getInfoData() { return new String[]{ - "Contained mass:", + translateToLocalFormatted("tt.keyphrase.Contained_mass", clientLocale) + ":", EnumChatFormatting.RED + Double.toString(overflowMatter) + EnumChatFormatting.RESET + " eV/c\u00b2 /", EnumChatFormatting.GREEN + Double.toString(overflowMax) + EnumChatFormatting.RESET + " eV/c\u00b2", - "Mass Disposal speed: " + EnumChatFormatting.BLUE + overflowDisperse + EnumChatFormatting.RESET + " (eV/c\u00b2)/s" + translateToLocalFormatted("tt.keyphrase.Mass_Disposal_speed", clientLocale) + ": " + EnumChatFormatting.BLUE + overflowDisperse + EnumChatFormatting.RESET + " (eV/c\u00b2)/s" }; } @Override public void onRemoval() { if (isValidMetaTileEntity(this) && getBaseMetaTileEntity().isActive()) { - TecTech.anomalyHandler.addAnomaly(getBaseMetaTileEntity(),overflowMatter*8D); + TecTech.anomalyHandler.addAnomaly(getBaseMetaTileEntity(), overflowMatter * 8D); if (TecTech.configTecTech.BOOM_ENABLE) { getBaseMetaTileEntity().doExplosion(V[15]); } else { - TecTech.proxy.broadcast("Muffler BOOM! " + getBaseMetaTileEntity().getXCoord() + ' ' + getBaseMetaTileEntity().getYCoord() + ' ' + getBaseMetaTileEntity().getZCoord()); + TecTech.proxy.broadcast(translateToLocalFormatted("tt.keyphrase.Muffler_BOOM", clientLocale) + " " + getBaseMetaTileEntity().getXCoord() + ' ' + getBaseMetaTileEntity().getYCoord() + ' ' + getBaseMetaTileEntity().getZCoord()); } } } //Return - Should Explode - public boolean addOverflowMatter(float matter){ - overflowMatter+=matter; + public boolean addOverflowMatter(float matter) { + overflowMatter += matter; return overflowMatter > overflowMax; } @@ -226,4 +250,4 @@ public class GT_MetaTileEntity_Hatch_OverflowElemental extends GT_MetaTileEntity this.overflowMatter = overflowMatter; return overflowMatter > overflowMax; } -} +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ParamText.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ParamText.java index 6a93fac487..c9c84cfbc0 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ParamText.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ParamText.java @@ -1,19 +1,12 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; import com.github.technus.tectech.CommonValues; -import com.github.technus.tectech.Util; import com.github.technus.tectech.loader.NetworkDispatcher; import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_ParamText; import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_ParamText; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; -import gregtech.api.objects.GT_RenderedTexture; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; @@ -25,32 +18,16 @@ import net.minecraftforge.fluids.FluidStack; /** * Created by danie_000 on 15.12.2016. */ -public class GT_MetaTileEntity_Hatch_ParamText extends GT_MetaTileEntity_Hatch { - public int param = -1; +public class GT_MetaTileEntity_Hatch_ParamText extends GT_MetaTileEntity_Hatch_Param { public String value0s=""; public String value1s=""; - public double value0D = 0; - public double value1D = 0; - public double input0D = 0; - public double input1D = 0; - private static Textures.BlockIcons.CustomIcon ScreenON; - private static Textures.BlockIcons.CustomIcon ScreenOFF; public GT_MetaTileEntity_Hatch_ParamText(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 0, "For parametrization of Multiblocks"); - Util.setTier(aTier,this); + super(aID,aName,aNameRegional,aTier); } public GT_MetaTileEntity_Hatch_ParamText(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { - super(aName, aTier, 0, aDescription, aTextures); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister aBlockIconRegister) { - super.registerIcons(aBlockIconRegister); - ScreenOFF = new Textures.BlockIcons.CustomIcon("iconsets/PARAM"); - ScreenON = new Textures.BlockIcons.CustomIcon("iconsets/PARAM_ACTIVE"); + super(aName, aTier, aDescription, aTextures); } @Override @@ -66,16 +43,6 @@ public class GT_MetaTileEntity_Hatch_ParamText extends GT_MetaTileEntity_Hatch { return new GT_GUIContainer_ParamText(aPlayerInventory, aBaseMetaTileEntity); } - @Override - public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, new GT_RenderedTexture(ScreenON)}; - } - - @Override - public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, new GT_RenderedTexture(ScreenOFF)}; - } - //@Override //public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { // if (aBaseMetaTileEntity.isClientSide() && (aTick % 20L == 0L)) { @@ -131,23 +98,14 @@ public class GT_MetaTileEntity_Hatch_ParamText extends GT_MetaTileEntity_Hatch { @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); - aNBT.setDouble("eValue0D", value0D); - aNBT.setDouble("eValue1D", value1D); - aNBT.setDouble("eInput0D", input0D); - aNBT.setDouble("eInput1D", input1D); - aNBT.setInteger("eParam", param); aNBT.setString("eIeValue0S", value0s); aNBT.setString("eIeValue1S", value1s); + aNBT.removeTag("ePointer"); } @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); - value0D = aNBT.getDouble("eValue0D"); - value1D = aNBT.getDouble("eValue1D"); - input0D = aNBT.getDouble("eInput0D"); - input1D = aNBT.getDouble("eInput1D"); - param = aNBT.getInteger("eParam"); value0s = aNBT.getString("eIeValue0S"); if (value0s==null){ value0s=""; 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_Container_Param.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Param.java index f9c53090ff..cb189538d8 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Param.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Param.java @@ -16,10 +16,14 @@ import net.minecraft.item.ItemStack; public class GT_Container_Param extends GT_ContainerMetaTile_Machine { public int param = 0; - public double value0f = 0; - public double value1f = 0; - public double input0f = 0; - public double input1f = 0; + public double value0d = 0; + public double value1d = 0; + public double input0d = 0; + public double input1d = 0; + public long value0l = 0; + public long value1l = 0; + public long input0l = 0; + public long input1l = 0; public GT_Container_Param(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(aInventoryPlayer, aTileEntity); @@ -133,18 +137,18 @@ public class GT_Container_Param extends GT_ContainerMetaTile_Machine { return; } param = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).param; - value0f = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).value0D; - value1f = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).value1D; - input0f = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).input0D; - input1f = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).input1D; + value0d = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).value0D; + value1d = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).value1D; + input0d = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).input0D; + input1d = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).input1D; for (Object crafter : crafters) { ICrafting var1 = (ICrafting) crafter; Util.sendInteger(param,this,var1,100); - Util.sendDouble(value0f,this,var1,102); - Util.sendDouble(value1f,this,var1, 106); - Util.sendDouble(input0f,this,var1, 110); - Util.sendDouble(input1f,this,var1, 114); + Util.sendDouble(value0d,this,var1,102); + Util.sendDouble(value1d,this,var1, 106); + Util.sendDouble(input0d,this,var1, 110); + Util.sendDouble(input1d,this,var1, 114); } } @@ -161,25 +165,25 @@ public class GT_Container_Param extends GT_ContainerMetaTile_Machine { case 103: case 104: case 105: - value0f=Util.receiveDouble(value0f,102,par1,par2); + value0d =Double.longBitsToDouble(value0l=Util.receiveLong(value0l,102,par1,par2)); return; case 106: case 107: case 108: case 109: - value1f=Util.receiveDouble(value1f,106,par1,par2); + value1d =Double.longBitsToDouble(value1l=Util.receiveLong(value1l,106,par1,par2)); return; case 110: case 111: case 112: case 113: - input0f=Util.receiveDouble(input0f,110,par1,par2); + input0d =Double.longBitsToDouble(input0l=Util.receiveLong(input0l,110,par1,par2)); return; case 114: case 115: case 116: case 117: - input1f=Util.receiveDouble(input1f,114,par1,par2); + input1d =Double.longBitsToDouble(input1l=Util.receiveLong(input1l,114,par1,par2)); return; default: } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java index e925ed91e8..b3b720732d 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamAdv.java @@ -17,10 +17,14 @@ import net.minecraft.item.ItemStack; public class GT_Container_ParamAdv extends GT_ContainerMetaTile_Machine { public int pointer=0; public int param = 0; - public double value1f = 0; - public double value0f = 0; - public double input0f = 0; - public double input1f = 0; + public double value1d = 0; + public double value0d = 0; + public double input0d = 0; + public double input1d = 0; + public long value0l = 0; + public long value1l = 0; + public long input0l = 0; + public long input1l = 0; public GT_Container_ParamAdv(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(aInventoryPlayer, aTileEntity); @@ -219,19 +223,19 @@ public class GT_Container_ParamAdv extends GT_ContainerMetaTile_Machine { return; } param = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).param; - value0f = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).value0D; - value1f = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).value1D; - input0f = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).input0D; - input1f = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).input1D; + value0d = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).value0D; + value1d = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).value1D; + input0d = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).input0D; + input1d = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).input1D; pointer = ((GT_MetaTileEntity_Hatch_Param) mTileEntity.getMetaTileEntity()).pointer; for (Object crafter : crafters) { ICrafting var1 = (ICrafting) crafter; Util.sendInteger(param,this,var1,100); - Util.sendDouble(value0f,this,var1,102); - Util.sendDouble(value1f,this,var1, 106); - Util.sendDouble(input0f,this,var1, 110); - Util.sendDouble(input1f,this,var1, 114); + Util.sendDouble(value0d,this,var1,102); + Util.sendDouble(value1d,this,var1, 106); + Util.sendDouble(input0d,this,var1, 110); + Util.sendDouble(input1d,this,var1, 114); Util.sendInteger(pointer,this,var1,118); } } @@ -249,25 +253,25 @@ public class GT_Container_ParamAdv extends GT_ContainerMetaTile_Machine { case 103: case 104: case 105: - value0f=Util.receiveDouble(value0f,102,par1,par2); + value0d =Double.longBitsToDouble(value0l=Util.receiveLong(value0l,102,par1,par2)); return; case 106: case 107: case 108: case 109: - value1f=Util.receiveDouble(value1f,106,par1,par2); + value1d =Double.longBitsToDouble(value1l=Util.receiveLong(value1l,106,par1,par2)); return; case 110: case 111: case 112: case 113: - input0f=Util.receiveDouble(input0f,110,par1,par2); + input0d =Double.longBitsToDouble(input0l=Util.receiveLong(input0l,110,par1,par2)); return; case 114: case 115: case 116: case 117: - input1f=Util.receiveDouble(input1f,114,par1,par2); + input1d =Double.longBitsToDouble(input1l=Util.receiveLong(input1l,114,par1,par2)); return; case 118: case 119: diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamText.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamText.java index 43eea1a123..7b6f97981f 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamText.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_ParamText.java @@ -21,10 +21,14 @@ import java.util.Objects; public class GT_Container_ParamText extends GT_ContainerMetaTile_Machine { public int param = 0; - public double value0f = 0; - public double value1f = 0; - public double input0f = 0; - public double input1f = 0; + public double value0d = 0; + public double value1d = 0; + public double input0d = 0; + public double input1d = 0; + public long value0l = 0; + public long value1l = 0; + public long input0l = 0; + public long input1l = 0; public String value0s=""; public String value1s=""; @@ -85,17 +89,17 @@ public class GT_Container_ParamText extends GT_ContainerMetaTile_Machine { return; } param = ((GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity()).param; - value0f = ((GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity()).value0D; - value1f = ((GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity()).value1D; - input0f = ((GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity()).input0D; - input1f = ((GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity()).input1D; + value0d = ((GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity()).value0D; + value1d = ((GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity()).value1D; + input0d = ((GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity()).input0D; + input1d = ((GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity()).input1D; for (Object crafter : crafters) { ICrafting var1 = (ICrafting) crafter; Util.sendInteger(param,this,var1,100); - Util.sendDouble(value0f,this,var1,102); - Util.sendDouble(value1f,this,var1, 106); - Util.sendDouble(input0f,this,var1, 110); - Util.sendDouble(input1f,this,var1, 114); + Util.sendDouble(value0d,this,var1,102); + Util.sendDouble(value1d,this,var1, 106); + Util.sendDouble(input0d,this,var1, 110); + Util.sendDouble(input1d,this,var1, 114); } if(!Objects.equals(value0s,((GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity()).value0s) || !Objects.equals(value0s,((GT_MetaTileEntity_Hatch_ParamText) mTileEntity.getMetaTileEntity()).value0s)){ @@ -125,25 +129,25 @@ public class GT_Container_ParamText extends GT_ContainerMetaTile_Machine { case 103: case 104: case 105: - value0f=Util.receiveDouble(value0f,102,par1,par2); + value0d =Double.longBitsToDouble(value0l=Util.receiveLong(value0l,102,par1,par2)); return; case 106: case 107: case 108: case 109: - value1f=Util.receiveDouble(value1f,106,par1,par2); + value1d =Double.longBitsToDouble(value1l=Util.receiveLong(value1l,106,par1,par2)); return; case 110: case 111: case 112: case 113: - input0f=Util.receiveDouble(input0f,110,par1,par2); + input0d =Double.longBitsToDouble(input0l=Util.receiveLong(input0l,110,par1,par2)); return; case 114: case 115: case 116: case 117: - input1f=Util.receiveDouble(input1f,114,par1,par2); + input1d =Double.longBitsToDouble(input1l=Util.receiveLong(input1l,114,par1,par2)); return; default: } 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/hatch/gui/GT_GUIContainer_Param.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java index bf63eaa24f..52f0832cb2 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Param.java @@ -21,14 +21,14 @@ public class GT_GUIContainer_Param extends GT_GUIContainerMetaTile_Machine { if (mContainer != null) { TecTechFontRender.INSTANCE.drawSplitString("Parameters: " + ((GT_Container_Param) mContainer).param, 46, 7, 167, 0xffffff); Locale locale= Locale.getDefault(); - TecTechFontRender.INSTANCE.drawSplitString("\u24EA\u2b07" + String.format(locale, "%+.5E", ((GT_Container_Param) mContainer).input0f), 46, 16, 167, 0x22ddff); - TecTechFontRender.INSTANCE.drawSplitString("\u2460\u2b07" + String.format(locale, "%+.5E", ((GT_Container_Param) mContainer).input1f), 46, 24, 167, 0x00ffff); - TecTechFontRender.INSTANCE.drawSplitString("\u24EA\u2b06" + String.format(locale, "%+.5E", ((GT_Container_Param) mContainer).value0f), 46, 33, 167, 0x00bbff); - TecTechFontRender.INSTANCE.drawSplitString("\u2460\u2b06" + String.format(locale, "%+.5E", ((GT_Container_Param) mContainer).value1f), 46, 41, 167, 0x0077ff); + TecTechFontRender.INSTANCE.drawSplitString("\u24EA\u2b07" + String.format(locale, "%+.5E", ((GT_Container_Param) mContainer).input0d), 46, 16, 167, 0x22ddff); + TecTechFontRender.INSTANCE.drawSplitString("\u2460\u2b07" + String.format(locale, "%+.5E", ((GT_Container_Param) mContainer).input1d), 46, 24, 167, 0x00ffff); + TecTechFontRender.INSTANCE.drawSplitString("\u24EA\u2b06" + String.format(locale, "%+.5E", ((GT_Container_Param) mContainer).value0d), 46, 33, 167, 0x00bbff); + TecTechFontRender.INSTANCE.drawSplitString("\u2460\u2b06" + String.format(locale, "%+.5E", ((GT_Container_Param) mContainer).value1d), 46, 41, 167, 0x0077ff); GL11.glPushMatrix(); GL11.glScalef(.5f,.5f,.5f); - TecTechFontRender.INSTANCE.drawSplitString("\u24EA\u2b06" + Util.longBitsToShortString(Double.doubleToLongBits(((GT_Container_Param) mContainer).value0f)), 92, 100, 334, 0x00bbff); - TecTechFontRender.INSTANCE.drawSplitString("\u2460\u2b06" + Util.longBitsToShortString(Double.doubleToLongBits(((GT_Container_Param) mContainer).value1f)), 92, 116, 334, 0x0077ff); + TecTechFontRender.INSTANCE.drawSplitString("\u24EA\u2b06" + Util.longBitsToShortString(Double.doubleToLongBits(((GT_Container_Param) mContainer).value0d)), 92, 100, 334, 0x00bbff); + TecTechFontRender.INSTANCE.drawSplitString("\u2460\u2b06" + Util.longBitsToShortString(Double.doubleToLongBits(((GT_Container_Param) mContainer).value1d)), 92, 116, 334, 0x0077ff); GL11.glPopMatrix(); } else { TecTechFontRender.INSTANCE.drawSplitString("Parameters", 46, 7, 167, 0xffffff); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java index a682323f8c..ca92f0496e 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamAdv.java @@ -21,14 +21,14 @@ public class GT_GUIContainer_ParamAdv extends GT_GUIContainerMetaTile_Machine { if (mContainer != null) { TecTechFontRender.INSTANCE.drawSplitString("Parameters X: " + ((GT_Container_ParamAdv) mContainer).param, 46, 7, 167, 0xffffff); Locale locale = Locale.getDefault(); - TecTechFontRender.INSTANCE.drawSplitString("\u24EA\u2b07" + String.format(locale, "%+.5E", (((GT_Container_ParamAdv) mContainer).input0f)), 46, 16, 167, 0x22ddff); - TecTechFontRender.INSTANCE.drawSplitString("\u2460\u2b07" + String.format(locale, "%+.5E", (((GT_Container_ParamAdv) mContainer).input1f)), 46, 24, 167, 0x00ffff); - TecTechFontRender.INSTANCE.drawSplitString("\u24EA\u2b06" + String.format(locale, "%+.5E", (((GT_Container_ParamAdv) mContainer).value0f)), 46, 33, 167, 0x00bbff); - TecTechFontRender.INSTANCE.drawSplitString("\u2460\u2b06" + String.format(locale, "%+.5E", (((GT_Container_ParamAdv) mContainer).value1f)), 46, 41, 167, 0x0077ff); + TecTechFontRender.INSTANCE.drawSplitString("\u24EA\u2b07" + String.format(locale, "%+.5E", (((GT_Container_ParamAdv) mContainer).input0d)), 46, 16, 167, 0x22ddff); + TecTechFontRender.INSTANCE.drawSplitString("\u2460\u2b07" + String.format(locale, "%+.5E", (((GT_Container_ParamAdv) mContainer).input1d)), 46, 24, 167, 0x00ffff); + TecTechFontRender.INSTANCE.drawSplitString("\u24EA\u2b06" + String.format(locale, "%+.5E", (((GT_Container_ParamAdv) mContainer).value0d)), 46, 33, 167, 0x00bbff); + TecTechFontRender.INSTANCE.drawSplitString("\u2460\u2b06" + String.format(locale, "%+.5E", (((GT_Container_ParamAdv) mContainer).value1d)), 46, 41, 167, 0x0077ff); GL11.glPushMatrix(); GL11.glScalef(.5f,.5f,.5f); - TecTechFontRender.INSTANCE.drawSplitString("\u24EA\u2b06" + Util.longBitsToShortString(Double.doubleToLongBits(((GT_Container_ParamAdv) mContainer).value0f)), 92, 100, 334, 0x00bbff); - TecTechFontRender.INSTANCE.drawSplitString("\u2460\u2b06" + Util.longBitsToShortString(Double.doubleToLongBits(((GT_Container_ParamAdv) mContainer).value1f)), 92, 116, 334, 0x0077ff); + TecTechFontRender.INSTANCE.drawSplitString("\u24EA\u2b06" + Util.longBitsToShortString(Double.doubleToLongBits(((GT_Container_ParamAdv) mContainer).value0d)), 92, 100, 334, 0x00bbff); + TecTechFontRender.INSTANCE.drawSplitString("\u2460\u2b06" + Util.longBitsToShortString(Double.doubleToLongBits(((GT_Container_ParamAdv) mContainer).value1d)), 92, 116, 334, 0x0077ff); GL11.glPopMatrix(); TecTechFontRender.INSTANCE.drawSplitString("Pointer " + Integer.toHexString(((GT_Container_ParamAdv) mContainer).pointer | 0x10000).substring(1), 46, 66, 167, 0x0033ff); } else { diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamText.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamText.java index ed1f1acdee..2b17563db0 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamText.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_ParamText.java @@ -17,7 +17,7 @@ import static gregtech.api.enums.GT_Values.RES_PATH_GUI; public class GT_GUIContainer_ParamText extends GT_GUIContainerMetaTile_Machine { private GuiTextField value0tb; - private GuiTextField valie1tb; + private GuiTextField value1tb; public GT_GUIContainer_ParamText(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(new GT_Container_ParamText(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "ParametrizerText.png"); @@ -28,8 +28,8 @@ public class GT_GUIContainer_ParamText extends GT_GUIContainerMetaTile_Machine { super.initGui(); value0tb = new GuiTextField(TecTechFontRender.INSTANCE, (this.width - 176) / 2 + 12 + 14, (this.height - 166) / 2 + 26, 156 - 18, 12); value0tb.setMaxStringLength(80); - valie1tb = new GuiTextField(TecTechFontRender.INSTANCE, (this.width - 176) / 2 + 12 + 14, (this.height - 166) / 2 + 41, 156 - 18, 12); - valie1tb.setMaxStringLength(80); + value1tb = new GuiTextField(TecTechFontRender.INSTANCE, (this.width - 176) / 2 + 12 + 14, (this.height - 166) / 2 + 41, 156 - 18, 12); + value1tb.setMaxStringLength(80); updateValues(); } @@ -37,15 +37,15 @@ public class GT_GUIContainer_ParamText extends GT_GUIContainerMetaTile_Machine { public void onGuiClosed() { super.onGuiClosed(); value0tb.setFocused(false); - valie1tb.setFocused(false); + value1tb.setFocused(false); updateValues(); } @Override protected void keyTyped(char p_73869_1_, int p_73869_2_) { value0tb.textboxKeyTyped(p_73869_1_, p_73869_2_); - valie1tb.textboxKeyTyped(p_73869_1_, p_73869_2_); - if ((p_73869_2_ != 1 && p_73869_2_ != this.mc.gameSettings.keyBindInventory.getKeyCode()) || (!value0tb.isFocused() && !valie1tb.isFocused())) { + value1tb.textboxKeyTyped(p_73869_1_, p_73869_2_); + if ((p_73869_2_ != 1 && p_73869_2_ != this.mc.gameSettings.keyBindInventory.getKeyCode()) || (!value0tb.isFocused() && !value1tb.isFocused())) { super.keyTyped(p_73869_1_, p_73869_2_); } updateValues(); @@ -55,21 +55,21 @@ public class GT_GUIContainer_ParamText extends GT_GUIContainerMetaTile_Machine { public void updateScreen() { super.updateScreen(); value0tb.updateCursorCounter(); - valie1tb.updateCursorCounter(); + value1tb.updateCursorCounter(); } @Override public void drawScreen(int par1, int par2, float par3) { super.drawScreen(par1, par2, par3); value0tb.drawTextBox(); - valie1tb.drawTextBox(); + value1tb.drawTextBox(); } @Override protected void mouseClicked(int p_73864_1_, int p_73864_2_, int p_73864_3_) { super.mouseClicked(p_73864_1_, p_73864_2_, p_73864_3_); value0tb.mouseClicked(p_73864_1_, p_73864_2_, p_73864_3_); - valie1tb.mouseClicked(p_73864_1_, p_73864_2_, p_73864_3_); + value1tb.mouseClicked(p_73864_1_, p_73864_2_, p_73864_3_); updateValues(); } @@ -80,8 +80,8 @@ public class GT_GUIContainer_ParamText extends GT_GUIContainerMetaTile_Machine { Locale locale = Locale.getDefault(); TecTechFontRender.INSTANCE.drawSplitString("\u24EA\u2b06", 10, 29, 16, 0x00bbff); TecTechFontRender.INSTANCE.drawSplitString("\u2460\u2b06", 10, 44, 16, 0x0077ff); - TecTechFontRender.INSTANCE.drawSplitString("\u24EA\u2b07" + String.format(locale, "%+.5E", (((GT_Container_ParamText) mContainer).input0f)), 10, 56, 167, 0x22ddff); - TecTechFontRender.INSTANCE.drawSplitString("\u2460\u2b07" + String.format(locale, "%+.5E", (((GT_Container_ParamText) mContainer).input1f)), 10, 65, 167, 0x00ffff); + TecTechFontRender.INSTANCE.drawSplitString("\u24EA\u2b07" + String.format(locale, "%+.5E", (((GT_Container_ParamText) mContainer).input0d)), 10, 56, 167, 0x22ddff); + TecTechFontRender.INSTANCE.drawSplitString("\u2460\u2b07" + String.format(locale, "%+.5E", (((GT_Container_ParamText) mContainer).input1d)), 10, 65, 167, 0x00ffff); } else { TecTechFontRender.INSTANCE.drawSplitString("Parameters tXt", 46, 7, 167, 0xffffff); } @@ -116,7 +116,7 @@ public class GT_GUIContainer_ParamText extends GT_GUIContainerMetaTile_Machine { } if (!Objects.equals(((GT_MetaTileEntity_Hatch_ParamText) ((GT_Container_ParamText) mContainer).mTileEntity.getMetaTileEntity()).value0s, value0tb.getText())) { ((GT_Container_ParamText) mContainer).value0s = value0tb.getText(); - ((GT_Container_ParamText) mContainer).value0f = val; + ((GT_Container_ParamText) mContainer).value0d = val; ((GT_MetaTileEntity_Hatch_ParamText) ((GT_Container_ParamText) mContainer).mTileEntity.getMetaTileEntity()).value0s = value0tb.getText(); NetworkDispatcher.INSTANCE.sendToServer(new TextParametersMessage.ParametersTextUpdate( @@ -129,8 +129,8 @@ public class GT_GUIContainer_ParamText extends GT_GUIContainerMetaTile_Machine { } private void updateIn1() { - if (!valie1tb.isFocused()) { - String str = valie1tb.getText().toLowerCase(); + if (!value1tb.isFocused()) { + String str = value1tb.getText().toLowerCase(); double val; try { if (str.contains("b")) { @@ -142,16 +142,16 @@ public class GT_GUIContainer_ParamText extends GT_GUIContainerMetaTile_Machine { } else { val = Util.stringToDouble(str); } - if (!Objects.equals(((GT_MetaTileEntity_Hatch_ParamText) ((GT_Container_ParamText) mContainer).mTileEntity.getMetaTileEntity()).value1s, valie1tb.getText())) { - ((GT_Container_ParamText) mContainer).value1s = valie1tb.getText(); - ((GT_Container_ParamText) mContainer).value1f = val; - ((GT_MetaTileEntity_Hatch_ParamText) ((GT_Container_ParamText) mContainer).mTileEntity.getMetaTileEntity()).value1s = valie1tb.getText(); + if (!Objects.equals(((GT_MetaTileEntity_Hatch_ParamText) ((GT_Container_ParamText) mContainer).mTileEntity.getMetaTileEntity()).value1s, value1tb.getText())) { + ((GT_Container_ParamText) mContainer).value1s = value1tb.getText(); + ((GT_Container_ParamText) mContainer).value1d = val; + ((GT_MetaTileEntity_Hatch_ParamText) ((GT_Container_ParamText) mContainer).mTileEntity.getMetaTileEntity()).value1s = value1tb.getText(); NetworkDispatcher.INSTANCE.sendToServer(new TextParametersMessage.ParametersTextUpdate( (GT_MetaTileEntity_Hatch_ParamText) ((GT_Container_ParamText) mContainer).mTileEntity.getMetaTileEntity())); } } catch (Exception e) { - valie1tb.setText(((GT_MetaTileEntity_Hatch_ParamText) ((GT_Container_ParamText) mContainer).mTileEntity.getMetaTileEntity()).value1s); + value1tb.setText(((GT_MetaTileEntity_Hatch_ParamText) ((GT_Container_ParamText) mContainer).mTileEntity.getMetaTileEntity()).value1s); } } } @@ -163,6 +163,6 @@ public class GT_GUIContainer_ParamText extends GT_GUIContainerMetaTile_Machine { public void setTextIn1(String in1) { ((GT_Container_ParamText) mContainer).value1s = in1; - this.valie1tb.setText(in1); + this.value1tb.setText(in1); } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java index ece8c6ba82..21e020be01 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_annihilation.java @@ -21,38 +21,41 @@ import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; +import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by danie_000 on 17.12.2016. */ public class GT_MetaTileEntity_EM_annihilation extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { + //region variables private static Textures.BlockIcons.CustomIcon ScreenOFF; private static Textures.BlockIcons.CustomIcon ScreenON; + //endregion //region structure private static final String[][] shape = new String[][]{ - {"\u0002","D000","C0 0","C0 . 0","C0 0","D000"}, - {"C01A10","C01A10","D1A1","00B101B00","11111111111","C01110","11111111111","00B101B00","D1A1","C01A10","C01A10",}, - {"C01A10","A223222322","A244242442","03442424430","12225252221","A244222442","12225252221","03442424430","A244242442","A223222322","C01A10",}, - {"D111","A244222442","A4G4","A4G4","12G21","12G21","12G21","A4G4","A4G4","A244222442","D111",}, - {"A0C0C0","03444244430","A4G4","A4G4","A4G4","02G20","A4G4","A4G4","A4G4","03444244430","A0C0C0",}, - {"00C!C00","02444544420","A4G4","A4G4","A4G4","!5G5!","A4G4","A4G4","A4G4","02444544420","00C!C00",}, - {"A0C0C0","03444244430","A4G4","A4G4","A4G4","02G20","A4G4","A4G4","A4G4","03444244430","A0C0C0",}, - {"D111","A244222442","A4G4","A4G4","12G21","12G21","12G21","A4G4","A4G4","A244222442","D111",}, - {"C01A10","A223222322","A244242442","03442424430","12225252221","A244222442","12225252221","03442424430","A244242442","A223222322","C01A10",}, - {"C01A10","C01A10","D1A1","00B101B00","11111111111","C01110","11111111111","00B101B00","D1A1","C01A10","C01A10",}, - {"\u0002","D000","C0 0","C0 0","C0 0","D000"}, + {"\u0002", "D000", "C0 0", "C0 . 0", "C0 0", "D000"}, + {"C01A10", "C01A10", "D1A1", "00B101B00", "11111111111", "C01110", "11111111111", "00B101B00", "D1A1", "C01A10", "C01A10",}, + {"C01A10", "A223222322", "A244242442", "03442424430", "12225252221", "A244222442", "12225252221", "03442424430", "A244242442", "A223222322", "C01A10",}, + {"D111", "A244222442", "A4G4", "A4G4", "12G21", "12G21", "12G21", "A4G4", "A4G4", "A244222442", "D111",}, + {"A0C0C0", "03444244430", "A4G4", "A4G4", "A4G4", "02G20", "A4G4", "A4G4", "A4G4", "03444244430", "A0C0C0",}, + {"00C!C00", "02444544420", "A4G4", "A4G4", "A4G4", "!5G5!", "A4G4", "A4G4", "A4G4", "02444544420", "00C!C00",}, + {"A0C0C0", "03444244430", "A4G4", "A4G4", "A4G4", "02G20", "A4G4", "A4G4", "A4G4", "03444244430", "A0C0C0",}, + {"D111", "A244222442", "A4G4", "A4G4", "12G21", "12G21", "12G21", "A4G4", "A4G4", "A244222442", "D111",}, + {"C01A10", "A223222322", "A244242442", "03442424430", "12225252221", "A244222442", "12225252221", "03442424430", "A244242442", "A223222322", "C01A10",}, + {"C01A10", "C01A10", "D1A1", "00B101B00", "11111111111", "C01110", "11111111111", "00B101B00", "D1A1", "C01A10", "C01A10",}, + {"\u0002", "D000", "C0 0", "C0 0", "C0 0", "D000"}, }; - private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT ,sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT}; + private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{4, 5, 12, 6, 0, 10}; private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; private static final String[] description = new String[]{ - EnumChatFormatting.AQUA+"Hint Details:", - "1 - Classic Hatches or High Power Casing", - "2 - Elemental Hatches or Molecular Casing", + EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", + translateToLocal("gt.blockmachines.multimachine.em.annihilation.hint.0"),//1 - Classic Hatches or High Power Casing + translateToLocal("gt.blockmachines.multimachine.em.annihilation.hint.1"),//2 - Elemental Hatches or Molecular Casing }; //endregion @@ -70,6 +73,20 @@ public class GT_MetaTileEntity_EM_annihilation extends GT_MetaTileEntity_Multibl } @Override + public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 5, 5, 0); + } + + @Override + public String[] getDescription() { + return new String[]{ + CommonValues.TEC_MARK_EM, + translateToLocal("gt.blockmachines.multimachine.em.annihilation.desc.0"),//Things+Anti Things don't like each other. + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.em.annihilation.desc.1")//Matter into power! + }; + } + + @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister aBlockIconRegister) { ScreenOFF = new Textures.BlockIcons.CustomIcon("iconsets/EM_ANNIHILATION"); @@ -86,26 +103,12 @@ public class GT_MetaTileEntity_EM_annihilation extends GT_MetaTileEntity_Multibl } @Override - public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 5, 5, 0); - } - - @Override public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMeta, 5, 5, 0,getBaseMetaTileEntity(),this,hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta, 5, 5, 0, getBaseMetaTileEntity(), this, hintsOnly); } @Override public String[] getStructureDescription(int stackSize) { return description; } - - @Override - public String[] getDescription() { - return new String[]{ - CommonValues.TEC_MARK_EM, - "Things+Anti Things don't like each other.", - EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Matter into power!" - }; - } -} +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java index 972f44fd85..79ae424bcb 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java @@ -24,111 +24,114 @@ import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBloc import static com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_decay.URANIUM_INGOT_MASS_DIFF; import static com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_decay.URANIUM_MASS_TO_EU_INSTANT; import static gregtech.api.enums.GT_Values.E; +import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by danie_000 on 17.12.2016. */ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { + //region variables private static Textures.BlockIcons.CustomIcon ScreenOFF; private static Textures.BlockIcons.CustomIcon ScreenON; - private static final double NEUTRONIUM_BLOCK_MASS =4.1E17; - private static final double NEUTRONIUM_BLOCK_ATOM_COUNT =2.4478671E44; - private static final double NEUTRONIUM_BLOCK_TO_EU_INSTANT = URANIUM_MASS_TO_EU_INSTANT * NEUTRONIUM_BLOCK_MASS /(URANIUM_INGOT_MASS_DIFF * 1.78266191e-36);//~ 5.314e40 + private static final double NEUTRONIUM_BLOCK_MASS = 4.1E17; + private static final double NEUTRONIUM_BLOCK_ATOM_COUNT = 2.4478671E44; + private static final double NEUTRONIUM_BLOCK_TO_EU_INSTANT = URANIUM_MASS_TO_EU_INSTANT * NEUTRONIUM_BLOCK_MASS / (URANIUM_INGOT_MASS_DIFF * 1.78266191e-36);//~ 5.314e40 private static final double NEUTRON_TO_EU_INSTANT = NEUTRONIUM_BLOCK_TO_EU_INSTANT / NEUTRONIUM_BLOCK_ATOM_COUNT;//~ 0.00021708694 - public boolean glassDome=false; + public boolean glassDome = false; + //endregion //Time dillatation - to slow down the explosion thing but REALLY REDUCE POWER OUTPUT //Startcodes to startup //per dim disable thingies - //region Structure actual + //region structure actual private static final String[][] shape = new String[][]{ - {"\u000B","M0000000","L00 00","L0 0","L0 !!! 0","L0 !.! 0","L0 !!! 0","L0 0","L00 00","M0000000",}, - {"\u0008","O0A0","O0A0","O0A0","O0A0","N11111","M1101011","I000010010010000","M1111111","I000010010010000","M1101011","N11111","O0A0","O0A0","O0A0","O0A0",}, - {"\u0006","O0A0","O0A0","O0A0","P1","P1","M1111111","L11E11","L1B222B1","G000B1A23332A1B000","J111A23332A111","G000B1A23332A1B000","L1B222B1","L11E11","M1111111","P1","P1","O0A0","O0A0","O0A0",}, - {"\u0005","O0A0","O0A0","P1","P1","\u0004","F00Q00","H11M11","F00Q00","\u0004","P1","P1","O0A0","O0A0",}, - {"\u0004","O0A0","N00000","P1","P4","P4","\u0003","F0S0","E00S00","F0144M4410","E00S00","F0S0","\u0003","P4","P4","P1","N00000","O0A0",}, - {"\u0003","O0A0","O0A0","P1","M2224222","\u0004","G2Q2","G2Q2","D00A2Q2A00","F14Q41","D00A2Q2A00","G2Q2","G2Q2","\u0004","M2224222","P1","O0A0","O0A0",}, - {"\u0002","O0A0","N00000","P1","P4","\u0006","D0W0","C00W00","D014S410","C00W00","D0W0","\u0006","P4","P1","N00000","O0A0",}, - {"\u0001","O0A0","O0A0","P1","M2224222","\u0006","E2U2","E2U2","B00A2U2A00","D14U41","B00A2U2A00","E2U2","E2U2","\u0006","M2224222","P1","O0A0","O0A0",}, - {"\u0001","O0A0","P1","P4","\u0009","B0[0","C14W41","B0[0","\u0009","P4","P1","O0A0",}, - {E,"O0A0","O0A0","P1","P4","\u0009","A00[00","C14W41","A00[00","\u0009","P4","P1","O0A0","O0A0",}, - {E,"O0A0","P1","\u000B","A0]0","B1[1","A0]0","\u000B","P1","O0A0",}, - {E,"O0A0","P1","\u000B","A0]0","B1[1","A0]0","\u000B","P1","O0A0",}, - {"O0A0","O0A0","M1111111","\u0009","B1[1","B1[1","001[100","B1[1","001[100","B1[1","B1[1","\u0009","M1111111","O0A0","O0A0",}, - {"O0A0","N11111","L11E11","\u0001","G2Q2",E,"E2U2","\u0003","B1[1","B1[1","A1]1","01]10","A1]1","01]10","A1]1","B1[1","B1[1","\u0003","E2U2",E,"G2Q2","\u0001","L11E11","N11111","O0A0",}, - {"O0A0","M1101011","L1B222B1",E,"F0S0","G2Q2","D0W0","E2U2","\u0003","B1[1","A1]1","A1]1","002[200","A12[21","002[200","A1]1","A1]1","B1[1","\u0003","E2U2","D0W0","G2Q2","F0S0",E,"L1B222B1","M1101011","O0A0",}, - {"L000000000","I000010010010000","G000B1A23332A1B000","F00Q00","E00S00","D00A2Q2A00","C00W00","B00A2U2A00","B0[0","A00[00","A0]0","A0]0","001[100","01]10","002[200","003[300","013[310","003[300","002[200","01]10","001[100","A0]0","A0]0","A00[00","B0[0","B00A2U2A00","C00W00","D00A2Q2A00","E00S00","F00Q00","G000B1A23332A1B000","I000010010010000","L000000000",}, - {"O0A0","M1111111","J111A23332A111","H11M11","F0144M4410","F14Q41","D014S410","D14U41","C14W41","C14W41","B1[1","B1[1","B1[1","A1]1","A12[21","013[310","A13[31","013[310","A12[21","A1]1","B1[1","B1[1","B1[1","C14W41","C14W41","D14U41","D014S410","F14Q41","F0144M4410","H11M11","J111A23332A111","M1111111","O0A0",}, - {"L000000000","I000010010010000","G000B1A23332A1B000","F00Q00","E00S00","D00A2Q2A00","C00W00","B00A2U2A00","B0[0","A00[00","A0]0","A0]0","001[100","01]10","002[200","003[300","013[310","003[300","002[200","01]10","001[100","A0]0","A0]0","A00[00","B0[0","B00A2U2A00","C00W00","D00A2Q2A00","E00S00","F00Q00","G000B1A23332A1B000","I000010010010000","L000000000",}, - {"O0A0","M1101011","L1B222B1",E,"F0S0","G2Q2","D0W0","E2U2","\u0003","B1[1","A1]1","A1]1","002[200","A12[21","002[200","A1]1","A1]1","B1[1","\u0003","E2U2","D0W0","G2Q2","F0S0",E,"L1B222B1","M1101011","O0A0",}, - {"O0A0","N11111","L11E11","\u0001","G2Q2",E,"E2U2","\u0003","B1[1","B1[1","A1]1","01]10","A1]1","01]10","A1]1","B1[1","B1[1","\u0003","E2U2",E,"G2Q2","\u0001","L11E11","N11111","O0A0",}, - {"O0A0","O0A0","M1111111","\u0009","B1[1","B1[1","001[100","B1[1","001[100","B1[1","B1[1","\u0009","M1111111","O0A0","O0A0",}, - {E,"O0A0","P1","\u000B","A0]0","B1[1","A0]0","\u000B","P1","O0A0",}, - {E,"O0A0","P1","\u000B","A0]0","B1[1","A0]0","\u000B","P1","O0A0",}, - {E,"O0A0","O0A0","P1","P4","\u0009","A00[00","C14W41","A00[00","\u0009","P4","P1","O0A0","O0A0",}, - {"\u0001","O0A0","P1","P4","\u0009","B0[0","C14W41","B0[0","\u0009","P4","P1","O0A0",}, - {"\u0001","O0A0","O0A0","P1","M2224222","\u0006","E2U2","E2U2","B00A2U2A00","D14U41","B00A2U2A00","E2U2","E2U2","\u0006","M2224222","P1","O0A0","O0A0",}, - {"\u0002","O0A0","N00000","P1","P4","\u0006","D0W0","C00W00","D014S410","C00W00","D0W0","\u0006","P4","P1","N00000","O0A0",}, - {"\u0003","O0A0","O0A0","P1","M2224222","\u0004","G2Q2","G2Q2","D00A2Q2A00","F14Q41","D00A2Q2A00","G2Q2","G2Q2","\u0004","M2224222","P1","O0A0","O0A0",}, - {"\u0004","O0A0","N00000","P1","P4","P4","\u0003","F0S0","E00S00","F0144M4410","E00S00","F0S0","\u0003","P4","P4","P1","N00000","O0A0",}, - {"\u0005","O0A0","O0A0","P1","P1","\u0004","F00Q00","H11M11","F00Q00","\u0004","P1","P1","O0A0","O0A0",}, - {"\u0006","O0A0","O0A0","O0A0","P1","P1","M1111111","L11E11","L1B222B1","G000B1A23332A1B000","J111A23332A111","G000B1A23332A1B000","L1B222B1","L11E11","M1111111","P1","P1","O0A0","O0A0","O0A0",}, - {"\u0008","O0A0","O0A0","O0A0","O0A0","N11111","M1101011","I000010010010000","M1111111","I000010010010000","M1101011","N11111","O0A0","O0A0","O0A0","O0A0",}, - {"\u000B","O0A0","O0A0","O0A0","L000000000","O0A0","L000000000","O0A0","O0A0","O0A0",}, + {"\u000B", "M0000000", "L00 00", "L0 0", "L0 !!! 0", "L0 !.! 0", "L0 !!! 0", "L0 0", "L00 00", "M0000000",}, + {"\u0008", "O0A0", "O0A0", "O0A0", "O0A0", "N11111", "M1101011", "I000010010010000", "M1111111", "I000010010010000", "M1101011", "N11111", "O0A0", "O0A0", "O0A0", "O0A0",}, + {"\u0006", "O0A0", "O0A0", "O0A0", "P1", "P1", "M1111111", "L11E11", "L1B222B1", "G000B1A23332A1B000", "J111A23332A111", "G000B1A23332A1B000", "L1B222B1", "L11E11", "M1111111", "P1", "P1", "O0A0", "O0A0", "O0A0",}, + {"\u0005", "O0A0", "O0A0", "P1", "P1", "\u0004", "F00Q00", "H11M11", "F00Q00", "\u0004", "P1", "P1", "O0A0", "O0A0",}, + {"\u0004", "O0A0", "N00000", "P1", "P4", "P4", "\u0003", "F0S0", "E00S00", "F0144M4410", "E00S00", "F0S0", "\u0003", "P4", "P4", "P1", "N00000", "O0A0",}, + {"\u0003", "O0A0", "O0A0", "P1", "M2224222", "\u0004", "G2Q2", "G2Q2", "D00A2Q2A00", "F14Q41", "D00A2Q2A00", "G2Q2", "G2Q2", "\u0004", "M2224222", "P1", "O0A0", "O0A0",}, + {"\u0002", "O0A0", "N00000", "P1", "P4", "\u0006", "D0W0", "C00W00", "D014S410", "C00W00", "D0W0", "\u0006", "P4", "P1", "N00000", "O0A0",}, + {"\u0001", "O0A0", "O0A0", "P1", "M2224222", "\u0006", "E2U2", "E2U2", "B00A2U2A00", "D14U41", "B00A2U2A00", "E2U2", "E2U2", "\u0006", "M2224222", "P1", "O0A0", "O0A0",}, + {"\u0001", "O0A0", "P1", "P4", "\u0009", "B0[0", "C14W41", "B0[0", "\u0009", "P4", "P1", "O0A0",}, + {E, "O0A0", "O0A0", "P1", "P4", "\u0009", "A00[00", "C14W41", "A00[00", "\u0009", "P4", "P1", "O0A0", "O0A0",}, + {E, "O0A0", "P1", "\u000B", "A0]0", "B1[1", "A0]0", "\u000B", "P1", "O0A0",}, + {E, "O0A0", "P1", "\u000B", "A0]0", "B1[1", "A0]0", "\u000B", "P1", "O0A0",}, + {"O0A0", "O0A0", "M1111111", "\u0009", "B1[1", "B1[1", "001[100", "B1[1", "001[100", "B1[1", "B1[1", "\u0009", "M1111111", "O0A0", "O0A0",}, + {"O0A0", "N11111", "L11E11", "\u0001", "G2Q2", E, "E2U2", "\u0003", "B1[1", "B1[1", "A1]1", "01]10", "A1]1", "01]10", "A1]1", "B1[1", "B1[1", "\u0003", "E2U2", E, "G2Q2", "\u0001", "L11E11", "N11111", "O0A0",}, + {"O0A0", "M1101011", "L1B222B1", E, "F0S0", "G2Q2", "D0W0", "E2U2", "\u0003", "B1[1", "A1]1", "A1]1", "002[200", "A12[21", "002[200", "A1]1", "A1]1", "B1[1", "\u0003", "E2U2", "D0W0", "G2Q2", "F0S0", E, "L1B222B1", "M1101011", "O0A0",}, + {"L000000000", "I000010010010000", "G000B1A23332A1B000", "F00Q00", "E00S00", "D00A2Q2A00", "C00W00", "B00A2U2A00", "B0[0", "A00[00", "A0]0", "A0]0", "001[100", "01]10", "002[200", "003[300", "013[310", "003[300", "002[200", "01]10", "001[100", "A0]0", "A0]0", "A00[00", "B0[0", "B00A2U2A00", "C00W00", "D00A2Q2A00", "E00S00", "F00Q00", "G000B1A23332A1B000", "I000010010010000", "L000000000",}, + {"O0A0", "M1111111", "J111A23332A111", "H11M11", "F0144M4410", "F14Q41", "D014S410", "D14U41", "C14W41", "C14W41", "B1[1", "B1[1", "B1[1", "A1]1", "A12[21", "013[310", "A13[31", "013[310", "A12[21", "A1]1", "B1[1", "B1[1", "B1[1", "C14W41", "C14W41", "D14U41", "D014S410", "F14Q41", "F0144M4410", "H11M11", "J111A23332A111", "M1111111", "O0A0",}, + {"L000000000", "I000010010010000", "G000B1A23332A1B000", "F00Q00", "E00S00", "D00A2Q2A00", "C00W00", "B00A2U2A00", "B0[0", "A00[00", "A0]0", "A0]0", "001[100", "01]10", "002[200", "003[300", "013[310", "003[300", "002[200", "01]10", "001[100", "A0]0", "A0]0", "A00[00", "B0[0", "B00A2U2A00", "C00W00", "D00A2Q2A00", "E00S00", "F00Q00", "G000B1A23332A1B000", "I000010010010000", "L000000000",}, + {"O0A0", "M1101011", "L1B222B1", E, "F0S0", "G2Q2", "D0W0", "E2U2", "\u0003", "B1[1", "A1]1", "A1]1", "002[200", "A12[21", "002[200", "A1]1", "A1]1", "B1[1", "\u0003", "E2U2", "D0W0", "G2Q2", "F0S0", E, "L1B222B1", "M1101011", "O0A0",}, + {"O0A0", "N11111", "L11E11", "\u0001", "G2Q2", E, "E2U2", "\u0003", "B1[1", "B1[1", "A1]1", "01]10", "A1]1", "01]10", "A1]1", "B1[1", "B1[1", "\u0003", "E2U2", E, "G2Q2", "\u0001", "L11E11", "N11111", "O0A0",}, + {"O0A0", "O0A0", "M1111111", "\u0009", "B1[1", "B1[1", "001[100", "B1[1", "001[100", "B1[1", "B1[1", "\u0009", "M1111111", "O0A0", "O0A0",}, + {E, "O0A0", "P1", "\u000B", "A0]0", "B1[1", "A0]0", "\u000B", "P1", "O0A0",}, + {E, "O0A0", "P1", "\u000B", "A0]0", "B1[1", "A0]0", "\u000B", "P1", "O0A0",}, + {E, "O0A0", "O0A0", "P1", "P4", "\u0009", "A00[00", "C14W41", "A00[00", "\u0009", "P4", "P1", "O0A0", "O0A0",}, + {"\u0001", "O0A0", "P1", "P4", "\u0009", "B0[0", "C14W41", "B0[0", "\u0009", "P4", "P1", "O0A0",}, + {"\u0001", "O0A0", "O0A0", "P1", "M2224222", "\u0006", "E2U2", "E2U2", "B00A2U2A00", "D14U41", "B00A2U2A00", "E2U2", "E2U2", "\u0006", "M2224222", "P1", "O0A0", "O0A0",}, + {"\u0002", "O0A0", "N00000", "P1", "P4", "\u0006", "D0W0", "C00W00", "D014S410", "C00W00", "D0W0", "\u0006", "P4", "P1", "N00000", "O0A0",}, + {"\u0003", "O0A0", "O0A0", "P1", "M2224222", "\u0004", "G2Q2", "G2Q2", "D00A2Q2A00", "F14Q41", "D00A2Q2A00", "G2Q2", "G2Q2", "\u0004", "M2224222", "P1", "O0A0", "O0A0",}, + {"\u0004", "O0A0", "N00000", "P1", "P4", "P4", "\u0003", "F0S0", "E00S00", "F0144M4410", "E00S00", "F0S0", "\u0003", "P4", "P4", "P1", "N00000", "O0A0",}, + {"\u0005", "O0A0", "O0A0", "P1", "P1", "\u0004", "F00Q00", "H11M11", "F00Q00", "\u0004", "P1", "P1", "O0A0", "O0A0",}, + {"\u0006", "O0A0", "O0A0", "O0A0", "P1", "P1", "M1111111", "L11E11", "L1B222B1", "G000B1A23332A1B000", "J111A23332A111", "G000B1A23332A1B000", "L1B222B1", "L11E11", "M1111111", "P1", "P1", "O0A0", "O0A0", "O0A0",}, + {"\u0008", "O0A0", "O0A0", "O0A0", "O0A0", "N11111", "M1101011", "I000010010010000", "M1111111", "I000010010010000", "M1101011", "N11111", "O0A0", "O0A0", "O0A0", "O0A0",}, + {"\u000B", "O0A0", "O0A0", "O0A0", "L000000000", "O0A0", "L000000000", "O0A0", "O0A0", "O0A0",}, }; - private static final Block[] blockType = new Block[]{sBlockCasingsTT,sBlockCasingsTT,sBlockCasingsTT,sBlockCasingsTT,sBlockCasingsTT}; + private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{12, 13, 14, 10, 11}; private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; private static final String[] description = new String[]{ - EnumChatFormatting.AQUA+"Hint Details:", - "1 - Classic Hatches or High Power Casing", - "2 - Elemental Hatches or Molecular Casing", + EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", + translateToLocal("gt.blockmachines.multimachine.em.blackholegenerator.hint.0"),//1 - Classic Hatches or High Power Casing + translateToLocal("gt.blockmachines.multimachine.em.blackholegenerator.hint.1"),//2 - Elemental Hatches or Molecular Casing }; //endregion - //region Structure dank - glass sphere for the looks + //region structure dank - glass sphere for the looks private static final String[][] shape2 = new String[][]{ - {"\u000B","M0000000","L00 00","L0 0","L0 !!! 0","L0 !.! 0","L0 !!! 0","L0 0","L00 00","M0000000",}, - {"\u0008","O0A0","M110A011","L1110A0111","K11110A01111","J1111222221111","J1112202022111","I000020020020000","M2222222","I000020020020000","J1112202022111","J1111222221111","K11110A01111","L1110A0111","M110A011","O0A0",}, - {"\u0006","O0A0","M110A011","K11110A01111","J111C2C111","I111D2D111","I11B2222222B11","H11B22E22B11","H11B2B333B2B11","G000B2A34443A2B000","J222A34443A222","G000B2A34443A2B000","H11B2B333B2B11","H11B22E22B11","I11B2222222B11","I111D2D111","J111C2C111","K11110A01111","M110A011","O0A0",}, - {"\u0005","O0A0","L1110A0111","J111C2C111","I11E2E11","H11M11","H1O1","G11O11","G1Q1","G1Q1","F00Q00","H22M22","F00Q00","G1Q1","G1Q1","G11O11","H1O1","H11M11","I11E2E11","J111C2C111","L1110A0111","O0A0",}, - {"\u0004","O0A0","K11100000111","I111D2D111","H11F5F11","G11G5G11","G1Q1","F11Q11","F1S1","F1S1","F0S0","E00S00","F0255M5520","E00S00","F0S0","F1S1","F1S1","F11Q11","G1Q1","G11G5G11","H11F5F11","I111D2D111","K11100000111","O0A0",}, - {"\u0003","O0A0","J111110A011111","H111E2E111","G11D3335333D11","F11Q11","F1S1","E11S11","E1U1","E1U1","E1A3Q3A1","E1A3Q3A1","D00A3Q3A00","F25Q52","D00A3Q3A00","E1A3Q3A1","E1A3Q3A1","E1U1","E1U1","E11S11","F1S1","F11Q11","G11D3335333D11","H111E2E111","J111110A011111","O0A0",}, - {"\u0002","O0A0","K11100000111","H111E2E111","G11G5G11","F1S1","E11S11","E1U1","E1U1","D1W1","D1W1","D1W1","D0W0","C00W00","D025S520","C00W00","D0W0","D1W1","D1W1","D1W1","E1U1","E1U1","E11S11","F1S1","G11G5G11","H111E2E111","K11100000111","O0A0",}, - {"\u0001","O0A0","L1110A0111","I111D2D111","G11D3335333D11","F1S1","E1U1","E1U1","D1W1","D1W1","D1W1","C1Y1","C1A3U3A1","C1A3U3A1","B00A3U3A00","D25U52","B00A3U3A00","C1A3U3A1","C1A3U3A1","C1Y1","D1W1","D1W1","D1W1","E1U1","E1U1","F1S1","G11D3335333D11","I111D2D111","L1110A0111","O0A0",}, - {"\u0001","M110A011","J111C2C111","H11F5F11","F11Q11","E11S11","E1U1","D1W1","D1W1","C1Y1","C1Y1","C1Y1","B1[1","B1[1","B0[0","C25W52","B0[0","B1[1","B1[1","C1Y1","C1Y1","C1Y1","D1W1","D1W1","E1U1","E11S11","F11Q11","H11F5F11","J111C2C111","M110A011",}, - {E,"O0A0","K11110A01111","I11E2E11","G11G5G11","F1S1","E1U1","D1W1","D1W1","C1Y1","C1Y1","B1[1","B1[1","B1[1","B1[1","A00[00","C25W52","A00[00","B1[1","B1[1","B1[1","B1[1","C1Y1","C1Y1","D1W1","D1W1","E1U1","F1S1","G11G5G11","I11E2E11","K11110A01111","O0A0",}, - {E,"M110A011","J111C2C111","H11M11","G1Q1","E11S11","E1U1","D1W1","C1Y1","C1Y1","B1[1","B1[1","B1[1","A1]1","A1]1","A0]0","B2[2","A0]0","A1]1","A1]1","B1[1","B1[1","B1[1","C1Y1","C1Y1","D1W1","E1U1","E11S11","G1Q1","H11M11","J111C2C111","M110A011",}, - {E,"L1110A0111","I111D2D111","H1O1","F11Q11","E1U1","D1W1","D1W1","C1Y1","B1[1","B1[1","B1[1","A1]1","A1]1","A1]1","A0]0","B2[2","A0]0","A1]1","A1]1","A1]1","B1[1","B1[1","B1[1","C1Y1","D1W1","D1W1","E1U1","F11Q11","H1O1","I111D2D111","L1110A0111",}, - {"O0A0","K11110A01111","I11B2222222B11","G11O11","F1S1","E1U1","D1W1","C1Y1","C1Y1","B1[1","B1[1","A1]1","A1]1","A12[21","A12[21","002[200","B2[2","002[200","A12[21","A12[21","A1]1","A1]1","B1[1","B1[1","C1Y1","C1Y1","D1W1","E1U1","F1S1","G11O11","I11B2222222B11","K11110A01111","O0A0",}, - {"O0A0","J1111222221111","H11B22E22B11","G1Q1","F1S1","E1A3Q3A1","D1W1","C1A3U3A1","B1[1","B1[1","A1]1","A1]1","A12[21","A12[21","A2]2","02]20","A2]2","02]20","A2]2","A12[21","A12[21","A1]1","A1]1","B1[1","B1[1","C1A3U3A1","D1W1","E1A3Q3A1","F1S1","G1Q1","H11B22E22B11","J1111222221111","O0A0",}, - {"O0A0","J1112202022111","H11B2B333B2B11","G1Q1","F0S0","E1A3Q3A1","D0W0","C1A3U3A1","B1[1","B1[1","A1]1","A1]1","A12[21","A2]2","A2]2","003[300","A23[32","003[300","A2]2","A2]2","A12[21","A1]1","A1]1","B1[1","B1[1","C1A3U3A1","D0W0","E1A3Q3A1","F0S0","G1Q1","H11B2B333B2B11","J1112202022111","O0A0",}, - {"L000000000","I000020020020000","G000B2A34443A2B000","F00Q00","E00S00","D00A3Q3A00","C00W00","B00A3U3A00","B0[0","A00[00","A0]0","A0]0","002[200","02]20","003[300","004[400","024[420","004[400","003[300","02]20","002[200","A0]0","A0]0","A00[00","B0[0","B00A3U3A00","C00W00","D00A3Q3A00","E00S00","F00Q00","G000B2A34443A2B000","I000020020020000","L000000000",}, - {"O0A0","M2222222","J222A34443A222","H22M22","F0255M5520","F25Q52","D025S520","D25U52","C25W52","C25W52","B2[2","B2[2","B2[2","A2]2","A23[32","024[420","A24[42","024[420","A23[32","A2]2","B2[2","B2[2","B2[2","C25W52","C25W52","D25U52","D025S520","F25Q52","F0255M5520","H22M22","J222A34443A222","M2222222","O0A0",}, - {"L000000000","I000020020020000","G000B2A34443A2B000","F00Q00","E00S00","D00A3Q3A00","C00W00","B00A3U3A00","B0[0","A00[00","A0]0","A0]0","002[200","02]20","003[300","004[400","024[420","004[400","003[300","02]20","002[200","A0]0","A0]0","A00[00","B0[0","B00A3U3A00","C00W00","D00A3Q3A00","E00S00","F00Q00","G000B2A34443A2B000","I000020020020000","L000000000",}, - {"O0A0","J1112202022111","H11B2B333B2B11","G1Q1","F0S0","E1A3Q3A1","D0W0","C1A3U3A1","B1[1","B1[1","A1]1","A1]1","A12[21","A2]2","A2]2","003[300","A23[32","003[300","A2]2","A2]2","A12[21","A1]1","A1]1","B1[1","B1[1","C1A3U3A1","D0W0","E1A3Q3A1","F0S0","G1Q1","H11B2B333B2B11","J1112202022111","O0A0",}, - {"O0A0","J1111222221111","H11B22E22B11","G1Q1","F1S1","E1A3Q3A1","D1W1","C1A3U3A1","B1[1","B1[1","A1]1","A1]1","A12[21","A12[21","A2]2","02]20","A2]2","02]20","A2]2","A12[21","A12[21","A1]1","A1]1","B1[1","B1[1","C1A3U3A1","D1W1","E1A3Q3A1","F1S1","G1Q1","H11B22E22B11","J1111222221111","O0A0",}, - {"O0A0","K11110A01111","I11B2222222B11","G11O11","F1S1","E1U1","D1W1","C1Y1","C1Y1","B1[1","B1[1","A1]1","A1]1","A12[21","A12[21","002[200","B2[2","002[200","A12[21","A12[21","A1]1","A1]1","B1[1","B1[1","C1Y1","C1Y1","D1W1","E1U1","F1S1","G11O11","I11B2222222B11","K11110A01111","O0A0",}, - {E,"L1110A0111","I111D2D111","H1O1","F11Q11","E1U1","D1W1","D1W1","C1Y1","B1[1","B1[1","B1[1","A1]1","A1]1","A1]1","A0]0","B2[2","A0]0","A1]1","A1]1","A1]1","B1[1","B1[1","B1[1","C1Y1","D1W1","D1W1","E1U1","F11Q11","H1O1","I111D2D111","L1110A0111",}, - {E,"M110A011","J111C2C111","H11M11","G1Q1","E11S11","E1U1","D1W1","C1Y1","C1Y1","B1[1","B1[1","B1[1","A1]1","A1]1","A0]0","B2[2","A0]0","A1]1","A1]1","B1[1","B1[1","B1[1","C1Y1","C1Y1","D1W1","E1U1","E11S11","G1Q1","H11M11","J111C2C111","M110A011",}, - {E,"O0A0","K11110A01111","I11E2E11","G11G5G11","F1S1","E1U1","D1W1","D1W1","C1Y1","C1Y1","B1[1","B1[1","B1[1","B1[1","A00[00","C25W52","A00[00","B1[1","B1[1","B1[1","B1[1","C1Y1","C1Y1","D1W1","D1W1","E1U1","F1S1","G11G5G11","I11E2E11","K11110A01111","O0A0",}, - {"\u0001","M110A011","J111C2C111","H11F5F11","F11Q11","E11S11","E1U1","D1W1","D1W1","C1Y1","C1Y1","C1Y1","B1[1","B1[1","B0[0","C25W52","B0[0","B1[1","B1[1","C1Y1","C1Y1","C1Y1","D1W1","D1W1","E1U1","E11S11","F11Q11","H11F5F11","J111C2C111","M110A011",}, - {"\u0001","O0A0","L1110A0111","I111D2D111","G11D3335333D11","F1S1","E1U1","E1U1","D1W1","D1W1","D1W1","C1Y1","C1A3U3A1","C1A3U3A1","B00A3U3A00","D25U52","B00A3U3A00","C1A3U3A1","C1A3U3A1","C1Y1","D1W1","D1W1","D1W1","E1U1","E1U1","F1S1","G11D3335333D11","I111D2D111","L1110A0111","O0A0",}, - {"\u0002","O0A0","K11100000111","H111E2E111","G11G5G11","F1S1","E11S11","E1U1","E1U1","D1W1","D1W1","D1W1","D0W0","C00W00","D025S520","C00W00","D0W0","D1W1","D1W1","D1W1","E1U1","E1U1","E11S11","F1S1","G11G5G11","H111E2E111","K11100000111","O0A0",}, - {"\u0003","O0A0","J111110A011111","H111E2E111","G11D3335333D11","F11Q11","F1S1","E11S11","E1U1","E1U1","E1A3Q3A1","E1A3Q3A1","D00A3Q3A00","F25Q52","D00A3Q3A00","E1A3Q3A1","E1A3Q3A1","E1U1","E1U1","E11S11","F1S1","F11Q11","G11D3335333D11","H111E2E111","J111110A011111","O0A0",}, - {"\u0004","O0A0","K11100000111","I111D2D111","H11F5F11","G11G5G11","G1Q1","F11Q11","F1S1","F1S1","F0S0","E00S00","F0255M5520","E00S00","F0S0","F1S1","F1S1","F11Q11","G1Q1","G11G5G11","H11F5F11","I111D2D111","K11100000111","O0A0",}, - {"\u0005","O0A0","L1110A0111","J111C2C111","I11E2E11","H11M11","H1O1","G11O11","G1Q1","G1Q1","F00Q00","H22M22","F00Q00","G1Q1","G1Q1","G11O11","H1O1","H11M11","I11E2E11","J111C2C111","L1110A0111","O0A0",}, - {"\u0006","O0A0","M110A011","K11110A01111","J111C2C111","I111D2D111","I11B2222222B11","H11B22E22B11","H11B2B333B2B11","G000B2A34443A2B000","J222A34443A222","G000B2A34443A2B000","H11B2B333B2B11","H11B22E22B11","I11B2222222B11","I111D2D111","J111C2C111","K11110A01111","M110A011","O0A0",}, - {"\u0008","O0A0","M110A011","L1110A0111","K11110A01111","J1111222221111","J1112202022111","I000020020020000","M2222222","I000020020020000","J1112202022111","J1111222221111","K11110A01111","L1110A0111","M110A011","O0A0",}, - {"\u000B","O0A0","O0A0","O0A0","L000000000","O0A0","L000000000","O0A0","O0A0","O0A0",}, + {"\u000B", "M0000000", "L00 00", "L0 0", "L0 !!! 0", "L0 !.! 0", "L0 !!! 0", "L0 0", "L00 00", "M0000000",}, + {"\u0008", "O0A0", "M110A011", "L1110A0111", "K11110A01111", "J1111222221111", "J1112202022111", "I000020020020000", "M2222222", "I000020020020000", "J1112202022111", "J1111222221111", "K11110A01111", "L1110A0111", "M110A011", "O0A0",}, + {"\u0006", "O0A0", "M110A011", "K11110A01111", "J111C2C111", "I111D2D111", "I11B2222222B11", "H11B22E22B11", "H11B2B333B2B11", "G000B2A34443A2B000", "J222A34443A222", "G000B2A34443A2B000", "H11B2B333B2B11", "H11B22E22B11", "I11B2222222B11", "I111D2D111", "J111C2C111", "K11110A01111", "M110A011", "O0A0",}, + {"\u0005", "O0A0", "L1110A0111", "J111C2C111", "I11E2E11", "H11M11", "H1O1", "G11O11", "G1Q1", "G1Q1", "F00Q00", "H22M22", "F00Q00", "G1Q1", "G1Q1", "G11O11", "H1O1", "H11M11", "I11E2E11", "J111C2C111", "L1110A0111", "O0A0",}, + {"\u0004", "O0A0", "K11100000111", "I111D2D111", "H11F5F11", "G11G5G11", "G1Q1", "F11Q11", "F1S1", "F1S1", "F0S0", "E00S00", "F0255M5520", "E00S00", "F0S0", "F1S1", "F1S1", "F11Q11", "G1Q1", "G11G5G11", "H11F5F11", "I111D2D111", "K11100000111", "O0A0",}, + {"\u0003", "O0A0", "J111110A011111", "H111E2E111", "G11D3335333D11", "F11Q11", "F1S1", "E11S11", "E1U1", "E1U1", "E1A3Q3A1", "E1A3Q3A1", "D00A3Q3A00", "F25Q52", "D00A3Q3A00", "E1A3Q3A1", "E1A3Q3A1", "E1U1", "E1U1", "E11S11", "F1S1", "F11Q11", "G11D3335333D11", "H111E2E111", "J111110A011111", "O0A0",}, + {"\u0002", "O0A0", "K11100000111", "H111E2E111", "G11G5G11", "F1S1", "E11S11", "E1U1", "E1U1", "D1W1", "D1W1", "D1W1", "D0W0", "C00W00", "D025S520", "C00W00", "D0W0", "D1W1", "D1W1", "D1W1", "E1U1", "E1U1", "E11S11", "F1S1", "G11G5G11", "H111E2E111", "K11100000111", "O0A0",}, + {"\u0001", "O0A0", "L1110A0111", "I111D2D111", "G11D3335333D11", "F1S1", "E1U1", "E1U1", "D1W1", "D1W1", "D1W1", "C1Y1", "C1A3U3A1", "C1A3U3A1", "B00A3U3A00", "D25U52", "B00A3U3A00", "C1A3U3A1", "C1A3U3A1", "C1Y1", "D1W1", "D1W1", "D1W1", "E1U1", "E1U1", "F1S1", "G11D3335333D11", "I111D2D111", "L1110A0111", "O0A0",}, + {"\u0001", "M110A011", "J111C2C111", "H11F5F11", "F11Q11", "E11S11", "E1U1", "D1W1", "D1W1", "C1Y1", "C1Y1", "C1Y1", "B1[1", "B1[1", "B0[0", "C25W52", "B0[0", "B1[1", "B1[1", "C1Y1", "C1Y1", "C1Y1", "D1W1", "D1W1", "E1U1", "E11S11", "F11Q11", "H11F5F11", "J111C2C111", "M110A011",}, + {E, "O0A0", "K11110A01111", "I11E2E11", "G11G5G11", "F1S1", "E1U1", "D1W1", "D1W1", "C1Y1", "C1Y1", "B1[1", "B1[1", "B1[1", "B1[1", "A00[00", "C25W52", "A00[00", "B1[1", "B1[1", "B1[1", "B1[1", "C1Y1", "C1Y1", "D1W1", "D1W1", "E1U1", "F1S1", "G11G5G11", "I11E2E11", "K11110A01111", "O0A0",}, + {E, "M110A011", "J111C2C111", "H11M11", "G1Q1", "E11S11", "E1U1", "D1W1", "C1Y1", "C1Y1", "B1[1", "B1[1", "B1[1", "A1]1", "A1]1", "A0]0", "B2[2", "A0]0", "A1]1", "A1]1", "B1[1", "B1[1", "B1[1", "C1Y1", "C1Y1", "D1W1", "E1U1", "E11S11", "G1Q1", "H11M11", "J111C2C111", "M110A011",}, + {E, "L1110A0111", "I111D2D111", "H1O1", "F11Q11", "E1U1", "D1W1", "D1W1", "C1Y1", "B1[1", "B1[1", "B1[1", "A1]1", "A1]1", "A1]1", "A0]0", "B2[2", "A0]0", "A1]1", "A1]1", "A1]1", "B1[1", "B1[1", "B1[1", "C1Y1", "D1W1", "D1W1", "E1U1", "F11Q11", "H1O1", "I111D2D111", "L1110A0111",}, + {"O0A0", "K11110A01111", "I11B2222222B11", "G11O11", "F1S1", "E1U1", "D1W1", "C1Y1", "C1Y1", "B1[1", "B1[1", "A1]1", "A1]1", "A12[21", "A12[21", "002[200", "B2[2", "002[200", "A12[21", "A12[21", "A1]1", "A1]1", "B1[1", "B1[1", "C1Y1", "C1Y1", "D1W1", "E1U1", "F1S1", "G11O11", "I11B2222222B11", "K11110A01111", "O0A0",}, + {"O0A0", "J1111222221111", "H11B22E22B11", "G1Q1", "F1S1", "E1A3Q3A1", "D1W1", "C1A3U3A1", "B1[1", "B1[1", "A1]1", "A1]1", "A12[21", "A12[21", "A2]2", "02]20", "A2]2", "02]20", "A2]2", "A12[21", "A12[21", "A1]1", "A1]1", "B1[1", "B1[1", "C1A3U3A1", "D1W1", "E1A3Q3A1", "F1S1", "G1Q1", "H11B22E22B11", "J1111222221111", "O0A0",}, + {"O0A0", "J1112202022111", "H11B2B333B2B11", "G1Q1", "F0S0", "E1A3Q3A1", "D0W0", "C1A3U3A1", "B1[1", "B1[1", "A1]1", "A1]1", "A12[21", "A2]2", "A2]2", "003[300", "A23[32", "003[300", "A2]2", "A2]2", "A12[21", "A1]1", "A1]1", "B1[1", "B1[1", "C1A3U3A1", "D0W0", "E1A3Q3A1", "F0S0", "G1Q1", "H11B2B333B2B11", "J1112202022111", "O0A0",}, + {"L000000000", "I000020020020000", "G000B2A34443A2B000", "F00Q00", "E00S00", "D00A3Q3A00", "C00W00", "B00A3U3A00", "B0[0", "A00[00", "A0]0", "A0]0", "002[200", "02]20", "003[300", "004[400", "024[420", "004[400", "003[300", "02]20", "002[200", "A0]0", "A0]0", "A00[00", "B0[0", "B00A3U3A00", "C00W00", "D00A3Q3A00", "E00S00", "F00Q00", "G000B2A34443A2B000", "I000020020020000", "L000000000",}, + {"O0A0", "M2222222", "J222A34443A222", "H22M22", "F0255M5520", "F25Q52", "D025S520", "D25U52", "C25W52", "C25W52", "B2[2", "B2[2", "B2[2", "A2]2", "A23[32", "024[420", "A24[42", "024[420", "A23[32", "A2]2", "B2[2", "B2[2", "B2[2", "C25W52", "C25W52", "D25U52", "D025S520", "F25Q52", "F0255M5520", "H22M22", "J222A34443A222", "M2222222", "O0A0",}, + {"L000000000", "I000020020020000", "G000B2A34443A2B000", "F00Q00", "E00S00", "D00A3Q3A00", "C00W00", "B00A3U3A00", "B0[0", "A00[00", "A0]0", "A0]0", "002[200", "02]20", "003[300", "004[400", "024[420", "004[400", "003[300", "02]20", "002[200", "A0]0", "A0]0", "A00[00", "B0[0", "B00A3U3A00", "C00W00", "D00A3Q3A00", "E00S00", "F00Q00", "G000B2A34443A2B000", "I000020020020000", "L000000000",}, + {"O0A0", "J1112202022111", "H11B2B333B2B11", "G1Q1", "F0S0", "E1A3Q3A1", "D0W0", "C1A3U3A1", "B1[1", "B1[1", "A1]1", "A1]1", "A12[21", "A2]2", "A2]2", "003[300", "A23[32", "003[300", "A2]2", "A2]2", "A12[21", "A1]1", "A1]1", "B1[1", "B1[1", "C1A3U3A1", "D0W0", "E1A3Q3A1", "F0S0", "G1Q1", "H11B2B333B2B11", "J1112202022111", "O0A0",}, + {"O0A0", "J1111222221111", "H11B22E22B11", "G1Q1", "F1S1", "E1A3Q3A1", "D1W1", "C1A3U3A1", "B1[1", "B1[1", "A1]1", "A1]1", "A12[21", "A12[21", "A2]2", "02]20", "A2]2", "02]20", "A2]2", "A12[21", "A12[21", "A1]1", "A1]1", "B1[1", "B1[1", "C1A3U3A1", "D1W1", "E1A3Q3A1", "F1S1", "G1Q1", "H11B22E22B11", "J1111222221111", "O0A0",}, + {"O0A0", "K11110A01111", "I11B2222222B11", "G11O11", "F1S1", "E1U1", "D1W1", "C1Y1", "C1Y1", "B1[1", "B1[1", "A1]1", "A1]1", "A12[21", "A12[21", "002[200", "B2[2", "002[200", "A12[21", "A12[21", "A1]1", "A1]1", "B1[1", "B1[1", "C1Y1", "C1Y1", "D1W1", "E1U1", "F1S1", "G11O11", "I11B2222222B11", "K11110A01111", "O0A0",}, + {E, "L1110A0111", "I111D2D111", "H1O1", "F11Q11", "E1U1", "D1W1", "D1W1", "C1Y1", "B1[1", "B1[1", "B1[1", "A1]1", "A1]1", "A1]1", "A0]0", "B2[2", "A0]0", "A1]1", "A1]1", "A1]1", "B1[1", "B1[1", "B1[1", "C1Y1", "D1W1", "D1W1", "E1U1", "F11Q11", "H1O1", "I111D2D111", "L1110A0111",}, + {E, "M110A011", "J111C2C111", "H11M11", "G1Q1", "E11S11", "E1U1", "D1W1", "C1Y1", "C1Y1", "B1[1", "B1[1", "B1[1", "A1]1", "A1]1", "A0]0", "B2[2", "A0]0", "A1]1", "A1]1", "B1[1", "B1[1", "B1[1", "C1Y1", "C1Y1", "D1W1", "E1U1", "E11S11", "G1Q1", "H11M11", "J111C2C111", "M110A011",}, + {E, "O0A0", "K11110A01111", "I11E2E11", "G11G5G11", "F1S1", "E1U1", "D1W1", "D1W1", "C1Y1", "C1Y1", "B1[1", "B1[1", "B1[1", "B1[1", "A00[00", "C25W52", "A00[00", "B1[1", "B1[1", "B1[1", "B1[1", "C1Y1", "C1Y1", "D1W1", "D1W1", "E1U1", "F1S1", "G11G5G11", "I11E2E11", "K11110A01111", "O0A0",}, + {"\u0001", "M110A011", "J111C2C111", "H11F5F11", "F11Q11", "E11S11", "E1U1", "D1W1", "D1W1", "C1Y1", "C1Y1", "C1Y1", "B1[1", "B1[1", "B0[0", "C25W52", "B0[0", "B1[1", "B1[1", "C1Y1", "C1Y1", "C1Y1", "D1W1", "D1W1", "E1U1", "E11S11", "F11Q11", "H11F5F11", "J111C2C111", "M110A011",}, + {"\u0001", "O0A0", "L1110A0111", "I111D2D111", "G11D3335333D11", "F1S1", "E1U1", "E1U1", "D1W1", "D1W1", "D1W1", "C1Y1", "C1A3U3A1", "C1A3U3A1", "B00A3U3A00", "D25U52", "B00A3U3A00", "C1A3U3A1", "C1A3U3A1", "C1Y1", "D1W1", "D1W1", "D1W1", "E1U1", "E1U1", "F1S1", "G11D3335333D11", "I111D2D111", "L1110A0111", "O0A0",}, + {"\u0002", "O0A0", "K11100000111", "H111E2E111", "G11G5G11", "F1S1", "E11S11", "E1U1", "E1U1", "D1W1", "D1W1", "D1W1", "D0W0", "C00W00", "D025S520", "C00W00", "D0W0", "D1W1", "D1W1", "D1W1", "E1U1", "E1U1", "E11S11", "F1S1", "G11G5G11", "H111E2E111", "K11100000111", "O0A0",}, + {"\u0003", "O0A0", "J111110A011111", "H111E2E111", "G11D3335333D11", "F11Q11", "F1S1", "E11S11", "E1U1", "E1U1", "E1A3Q3A1", "E1A3Q3A1", "D00A3Q3A00", "F25Q52", "D00A3Q3A00", "E1A3Q3A1", "E1A3Q3A1", "E1U1", "E1U1", "E11S11", "F1S1", "F11Q11", "G11D3335333D11", "H111E2E111", "J111110A011111", "O0A0",}, + {"\u0004", "O0A0", "K11100000111", "I111D2D111", "H11F5F11", "G11G5G11", "G1Q1", "F11Q11", "F1S1", "F1S1", "F0S0", "E00S00", "F0255M5520", "E00S00", "F0S0", "F1S1", "F1S1", "F11Q11", "G1Q1", "G11G5G11", "H11F5F11", "I111D2D111", "K11100000111", "O0A0",}, + {"\u0005", "O0A0", "L1110A0111", "J111C2C111", "I11E2E11", "H11M11", "H1O1", "G11O11", "G1Q1", "G1Q1", "F00Q00", "H22M22", "F00Q00", "G1Q1", "G1Q1", "G11O11", "H1O1", "H11M11", "I11E2E11", "J111C2C111", "L1110A0111", "O0A0",}, + {"\u0006", "O0A0", "M110A011", "K11110A01111", "J111C2C111", "I111D2D111", "I11B2222222B11", "H11B22E22B11", "H11B2B333B2B11", "G000B2A34443A2B000", "J222A34443A222", "G000B2A34443A2B000", "H11B2B333B2B11", "H11B22E22B11", "I11B2222222B11", "I111D2D111", "J111C2C111", "K11110A01111", "M110A011", "O0A0",}, + {"\u0008", "O0A0", "M110A011", "L1110A0111", "K11110A01111", "J1111222221111", "J1112202022111", "I000020020020000", "M2222222", "I000020020020000", "J1112202022111", "J1111222221111", "K11110A01111", "L1110A0111", "M110A011", "O0A0",}, + {"\u000B", "O0A0", "O0A0", "O0A0", "L000000000", "O0A0", "L000000000", "O0A0", "O0A0", "O0A0",}, }; - private static final Block[] blockType2 = new Block[]{sBlockCasingsTT, QuantumGlassBlock.INSTANCE,sBlockCasingsTT,sBlockCasingsTT,sBlockCasingsTT,sBlockCasingsTT}; + private static final Block[] blockType2 = new Block[]{sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta2 = new byte[]{12, 0, 13, 14, 10, 11}; //endregion @@ -140,66 +143,9 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E super(aName); } - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_EM_bhg(mName); - } - - @Override - public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - if(structureCheck_EM(shape2, blockType2, blockMeta2, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 16, 16, 0)){ - glassDome=true; - return true; - } - if(structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 16, 16, 0)){ - glassDome=false; - return true; - } - //todo check tiers of hatches!!!! - return false; - } - - @Override - public void construct(int stackSize, boolean hintsOnly) { - if((stackSize &1)==1) { - StructureBuilderExtreme(shape, blockType, blockMeta, 16, 16, 0, getBaseMetaTileEntity(),this, hintsOnly); - } else { - StructureBuilderExtreme(shape2, blockType2, blockMeta2, 16, 16, 0, getBaseMetaTileEntity(),this, hintsOnly); - } - } - - @Override - public String[] getStructureDescription(int stackSize) { - return description; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister aBlockIconRegister) { - ScreenOFF = new Textures.BlockIcons.CustomIcon("iconsets/EM_BHG"); - ScreenON = new Textures.BlockIcons.CustomIcon("iconsets/EM_BHG_ACTIVE"); - super.registerIcons(aBlockIconRegister); - } - - @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][12], new TT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; - } - return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12]}; - } - - @Override - public String[] getDescription() { - return new String[]{ - CommonValues.TEC_MARK_EM, - "Singularity based power generation.", - EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Super unstable!!!" - }; - } - /** * Black hole event horizon radius calculator + * * @param massKg mass in kg * @return radius in meters */ @@ -209,6 +155,7 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E /** * Black hole event horizon surface area calculator + * * @param massKg mass in kg * @return area in meters^2 */ @@ -218,6 +165,7 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E /** * Black hole event horizon temperature calculator + * * @param massKg mass in kg * @return temperature in K */ @@ -227,6 +175,7 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E /** * Black hole luminosity calculator + * * @param massKg mass in kg * @return luminosity in watts */ @@ -236,6 +185,7 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E /** * Black hole acretion disk luminosity calculator + * * @param massKgPer1s mass injection kg per s * @return luminosity in watts */ @@ -245,36 +195,40 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E /** * Black hole gravity field calculator, should be used for gravity blasting - * @param massKg mass in kg + * + * @param massKg mass in kg * @param distanceSq distance squared in meters * @return gravity field */ - private static double getGravityField(double massKg,double distanceSq) { + private static double getGravityField(double massKg, double distanceSq) { return massKg * 6.6743015e-11 / distanceSq; } /** * Black hole containment force calculator - * @param massKg mass in kg + * + * @param massKg mass in kg * @param radiusSq radius squared in meters * @return force in newtons */ - private static double getContainmentForce(double massKg,double radiusSq) { + private static double getContainmentForce(double massKg, double radiusSq) { return Math.pow(massKg, 2) * 6.6743015e-11 / radiusSq; } /** * Black hole containment pressure calculator F/s, should be used for bhg initial release explosion? - * @param massKg mass in kg + * + * @param massKg mass in kg * @param radiusSq radius squared in meters * @return pressure in pascals */ - private static double getContainmentPressure(double massKg,double radiusSq) { + private static double getContainmentPressure(double massKg, double radiusSq) { return getContainmentForce(massKg, radiusSq) / (12.566370614359172 * radiusSq); } /** * Black hole containment energy calculator, assuming F*s, and 100% efficient gravity force field + * * @param massKg mass in kg * @return power in watts */ @@ -284,16 +238,75 @@ public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_E /** * Black hole power balance, zero at mass ~= 2.5525e10 (T~=4.8067e12) - * @param massKg mass in kg + * + * @param massKg mass in kg * @param massKgPer1s mass injection kg per s * @return power in watts */ @Deprecated - private static double getContainmentPowerBalance(double massKg,double massKgPer1s) { - return getLuminosity(massKg)+getAcretionDiskLuminosity(massKgPer1s)-getContainmentPower(massKg); + private static double getContainmentPowerBalance(double massKg, double massKgPer1s) { + return getLuminosity(massKg) + getAcretionDiskLuminosity(massKgPer1s) - getContainmentPower(massKg); } //todo compaction energy 8 * Long.MAx_VALUE? //todo neutronium decay gen? 0.0007186885 mass diff - actually compute hydrogen amount... -} + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_EM_bhg(mName); + } + + @Override + public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + if (structureCheck_EM(shape2, blockType2, blockMeta2, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 16, 16, 0)) { + glassDome = true; + return true; + } + if (structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 16, 16, 0)) { + glassDome = false; + return true; + } + //todo check tiers of hatches!!!! + return false; + } + + @Override + public String[] getDescription() { + return new String[]{ + CommonValues.TEC_MARK_EM, + translateToLocal("gt.blockmachines.multimachine.em.blackholegenerator.desc.0"),//Singularity based power generation. + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.em.blackholegenerator.desc.1")//Super unstable!!! + }; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister aBlockIconRegister) { + ScreenOFF = new Textures.BlockIcons.CustomIcon("iconsets/EM_BHG"); + ScreenON = new Textures.BlockIcons.CustomIcon("iconsets/EM_BHG_ACTIVE"); + super.registerIcons(aBlockIconRegister); + } + + @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][12], new TT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; + } + return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12]}; + } + + @Override + public void construct(int stackSize, boolean hintsOnly) { + if ((stackSize & 1) == 1) { + StructureBuilderExtreme(shape, blockType, blockMeta, 16, 16, 0, getBaseMetaTileEntity(), this, hintsOnly); + } else { + StructureBuilderExtreme(shape2, blockType2, blockMeta2, 16, 16, 0, getBaseMetaTileEntity(), this, hintsOnly); + } + } + + @Override + public String[] getStructureDescription(int stackSize) { + return description; + } +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java index 1dc80606d9..2b0b0f8465 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_collider.java @@ -15,11 +15,7 @@ import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.casing.TT_Container_Casings; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.INameFunction; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IStatusFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.*; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -42,54 +38,59 @@ import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texture import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*; +import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by danie_000 on 17.12.2016. */ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { + //region variables private static Textures.BlockIcons.CustomIcon ScreenOFF; private static Textures.BlockIcons.CustomIcon ScreenON; private static Textures.BlockIcons.CustomIcon ScreenON_Slave; private static Textures.BlockIcons.CustomIcon ScreenOFF_Slave; - protected static final byte FUSE_MODE=0, COLLIDE_MODE =1; + protected static final byte FUSE_MODE = 0, COLLIDE_MODE = 1; private static double MASS_TO_EU_INSTANT; - private static int STARTUP_COST,KEEPUP_COST; + private static int STARTUP_COST, KEEPUP_COST; - public static void setValues(int heliumPlasmaValue){ - double MASS_TO_EU_PARTIAL = heliumPlasmaValue / 1.75893000478707E07;//mass diff - MASS_TO_EU_INSTANT = MASS_TO_EU_PARTIAL * 20; - STARTUP_COST=-heliumPlasmaValue*10000; - KEEPUP_COST=-heliumPlasmaValue; - } + protected byte eTier = 0; + protected cElementalInstanceStack stack; + private long plasmaEnergy; + + protected boolean started = false; + //endregion //region collision handlers - public static final HashMap<Integer, IColliderHandler> FUSE_HANDLERS =new HashMap<>(); - public static final HashMap<String, IPrimitiveColliderHandler> PRIMITIVE_FUSE_HANDLERS =new HashMap<>(); + public static final HashMap<Integer, IColliderHandler> FUSE_HANDLERS = new HashMap<>(); + public static final HashMap<String, IPrimitiveColliderHandler> PRIMITIVE_FUSE_HANDLERS = new HashMap<>(); + public interface IPrimitiveColliderHandler { void collide(cElementalInstanceStack in1, cElementalInstanceStack in2, cElementalInstanceStackMap out); } + public interface IColliderHandler extends IPrimitiveColliderHandler { byte getRequiredTier(); } + static { FUSE_HANDLERS.put((dAtomDefinition.getClassTypeStatic() << 16) | dAtomDefinition.getClassTypeStatic(), new IColliderHandler() { @Override public void collide(cElementalInstanceStack in1, cElementalInstanceStack in2, cElementalInstanceStackMap out) { try { - cElementalMutableDefinitionStackMap defs=new cElementalMutableDefinitionStackMap(); + cElementalMutableDefinitionStackMap defs = new cElementalMutableDefinitionStackMap(); defs.putUnifyAll(in1.definition.getSubParticles()); defs.putUnifyAll(in2.definition.getSubParticles()); dAtomDefinition atom = new dAtomDefinition(defs.toImmutable_optimized_unsafeLeavesExposedElementalTree()); - out.putUnify(new cElementalInstanceStack(atom,Math.min(in1.amount,in2.amount))); - }catch (Exception e){ - out.putUnifyAll(in1,in2); + out.putUnify(new cElementalInstanceStack(atom, Math.min(in1.amount, in2.amount))); + } catch (Exception e) { + out.putUnifyAll(in1, in2); return; } - if(in1.amount>in2.amount){ - out.putUnify(new cElementalInstanceStack(in1.definition,in1.amount-in2.amount)); - }else if (in2.amount>in1.amount){ - out.putUnify(new cElementalInstanceStack(in2.definition,in2.amount-in1.amount)); + if (in1.amount > in2.amount) { + out.putUnify(new cElementalInstanceStack(in1.definition, in1.amount - in2.amount)); + } else if (in2.amount > in1.amount) { + out.putUnify(new cElementalInstanceStack(in2.definition, in2.amount - in1.amount)); } } @@ -106,19 +107,19 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB @Override public void collide(cElementalInstanceStack in1, cElementalInstanceStack in2, cElementalInstanceStackMap out) { try { - cElementalMutableDefinitionStackMap defs=new cElementalMutableDefinitionStackMap(); + cElementalMutableDefinitionStackMap defs = new cElementalMutableDefinitionStackMap(); defs.putUnifyAll(in1.definition.getSubParticles()); defs.putUnifyAll(in2.definition.getSubParticles()); dHadronDefinition hadron = new dHadronDefinition(defs.toImmutable_optimized_unsafeLeavesExposedElementalTree()); - out.putUnify(new cElementalInstanceStack(hadron,Math.min(in1.amount,in2.amount))); - }catch (Exception e){ - out.putUnifyAll(in1,in2); + out.putUnify(new cElementalInstanceStack(hadron, Math.min(in1.amount, in2.amount))); + } catch (Exception e) { + out.putUnifyAll(in1, in2); return; } - if(in1.amount>in2.amount){ - out.putUnify(new cElementalInstanceStack(in1.definition,in1.amount-in2.amount)); - }else if (in2.amount>in1.amount){ - out.putUnify(new cElementalInstanceStack(in2.definition,in2.amount-in1.amount)); + if (in1.amount > in2.amount) { + out.putUnify(new cElementalInstanceStack(in1.definition, in1.amount - in2.amount)); + } else if (in2.amount > in1.amount) { + out.putUnify(new cElementalInstanceStack(in2.definition, in2.amount - in1.amount)); } } @@ -131,19 +132,19 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB @Override public void collide(cElementalInstanceStack in1, cElementalInstanceStack in2, cElementalInstanceStackMap out) { try { - cElementalMutableDefinitionStackMap defs=new cElementalMutableDefinitionStackMap(); + cElementalMutableDefinitionStackMap defs = new cElementalMutableDefinitionStackMap(); defs.putUnifyAll(in1.definition.getSubParticles()); defs.putUnify(in2.definition.getStackForm(1)); dHadronDefinition hadron = new dHadronDefinition(defs.toImmutable_optimized_unsafeLeavesExposedElementalTree()); - out.putUnify(new cElementalInstanceStack(hadron,Math.min(in1.amount,in2.amount))); - }catch (Exception e){ - out.putUnifyAll(in1,in2); + out.putUnify(new cElementalInstanceStack(hadron, Math.min(in1.amount, in2.amount))); + } catch (Exception e) { + out.putUnifyAll(in1, in2); return; } - if(in1.amount>in2.amount){ - out.putUnify(new cElementalInstanceStack(in1.definition,in1.amount-in2.amount)); - }else if (in2.amount>in1.amount){ - out.putUnify(new cElementalInstanceStack(in2.definition,in2.amount-in1.amount)); + if (in1.amount > in2.amount) { + out.putUnify(new cElementalInstanceStack(in1.definition, in1.amount - in2.amount)); + } else if (in2.amount > in1.amount) { + out.putUnify(new cElementalInstanceStack(in2.definition, in2.amount - in1.amount)); } } @@ -159,11 +160,11 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB FUSE_HANDLERS.put((cElementalPrimitive.getClassTypeStatic() << 16) | cElementalPrimitive.getClassTypeStatic(), new IColliderHandler() { @Override public void collide(cElementalInstanceStack in1, cElementalInstanceStack in2, cElementalInstanceStackMap out) { - IPrimitiveColliderHandler collisionHandler= PRIMITIVE_FUSE_HANDLERS.get(in1.definition.getClass().getName()+'\0'+in2.definition.getClass().getName()); + IPrimitiveColliderHandler collisionHandler = PRIMITIVE_FUSE_HANDLERS.get(in1.definition.getClass().getName() + '\0' + in2.definition.getClass().getName()); if (collisionHandler != null) { collisionHandler.collide(in2, in1, out); } else { - out.putUnifyAll(in1,in2); + out.putUnifyAll(in1, in2); } } @@ -175,40 +176,40 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB PRIMITIVE_FUSE_HANDLERS.put(eQuarkDefinition.class.getName() + '\0' + eQuarkDefinition.class.getName(), (in1, in2, out) -> { try { - cElementalMutableDefinitionStackMap defs=new cElementalMutableDefinitionStackMap(); + cElementalMutableDefinitionStackMap defs = new cElementalMutableDefinitionStackMap(); defs.putUnify(in1.definition.getStackForm(1)); defs.putUnify(in2.definition.getStackForm(1)); dHadronDefinition hadron = new dHadronDefinition(defs.toImmutable_optimized_unsafeLeavesExposedElementalTree()); - out.putUnify(new cElementalInstanceStack(hadron,Math.min(in1.amount,in2.amount))); - }catch (Exception e){ - out.putUnifyAll(in1,in2); + out.putUnify(new cElementalInstanceStack(hadron, Math.min(in1.amount, in2.amount))); + } catch (Exception e) { + out.putUnifyAll(in1, in2); return; } - if(in1.amount>in2.amount){ - out.putUnify(new cElementalInstanceStack(in1.definition,in1.amount-in2.amount)); - }else if (in2.amount>in1.amount){ - out.putUnify(new cElementalInstanceStack(in2.definition,in2.amount-in1.amount)); + if (in1.amount > in2.amount) { + out.putUnify(new cElementalInstanceStack(in1.definition, in1.amount - in2.amount)); + } else if (in2.amount > in1.amount) { + out.putUnify(new cElementalInstanceStack(in2.definition, in2.amount - in1.amount)); } }); PRIMITIVE_FUSE_HANDLERS.put(ePrimalAspectDefinition.class.getName() + '\0' + ePrimalAspectDefinition.class.getName(), (in1, in2, out) -> { if (fuseAspects(in1, in2, out)) return; - if(in1.amount>in2.amount){ - out.putUnify(new cElementalInstanceStack(in1.definition,in1.amount-in2.amount)); - }else if (in2.amount>in1.amount){ - out.putUnify(new cElementalInstanceStack(in2.definition,in2.amount-in1.amount)); + if (in1.amount > in2.amount) { + out.putUnify(new cElementalInstanceStack(in1.definition, in1.amount - in2.amount)); + } else if (in2.amount > in1.amount) { + out.putUnify(new cElementalInstanceStack(in2.definition, in2.amount - in1.amount)); } }); } private static boolean fuseAspects(cElementalInstanceStack in1, cElementalInstanceStack in2, cElementalInstanceStackMap out) { try { - cElementalMutableDefinitionStackMap defs=new cElementalMutableDefinitionStackMap(); + cElementalMutableDefinitionStackMap defs = new cElementalMutableDefinitionStackMap(); defs.putUnify(in1.definition.getStackForm(1)); defs.putUnify(in2.definition.getStackForm(1)); dComplexAspectDefinition aspect = new dComplexAspectDefinition(defs.toImmutable_optimized_unsafeLeavesExposedElementalTree()); - out.putUnify(new cElementalInstanceStack(aspect,Math.min(in1.amount,in2.amount))); - }catch (Exception e){ - out.putUnifyAll(in1,in2); + out.putUnify(new cElementalInstanceStack(aspect, Math.min(in1.amount, in2.amount))); + } catch (Exception e) { + out.putUnifyAll(in1, in2); return true; } return false; @@ -219,10 +220,10 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB @Override public void collide(cElementalInstanceStack in1, cElementalInstanceStack in2, cElementalInstanceStackMap out) { if (fuseAspects(in1, in2, out)) return; - if(in1.amount>in2.amount){ - out.putUnify(new cElementalInstanceStack(in1.definition,in1.amount-in2.amount)); - }else if (in2.amount>in1.amount){ - out.putUnify(new cElementalInstanceStack(in2.definition,in2.amount-in1.amount)); + if (in1.amount > in2.amount) { + out.putUnify(new cElementalInstanceStack(in1.definition, in1.amount - in2.amount)); + } else if (in2.amount > in1.amount) { + out.putUnify(new cElementalInstanceStack(in2.definition, in2.amount - in1.amount)); } } @@ -238,19 +239,19 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB @Override public void collide(cElementalInstanceStack in1, cElementalInstanceStack in2, cElementalInstanceStackMap out) { try { - cElementalMutableDefinitionStackMap defs=new cElementalMutableDefinitionStackMap(); + cElementalMutableDefinitionStackMap defs = new cElementalMutableDefinitionStackMap(); defs.putUnifyAll(in1.definition.getSubParticles()); defs.putUnify(in2.definition.getStackForm(1)); dAtomDefinition atom = new dAtomDefinition(defs.toImmutable_optimized_unsafeLeavesExposedElementalTree()); - out.putUnify(new cElementalInstanceStack(atom,Math.min(in1.amount,in2.amount))); - }catch (Exception e){ - out.putUnifyAll(in1,in2); + out.putUnify(new cElementalInstanceStack(atom, Math.min(in1.amount, in2.amount))); + } catch (Exception e) { + out.putUnifyAll(in1, in2); return; } - if(in1.amount>in2.amount){ - out.putUnify(new cElementalInstanceStack(in1.definition,in1.amount-in2.amount)); - }else if (in2.amount>in1.amount){ - out.putUnify(new cElementalInstanceStack(in2.definition,in2.amount-in1.amount)); + if (in1.amount > in2.amount) { + out.putUnify(new cElementalInstanceStack(in1.definition, in1.amount - in2.amount)); + } else if (in2.amount > in1.amount) { + out.putUnify(new cElementalInstanceStack(in2.definition, in2.amount - in1.amount)); } } @@ -262,15 +263,11 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB } //endregion - protected byte eTier = 0; - protected cElementalInstanceStack stack; - private long plasmaEnergy; - //region parameters protected Parameters.Group.ParameterIn mode; - private static final IStatusFunction<GT_MetaTileEntity_EM_collider> MODE_STATUS = (base_EM, p)->{ - if(base_EM.isMaster()){ - double mode=p.get(); + private static final IStatusFunction<GT_MetaTileEntity_EM_collider> MODE_STATUS = (base_EM, p) -> { + if (base_EM.isMaster()) { + double mode = p.get(); if (mode == FUSE_MODE || mode == COLLIDE_MODE) { return STATUS_OK; } else if (mode > 1) { @@ -282,46 +279,44 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB } return STATUS_UNUSED; }; - private static final INameFunction<GT_MetaTileEntity_EM_collider> MODE_NAME = (base_EM, p)->{ - if(base_EM.isMaster()){ - double mode=p.get(); - if(mode==FUSE_MODE){ - return "Mode: Fuse"; - }else if(mode==COLLIDE_MODE){ - return "Mode: Collide"; + private static final INameFunction<GT_MetaTileEntity_EM_collider> MODE_NAME = (base_EM, p) -> { + if (base_EM.isMaster()) { + double mode = p.get(); + if (mode == FUSE_MODE) { + return translateToLocal("gt.blockmachines.multimachine.em.collider.mode.0");//Mode: Fuse + } else if (mode == COLLIDE_MODE) { + return translateToLocal("gt.blockmachines.multimachine.em.collider.mode.1");//Mode: Collide } - return "Mode: Undefined"; + return translateToLocal("gt.blockmachines.multimachine.em.collider.mode.2");//Mode: Undefined } - return "Currently Slaves..."; + return translateToLocal("gt.blockmachines.multimachine.em.collider.mode.3");//Currently Slaves... }; //endregion - protected boolean started=false; - - //region Structure + //region structure //use multi A energy inputs, use less power the longer it runs private static final String[][] shape = new String[][]{ - {"I0A0A0","I00000","I0A0A0",}, - {"H0000000","G001111100","H0000000",}, - {"F22223332222","F41155555114","F22223332222",}, - {"E2000000000002","E4155111115514","E2000000000002",}, - {"D20000E00002","D41511E11514","D20000E00002",}, - {"C2000I0002","C4151I1514","C2000I0002",}, - {"B2000K0002","B4151K1514","B2000K0002",}, - {"B200M002","A0151M1510","B200M002",}, - {"A0200M0020","A0151M1510","A0200M0020",}, - {"0020O0200","0151O1510","0020O0200",}, - {"A030O030","0151O1510","A030O030",}, - {"0030O0300","0151O1510","0030O0300",}, - {"A030O030","0151O1510","A030O030",}, - {"0020O0200","0151O1510","0020O0200",}, - {"A0200M0020","A0151M1510","A0200M0020",}, - {"B200M002","A0151M1510","B200M002",}, - {"B2000K0002","B4151K1514","B2000K0002",}, - {"C2000I0002","C4151I1514","C2000I0002",}, - {"D200002 200002","D415112 . 211514","D200002 200002",}, - {"E20!!22222!!02","E4155111115514","E20!!22222!!02",}, - {"F2222#\"#2222","F41155555114","F2222#\"#2222",}, + {"I0A0A0", "I00000", "I0A0A0",}, + {"H0000000", "G001111100", "H0000000",}, + {"F22223332222", "F41155555114", "F22223332222",}, + {"E2000000000002", "E4155111115514", "E2000000000002",}, + {"D20000E00002", "D41511E11514", "D20000E00002",}, + {"C2000I0002", "C4151I1514", "C2000I0002",}, + {"B2000K0002", "B4151K1514", "B2000K0002",}, + {"B200M002", "A0151M1510", "B200M002",}, + {"A0200M0020", "A0151M1510", "A0200M0020",}, + {"0020O0200", "0151O1510", "0020O0200",}, + {"A030O030", "0151O1510", "A030O030",}, + {"0030O0300", "0151O1510", "0030O0300",}, + {"A030O030", "0151O1510", "A030O030",}, + {"0020O0200", "0151O1510", "0020O0200",}, + {"A0200M0020", "A0151M1510", "A0200M0020",}, + {"B200M002", "A0151M1510", "B200M002",}, + {"B2000K0002", "B4151K1514", "B2000K0002",}, + {"C2000I0002", "C4151I1514", "C2000I0002",}, + {"D200002 200002", "D415112 . 211514", "D200002 200002",}, + {"E20!!22222!!02", "E4155111115514", "E20!!22222!!02",}, + {"F2222#\"#2222", "F41155555114", "F2222#\"#2222",}, }; private static final Block[] blockType = new Block[]{ sBlockCasingsTT, @@ -342,12 +337,12 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4, 4, 4}; private static final String[] description = new String[]{ - EnumChatFormatting.AQUA+"Hint Details:", - "1 - Classic Hatches or High Power Casing", - "2 - Elemental Input Hatches or Molecular Casing", - "3 - Elemental Output Hatches or Molecular Casing", - "4 - Elemental Overflow Hatches or Molecular Casing", - "General - Another Controller facing opposite direction", + EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", + translateToLocal("gt.blockmachines.multimachine.em.collider.hint.0"),//1 - Classic Hatches or High Power Casing + translateToLocal("gt.blockmachines.multimachine.em.collider.hint.1"),//2 - Elemental Input Hatches or Molecular Casing + translateToLocal("gt.blockmachines.multimachine.em.collider.hint.2"),//3 - Elemental Output Hatches or Molecular Casing + translateToLocal("gt.blockmachines.multimachine.em.collider.hint.3"),//4 - Elemental Overflow Hatches or Molecular Casing + translateToLocal("gt.blockmachines.multimachine.em.collider.hint.4"),//General - Another Controller facing opposite direction }; //endregion @@ -359,65 +354,104 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB super(aName); } - @Override - protected void parametersInstantiation_EM() { - Parameters.Group hatch_0=parametrization.getGroup(0); - mode=hatch_0.makeInParameter(0,FUSE_MODE, MODE_NAME, MODE_STATUS); + public static void setValues(int heliumPlasmaValue) { + double MASS_TO_EU_PARTIAL = heliumPlasmaValue / 1.75893000478707E07;//mass diff + MASS_TO_EU_INSTANT = MASS_TO_EU_PARTIAL * 20; + STARTUP_COST = -heliumPlasmaValue * 10000; + KEEPUP_COST = -heliumPlasmaValue; } - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_EM_collider(mName); + protected double fuse(GT_MetaTileEntity_EM_collider partner) { + if (partner.stack != null && stack != null) {//todo add single event mode as an option + boolean check = stack.definition.fusionMakesEnergy(stack.getEnergy()) && + partner.stack.definition.fusionMakesEnergy(partner.stack.getEnergy()); + + cElementalInstanceStack stack2 = partner.stack; + double preMass = stack2.getMass() + stack.getMass(); + //System.out.println("preMass = " + preMass); + + cElementalInstanceStackMap map = new cElementalInstanceStackMap(); + IColliderHandler colliderHandler; + if (stack2.definition.getClassType() > stack.definition.getClassType()) {//always bigger first + colliderHandler = FUSE_HANDLERS.get((stack2.definition.getClassType() << 16) | stack.definition.getClassType()); + if (handleRecipe(stack2, map, colliderHandler)) return 0; + } else { + colliderHandler = FUSE_HANDLERS.get((stack.definition.getClassType() << 16) | stack2.definition.getClassType()); + if (handleRecipe(stack2, map, colliderHandler)) return 0; + } + for (cElementalInstanceStack newStack : map.values()) { + check &= newStack.definition.fusionMakesEnergy(newStack.getEnergy()); + } + //System.out.println("outputEM[0].getMass() = " + outputEM[0].getMass()); + outputEM = new cElementalInstanceStackMap[]{map}; + + partner.stack = stack = null; + //System.out.println("check = " + check); + //System.out.println("preMass-map.getMass() = " + (preMass - map.getMass())); + return check ? preMass - map.getMass() : + Math.min(preMass - map.getMass(), 0); + } + return 0; } - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister aBlockIconRegister) { - ScreenOFF = new Textures.BlockIcons.CustomIcon("iconsets/EM_COLLIDER"); - ScreenON = new Textures.BlockIcons.CustomIcon("iconsets/EM_COLLIDER_ACTIVE"); - ScreenOFF_Slave = new Textures.BlockIcons.CustomIcon("iconsets/EM_COLLIDER_SLAVE"); - ScreenON_Slave = new Textures.BlockIcons.CustomIcon("iconsets/EM_COLLIDER_ACTIVE_SLAVE"); - super.registerIcons(aBlockIconRegister); + private boolean handleRecipe(cElementalInstanceStack stack2, cElementalInstanceStackMap map, IColliderHandler colliderHandler) { + if (colliderHandler != null && eTier >= colliderHandler.getRequiredTier()) { + colliderHandler.collide(stack2, stack, map); + } else { + map.putUnifyAll(stack, stack2); + outputEM = new cElementalInstanceStackMap[]{map}; + return true; + } + return false; } - @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - if (aSide == aFacing) { - if(aFacing%2==0){ - return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4], new TT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; - }else{ - return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4], new TT_RenderedTexture(aActive ? ScreenON_Slave : ScreenOFF_Slave)}; - } + protected GT_MetaTileEntity_EM_collider getPartner() { + IGregTechTileEntity iGregTechTileEntity = getBaseMetaTileEntity(); + int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX * 4; + int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY * 4; + int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ * 4; + IGregTechTileEntity gregTechBaseTileEntity = iGregTechTileEntity.getIGregTechTileEntityOffset(xDir, yDir, zDir); + if (gregTechBaseTileEntity != null) { + IMetaTileEntity gregTechMetaTileEntity = gregTechBaseTileEntity.getMetaTileEntity(); + return gregTechMetaTileEntity instanceof GT_MetaTileEntity_EM_collider && + ((GT_MetaTileEntity_EM_collider) gregTechMetaTileEntity).mMachine && + gregTechBaseTileEntity.getBackFacing() == iGregTechTileEntity.getFrontFacing() ? + (GT_MetaTileEntity_EM_collider) gregTechMetaTileEntity : null; } - return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4]}; + return null; } - @Override - public void saveNBTData(NBTTagCompound aNBT) { - super.saveNBTData(aNBT); - aNBT.setByte("eTier", eTier);//collider tier - aNBT.setBoolean("eStarted",started); - if(stack!=null) { - aNBT.setTag("eStack", stack.toNBT()); + protected final boolean isMaster() { + return getBaseMetaTileEntity().getFrontFacing() % 2 == 0; + } + + private void makeEU(double massDiff) { + plasmaEnergy += massDiff * MASS_TO_EU_INSTANT; + System.out.println("plasmaEnergy = " + plasmaEnergy); + } + + private cElementalInstanceStackMap tickStack() { + if (stack == null) { + return null; + } + cElementalInstanceStackMap newInstances = stack.decay(1, stack.age += 1, 0); + if (newInstances == null) { + stack.nextColor(); + } else { + stack = newInstances.remove(newInstances.getLast().definition); } - aNBT.setLong("ePlasmaEnergy",plasmaEnergy); + return newInstances; } @Override - public void loadNBTData(NBTTagCompound aNBT) { - super.loadNBTData(aNBT); - eTier = aNBT.getByte("eTier");//collider tier - started=aNBT.getBoolean("eStarted"); - if(aNBT.hasKey("eStack")){ - stack=cElementalInstanceStack.fromNBT(aNBT.getCompoundTag("eStack")); - } - plasmaEnergy=aNBT.getLong("ePlasmaEnergy"); + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_EM_collider(mName); } @Override public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX*2; - int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ*2; + int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX * 2; + int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ * 2; if (iGregTechTileEntity.getBlockOffset(xDir, 0, zDir) != sBlockCasingsTT) { eTier = 0; return false; @@ -452,52 +486,21 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB } @Override - public void construct(int stackSize, boolean hintsOnly) { - IGregTechTileEntity iGregTechTileEntity=getBaseMetaTileEntity(); - int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX*4; - int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY*4; - int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ*4; - if(hintsOnly){ - TecTech.proxy.hint_particle(iGregTechTileEntity.getWorld(), - iGregTechTileEntity.getXCoord()+xDir, - iGregTechTileEntity.getYCoord()+yDir, - iGregTechTileEntity.getZCoord()+zDir, - TT_Container_Casings.sHintCasingsTT,12); - } else{ - if(iGregTechTileEntity.getBlockOffset(xDir,0,zDir).getMaterial() == Material.air) { - iGregTechTileEntity.getWorld().setBlock(iGregTechTileEntity.getXCoord() + xDir, iGregTechTileEntity.getYCoord()+yDir, iGregTechTileEntity.getZCoord() + zDir, TT_Container_Casings.sHintCasingsTT, 12, 2); - } - } - if ((stackSize & 1) == 1) { - StructureBuilderExtreme(shape, blockType, blockMeta1, 11, 1, 18, iGregTechTileEntity,this, hintsOnly); - } else { - StructureBuilderExtreme(shape, blockType, blockMeta2, 11, 1, 18, iGregTechTileEntity,this, hintsOnly); - } - } - - @Override - public void parametersStatusesWrite_EM(boolean machineBusy) { - if(isMaster()) { - super.parametersStatusesWrite_EM(machineBusy); - } - } - - @Override public boolean checkRecipe_EM(ItemStack itemStack) { - GT_MetaTileEntity_EM_collider partner=getPartner(); - if(partner==null){ + GT_MetaTileEntity_EM_collider partner = getPartner(); + if (partner == null) { return false; } - mEfficiencyIncrease=10000; - if(started) { - if(stack==null) { + mEfficiencyIncrease = 10000; + if (started) { + if (stack == null) { for (GT_MetaTileEntity_Hatch_InputElemental inputElemental : eInputHatches) { cElementalInstanceStackMap container = inputElemental.getContainerHandler(); if (container.isEmpty()) { continue; } stack = container.remove(container.getFirst().definition); - long eut = KEEPUP_COST+(long)(KEEPUP_COST * Math.abs(stack.getMass() / dAtomDefinition.getSomethingHeavy().getMass()))/2; + long eut = KEEPUP_COST + (long) (KEEPUP_COST * Math.abs(stack.getMass() / dAtomDefinition.getSomethingHeavy().getMass())) / 2; if (eut < Integer.MIN_VALUE + 7) { return false; } @@ -515,179 +518,178 @@ public class GT_MetaTileEntity_EM_collider extends GT_MetaTileEntity_MultiblockB mEUt = KEEPUP_COST; eAmpereFlow = 2; return true; - }else{ - started=true; - mMaxProgresstime=20; - mEUt=STARTUP_COST; - eAmpereFlow=10; + } else { + started = true; + mMaxProgresstime = 20; + mEUt = STARTUP_COST; + eAmpereFlow = 10; return true; } } - protected double fuse(GT_MetaTileEntity_EM_collider partner){ - if(partner.stack!=null && stack!=null) {//todo add single event mode as an option - boolean check=stack.definition.fusionMakesEnergy(stack.getEnergy()) && - partner.stack.definition.fusionMakesEnergy(partner.stack.getEnergy()); + @Override + public void outputAfterRecipe_EM() { + GT_MetaTileEntity_EM_collider partner = getPartner(); + if (partner == null) { + if (stack != null) { + cleanMassEM_EM(stack.getMass()); + stack = null; + } + return; + } + if (isMaster()) { + switch ((int) mode.get()) { + case FUSE_MODE: + makeEU(fuse(partner)); + break; + case COLLIDE_MODE: + //collide(partner);//todo + break; + default: { + outputEM = new cElementalInstanceStackMap[2]; + outputEM[1] = tickStack(); + if (outputEM[1] == null) { + outputEM[1] = partner.tickStack(); + } else { + cElementalInstanceStackMap map = partner.tickStack(); + if (map != null) { + outputEM[1].putUnifyAll(map); + } + } + } + } + if (outputEM != null) { + for (int i = 0, lim = Math.min(outputEM.length, eOutputHatches.size()); i < lim; i++) { + if (outputEM[i] != null) { + eOutputHatches.get(i).getContainerHandler().putUnifyAll(outputEM[i]); + outputEM[i] = null; + } + } + } + } + } - cElementalInstanceStack stack2 = partner.stack; - double preMass = stack2.getMass() + stack.getMass(); - //System.out.println("preMass = " + preMass); + @Override + public String[] getDescription() { + return new String[]{ + CommonValues.TEC_MARK_EM, + translateToLocal("gt.blockmachines.multimachine.em.collider.desc.0"),//Collide matter at extreme velocities. + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.em.collider.desc.1")//Faster than light*!!! + }; + } - cElementalInstanceStackMap map = new cElementalInstanceStackMap(); - IColliderHandler colliderHandler; - if (stack2.definition.getClassType() > stack.definition.getClassType()) {//always bigger first - colliderHandler = FUSE_HANDLERS.get((stack2.definition.getClassType() << 16) | stack.definition.getClassType()); - if (handleRecipe(stack2, map, colliderHandler)) return 0; + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister aBlockIconRegister) { + ScreenOFF = new Textures.BlockIcons.CustomIcon("iconsets/EM_COLLIDER"); + ScreenON = new Textures.BlockIcons.CustomIcon("iconsets/EM_COLLIDER_ACTIVE"); + ScreenOFF_Slave = new Textures.BlockIcons.CustomIcon("iconsets/EM_COLLIDER_SLAVE"); + ScreenON_Slave = new Textures.BlockIcons.CustomIcon("iconsets/EM_COLLIDER_ACTIVE_SLAVE"); + super.registerIcons(aBlockIconRegister); + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + if (aFacing % 2 == 0) { + return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4], new TT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; } else { - colliderHandler = FUSE_HANDLERS.get((stack.definition.getClassType() << 16) | stack2.definition.getClassType()); - if (handleRecipe(stack2, map, colliderHandler)) return 0; - } - for (cElementalInstanceStack newStack : map.values()) { - check &= newStack.definition.fusionMakesEnergy(newStack.getEnergy()); + return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4], new TT_RenderedTexture(aActive ? ScreenON_Slave : ScreenOFF_Slave)}; } - //System.out.println("outputEM[0].getMass() = " + outputEM[0].getMass()); - outputEM = new cElementalInstanceStackMap[]{map}; + } + return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4]}; + } - partner.stack = stack = null; - //System.out.println("check = " + check); - //System.out.println("preMass-map.getMass() = " + (preMass - map.getMass())); - return check ? preMass - map.getMass() : - Math.min(preMass - map.getMass(), 0); + @Override + protected void parametersInstantiation_EM() { + Parameters.Group hatch_0 = parametrization.getGroup(0); + mode = hatch_0.makeInParameter(0, FUSE_MODE, MODE_NAME, MODE_STATUS); + } + + @Override + public void parametersStatusesWrite_EM(boolean machineBusy) { + if (isMaster()) { + super.parametersStatusesWrite_EM(machineBusy); } - return 0; } - private boolean handleRecipe(cElementalInstanceStack stack2, cElementalInstanceStackMap map, IColliderHandler colliderHandler) { - if (colliderHandler != null && eTier>= colliderHandler.getRequiredTier()) { - colliderHandler.collide(stack2, stack, map); - } else { - map.putUnifyAll(stack,stack2); - outputEM=new cElementalInstanceStackMap[]{map}; - return true; + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setByte("eTier", eTier);//collider tier + aNBT.setBoolean("eStarted", started); + if (stack != null) { + aNBT.setTag("eStack", stack.toNBT()); } - return false; + aNBT.setLong("ePlasmaEnergy", plasmaEnergy); } @Override - protected void afterRecipeCheckFailed() { - started=false; - if(stack!=null){ - cleanMassEM_EM(stack.getMass()); - stack=null; + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + eTier = aNBT.getByte("eTier");//collider tier + started = aNBT.getBoolean("eStarted"); + if (aNBT.hasKey("eStack")) { + stack = cElementalInstanceStack.fromNBT(aNBT.getCompoundTag("eStack")); } - getBaseMetaTileEntity().disableWorking(); - super.afterRecipeCheckFailed(); + plasmaEnergy = aNBT.getLong("ePlasmaEnergy"); } @Override public void stopMachine() { - started=false; - if(stack!=null){ + started = false; + if (stack != null) { cleanMassEM_EM(stack.getMass()); - stack=null; + stack = null; } super.stopMachine(); } @Override - public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if(!aBaseMetaTileEntity.isAllowedToWork()){ - started=false; + protected void afterRecipeCheckFailed() { + started = false; + if (stack != null) { + cleanMassEM_EM(stack.getMass()); + stack = null; } - super.onPreTick(aBaseMetaTileEntity, aTick); + getBaseMetaTileEntity().disableWorking(); + super.afterRecipeCheckFailed(); } - protected GT_MetaTileEntity_EM_collider getPartner(){ - IGregTechTileEntity iGregTechTileEntity=getBaseMetaTileEntity(); - int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX*4; - int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY*4; - int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ*4; - IGregTechTileEntity gregTechBaseTileEntity=iGregTechTileEntity.getIGregTechTileEntityOffset(xDir, yDir, zDir); - if(gregTechBaseTileEntity!=null) { - IMetaTileEntity gregTechMetaTileEntity = gregTechBaseTileEntity.getMetaTileEntity(); - return gregTechMetaTileEntity instanceof GT_MetaTileEntity_EM_collider && - ((GT_MetaTileEntity_EM_collider) gregTechMetaTileEntity).mMachine && - gregTechBaseTileEntity.getBackFacing() == iGregTechTileEntity.getFrontFacing() ? - (GT_MetaTileEntity_EM_collider) gregTechMetaTileEntity : null; + @Override + public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (!aBaseMetaTileEntity.isAllowedToWork()) { + started = false; } - return null; - } - - protected final boolean isMaster(){ - return getBaseMetaTileEntity().getFrontFacing()%2==0; + super.onPreTick(aBaseMetaTileEntity, aTick); } @Override - public void outputAfterRecipe_EM(){ - GT_MetaTileEntity_EM_collider partner=getPartner(); - if(partner==null){ - if(stack!=null){ - cleanMassEM_EM(stack.getMass()); - stack=null; - } - return; - } - if (isMaster()) { - switch ((int)mode.get()){ - case FUSE_MODE: - makeEU(fuse(partner)); - break; - case COLLIDE_MODE: - //collide(partner);//todo - break; - default: { - outputEM=new cElementalInstanceStackMap[2]; - outputEM[1]=tickStack(); - if(outputEM[1]==null){ - outputEM[1]=partner.tickStack(); - }else { - cElementalInstanceStackMap map=partner.tickStack(); - if(map!=null){ - outputEM[1].putUnifyAll(map); - } - } - } - } - if(outputEM!=null) { - for(int i=0,lim=Math.min(outputEM.length,eOutputHatches.size());i<lim;i++){ - if(outputEM[i]!=null) { - eOutputHatches.get(i).getContainerHandler().putUnifyAll(outputEM[i]); - outputEM[i]=null; - } - } + public void construct(int stackSize, boolean hintsOnly) { + IGregTechTileEntity iGregTechTileEntity = getBaseMetaTileEntity(); + int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX * 4; + int yDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetY * 4; + int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ * 4; + if (hintsOnly) { + TecTech.proxy.hint_particle(iGregTechTileEntity.getWorld(), + iGregTechTileEntity.getXCoord() + xDir, + iGregTechTileEntity.getYCoord() + yDir, + iGregTechTileEntity.getZCoord() + zDir, + TT_Container_Casings.sHintCasingsTT, 12); + } else { + if (iGregTechTileEntity.getBlockOffset(xDir, 0, zDir).getMaterial() == Material.air) { + iGregTechTileEntity.getWorld().setBlock(iGregTechTileEntity.getXCoord() + xDir, iGregTechTileEntity.getYCoord() + yDir, iGregTechTileEntity.getZCoord() + zDir, TT_Container_Casings.sHintCasingsTT, 12, 2); } } - } - - private void makeEU(double massDiff){ - plasmaEnergy+=massDiff*MASS_TO_EU_INSTANT; - System.out.println("plasmaEnergy = " + plasmaEnergy); - } - - private cElementalInstanceStackMap tickStack(){ - if(stack==null){ - return null; - } - cElementalInstanceStackMap newInstances = stack.decay(1, stack.age += 1, 0); - if (newInstances == null) { - stack.nextColor(); + if ((stackSize & 1) == 1) { + StructureBuilderExtreme(shape, blockType, blockMeta1, 11, 1, 18, iGregTechTileEntity, this, hintsOnly); } else { - stack=newInstances.remove(newInstances.getLast().definition); + StructureBuilderExtreme(shape, blockType, blockMeta2, 11, 1, 18, iGregTechTileEntity, this, hintsOnly); } - return newInstances; } @Override public String[] getStructureDescription(int stackSize) { return description; } - - @Override - public String[] getDescription() { - return new String[]{ - CommonValues.TEC_MARK_EM, - "Collide matter at extreme velocities.", - EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Faster than light*!!!" - }; - } -} +}
\ No newline at end of file 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..edb581179e 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 @@ -9,12 +9,7 @@ import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputData; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OutputData; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Rack; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.INameFunction; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IStatusFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.*; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -39,41 +34,20 @@ import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texture import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*; +import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by danie_000 on 17.12.2016. */ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { + //region variables + private final ArrayList<GT_MetaTileEntity_Hatch_Rack> eRacks = new ArrayList<>(); + private static Textures.BlockIcons.CustomIcon ScreenOFF; private static Textures.BlockIcons.CustomIcon ScreenON; - - //region parameters - protected Parameters.Group.ParameterIn overclock,overvolt; - protected Parameters.Group.ParameterOut maxCurrentTemp,availableData; - private static final INameFunction<GT_MetaTileEntity_EM_computer> OC_NAME = (base, p)-> "Overclock ratio"; - private static final INameFunction<GT_MetaTileEntity_EM_computer> OV_NAME = (base, p)-> "Overvoltage ratio"; - private static final INameFunction<GT_MetaTileEntity_EM_computer> MAX_TEMP_NAME = (base, p)-> "Current max. heat"; - private static final INameFunction<GT_MetaTileEntity_EM_computer> COMPUTE_NAME = (base, p)-> "Produced computation"; - private static final IStatusFunction<GT_MetaTileEntity_EM_computer> OC_STATUS= - (base,p)->LedStatus.fromLimitsInclusiveOuterBoundary(p.get(),0,1,1,3); - private static final IStatusFunction<GT_MetaTileEntity_EM_computer> OV_STATUS= - (base,p)->LedStatus.fromLimitsInclusiveOuterBoundary(p.get(),.7,.8,1.2,2); - private static final IStatusFunction<GT_MetaTileEntity_EM_computer> MAX_TEMP_STATUS= - (base,p)->LedStatus.fromLimitsInclusiveOuterBoundary(p.get(),-10000,0,0,5000); - private static final IStatusFunction<GT_MetaTileEntity_EM_computer> COMPUTE_STATUS=(base, p)->{ - if(base.eAvailableData<0){ - return STATUS_TOO_LOW; - } - if(base.eAvailableData==0){ - return STATUS_NEUTRAL; - } - return STATUS_OK; - }; //endregion - private final ArrayList<GT_MetaTileEntity_Hatch_Rack> eRacks = new ArrayList<>(); - - //region Structure + //region structure private static final String[][] front = new String[][]{{"A ", "A ", "A. ", "A ",},}; private static final String[][] terminator = new String[][]{{"A ", "A ", "A ", "A ",},}; private static final String[][] cap = new String[][]{{"-01", "A22", "A22", "-01",},}; @@ -85,9 +59,34 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{1, 3}; private static final String[] description = new String[]{ - EnumChatFormatting.AQUA+"Hint Details:", - "1 - Classic/Data Hatches or Computer casing", - "2 - Rack Hatches or Advanced computer casing", + EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", + translateToLocal("gt.blockmachines.multimachine.em.computer.hint.0"),//1 - Classic/Data Hatches or Computer casing + translateToLocal("gt.blockmachines.multimachine.em.computer.hint.1"),//2 - Rack Hatches or Advanced computer casing + }; + //endregion + + //region parameters + protected Parameters.Group.ParameterIn overclock, overvolt; + protected Parameters.Group.ParameterOut maxCurrentTemp, availableData; + + private static final INameFunction<GT_MetaTileEntity_EM_computer> OC_NAME = (base, p) -> translateToLocal("gt.blockmachines.multimachine.em.computer.cfgi.0");//Overclock ratio + private static final INameFunction<GT_MetaTileEntity_EM_computer> OV_NAME = (base, p) -> translateToLocal("gt.blockmachines.multimachine.em.computer.cfgi.1");//Overvoltage ratio + private static final INameFunction<GT_MetaTileEntity_EM_computer> MAX_TEMP_NAME = (base, p) -> translateToLocal("gt.blockmachines.multimachine.em.computer.cfgo.0");//Current max. heat + private static final INameFunction<GT_MetaTileEntity_EM_computer> COMPUTE_NAME = (base, p) -> translateToLocal("gt.blockmachines.multimachine.em.computer.cfgo.1");//Produced computation + private static final IStatusFunction<GT_MetaTileEntity_EM_computer> OC_STATUS = + (base, p) -> LedStatus.fromLimitsInclusiveOuterBoundary(p.get(), 0, 1, 1, 3); + private static final IStatusFunction<GT_MetaTileEntity_EM_computer> OV_STATUS = + (base, p) -> LedStatus.fromLimitsInclusiveOuterBoundary(p.get(), .7, .8, 1.2, 2); + private static final IStatusFunction<GT_MetaTileEntity_EM_computer> MAX_TEMP_STATUS = + (base, p) -> LedStatus.fromLimitsInclusiveOuterBoundary(p.get(), -10000, 0, 0, 5000); + private static final IStatusFunction<GT_MetaTileEntity_EM_computer> COMPUTE_STATUS = (base, p) -> { + if (base.eAvailableData < 0) { + return STATUS_TOO_LOW; + } + if (base.eAvailableData == 0) { + return STATUS_NEUTRAL; + } + return STATUS_OK; }; //endregion @@ -104,57 +103,75 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB } @Override - protected void parametersInstantiation_EM() { - Parameters.Group hatch_0=parametrization.getGroup(0); - overclock=hatch_0.makeInParameter(0,1,OC_NAME,OC_STATUS); - overvolt=hatch_0.makeInParameter(1,1,OV_NAME,OV_STATUS); - maxCurrentTemp=hatch_0.makeOutParameter(0,0,MAX_TEMP_NAME,MAX_TEMP_STATUS); - availableData=hatch_0.makeOutParameter(1,0,COMPUTE_NAME,COMPUTE_STATUS); - } - - @Override - @SideOnly(Side.CLIENT) - protected ResourceLocation getActivitySound(){ - return GT_MetaTileEntity_EM_switch.activitySound; - } - - @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_EM_computer(mName); } @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister aBlockIconRegister) { - ScreenOFF = new Textures.BlockIcons.CustomIcon("iconsets/EM_COMPUTER"); - ScreenON = new Textures.BlockIcons.CustomIcon("iconsets/EM_COMPUTER_ACTIVE"); - super.registerIcons(aBlockIconRegister); + protected void parametersInstantiation_EM() { + Parameters.Group hatch_0 = parametrization.getGroup(0); + overclock = hatch_0.makeInParameter(0, 1, OC_NAME, OC_STATUS); + overvolt = hatch_0.makeInParameter(1, 1, OV_NAME, OV_STATUS); + maxCurrentTemp = hatch_0.makeOutParameter(0, 0, MAX_TEMP_NAME, MAX_TEMP_STATUS); + availableData = hatch_0.makeOutParameter(1, 0, COMPUTE_NAME, COMPUTE_STATUS); } @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][3], new TT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; + public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + for (GT_MetaTileEntity_Hatch_Rack rack : eRacks) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(rack)) { + rack.getBaseMetaTileEntity().setActive(false); + } } - return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][3]}; + eRacks.clear(); + if (!structureCheck_EM(front, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, 0)) { + return false; + } + if (!structureCheck_EM(cap, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, -1)) { + return false; + } + byte offset = -2, totalLen = 4; + while (offset > -16) { + if (!structureCheck_EM(slice, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, offset)) { + break; + } + totalLen++; + offset--; + } + if (totalLen > 16) { + return false; + } + if (!structureCheck_EM(cap, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, ++offset)) { + return false; + } + if (!structureCheck_EM(terminator, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, --offset)) { + return false; + } + eCertainMode = (byte) Math.min(totalLen / 3, 5); + for (GT_MetaTileEntity_Hatch_Rack rack : eRacks) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(rack)) { + rack.getBaseMetaTileEntity().setActive(iGregTechTileEntity.isActive()); + } + } + return eUncertainHatches.size() == 1; } @Override public boolean checkRecipe_EM(ItemStack itemStack) { - parametrization.setToDefaults(false,true); + parametrization.setToDefaults(false, true); eAvailableData = 0; - double maxTemp=0; - double overClockRatio= overclock.get(); - double overVoltageRatio= overvolt.get(); - if(Double.isNaN(overClockRatio) || Double.isNaN(overVoltageRatio)) { + double maxTemp = 0; + double overClockRatio = overclock.get(); + double overVoltageRatio = overvolt.get(); + if (Double.isNaN(overClockRatio) || Double.isNaN(overVoltageRatio)) { return false; } - if(overclock.getStatus(true).isOk && overvolt.getStatus(true).isOk){ - float eut=V[8] * (float)overVoltageRatio * (float)overClockRatio; - if(eut<Integer.MAX_VALUE-7) { + if (overclock.getStatus(true).isOk && overvolt.getStatus(true).isOk) { + float eut = V[8] * (float) overVoltageRatio * (float) overClockRatio; + if (eut < Integer.MAX_VALUE - 7) { mEUt = -(int) eut; - } else{ - mEUt = -(int)V[8]; + } else { + mEUt = -(int) V[8]; return false; } short thingsActive = 0; @@ -165,7 +182,7 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB continue; } if (rack.heat > maxTemp) { - maxTemp=rack.heat; + maxTemp = rack.heat; } rackComputation = rack.tickComponents((float) overClockRatio, (float) overVoltageRatio); if (rackComputation > 0) { @@ -191,8 +208,8 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB availableData.set(eAvailableData); return true; } else { - eAvailableData=0; - mEUt = -(int)V[8]; + eAvailableData = 0; + mEUt = -(int) V[8]; eAmpereFlow = 1; mMaxProgresstime = 20; mEfficiencyIncrease = 10000; @@ -209,7 +226,7 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB if (!eOutputData.isEmpty()) { Vec3pos pos = new Vec3pos(getBaseMetaTileEntity()); QuantumDataPacket pack = new QuantumDataPacket(eAvailableData / eOutputData.size()).unifyTraceWith(pos); - if(pack==null){ + if (pack == null) { return; } for (GT_MetaTileEntity_Hatch_InputData hatch : eInputData) { @@ -229,18 +246,34 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB } @Override - protected long getAvailableData_EM() { - return eAvailableData; + public String[] getDescription() { + return new String[]{ + CommonValues.TEC_MARK_EM, + Util.intBitsToString(TecTech.RANDOM.nextInt()), + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.em.computer.desc")//You need it to process the number above + }; } @Override - protected void afterRecipeCheckFailed() { - super.afterRecipeCheckFailed(); - for (GT_MetaTileEntity_Hatch_Rack rack : eRacks) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(rack)) { - rack.getBaseMetaTileEntity().setActive(false); - } + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister aBlockIconRegister) { + ScreenOFF = new Textures.BlockIcons.CustomIcon("iconsets/EM_COMPUTER"); + ScreenON = new Textures.BlockIcons.CustomIcon("iconsets/EM_COMPUTER_ACTIVE"); + super.registerIcons(aBlockIconRegister); + } + + @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][3], new TT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; } + return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][3]}; + } + + @Override + @SideOnly(Side.CLIENT) + protected ResourceLocation getActivitySound() { + return GT_MetaTileEntity_EM_switch.activitySound; } @Override @@ -254,9 +287,21 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB } @Override + protected void extraExplosions_EM() { + for (MetaTileEntity tTileEntity : eRacks) { + tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]); + } + } + + @Override + protected long getAvailableData_EM() { + return eAvailableData; + } + + @Override public void stopMachine() { super.stopMachine(); - eAvailableData=0; + eAvailableData = 0; for (GT_MetaTileEntity_Hatch_Rack rack : eRacks) { if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(rack)) { rack.getBaseMetaTileEntity().setActive(false); @@ -265,94 +310,47 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB } @Override - public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + protected void afterRecipeCheckFailed() { + super.afterRecipeCheckFailed(); for (GT_MetaTileEntity_Hatch_Rack rack : eRacks) { if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(rack)) { rack.getBaseMetaTileEntity().setActive(false); } } - eRacks.clear(); - if (!structureCheck_EM(front, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, 0)) { - return false; - } - if (!structureCheck_EM(cap, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, -1)) { - return false; - } - byte offset = -2, totalLen = 4; - while (offset > -16) { - if (!structureCheck_EM(slice, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, offset)) { - break; - } - totalLen++; - offset--; - } - if (totalLen > 16) { - return false; - } - if (!structureCheck_EM(cap, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, ++offset)) { + } + + public final boolean addRackToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { return false; } - if (!structureCheck_EM(terminator, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, --offset)) { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { return false; } - eCertainMode = (byte) Math.min(totalLen / 3, 5); - for (GT_MetaTileEntity_Hatch_Rack rack : eRacks) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(rack)) { - rack.getBaseMetaTileEntity().setActive(iGregTechTileEntity.isActive()); - } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Rack) { + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + return eRacks.add((GT_MetaTileEntity_Hatch_Rack) aMetaTileEntity); } - return eUncertainHatches.size() == 1; + return false; } @Override public void construct(int stackSize, boolean hintsOnly) { - IGregTechTileEntity igt=getBaseMetaTileEntity(); - StructureBuilderExtreme(front, blockType, blockMeta, 1, 2, 0, igt,this,hintsOnly); - StructureBuilderExtreme(cap, blockType, blockMeta, 1, 2, -1, igt,this,hintsOnly); + IGregTechTileEntity igt = getBaseMetaTileEntity(); + StructureBuilderExtreme(front, blockType, blockMeta, 1, 2, 0, igt, this, hintsOnly); + StructureBuilderExtreme(cap, blockType, blockMeta, 1, 2, -1, igt, this, hintsOnly); - byte offset=-2; - for (int rackSlices = stackSize >12?12: stackSize; rackSlices>0 ; rackSlices--) { - StructureBuilderExtreme(slice, blockType, blockMeta, 1, 2, offset--, igt,this,hintsOnly); + byte offset = -2; + for (int rackSlices = Math.min(stackSize, 12); rackSlices > 0; rackSlices--) { + StructureBuilderExtreme(slice, blockType, blockMeta, 1, 2, offset--, igt, this, hintsOnly); } - StructureBuilderExtreme(cap, blockType, blockMeta, 1, 2, offset--, igt,this,hintsOnly); - StructureBuilderExtreme(terminator, blockType, blockMeta, 1, 2, offset,igt,this,hintsOnly); + StructureBuilderExtreme(cap, blockType, blockMeta, 1, 2, offset--, igt, this, hintsOnly); + StructureBuilderExtreme(terminator, blockType, blockMeta, 1, 2, offset, igt, this, hintsOnly); } @Override public String[] getStructureDescription(int stackSize) { return description; } - - @Override - protected void extraExplosions_EM() { - for (MetaTileEntity tTileEntity : eRacks) { - tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]); - } - } - - @Override - public String[] getDescription() { - return new String[]{ - CommonValues.TEC_MARK_EM, - Util.intBitsToString(TecTech.RANDOM.nextInt()), - EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "You need it to process the number above" - }; - } - - //NEW METHOD - public final boolean addRackToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) { - return false; - } - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Rack) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return eRacks.add((GT_MetaTileEntity_Hatch_Rack) aMetaTileEntity); - } - return false; - } -} +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafting.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafting.java index a72740e84f..263a46a9d3 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafting.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_crafting.java @@ -21,39 +21,43 @@ import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; +import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by danie_000 on 17.12.2016. */ public class GT_MetaTileEntity_EM_crafting extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { + //region variables private static Textures.BlockIcons.CustomIcon ScreenOFF; private static Textures.BlockIcons.CustomIcon ScreenON; - public static final String crafter="EM Crafting"; + public static final String crafter = "EM Crafting"; + //endregion + //region structure private static final String[][] shape = new String[][]{ - {"A000","0 0","0 . 0","0 0","A000",}, - {"00000","00000","00000","00000","00000",}, - {"0C0","A!!!","A!1!","A!!!","0C0",}, - {"22222","22222","22122","22222","22222",}, - {"23432","33333","43134","33333","23432",}, - {"23332","33333","33533","33333","23332",}, - {"23432","33333","43134","33333","23432",}, - {"22222","22222","22122","22222","22222",}, - {"0C0","A!!!","A!1!","A!!!","0C0",}, - {"00000","00000","00000","00000","00000",}, - {"A000","0 0","0 0","0 0","A000",}, + {"A000", "0 0", "0 . 0", "0 0", "A000",}, + {"00000", "00000", "00000", "00000", "00000",}, + {"0C0", "A!!!", "A!1!", "A!!!", "0C0",}, + {"22222", "22222", "22122", "22222", "22222",}, + {"23432", "33333", "43134", "33333", "23432",}, + {"23332", "33333", "33533", "33333", "23332",}, + {"23432", "33333", "43134", "33333", "23432",}, + {"22222", "22222", "22122", "22222", "22222",}, + {"0C0", "A!!!", "A!1!", "A!!!", "0C0",}, + {"00000", "00000", "00000", "00000", "00000",}, + {"A000", "0 0", "0 0", "0 0", "A000",}, }; - private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT , QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT}; + private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{4, 10, 5, 0, 6, 9}; private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; private static final String[] description = new String[]{ - EnumChatFormatting.AQUA+"Hint Details:", - "1 - Classic Hatches or High Power Casing", - "2 - Elemental Hatches or Molecular Casing", + EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", + translateToLocal("gt.blockmachines.multimachine.em.crafter.hint.0"),//1 - Classic Hatches or High Power Casing + translateToLocal("gt.blockmachines.multimachine.em.crafter.hint.1"),//2 - Elemental Hatches or Molecular Casing }; //endregion @@ -71,6 +75,11 @@ public class GT_MetaTileEntity_EM_crafting extends GT_MetaTileEntity_MultiblockB } @Override + public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0); + } + + @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister aBlockIconRegister) { ScreenOFF = new Textures.BlockIcons.CustomIcon("iconsets/EM_CRAFTING"); @@ -79,6 +88,15 @@ public class GT_MetaTileEntity_EM_crafting extends GT_MetaTileEntity_MultiblockB } @Override + public String[] getDescription() { + return new String[]{ + CommonValues.TEC_MARK_EM, + translateToLocal("gt.blockmachines.multimachine.em.crafter.desc.0"),//The most precise way of making stuff. + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.em.crafter.desc.1")// + }; + } + + @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][12], new TT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; @@ -87,26 +105,12 @@ public class GT_MetaTileEntity_EM_crafting extends GT_MetaTileEntity_MultiblockB } @Override - public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0); - } - - @Override public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),this,hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), this, hintsOnly); } @Override public String[] getStructureDescription(int stackSize) { return description; } - - @Override - public String[] getDescription() { - return new String[]{ - CommonValues.TEC_MARK_EM, - "The most precise way of making stuff.", - EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "(Trans-Planck process)" - }; - } -} +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java index 13bdc4976d..f18fe57b6f 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dataBank.java @@ -33,27 +33,30 @@ import static com.github.technus.tectech.recipe.TT_recipeAdder.nullItem; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; +import static net.minecraft.util.StatCollector.translateToLocal; public class GT_MetaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { + //region variables private final ArrayList<GT_MetaTileEntity_Hatch_OutputDataItems> eStacksDataOutputs = new ArrayList<>(); private final ArrayList<GT_MetaTileEntity_Hatch_DataAccess> eDataAccessHatches = new ArrayList<>(); + //endregion - //region Structure + //region structure private static final String[][] shape = new String[][]{ - {"0 0","0 . 0","0 0",}, - {"0!!!0","01110","0!!!0",}, - {"0!!!0","0!!!0","0!!!0",}, + {"0 0", "0 . 0", "0 0",}, + {"0!!!0", "01110", "0!!!0",}, + {"0!!!0", "0!!!0", "0!!!0",}, }; - private static final Block[] blockType = new Block[]{sBlockCasingsTT,sBlockCasingsTT}; - private static final byte[] blockMeta = new byte[]{2,1}; - private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList,this::addDataBankHatchToMachineList}; - private static final short[] casingTextures = new short[]{textureOffset,textureOffset+1}; - private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT,sBlockCasingsTT}; - private static final byte[] blockMetaFallback = new byte[]{0,1}; + private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; + private static final byte[] blockMeta = new byte[]{2, 1}; + private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList, this::addDataBankHatchToMachineList}; + private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 1}; + private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; + private static final byte[] blockMetaFallback = new byte[]{0, 1}; private static final String[] description = new String[]{ - EnumChatFormatting.AQUA+"Hint Details:", - "1 - Classic Hatches or high power casing", - "2 - Data Access/Data Bank Master Hatches or computer casing", + EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", + translateToLocal("gt.blockmachines.multimachine.em.databank.hint.0"),//1 - Classic Hatches or high power casing + translateToLocal("gt.blockmachines.multimachine.em.databank.hint.1"),//2 - Data Access/Data Bank Master Hatches or computer casing }; //endregion @@ -65,38 +68,12 @@ public class GT_MetaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockB super(aName); } - public final static ResourceLocation activitySound=new ResourceLocation(Reference.MODID+":fx_hi_freq"); - - @Override - @SideOnly(Side.CLIENT) - protected ResourceLocation getActivitySound(){ - return activitySound; - } - @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_EM_dataBank(mName); } @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][1], new TT_RenderedTexture(aActive ? GT_MetaTileEntity_MultiblockBase_EM.ScreenON : GT_MetaTileEntity_MultiblockBase_EM.ScreenOFF)}; - } - return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][1]}; - } - - @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, true, false, true); - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png", true, false, true);//todo texture - } - - @Override public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { eDataAccessHatches.clear(); eStacksDataOutputs.clear(); @@ -104,20 +81,10 @@ public class GT_MetaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockB } @Override - public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMeta,2, 1, 0, getBaseMetaTileEntity(),this,hintsOnly); - } - - @Override - public String[] getStructureDescription(int stackSize) { - return description; - } - - @Override public boolean checkRecipe_EM(ItemStack itemStack) { if (eDataAccessHatches.size() > 0 && eStacksDataOutputs.size() > 0) { - mEUt = -(int)V[4]; - eAmpereFlow = 1 + eStacksDataOutputs.size()*eDataAccessHatches.size(); + mEUt = -(int) V[4]; + eAmpereFlow = 1 + eStacksDataOutputs.size() * eDataAccessHatches.size(); mMaxProgresstime = 20; mEfficiencyIncrease = 10000; return true; @@ -127,24 +94,24 @@ public class GT_MetaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockB @Override public void outputAfterRecipe_EM() { - ArrayList<ItemStack> stacks=new ArrayList<>(); - for(GT_MetaTileEntity_Hatch_DataAccess dataAccess:eDataAccessHatches){ - int count=dataAccess.getSizeInventory(); - for(int i=0;i<count;i++){ - ItemStack stack=dataAccess.getStackInSlot(i); - if(stack!=null){ + ArrayList<ItemStack> stacks = new ArrayList<>(); + for (GT_MetaTileEntity_Hatch_DataAccess dataAccess : eDataAccessHatches) { + int count = dataAccess.getSizeInventory(); + for (int i = 0; i < count; i++) { + ItemStack stack = dataAccess.getStackInSlot(i); + if (stack != null) { stacks.add(stack); } } } - if(stacks.size()>0){ - ItemStack[] arr=stacks.toArray(nullItem); - for(GT_MetaTileEntity_Hatch_OutputDataItems hatch:eStacksDataOutputs){ - hatch.q=new InventoryDataPacket(arr); + if (stacks.size() > 0) { + ItemStack[] arr = stacks.toArray(nullItem); + for (GT_MetaTileEntity_Hatch_OutputDataItems hatch : eStacksDataOutputs) { + hatch.q = new InventoryDataPacket(arr); } - }else{ - for(GT_MetaTileEntity_Hatch_OutputDataItems hatch:eStacksDataOutputs){ - hatch.q=null; + } else { + for (GT_MetaTileEntity_Hatch_OutputDataItems hatch : eStacksDataOutputs) { + hatch.q = null; } } } @@ -153,12 +120,37 @@ public class GT_MetaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockB public String[] getDescription() { return new String[]{ CommonValues.TEC_MARK_EM, - "Remote assembly data delivery", - EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Apply directly to the forehead" + translateToLocal("gt.blockmachines.multimachine.em.databank.desc.0"),//Remote assembly data delivery + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.em.databank.desc.1")//Apply directly to the forehead }; } - //NEW METHOD + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, true, false, true); + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png", true, false, true);//todo texture + } + + @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][1], new TT_RenderedTexture(aActive ? GT_MetaTileEntity_MultiblockBase_EM.ScreenON : GT_MetaTileEntity_MultiblockBase_EM.ScreenOFF)}; + } + return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][1]}; + } + + public final static ResourceLocation activitySound = new ResourceLocation(Reference.MODID + ":fx_hi_freq"); + + @Override + @SideOnly(Side.CLIENT) + protected ResourceLocation getActivitySound() { + return activitySound; + } + public final boolean addDataBankHatchToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (aTileEntity == null) { return false; @@ -170,10 +162,20 @@ public class GT_MetaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockB if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputDataItems) { ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); return eStacksDataOutputs.add((GT_MetaTileEntity_Hatch_OutputDataItems) aMetaTileEntity); - }else if(aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DataAccess && !(aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputDataItems)){ + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DataAccess && !(aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputDataItems)) { ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); return eDataAccessHatches.add((GT_MetaTileEntity_Hatch_DataAccess) aMetaTileEntity); } return false; } -} + + @Override + public void construct(int stackSize, boolean hintsOnly) { + StructureBuilderExtreme(shape, blockType, blockMeta, 2, 1, 0, getBaseMetaTileEntity(), this, hintsOnly); + } + + @Override + public String[] getStructureDescription(int stackSize) { + return description; + } +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java index 21344b9f34..ae9ee1c524 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java @@ -6,11 +6,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElement import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.INameFunction; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IStatusFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.*; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -24,8 +20,11 @@ import ic2.core.init.MainConfig; import ic2.core.util.ConfigUtil; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; +import org.apache.commons.lang3.reflect.FieldUtils; import static com.github.technus.tectech.CommonValues.VN; import static com.github.technus.tectech.Util.StructureBuilderExtreme; @@ -34,51 +33,57 @@ import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texture import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.STATUS_OK; import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.STATUS_TOO_LOW; +import static net.minecraft.util.StatCollector.translateToLocal; +import static net.minecraft.util.StatCollector.translateToLocalFormatted; /** * Created by danie_000 on 17.12.2016. */ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { + //region variables private static Textures.BlockIcons.CustomIcon ScreenOFF; private static Textures.BlockIcons.CustomIcon ScreenON; public static final double URANIUM_INGOT_MASS_DIFF = 1.6114516E10; private static final double URANIUM_MASS_TO_EU_PARTIAL = ConfigUtil.getFloat(MainConfig.get(), "balance/energy/generator/nuclear") * 3_000_000.0 / URANIUM_INGOT_MASS_DIFF; - public static final double URANIUM_MASS_TO_EU_INSTANT = URANIUM_MASS_TO_EU_PARTIAL *20; + public static final double URANIUM_MASS_TO_EU_INSTANT = URANIUM_MASS_TO_EU_PARTIAL * 20; - //region parameters - protected Parameters.Group.ParameterIn ampereFlow; - private static final INameFunction<GT_MetaTileEntity_EM_decay> FLOW_NAME= (base, p)->"Ampere divider"; - private static final IStatusFunction<GT_MetaTileEntity_EM_decay> FLOW_STATUS= (base, p)->{ - if(base.eAmpereFlow<=0){ - return STATUS_TOO_LOW; - } - return STATUS_OK; - }; + private String clientLocale = "en_US"; //endregion //region structure private static final String[][] shape = new String[][]{ - {"0C0","A ","A . ","A ","0C0",}, - {"00000","00000","00000","00000","00000",}, - {"0C0","A!!!","A!0!","A!!!","0C0",}, - {"01110","12221","12221","12221","01110",}, - {"01310","12221","32223","12221","01310",}, - {"01110","12221","12221","12221","01110",}, - {"0C0","A!!!","A!0!","A!!!","0C0",}, - {"00000","00000","00000","00000","00000",}, - {"0C0","A ","A ","A ","0C0",}, + {"0C0", "A ", "A . ", "A ", "0C0",}, + {"00000", "00000", "00000", "00000", "00000",}, + {"0C0", "A!!!", "A!0!", "A!!!", "0C0",}, + {"01110", "12221", "12221", "12221", "01110",}, + {"01310", "12221", "32223", "12221", "01310",}, + {"01110", "12221", "12221", "12221", "01110",}, + {"0C0", "A!!!", "A!0!", "A!!!", "0C0",}, + {"00000", "00000", "00000", "00000", "00000",}, + {"0C0", "A ", "A ", "A ", "0C0",}, }; - private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT ,sBlockCasingsTT}; + private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{4, 5, 8, 6}; private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; private static final String[] description = new String[]{ - EnumChatFormatting.AQUA+"Hint Details:", - "1 - Classic Hatches or High Power Casing", - "2 - Elemental Hatches or Molecular Casing", + EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", + translateToLocal("gt.blockmachines.multimachine.em.decay.hint.0"),//1 - Classic Hatches or High Power Casing + translateToLocal("gt.blockmachines.multimachine.em.decay.hint.1"),//2 - Elemental Hatches or Molecular Casing + }; + //endregion + + //region parameters + protected Parameters.Group.ParameterIn ampereFlow; + private static final INameFunction<GT_MetaTileEntity_EM_decay> FLOW_NAME = (base, p) -> translateToLocal("gt.blockmachines.multimachine.em.decay.conf");//Ampere divider + private static final IStatusFunction<GT_MetaTileEntity_EM_decay> FLOW_STATUS = (base, p) -> { + if (base.eAmpereFlow <= 0) { + return STATUS_TOO_LOW; + } + return STATUS_OK; }; //endregion @@ -91,61 +96,20 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase } @Override - protected void parametersInstantiation_EM() { - Parameters.Group hatch_0=parametrization.getGroup(0, true); - ampereFlow=hatch_0.makeInParameter(0,1,FLOW_NAME,FLOW_STATUS); - } - - @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_EM_decay(mName); } @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister aBlockIconRegister) { - ScreenOFF = new Textures.BlockIcons.CustomIcon("iconsets/EM_DECAY"); - ScreenON = new Textures.BlockIcons.CustomIcon("iconsets/EM_DECAY_ACTIVE"); - super.registerIcons(aBlockIconRegister); - } - - @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][12], new TT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; - } - return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12]}; - } - - @Override public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0); } @Override - public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),this,hintsOnly); - } - - @Override - public String[] getStructureDescription(int stackSize) { - return description; - } - - @Override - public String[] getDescription() { - return new String[]{ - CommonValues.TEC_MARK_EM, - "Is life time too long?", - EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Make it half-life (3) instead!" - }; - } - - @Override public boolean checkRecipe_EM(ItemStack itemStack) { - cElementalInstanceStackMap map= getInputsClone_EM(); - if(map!=null && map.hasStacks()){ - for(GT_MetaTileEntity_Hatch_InputElemental i:eInputHatches){ + cElementalInstanceStackMap map = getInputsClone_EM(); + if (map != null && map.hasStacks()) { + for (GT_MetaTileEntity_Hatch_InputElemental i : eInputHatches) { i.getContainerHandler().clear(); } return startRecipe(map); @@ -156,44 +120,53 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase private boolean startRecipe(cElementalInstanceStackMap input) { mMaxProgresstime = 20; mEfficiencyIncrease = 10000; - outputEM=new cElementalInstanceStackMap[2]; - outputEM[0]=input; - outputEM[1]=new cElementalInstanceStackMap(); + outputEM = new cElementalInstanceStackMap[2]; + outputEM[0] = input; + outputEM[1] = new cElementalInstanceStackMap(); - for(cElementalInstanceStack stack:outputEM[0].values()){ + for (cElementalInstanceStack stack : outputEM[0].values()) { if (stack.getEnergy() == 0 && stack.definition.decayMakesEnergy(1) && getBaseMetaTileEntity().decreaseStoredEnergyUnits( - (long) (stack.getEnergySettingCost(1) * URANIUM_MASS_TO_EU_INSTANT), false)) { + (long) (stack.getEnergySettingCost(1) * URANIUM_MASS_TO_EU_INSTANT), false)) { stack.setEnergy(1); - }else if(!stack.definition.decayMakesEnergy(stack.getEnergy())){ + } else if (!stack.definition.decayMakesEnergy(stack.getEnergy())) { outputEM[0].remove(stack.definition); outputEM[1].putReplace(stack); } //System.out.println(stack.definition.getSymbol()+" "+stack.amount); } - float preMass=outputEM[0].getMass(); - outputEM[0].tickContent(1,0,1); - double energyDose=((preMass-outputEM[0].getMass())* URANIUM_MASS_TO_EU_PARTIAL); - eAmpereFlow=(long) ampereFlow.get(); + float preMass = outputEM[0].getMass(); + outputEM[0].tickContent(1, 0, 1); + double energyDose = ((preMass - outputEM[0].getMass()) * URANIUM_MASS_TO_EU_PARTIAL); + eAmpereFlow = (long) ampereFlow.get(); if (eAmpereFlow <= 0) { - mEUt=0; + mEUt = 0; return false; } - mEUt=(int)(energyDose/eAmpereFlow); + mEUt = (int) (energyDose / eAmpereFlow); return outputEM[0].hasStacks(); } @Override public void outputAfterRecipe_EM() { - for(int i=0;i<2&&i<eOutputHatches.size();i++){ + for (int i = 0; i < 2 && i < eOutputHatches.size(); i++) { eOutputHatches.get(i).getContainerHandler().putUnifyAll(outputEM[i]); - outputEM[i]=null; + outputEM[i] = null; } } @Override + public String[] getDescription() { + return new String[]{ + CommonValues.TEC_MARK_EM, + translateToLocal("gt.blockmachines.multimachine.em.decay.desc.0"),//Is life time too long? + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.em.decay.desc.1")//Make it half-life (3) instead! + }; + } + + @Override public String[] getInfoData() {//TODO Do it long storedEnergy = 0; long maxEnergy = 0; @@ -211,22 +184,72 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase } return new String[]{ - "Progress:", + translateToLocalFormatted("tt.keyword.Progress", clientLocale) + ":", EnumChatFormatting.GREEN + Integer.toString(mProgresstime / 20) + EnumChatFormatting.RESET + " s / " + EnumChatFormatting.YELLOW + mMaxProgresstime / 20 + EnumChatFormatting.RESET + " s", - "Energy Hatches:", + translateToLocalFormatted("tt.keyphrase.Energy_Hatches", clientLocale) + ":", EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU", - (mEUt <= 0 ? "Probably uses: " : "Probably makes: ") + + (mEUt <= 0 ? translateToLocalFormatted("tt.keyphrase.Probably_uses", clientLocale) + ": " : translateToLocalFormatted("tt.keyphrase.Probably_makes", clientLocale) + ": ") + EnumChatFormatting.RED + Math.abs(mEUt) + EnumChatFormatting.RESET + " EU/t at " + EnumChatFormatting.RED + eAmpereFlow + EnumChatFormatting.RESET + " A", - "Tier Rating: " + EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier_EM()] + EnumChatFormatting.RESET + " / " + EnumChatFormatting.GREEN + VN[getMinEnergyInputTier_EM()] + EnumChatFormatting.RESET + - " Amp Rating: " + EnumChatFormatting.GREEN + eMaxAmpereFlow + EnumChatFormatting.RESET + " A", - "Problems: " + EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + - " Efficiency: " + EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", - "PowerPass: " + EnumChatFormatting.BLUE + ePowerPass + EnumChatFormatting.RESET + - " SafeVoid: " + EnumChatFormatting.BLUE + eSafeVoid, - "Computation: " + EnumChatFormatting.GREEN + eAvailableData + EnumChatFormatting.RESET + " / " + EnumChatFormatting.YELLOW + eRequiredData + EnumChatFormatting.RESET, + translateToLocalFormatted("tt.keyphrase.Tier_Rating", clientLocale) + ": " + EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier_EM()] + EnumChatFormatting.RESET + " / " + EnumChatFormatting.GREEN + VN[getMinEnergyInputTier_EM()] + EnumChatFormatting.RESET + + " " + translateToLocalFormatted("tt.keyphrase.Amp_Rating", clientLocale) + ": " + EnumChatFormatting.GREEN + eMaxAmpereFlow + EnumChatFormatting.RESET + " A", + translateToLocalFormatted("tt.keyword.Problems", clientLocale) + ": " + EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + + " " + translateToLocalFormatted("tt.keyword.Efficiency", clientLocale) + ": " + EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", + translateToLocalFormatted("tt.keyword.PowerPass", clientLocale) + ": " + EnumChatFormatting.BLUE + ePowerPass + EnumChatFormatting.RESET + + " " + translateToLocalFormatted("tt.keyword.SafeVoid", clientLocale) + ": " + EnumChatFormatting.BLUE + eSafeVoid, + translateToLocalFormatted("tt.keyword.Computation", clientLocale) + ": " + EnumChatFormatting.GREEN + eAvailableData + EnumChatFormatting.RESET + " / " + EnumChatFormatting.YELLOW + eRequiredData + EnumChatFormatting.RESET, }; } -} + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister aBlockIconRegister) { + ScreenOFF = new Textures.BlockIcons.CustomIcon("iconsets/EM_DECAY"); + ScreenON = new Textures.BlockIcons.CustomIcon("iconsets/EM_DECAY_ACTIVE"); + super.registerIcons(aBlockIconRegister); + } + + @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][12], new TT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; + } + return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][12]}; + } + + @Override + protected void parametersInstantiation_EM() { + Parameters.Group hatch_0 = parametrization.getGroup(0, true); + ampereFlow = hatch_0.makeInParameter(0, 1, FLOW_NAME, FLOW_STATUS); + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + super.onRightclick(aBaseMetaTileEntity, aPlayer); + + if (!aBaseMetaTileEntity.isClientSide() && aPlayer instanceof EntityPlayerMP) { + try { + EntityPlayerMP player = (EntityPlayerMP) aPlayer; + clientLocale = (String) FieldUtils.readField(player, "translator", true); + } catch (Exception e) { + clientLocale = "en_US"; + } + } else { + return true; + } + System.out.println(clientLocale); + return true; + } + + @Override + public void construct(int stackSize, boolean hintsOnly) { + StructureBuilderExtreme(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), this, hintsOnly); + } + + @Override + public String[] getStructureDescription(int stackSize) { + return description; + } +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java index 011105356a..27b770c88b 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java @@ -31,13 +31,13 @@ import static com.github.technus.tectech.mechanics.elementalMatter.definitions.c import static com.github.technus.tectech.mechanics.elementalMatter.definitions.complex.dAtomDefinition.refUnstableMass; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; +import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by danie_000 on 17.12.2016. */ public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { - - //region Structure + //region structure //use multi A energy inputs, use less power the longer it runs private static final String[][] shape = new String[][]{ {" ", " . ", " ",}, @@ -55,10 +55,10 @@ public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_Multiblo private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4, 4}; private static final String[] description = new String[]{ - EnumChatFormatting.AQUA + "Hint Details:", - "1 - Classic Hatches or High Power Casing", - "2 - Elemental Input Hatch", - "3 - Elemental Overflow Hatches or Molecular Casing", + EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", + translateToLocal("gt.blockmachines.multimachine.em.emtomatter.hint.0"),//1 - Classic Hatches or High Power Casing" + translateToLocal("gt.blockmachines.multimachine.em.emtomatter.hint.1"),//2 - Elemental Input Hatch + translateToLocal("gt.blockmachines.multimachine.em.emtomatter.hint.2"),//3 - Elemental Overflow Hatches or Molecular Casing }; //endregion @@ -70,10 +70,17 @@ public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_Multiblo super(aName); } - @Override - @SideOnly(Side.CLIENT) - protected ResourceLocation getActivitySound(){ - return GT_MetaTileEntity_EM_quantizer.activitySound; + private void startRecipe(iHasElementalDefinition from, long energy) { + mMaxProgresstime = 20; + mEfficiencyIncrease = 10000; + float mass = from.getMass(); + float euMult = Math.abs(mass / refMass); + eAmpereFlow = (int) Math.ceil(Math.sqrt(Math.sqrt(euMult))); + if (mass > refUnstableMass || from.getDefinition().getRawTimeSpan(energy) < STABLE_RAW_LIFE_TIME) { + mEUt = (int) -V[8]; + } else { + mEUt = (int) -V[6]; + } } @Override @@ -87,16 +94,6 @@ public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_Multiblo } @Override - public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(),this, hintsOnly); - } - - @Override - public String[] getStructureDescription(int stackSize) { - return description; - } - - @Override public boolean checkRecipe_EM(ItemStack itemStack) { for (GT_MetaTileEntity_Hatch_InputElemental in : eInputHatches) { cElementalInstanceStackMap map = in.getContainerHandler(); @@ -105,7 +102,7 @@ public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_Multiblo if (info != null) { if (map.removeAllAmounts(false, (iHasElementalDefinition) info.input())) { mOutputFluids = new FluidStack[]{(FluidStack) info.output()}; - startRecipe((iHasElementalDefinition) info.input(),stack.getEnergy()); + startRecipe((iHasElementalDefinition) info.input(), stack.getEnergy()); return true; } } @@ -114,7 +111,7 @@ public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_Multiblo if (info != null) { if (map.removeAllAmounts(false, (iHasElementalDefinition) info.input())) { mOutputItems = new ItemStack[]{(ItemStack) info.output()}; - startRecipe((iHasElementalDefinition) info.input(),stack.getEnergy()); + startRecipe((iHasElementalDefinition) info.input(), stack.getEnergy()); return true; } } @@ -125,7 +122,7 @@ public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_Multiblo ArrayList<ItemStack> items = OreDictionary.getOres(((aOredictDequantizationInfo) info).out); if (items != null && !items.isEmpty()) { mOutputItems = new ItemStack[]{items.get(0)}; - startRecipe((iHasElementalDefinition) info.input(),stack.getEnergy()); + startRecipe((iHasElementalDefinition) info.input(), stack.getEnergy()); return true; } } @@ -135,25 +132,28 @@ public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_Multiblo return false; } - private void startRecipe(iHasElementalDefinition from, long energy) { - mMaxProgresstime = 20; - mEfficiencyIncrease = 10000; - float mass = from.getMass(); - float euMult = Math.abs(mass / refMass); - eAmpereFlow = (int) Math.ceil(Math.sqrt(Math.sqrt(euMult))); - if (mass > refUnstableMass || from.getDefinition().getRawTimeSpan(energy) < STABLE_RAW_LIFE_TIME) { - mEUt = (int) -V[8]; - } else { - mEUt = (int) -V[6]; - } - } - @Override public String[] getDescription() { return new String[]{ CommonValues.TEC_MARK_EM, - "Transform quantum form back to...", - EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "regular one, but why?" + translateToLocal("gt.blockmachines.multimachine.em.emtomatter.desc.0"),//Transform quantum form back to... + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.em.emtomatter.desc.1")//regular one, but why? }; } -} + + @Override + @SideOnly(Side.CLIENT) + protected ResourceLocation getActivitySound() { + return GT_MetaTileEntity_EM_quantizer.activitySound; + } + + @Override + public void construct(int stackSize, boolean hintsOnly) { + StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), this, hintsOnly); + } + + @Override + public String[] getStructureDescription(int stackSize) { + return description; + } +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java index d0b5b4ff35..4e8e8d27ec 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java @@ -27,12 +27,13 @@ import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; import static gregtech.api.GregTech_API.mEUtoRF; +import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by danie_000 on 17.12.2016. */ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { - //region Structure + //region structure private static final String[][] shape = new String[][]{ {" ", "000", "1.1", "000", " ",}, {" ", "010", "111", "010", " ",}, @@ -45,30 +46,63 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0}; private static final String[] description = new String[]{ - EnumChatFormatting.AQUA+"Hint Details:", - "1 - Classic Hatches or High Power Casing", + EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", + translateToLocal("gt.blockmachines.multimachine.em.infuser.hint"),//1 - Classic Hatches or High Power Casing }; //endregion public GT_MetaTileEntity_EM_infuser(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); minRepairStatus = (byte) getIdealStatus(); - eDismantleBoom=true; + eDismantleBoom = true; } public GT_MetaTileEntity_EM_infuser(String aName) { super(aName); minRepairStatus = (byte) getIdealStatus(); - eDismantleBoom=true; + eDismantleBoom = true; } + private long doChargeItemStack(IElectricItem item, ItemStack stack) { + try { + double euDiff = item.getMaxCharge(stack) - ElectricItem.manager.getCharge(stack); + if (euDiff > 0) { + setEUVar(getEUVar() - (getEUVar() >> 5)); + } + long remove = (long) Math.ceil( + ElectricItem.manager.charge(stack, + Math.min(euDiff, getEUVar()) + , item.getTier(stack), true, false)); + setEUVar(getEUVar() - remove); + if (getEUVar() < 0) { + setEUVar(0); + } + return remove; + } catch (Exception e) { + if (DEBUG_MODE) { + e.printStackTrace(); + } + } + return 0; + } - public final static ResourceLocation activitySound=new ResourceLocation(Reference.MODID+":fx_whooum"); - - @Override - @SideOnly(Side.CLIENT) - protected ResourceLocation getActivitySound(){ - return activitySound; + private long doChargeItemStackRF(IEnergyContainerItem item, ItemStack stack) { + try { + long RF = Math.min(item.getMaxEnergyStored(stack) - item.getEnergyStored(stack), getEUVar() * mEUtoRF / 100L); + //if(RF>0)this.setEUVar(this.getEUVar()-this.getEUVar()>>10); + RF = item.receiveEnergy(stack, RF > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) RF, false); + RF = RF * 100L / mEUtoRF; + setEUVar(getEUVar() - RF); + if (getEUVar() < 0) { + setEUVar(0); + } + return RF; + } catch (Exception e) { + if (DEBUG_MODE) { + e.printStackTrace(); + } + } + return 0; } @Override @@ -77,31 +111,11 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa } @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity,true,false,true); - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png",true,false,true); - } - - @Override public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, 0); } @Override - public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMeta,1, 2, 0, getBaseMetaTileEntity(),this,hintsOnly); - } - - @Override - public String[] getStructureDescription(int stackSize) { - return description; - } - - @Override public boolean checkRecipe_EM(ItemStack itemStack) { if (itemStack != null && itemStack.stackSize == 1) { Item ofThis = itemStack.getItem(); @@ -142,52 +156,38 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa public String[] getDescription() { return new String[]{ CommonValues.TEC_MARK_GENERAL, - "Power Transfer Extreme!", - EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Insanely fast charging!", - EnumChatFormatting.BLUE + "Doesn't work while broken!", - EnumChatFormatting.BLUE + "Power loss is a thing." + translateToLocal("gt.blockmachines.multimachine.em.infuser.desc.0"),//Power Transfer Extreme! + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.em.infuser.desc.1"), + EnumChatFormatting.BLUE + translateToLocal("gt.blockmachines.multimachine.em.infuser.desc.2"), + EnumChatFormatting.BLUE + translateToLocal("gt.blockmachines.multimachine.em.infuser.desc.3") }; } - private long doChargeItemStack(IElectricItem item, ItemStack stack) { - try { - double euDiff = item.getMaxCharge(stack) - ElectricItem.manager.getCharge(stack); - if (euDiff > 0) { - setEUVar(getEUVar() - (getEUVar() >> 5)); - } - long remove = (long) Math.ceil( - ElectricItem.manager.charge(stack, - Math.min(euDiff, getEUVar()) - , item.getTier(stack), true, false)); - setEUVar(getEUVar() - remove); - if (getEUVar() < 0) { - setEUVar(0); - } - return remove; - } catch (Exception e) { - if (DEBUG_MODE) { - e.printStackTrace(); - } - } - return 0; + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, true, false, true); } - private long doChargeItemStackRF(IEnergyContainerItem item, ItemStack stack) { - try { - long RF = Math.min(item.getMaxEnergyStored(stack) - item.getEnergyStored(stack), getEUVar() * mEUtoRF / 100L); - //if(RF>0)this.setEUVar(this.getEUVar()-this.getEUVar()>>10); - RF = item.receiveEnergy(stack, RF > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) RF, false); - RF = RF * 100L / mEUtoRF; - setEUVar(getEUVar() - RF); - if (getEUVar() < 0) { - setEUVar(0); - } - return RF; - } catch (Exception e) { - if (DEBUG_MODE) { - e.printStackTrace(); - } - } - return 0; + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png", true, false, true); + } + + public final static ResourceLocation activitySound = new ResourceLocation(Reference.MODID + ":fx_whooum"); + + @Override + @SideOnly(Side.CLIENT) + protected ResourceLocation getActivitySound() { + return activitySound; + } + + @Override + public void construct(int stackSize, boolean hintsOnly) { + StructureBuilderExtreme(shape, blockType, blockMeta, 1, 2, 0, getBaseMetaTileEntity(), this, hintsOnly); + } + + @Override + public String[] getStructureDescription(int stackSize) { + return description; } -} +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java index 337afd4f32..aba87eaf6b 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_junction.java @@ -4,11 +4,7 @@ import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OutputElemental; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.INameFunction; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IStatusFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.*; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Utility; @@ -22,12 +18,13 @@ import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texture import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*; import static gregtech.api.enums.GT_Values.E; +import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by danie_000 on 17.12.2016. */ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { - //region Structure + //region structure //use multi A energy inputs, use less power the longer it runs private static final String[][] shape = new String[][]{ {" ", " . ", " ",}, @@ -42,38 +39,38 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB {"A!!!", "!000!", "!000!", "!000!", "A!!!",}, {"A!!!", "!!!!!", "!!!!!", "!!!!!", "A!!!",}, }; - private static final Block[] blockType = new Block[]{sBlockCasingsTT,sBlockCasingsTT}; - private static final byte[] blockMeta = new byte[]{4,5}; + private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; + private static final byte[] blockMeta = new byte[]{4, 5}; private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; private static final String[] description = new String[]{ - EnumChatFormatting.AQUA+"Hint Details:", - "1 - Classic Hatches or High Power Casing", - "2 - Elemental Hatches or Molecular Casing", + EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", + translateToLocal("gt.blockmachines.multimachine.em.junction.hint.0"),//1 - Classic Hatches or High Power Casing + translateToLocal("gt.blockmachines.multimachine.em.junction.hint.1"),//2 - Elemental Hatches or Molecular Casing }; //endregion //region parameters - private static final INameFunction<GT_MetaTileEntity_EM_junction> ROUTE_NAME= - (base,p)->(p.parameterId()==0?"Source ":"Destination ")+p.hatchId(); + private static final INameFunction<GT_MetaTileEntity_EM_junction> ROUTE_NAME = + (base, p) -> (p.parameterId() == 0 ? translateToLocal("tt.keyword.Source") + " " : translateToLocal("tt.keyword.Destination") + " ") + p.hatchId(); private static final IStatusFunction<GT_MetaTileEntity_EM_junction> SRC_STATUS = - (base,p)-> { + (base, p) -> { double v = p.get(); if (Double.isNaN(v)) return STATUS_WRONG; - v=(int)v; + v = (int) v; if (v < 0) return STATUS_TOO_LOW; if (v == 0) return STATUS_NEUTRAL; if (v >= base.eInputHatches.size()) return STATUS_TOO_HIGH; return STATUS_OK; }; private static final IStatusFunction<GT_MetaTileEntity_EM_junction> DST_STATUS = - (base,p)->{ - if(base.src[p.hatchId()].getStatus(false)== STATUS_OK){ + (base, p) -> { + if (base.src[p.hatchId()].getStatus(false) == STATUS_OK) { double v = p.get(); if (Double.isNaN(v)) return STATUS_WRONG; - v=(int)v; + v = (int) v; if (v < 0) return STATUS_TOO_LOW; if (v == 0) return STATUS_LOW; if (v >= base.eInputHatches.size()) return STATUS_TOO_HIGH; @@ -94,52 +91,22 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB } @Override - protected void parametersInstantiation_EM() { - src=new Parameters.Group.ParameterIn[10]; - dst=new Parameters.Group.ParameterIn[10]; - for (int i = 0; i < 10; i++) { - Parameters.Group hatch = parametrization.getGroup(i); - src[i] = hatch.makeInParameter(0, i, ROUTE_NAME, SRC_STATUS); - dst[i] = hatch.makeInParameter(1, i, ROUTE_NAME, DST_STATUS); - } - } - - @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_EM_junction(mName); } @Override public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - int meta=iGregTechTileEntity.getMetaIDAtSide(GT_Utility.getOppositeSide(iGregTechTileEntity.getFrontFacing())); - if(meta==4){ + int meta = iGregTechTileEntity.getMetaIDAtSide(GT_Utility.getOppositeSide(iGregTechTileEntity.getFrontFacing())); + if (meta == 4) { return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 1, 0); - }else if(meta==5){ + } else if (meta == 5) { return structureCheck_EM(shapeBig, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0); } return false; } @Override - public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMeta,1, 1, 0, getBaseMetaTileEntity(),this,hintsOnly); - } - - @Override - public String[] getStructureDescription(int stackSize) { - return description; - } - - @Override - public String[] getDescription() { - return new String[]{ - CommonValues.TEC_MARK_EM, - "Reroutes Matter", - EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Axis aligned movement!" - }; - } - - @Override public boolean checkRecipe_EM(ItemStack itemStack) { for (GT_MetaTileEntity_Hatch_InputElemental in : eInputHatches) { if (in.getContainerHandler().hasStacks()) { @@ -155,18 +122,18 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB @Override public void outputAfterRecipe_EM() { - double src,dst; + double src, dst; for (int i = 0; i < 10; i++) { - src= this.src[i].get(); - dst= this.dst[i].get(); - if(Double.isNaN(src) || Double.isNaN(dst)) { + src = this.src[i].get(); + dst = this.dst[i].get(); + if (Double.isNaN(src) || Double.isNaN(dst)) { continue; } - int inIndex = (int)src - 1; + int inIndex = (int) src - 1; if (inIndex < 0 || inIndex >= eInputHatches.size()) { continue; } - int outIndex = (int)dst - 1; + int outIndex = (int) dst - 1; GT_MetaTileEntity_Hatch_InputElemental in = eInputHatches.get(inIndex); if (outIndex == -1) {//param==0 -> null the content cleanHatchContentEM_EM(in); @@ -180,4 +147,34 @@ public class GT_MetaTileEntity_EM_junction extends GT_MetaTileEntity_MultiblockB } } } -} + + @Override + public String[] getDescription() { + return new String[]{ + CommonValues.TEC_MARK_EM, + translateToLocal("gt.blockmachines.multimachine.em.junction.desc.0"),//Reroutes Matter + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.em.junction.desc.1")//Axis aligned movement! + }; + } + + @Override + protected void parametersInstantiation_EM() { + src = new Parameters.Group.ParameterIn[10]; + dst = new Parameters.Group.ParameterIn[10]; + for (int i = 0; i < 10; i++) { + Parameters.Group hatch = parametrization.getGroup(i); + src[i] = hatch.makeInParameter(0, i, ROUTE_NAME, SRC_STATUS); + dst[i] = hatch.makeInParameter(1, i, ROUTE_NAME, DST_STATUS); + } + } + + @Override + public void construct(int stackSize, boolean hintsOnly) { + StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), this, hintsOnly); + } + + @Override + public String[] getStructureDescription(int stackSize) { + return description; + } +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java index 7f983b798c..4d65b67ed0 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java @@ -40,12 +40,13 @@ import static com.github.technus.tectech.recipe.TT_recipeAdder.nullFluid; import static com.github.technus.tectech.recipe.TT_recipeAdder.nullItem; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; +import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by danie_000 on 17.12.2016. */ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { - //region Structure + //region structure //use multi A energy inputs, use less power the longer it runs private static final String[][] shape = new String[][]{ {" ", " . ", " ",}, @@ -63,10 +64,10 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4, 4}; private static final String[] description = new String[]{ - EnumChatFormatting.AQUA+"Hint Details:", - "1 - Classic Hatches or High Power Casing", - "2 - Elemental Output Hatch", - "3 - Elemental Overflow Hatches or Molecular Casing", + EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", + translateToLocal("gt.blockmachines.multimachine.em.mattertoem.hint.0"),//1 - Classic Hatches or High Power Casing + translateToLocal("gt.blockmachines.multimachine.em.mattertoem.hint.1"),//2 - Elemental Output Hatch + translateToLocal("gt.blockmachines.multimachine.em.mattertoem.hint.2"),//3 - Elemental Overflow Hatches or Molecular Casing }; //endregion @@ -78,14 +79,6 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock super(aName); } - public final static ResourceLocation activitySound=new ResourceLocation(Reference.MODID+":fx_mid_freq"); - - @Override - @SideOnly(Side.CLIENT) - protected ResourceLocation getActivitySound(){ - return activitySound; - } - @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_EM_quantizer(mName); @@ -97,25 +90,6 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock } @Override - public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(),this,hintsOnly); - } - - @Override - public String[] getStructureDescription(int stackSize) { - return description; - } - - @Override - public String[] getDescription() { - return new String[]{ - CommonValues.TEC_MARK_EM, - "Conveniently convert regular stuff into quantum form.", - EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "To make it more inconvenient." - }; - } - - @Override public boolean checkRecipe_EM(ItemStack itemStack) {//TODO implement instance quantization if (GregTech_API.sPostloadFinished) { ArrayList<ItemStack> storedInputs = getStoredInputs(); @@ -204,4 +178,31 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock eOutputHatches.get(0).getContainerHandler().putUnifyAll(outputEM[0]); outputEM = null; } -} + + @Override + public String[] getDescription() { + return new String[]{ + CommonValues.TEC_MARK_EM, + translateToLocal("gt.blockmachines.multimachine.em.mattertoem.desc.0"),//Conveniently convert regular stuff into quantum form. + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.em.mattertoem.desc.1")//To make it more inconvenient. + }; + } + + public final static ResourceLocation activitySound = new ResourceLocation(Reference.MODID + ":fx_mid_freq"); + + @Override + @SideOnly(Side.CLIENT) + protected ResourceLocation getActivitySound() { + return activitySound; + } + + @Override + public void construct(int stackSize, boolean hintsOnly) { + StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), this, hintsOnly); + } + + @Override + public String[] getStructureDescription(int stackSize) { + return description; + } +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java index 0c37246de8..f90f0bffc3 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java @@ -22,12 +22,15 @@ import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagString; import net.minecraft.util.EnumChatFormatting; +import org.apache.commons.lang3.reflect.FieldUtils; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -42,17 +45,25 @@ import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBloc import static com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_crafting.crafter; import static com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.GT_MetaTileEntity_EM_machine.machine; import static gregtech.api.enums.GT_Values.E; +import static net.minecraft.util.StatCollector.translateToLocal; +import static net.minecraft.util.StatCollector.translateToLocalFormatted; /** * Created by danie_000 on 17.12.2016. */ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { + //region variables private final ArrayList<GT_MetaTileEntity_Hatch_Holder> eHolders = new ArrayList<>(); private GT_Recipe.GT_Recipe_AssemblyLine tRecipe; private TT_recipe.TT_assLineRecipe aRecipe; private String machineType; private ItemStack holdItem; - private long computationRemaining,computationRequired; + private long computationRemaining, computationRequired; + + private static LinkedHashMap<String, String> lServerNames; + + private String clientLocale = "en_US"; + //endregion //region structure private static final String[][] shape = new String[][]{ @@ -71,9 +82,9 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, Blocks.air}; private static final byte[] blockMetaFallback = new byte[]{1, 0}; private static final String[] description = new String[]{ - EnumChatFormatting.AQUA+"Hint Details:", - "1 - Classic/Data Hatches or Computer casing", - "2 - Holder Hatch", + EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", + translateToLocal("gt.blockmachines.multimachine.em.research.hint.0"),//1 - Classic/Data Hatches or Computer casing + translateToLocal("gt.blockmachines.multimachine.em.research.hint.1"),//2 - Holder Hatch }; //endregion @@ -85,183 +96,7 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB super(aName); } - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_EM_research(mName); - } - - @Override - public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - for (GT_MetaTileEntity_Hatch_Holder rack : eHolders) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(rack)) { - rack.getBaseMetaTileEntity().setActive(false); - } - } - eHolders.clear(); - - if (!structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 3, 4)) { - return false; - } - - for (GT_MetaTileEntity_Hatch_Holder rack : eHolders) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(rack)) { - rack.getBaseMetaTileEntity().setActive(iGregTechTileEntity.isActive()); - } - } - return eHolders.size() == 1; - } - - @Override - public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMeta,1, 3, 4, getBaseMetaTileEntity(),this,hintsOnly); - } - - @Override - public String[] getStructureDescription(int stackSize) { - return description; - } - - @Override - public void saveNBTData(NBTTagCompound aNBT) { - super.saveNBTData(aNBT); - aNBT.setLong("eComputationRemaining",computationRemaining); - aNBT.setLong("eComputationRequired",computationRequired); - if(holdItem!=null) { - aNBT.setTag("eHold", holdItem.writeToNBT(new NBTTagCompound())); - } else { - aNBT.removeTag("eHold"); - } - } - - @Override - public void loadNBTData(NBTTagCompound aNBT) { - super.loadNBTData(aNBT); - computationRemaining=aNBT.getLong("eComputationRemaining"); - computationRequired=aNBT.getLong("eComputationRequired"); - if(aNBT.hasKey("eHold")) { - holdItem = ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("eHold")); - } else { - holdItem = null; - } - } - - @Override - public void onFirstTick_EM(IGregTechTileEntity aBaseMetaTileEntity) { - if(aBaseMetaTileEntity.isServerSide()) { - if (computationRemaining > 0) { - aRecipe = null; - tRecipe = null; - if (holdItem != null) { - if (ItemList.Tool_DataStick.isStackEqual(mInventory[1], false, true)) { - for (GT_Recipe.GT_Recipe_AssemblyLine tRecipe : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes) { - if (GT_Utility.areStacksEqual(tRecipe.mResearchItem, holdItem, true)) { - this.tRecipe = tRecipe; - break; - } - } - } else if (ItemList.Tool_DataOrb.isStackEqual(mInventory[1], false, true)) { - for (TT_recipe.TT_assLineRecipe assRecipeTT : TT_recipe.TT_Recipe_Map.sMachineRecipes.recipeList()) { - if (GT_Utility.areStacksEqual(assRecipeTT.mResearchItem, holdItem, true)) { - aRecipe = assRecipeTT; - machineType = machine; - break; - } - } - if (aRecipe == null) { - for (TT_recipe.TT_assLineRecipe assRecipeTT : TT_recipe.TT_Recipe_Map.sCrafterRecipes.recipeList()) { - if (GT_Utility.areStacksEqual(assRecipeTT.mResearchItem, holdItem, true)) { - aRecipe = assRecipeTT; - machineType = crafter; - break; - } - } - } - } - } - if (tRecipe == null && aRecipe == null) { - holdItem = null; - computationRequired = computationRemaining = 0; - mMaxProgresstime = 0; - mEfficiencyIncrease = 0; - for (GT_MetaTileEntity_Hatch_Holder r : eHolders) { - r.getBaseMetaTileEntity().setActive(false); - } - } - } - } - } - - @Override - public boolean checkRecipe_EM(ItemStack itemStack) { - tRecipe=null; - aRecipe=null; - if(!eHolders.isEmpty() && eHolders.get(0).mInventory[0]!=null) { - holdItem = eHolders.get(0).mInventory[0].copy(); - if(ItemList.Tool_DataStick.isStackEqual(itemStack, false, true)) { - for (GT_Recipe.GT_Recipe_AssemblyLine assRecipe : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes) { - if (GT_Utility.areStacksEqual(assRecipe.mResearchItem, holdItem, true)) { - tRecipe = assRecipe; - //if found - if (iterateRecipes()) return true; - } - } - }else if(ItemList.Tool_DataOrb.isStackEqual(itemStack, false, true)){ - for (TT_recipe.TT_assLineRecipe assRecipeTT:TT_recipe.TT_Recipe_Map.sMachineRecipes.recipeList()){ - if (GT_Utility.areStacksEqual(assRecipeTT.mResearchItem, holdItem, true)) { - aRecipe = assRecipeTT; - machineType=machine; - //if found - if (iterateRecipes()) return true; - } - } - for (TT_recipe.TT_assLineRecipe assRecipeTT:TT_recipe.TT_Recipe_Map.sCrafterRecipes.recipeList()){ - if (GT_Utility.areStacksEqual(assRecipeTT.mResearchItem, holdItem, true)) { - aRecipe = assRecipeTT; - machineType=crafter; - //if found - if (iterateRecipes()) return true; - } - } - } - } - holdItem=null; - computationRequired=computationRemaining=0; - for (GT_MetaTileEntity_Hatch_Holder r : eHolders) { - r.getBaseMetaTileEntity().setActive(false); - } - return false; - } - - private boolean iterateRecipes() { - for (GT_Recipe ttRecipe : TT_recipe.GT_Recipe_MapTT.sResearchableFakeRecipes.mRecipeList) { - if (GT_Utility.areStacksEqual(ttRecipe.mInputs[0], holdItem, true)) { - computationRequired = computationRemaining = ttRecipe.mDuration * 20L; - mMaxProgresstime = 20; - mEfficiencyIncrease = 10000; - eRequiredData = (short) (ttRecipe.mSpecialValue >>> 16); - eAmpereFlow = (short) (ttRecipe.mSpecialValue & 0xFFFF); - mEUt = ttRecipe.mEUt; - eHolders.get(0).getBaseMetaTileEntity().setActive(true); - return true; - } - } - return false; - } - - @Override - public boolean onRunningTick(ItemStack aStack) { - if(computationRemaining<=0) { - computationRemaining=0; - mProgresstime=mMaxProgresstime; - return true; - }else{ - computationRemaining-=eAvailableData; - mProgresstime=1; - return super.onRunningTick(aStack); - } - } - - private void makeStick(){ + private void makeStick() { mInventory[1].setTagCompound(new NBTTagCompound()); mInventory[1].setStackDisplayName(GT_LanguageManager.getTranslation(tRecipe.mOutput.getDisplayName()) + " Construction Data"); GT_Utility.ItemNBT.setBookTitle(mInventory[1], GT_LanguageManager.getTranslation(tRecipe.mOutput.getDisplayName()) + " Construction Data"); @@ -292,20 +127,19 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB tNBT.setTag("pages", tNBTList); } - private static LinkedHashMap<String, String> lServerNames; static { try { Class GT_Assemblyline_Server = Class.forName("gregtech.api.util.GT_Assemblyline_Server"); - lServerNames=(LinkedHashMap<String, String>)GT_Assemblyline_Server.getField("lServerNames").get(null); - }catch (ClassNotFoundException|NoSuchFieldException|IllegalAccessException e){ - lServerNames=null; + lServerNames = (LinkedHashMap<String, String>) GT_Assemblyline_Server.getField("lServerNames").get(null); + } catch (ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) { + lServerNames = null; } } - private void makeStick2(){ + private void makeStick2() { String s = tRecipe.mOutput.getDisplayName(); if (getBaseMetaTileEntity().isServerSide()) { - if(lServerNames!=null) { + if(lServerNames != null) { s = lServerNames.get(tRecipe.mOutput.getDisplayName()); if (s == null) { s = tRecipe.mOutput.getDisplayName(); @@ -315,18 +149,18 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB } } mInventory[1].setTagCompound(new NBTTagCompound()); - mInventory[1].setStackDisplayName(s+" Construction Data"); - GT_Utility.ItemNBT.setBookTitle(mInventory[1], s+" Construction Data"); + mInventory[1].setStackDisplayName(s + " Construction Data"); + GT_Utility.ItemNBT.setBookTitle(mInventory[1], s + " Construction Data"); NBTTagCompound tNBT = mInventory[1].getTagCompound(); tNBT.setTag("output", tRecipe.mOutput.writeToNBT(new NBTTagCompound())); tNBT.setInteger("time", tRecipe.mDuration); tNBT.setInteger("eu", tRecipe.mEUt); - for(int i = 0 ; i < tRecipe.mInputs.length ; i++){ - tNBT.setTag(""+i, tRecipe.mInputs[i].writeToNBT(new NBTTagCompound())); + for (int i = 0; i < tRecipe.mInputs.length; i++) { + tNBT.setTag("" + i, tRecipe.mInputs[i].writeToNBT(new NBTTagCompound())); } - for(int i = 0 ; i < tRecipe.mOreDictAlt.length ; i++){ + for (int i = 0; i < tRecipe.mOreDictAlt.length; i++) { if (tRecipe.mOreDictAlt[i] != null && tRecipe.mOreDictAlt[i].length > 0) { tNBT.setInteger("a" + i, tRecipe.mOreDictAlt[i].length); for (int j = 0; j < tRecipe.mOreDictAlt[i].length; j++) { @@ -334,30 +168,30 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB } } } - for(int i = 0 ; i < tRecipe.mFluidInputs.length ; i++){ - tNBT.setTag("f"+i, tRecipe.mFluidInputs[i].writeToNBT(new NBTTagCompound())); + for (int i = 0; i < tRecipe.mFluidInputs.length; i++) { + tNBT.setTag("f" + i, tRecipe.mFluidInputs[i].writeToNBT(new NBTTagCompound())); } - tNBT.setString("author", EnumChatFormatting.BLUE + "Tec" + EnumChatFormatting.DARK_BLUE + "Tech" + EnumChatFormatting.WHITE + ' ' + machineType+ " Recipe Generator"); + tNBT.setString("author", EnumChatFormatting.BLUE + "Tec" + EnumChatFormatting.DARK_BLUE + "Tech" + EnumChatFormatting.WHITE + ' ' + machineType + " Recipe Generator"); NBTTagList tNBTList = new NBTTagList(); - s=tRecipe.mOutput.getDisplayName(); + s = tRecipe.mOutput.getDisplayName(); if (getBaseMetaTileEntity().isServerSide()) { s = lServerNames.get(tRecipe.mOutput.getDisplayName()); - if (s==null) { + if (s == null) { s = tRecipe.mOutput.getDisplayName(); } } - tNBTList.appendTag(new NBTTagString("Construction plan for "+tRecipe.mOutput.stackSize+" "+s+". Needed EU/t: "+tRecipe.mEUt+" Production time: "+(tRecipe.mDuration/20))); - for(int i=0;i<tRecipe.mInputs.length;i++){ + tNBTList.appendTag(new NBTTagString("Construction plan for " + tRecipe.mOutput.stackSize + " " + s + ". Needed EU/t: " + tRecipe.mEUt + " Production time: " + (tRecipe.mDuration / 20))); + for (int i = 0; i < tRecipe.mInputs.length; i++) { if (tRecipe.mOreDictAlt[i] != null) { int count = 0; - StringBuilder tBuilder = new StringBuilder("Input Bus "+(i+1)+": "); + StringBuilder tBuilder = new StringBuilder("Input Bus " + (i + 1) + ": "); for (ItemStack tStack : tRecipe.mOreDictAlt[i]) { if (tStack != null) { - s=tStack.getDisplayName(); + s = tStack.getDisplayName(); if (getBaseMetaTileEntity().isServerSide()) { - s=lServerNames.get(tStack.getDisplayName()); - if (s==null) - s=tStack.getDisplayName(); + s = lServerNames.get(tStack.getDisplayName()); + if (s == null) + s = tStack.getDisplayName(); } @@ -366,27 +200,27 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB } } if (count > 0) tNBTList.appendTag(new NBTTagString(tBuilder.toString())); - } else if(tRecipe.mInputs[i]!=null){ - s=tRecipe.mInputs[i].getDisplayName(); + } else if (tRecipe.mInputs[i] != null) { + s = tRecipe.mInputs[i].getDisplayName(); if (getBaseMetaTileEntity().isServerSide()) { s = lServerNames.get(tRecipe.mInputs[i].getDisplayName()); - if (s==null) { + if (s == null) { s = tRecipe.mInputs[i].getDisplayName(); } } - tNBTList.appendTag(new NBTTagString("Input Bus "+(i+1)+": "+tRecipe.mInputs[i].stackSize+" "+s)); + tNBTList.appendTag(new NBTTagString("Input Bus " + (i + 1) + ": " + tRecipe.mInputs[i].stackSize + " " + s)); } } - for(int i=0;i<tRecipe.mFluidInputs.length;i++){ - if(tRecipe.mFluidInputs[i]!=null){ - s=tRecipe.mFluidInputs[i].getLocalizedName(); + for (int i = 0; i < tRecipe.mFluidInputs.length; i++) { + if (tRecipe.mFluidInputs[i] != null) { + s = tRecipe.mFluidInputs[i].getLocalizedName(); if (getBaseMetaTileEntity().isServerSide()) { s = lServerNames.get(tRecipe.mFluidInputs[i].getLocalizedName()); - if (s==null) { + if (s == null) { s = tRecipe.mFluidInputs[i].getLocalizedName(); } } - tNBTList.appendTag(new NBTTagString("Input Hatch "+(i+1)+": "+tRecipe.mFluidInputs[i].amount+"L "+s)); + tNBTList.appendTag(new NBTTagString("Input Hatch " + (i + 1) + ": " + tRecipe.mFluidInputs[i].amount + "L " + s)); } } tNBT.setTag("pages", tNBTList); @@ -394,10 +228,93 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB mInventory[1].setTagCompound(tNBT); } + private boolean iterateRecipes() { + for (GT_Recipe ttRecipe : TT_recipe.GT_Recipe_MapTT.sResearchableFakeRecipes.mRecipeList) { + if (GT_Utility.areStacksEqual(ttRecipe.mInputs[0], holdItem, true)) { + computationRequired = computationRemaining = ttRecipe.mDuration * 20L; + mMaxProgresstime = 20; + mEfficiencyIncrease = 10000; + eRequiredData = (short) (ttRecipe.mSpecialValue >>> 16); + eAmpereFlow = (short) (ttRecipe.mSpecialValue & 0xFFFF); + mEUt = ttRecipe.mEUt; + eHolders.get(0).getBaseMetaTileEntity().setActive(true); + return true; + } + } + return false; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_EM_research(mName); + } + + @Override + public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + for (GT_MetaTileEntity_Hatch_Holder rack : eHolders) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(rack)) { + rack.getBaseMetaTileEntity().setActive(false); + } + } + eHolders.clear(); + + if (!structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 3, 4)) { + return false; + } + + for (GT_MetaTileEntity_Hatch_Holder rack : eHolders) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(rack)) { + rack.getBaseMetaTileEntity().setActive(iGregTechTileEntity.isActive()); + } + } + return eHolders.size() == 1; + } + + @Override + public boolean checkRecipe_EM(ItemStack itemStack) { + tRecipe = null; + aRecipe = null; + if (!eHolders.isEmpty() && eHolders.get(0).mInventory[0] != null) { + holdItem = eHolders.get(0).mInventory[0].copy(); + if (ItemList.Tool_DataStick.isStackEqual(itemStack, false, true)) { + for (GT_Recipe.GT_Recipe_AssemblyLine assRecipe : TT_recipe.GT_Recipe_MapTT.sAssemblylineRecipes) { + if (GT_Utility.areStacksEqual(assRecipe.mResearchItem, holdItem, true)) { + tRecipe = assRecipe; + //if found + if (iterateRecipes()) return true; + } + } + } else if (ItemList.Tool_DataOrb.isStackEqual(itemStack, false, true)) { + for (TT_recipe.TT_assLineRecipe assRecipeTT : TT_recipe.TT_Recipe_Map.sMachineRecipes.recipeList()) { + if (GT_Utility.areStacksEqual(assRecipeTT.mResearchItem, holdItem, true)) { + aRecipe = assRecipeTT; + machineType = machine; + //if found + if (iterateRecipes()) return true; + } + } + for (TT_recipe.TT_assLineRecipe assRecipeTT : TT_recipe.TT_Recipe_Map.sCrafterRecipes.recipeList()) { + if (GT_Utility.areStacksEqual(assRecipeTT.mResearchItem, holdItem, true)) { + aRecipe = assRecipeTT; + machineType = crafter; + //if found + if (iterateRecipes()) return true; + } + } + } + } + holdItem = null; + computationRequired = computationRemaining = 0; + for (GT_MetaTileEntity_Hatch_Holder r : eHolders) { + r.getBaseMetaTileEntity().setActive(false); + } + return false; + } + @Override public void outputAfterRecipe_EM() { - if(!eHolders.isEmpty()) { - if (tRecipe != null && ItemList.Tool_DataStick.isStackEqual(mInventory[1], false, true)){ + if (!eHolders.isEmpty()) { + if (tRecipe != null && ItemList.Tool_DataStick.isStackEqual(mInventory[1], false, true)) { eHolders.get(0).getBaseMetaTileEntity().setActive(false); eHolders.get(0).mInventory[0] = null; if (lServerNames == null) { @@ -405,40 +322,74 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB } else { try { makeStick2(); - }catch (NoSuchFieldError e){ + } catch (NoSuchFieldError e) { makeStick(); } } - }else if (aRecipe != null && ItemList.Tool_DataOrb.isStackEqual(mInventory[1], false, true)) { + } else if (aRecipe != null && ItemList.Tool_DataOrb.isStackEqual(mInventory[1], false, true)) { eHolders.get(0).getBaseMetaTileEntity().setActive(false); eHolders.get(0).mInventory[0] = null; - mInventory[1].setStackDisplayName(GT_LanguageManager.getTranslation(aRecipe.mOutputs[0].getDisplayName()) + ' ' + machineType +" Construction Data"); + mInventory[1].setStackDisplayName(GT_LanguageManager.getTranslation(aRecipe.mOutputs[0].getDisplayName()) + ' ' + machineType + " Construction Data"); NBTTagCompound tNBT = mInventory[1].getTagCompound();//code above makes it not null tNBT.setString("eMachineType", machineType); - GameRegistry.UniqueIdentifier uid=GameRegistry.findUniqueIdentifierFor(aRecipe.mOutputs[0].getItem()); - tNBT.setString(E_RECIPE_ID, uid+":"+aRecipe.mOutputs[0].getItemDamage()); - tNBT.setString("author", EnumChatFormatting.BLUE + "Tec" + EnumChatFormatting.DARK_BLUE + "Tech" + EnumChatFormatting.WHITE + ' ' + machineType+ " Recipe Generator"); + GameRegistry.UniqueIdentifier uid = GameRegistry.findUniqueIdentifierFor(aRecipe.mOutputs[0].getItem()); + tNBT.setString(E_RECIPE_ID, uid + ":" + aRecipe.mOutputs[0].getItemDamage()); + tNBT.setString("author", EnumChatFormatting.BLUE + "Tec" + EnumChatFormatting.DARK_BLUE + "Tech" + EnumChatFormatting.WHITE + ' ' + machineType + " Recipe Generator"); } } - computationRequired=computationRemaining=0; - tRecipe=null; - aRecipe=null; - holdItem=null; + computationRequired = computationRemaining = 0; + tRecipe = null; + aRecipe = null; + holdItem = null; } @Override - protected void extraExplosions_EM() { - for (MetaTileEntity tTileEntity : eHolders) { - tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]); - } + public String[] getDescription() { + return new String[]{ + CommonValues.TEC_MARK_EM, + translateToLocal("gt.blockmachines.multimachine.em.research.desc.0"),//Philosophers didn't even... + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.em.research.desc.0")//dream about it! + }; } - //@Override - //public boolean isFacingValid(byte aFacing) { - // return aFacing >= 2; - //} + @Override + public String[] getInfoData() { + long storedEnergy = 0; + long maxEnergy = 0; + for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); + maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); + } + } + for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : eEnergyMulti) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); + maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); + } + } + + return new String[]{ + translateToLocalFormatted("tt.keyphrase.Energy_Hatches", clientLocale) + ":", + EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET + " EU / " + + EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU", + (mEUt <= 0 ? translateToLocalFormatted("tt.keyphrase.Probably_uses", clientLocale) + ": " : translateToLocalFormatted("tt.keyphrase.Probably_makes", clientLocale) + ": ") + + EnumChatFormatting.RED + Math.abs(mEUt) + EnumChatFormatting.RESET + " EU/t " + translateToLocalFormatted("tt.keyword.at", clientLocale) + " " + + EnumChatFormatting.RED + eAmpereFlow + EnumChatFormatting.RESET + " A", + translateToLocalFormatted("tt.keyphrase.Tier_Rating", clientLocale) + ": " + EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier_EM()] + EnumChatFormatting.RESET + " / " + EnumChatFormatting.GREEN + VN[getMinEnergyInputTier_EM()] + EnumChatFormatting.RESET + + " " + translateToLocalFormatted("tt.keyphrase.Amp_Rating", clientLocale) + ": " + EnumChatFormatting.GREEN + eMaxAmpereFlow + EnumChatFormatting.RESET + " A", + translateToLocalFormatted("tt.keyword.Problems", clientLocale) + ": " + EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + + " " + translateToLocalFormatted("tt.keyword.Efficiency", clientLocale) + ": " + EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", + translateToLocalFormatted("tt.keyword.PowerPass", clientLocale) + ": " + EnumChatFormatting.BLUE + ePowerPass + EnumChatFormatting.RESET + + " " + translateToLocalFormatted("tt.keyword.SafeVoid", clientLocale) + ": " + EnumChatFormatting.BLUE + eSafeVoid, + translateToLocalFormatted("tt.keyphrase.Computation_Available", clientLocale) + ": " + EnumChatFormatting.GREEN + eAvailableData + EnumChatFormatting.RESET + " / " + EnumChatFormatting.YELLOW + eRequiredData + EnumChatFormatting.RESET, + translateToLocalFormatted("tt.keyphrase.Computation_Remaining", clientLocale) + ":", + EnumChatFormatting.GREEN + Long.toString(computationRemaining / 20L) + EnumChatFormatting.RESET + " / " + + EnumChatFormatting.YELLOW + computationRequired / 20L + }; + } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { @@ -449,16 +400,6 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB } @Override - public String[] getDescription() { - return new String[]{ - CommonValues.TEC_MARK_EM, - "Philosophers didn't even...", - EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "dream about it!" - }; - } - - - @Override public void onRemoval() { super.onRemoval(); for (GT_MetaTileEntity_Hatch_Holder r : eHolders) { @@ -467,18 +408,112 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB } @Override + protected void extraExplosions_EM() { + for (MetaTileEntity tTileEntity : eHolders) { + tTileEntity.getBaseMetaTileEntity().doExplosion(V[9]); + } + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setLong("eComputationRemaining", computationRemaining); + aNBT.setLong("eComputationRequired", computationRequired); + if (holdItem != null) { + aNBT.setTag("eHold", holdItem.writeToNBT(new NBTTagCompound())); + } else { + aNBT.removeTag("eHold"); + } + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + computationRemaining = aNBT.getLong("eComputationRemaining"); + computationRequired = aNBT.getLong("eComputationRequired"); + if (aNBT.hasKey("eHold")) { + holdItem = ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("eHold")); + } else { + holdItem = null; + } + } + + @Override public void stopMachine() { super.stopMachine(); for (GT_MetaTileEntity_Hatch_Holder r : eHolders) { r.getBaseMetaTileEntity().setActive(false); } - computationRequired=computationRemaining=0; - tRecipe=null; - aRecipe=null; - holdItem=null; + computationRequired = computationRemaining = 0; + tRecipe = null; + aRecipe = null; + holdItem = null; + } + + //@Override + //public boolean isFacingValid(byte aFacing) { + // return aFacing >= 2; + //} + + @Override + public void onFirstTick_EM(IGregTechTileEntity aBaseMetaTileEntity) { + if (aBaseMetaTileEntity.isServerSide()) { + if (computationRemaining > 0) { + aRecipe = null; + tRecipe = null; + if (holdItem != null) { + if (ItemList.Tool_DataStick.isStackEqual(mInventory[1], false, true)) { + for (GT_Recipe.GT_Recipe_AssemblyLine tRecipe : TT_recipe.GT_Recipe_MapTT.sAssemblylineRecipes) { + if (GT_Utility.areStacksEqual(tRecipe.mResearchItem, holdItem, true)) { + this.tRecipe = tRecipe; + break; + } + } + } else if (ItemList.Tool_DataOrb.isStackEqual(mInventory[1], false, true)) { + for (TT_recipe.TT_assLineRecipe assRecipeTT : TT_recipe.TT_Recipe_Map.sMachineRecipes.recipeList()) { + if (GT_Utility.areStacksEqual(assRecipeTT.mResearchItem, holdItem, true)) { + aRecipe = assRecipeTT; + machineType = machine; + break; + } + } + if (aRecipe == null) { + for (TT_recipe.TT_assLineRecipe assRecipeTT : TT_recipe.TT_Recipe_Map.sCrafterRecipes.recipeList()) { + if (GT_Utility.areStacksEqual(assRecipeTT.mResearchItem, holdItem, true)) { + aRecipe = assRecipeTT; + machineType = crafter; + break; + } + } + } + } + } + if (tRecipe == null && aRecipe == null) { + holdItem = null; + computationRequired = computationRemaining = 0; + mMaxProgresstime = 0; + mEfficiencyIncrease = 0; + for (GT_MetaTileEntity_Hatch_Holder r : eHolders) { + r.getBaseMetaTileEntity().setActive(false); + } + } + } + } + } + + @Override + public boolean onRunningTick(ItemStack aStack) { + if (computationRemaining <= 0) { + computationRemaining = 0; + mProgresstime = mMaxProgresstime; + return true; + } else { + computationRemaining -= eAvailableData; + mProgresstime = 1; + return super.onRunningTick(aStack); + } } - //NEW METHOD public final boolean addHolderToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (aTileEntity == null) { return false; @@ -495,44 +530,35 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB } @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + super.onRightclick(aBaseMetaTileEntity, aPlayer); + + if (!aBaseMetaTileEntity.isClientSide() && aPlayer instanceof EntityPlayerMP) { + try { + EntityPlayerMP player = (EntityPlayerMP) aPlayer; + clientLocale = (String) FieldUtils.readField(player, "translator", true); + } catch (Exception e) { + clientLocale = "en_US"; + } + } else { + return true; + } + System.out.println(clientLocale); + return true; + } + + @Override public int getInventoryStackLimit() { return 1; } @Override - public String[] getInfoData() { - long storedEnergy = 0; - long maxEnergy = 0; - for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); - maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); - } - } - for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : eEnergyMulti) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); - maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); - } - } + public void construct(int stackSize, boolean hintsOnly) { + StructureBuilderExtreme(shape, blockType, blockMeta, 1, 3, 4, getBaseMetaTileEntity(), this, hintsOnly); + } - return new String[]{ - "Energy Hatches:", - EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET + " EU / " + - EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU", - (mEUt <= 0 ? "Probably uses: " : "Probably makes: ") + - EnumChatFormatting.RED + Math.abs(mEUt) + EnumChatFormatting.RESET + " EU/t at " + - EnumChatFormatting.RED + eAmpereFlow + EnumChatFormatting.RESET + " A", - "Tier Rating: " + EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier_EM()] + EnumChatFormatting.RESET + " / " + EnumChatFormatting.GREEN + VN[getMinEnergyInputTier_EM()] + EnumChatFormatting.RESET + - " Amp Rating: " + EnumChatFormatting.GREEN + eMaxAmpereFlow + EnumChatFormatting.RESET + " A", - "Problems: " + EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + - " Efficiency: " + EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", - "PowerPass: " + EnumChatFormatting.BLUE + ePowerPass + EnumChatFormatting.RESET + - " SafeVoid: " + EnumChatFormatting.BLUE + eSafeVoid, - "Computation Available: " + EnumChatFormatting.GREEN + eAvailableData + EnumChatFormatting.RESET, - "Computation Remaining:", - EnumChatFormatting.GREEN + Long.toString(computationRemaining / 20L) + EnumChatFormatting.RESET + " / " + - EnumChatFormatting.YELLOW + computationRequired / 20L - }; + @Override + public String[] getStructureDescription(int stackSize) { + return description; } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java index 96132a889e..6170bd081f 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_scanner.java @@ -13,12 +13,7 @@ import com.github.technus.tectech.thing.block.QuantumStuffBlock; import com.github.technus.tectech.thing.item.ElementalDefinitionScanStorage_EM; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.INameFunction; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IStatusFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.*; import gregtech.api.enums.ItemList; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -28,11 +23,14 @@ import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Recipe; import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.common.util.ForgeDirection; +import org.apache.commons.lang3.reflect.FieldUtils; import static com.github.technus.tectech.CommonValues.V; import static com.github.technus.tectech.CommonValues.VN; @@ -45,39 +43,27 @@ import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texture import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; import static com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_crafting.crafter; import static com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.GT_MetaTileEntity_EM_machine.machine; +import static net.minecraft.util.StatCollector.translateToLocal; +import static net.minecraft.util.StatCollector.translateToLocalFormatted; /** * Created by danie_000 on 17.12.2016. */ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { - public static final int SCAN_DO_NOTHING=0, - SCAN_GET_NOMENCLATURE=1,SCAN_GET_DEPTH_LEVEL=2,SCAN_GET_AMOUNT=4,SCAN_GET_CHARGE=8, - SCAN_GET_MASS=16,SCAN_GET_ENERGY_LEVEL=32,SCAN_GET_TIMESPAN_INFO=64,SCAN_GET_ENERGY_STATES=128, - SCAN_GET_COLOR=256,SCAN_GET_AGE=512,SCAN_GET_TIMESPAN_MULT=1024,SCAN_GET_CLASS_TYPE=2048; + //region variables + public static final int SCAN_DO_NOTHING = 0, + SCAN_GET_NOMENCLATURE = 1, SCAN_GET_DEPTH_LEVEL = 2, SCAN_GET_AMOUNT = 4, SCAN_GET_CHARGE = 8, + SCAN_GET_MASS = 16, SCAN_GET_ENERGY_LEVEL = 32, SCAN_GET_TIMESPAN_INFO = 64, SCAN_GET_ENERGY_STATES = 128, + SCAN_GET_COLOR = 256, SCAN_GET_AGE = 512, SCAN_GET_TIMESPAN_MULT = 1024, SCAN_GET_CLASS_TYPE = 2048; private TT_recipe.TT_EMRecipe.TT_EMRecipe eRecipe; private cElementalDefinitionStack objectResearched; private cElementalInstanceStackMap objectsScanned; private String machineType; - private long totalComputationRemaining, totalComputationRequired; + private long computationRemaining, computationRequired; private int[] scanComplexity; - //region parameters - private static final INameFunction<GT_MetaTileEntity_EM_scanner> CONFIG_NAME= - (base,p)->"Config at Depth: "+(p.hatchId()*2+p.parameterId()); - private static final IStatusFunction<GT_MetaTileEntity_EM_scanner> CONFIG_STATUS= - (base,p)->{ - double v=p.get(); - if(Double.isNaN(v)){ - return LedStatus.STATUS_WRONG; - } - v=(int)v; - if(v==0) return LedStatus.STATUS_NEUTRAL; - if(v>=SCAN_GET_CLASS_TYPE) return LedStatus.STATUS_TOO_HIGH; - if(v<0) return LedStatus.STATUS_TOO_LOW; - return LedStatus.STATUS_OK; - }; - protected Parameters.Group.ParameterIn[] scanConfiguration; + private String clientLocale = "en_US"; //endregion //region structure @@ -102,178 +88,154 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4, 4, 4}; private static final String[] description = new String[]{ - EnumChatFormatting.AQUA+"Hint Details:", - "1 - Classic Hatches or High Power Casing", - "2 - Elemental Input Hatches or Molecular Casing", - "3 - Elemental Output Hatches or Molecular Casing", - "4 - Elemental Overflow Hatches or Molecular Casing", + EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", + translateToLocal("gt.blockmachines.multimachine.em.scanner.hint.0"),//1 - Classic Hatches or High Power Casing + translateToLocal("gt.blockmachines.multimachine.em.scanner.hint.1"),//2 - Elemental Input Hatches or Molecular Casing + translateToLocal("gt.blockmachines.multimachine.em.scanner.hint.2"),//3 - Elemental Output Hatches or Molecular Casing + translateToLocal("gt.blockmachines.multimachine.em.scanner.hint.3"),//4 - Elemental Overflow Hatches or Molecular Casing }; //endregion + //region parameters + private static final INameFunction<GT_MetaTileEntity_EM_scanner> CONFIG_NAME = + (base, p) -> "Config at Depth: " + (p.hatchId() * 2 + p.parameterId()); + private static final IStatusFunction<GT_MetaTileEntity_EM_scanner> CONFIG_STATUS = + (base, p) -> { + double v = p.get(); + if (Double.isNaN(v)) { + return LedStatus.STATUS_WRONG; + } + v = (int) v; + if (v == 0) return LedStatus.STATUS_NEUTRAL; + if (v >= SCAN_GET_CLASS_TYPE) return LedStatus.STATUS_TOO_HIGH; + if (v < 0) return LedStatus.STATUS_TOO_LOW; + return LedStatus.STATUS_OK; + }; + protected Parameters.Group.ParameterIn[] scanConfiguration; + //endregion + public GT_MetaTileEntity_EM_scanner(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); - eDismantleBoom=true; + eDismantleBoom = true; } public GT_MetaTileEntity_EM_scanner(String aName) { super(aName); - eDismantleBoom=true; + eDismantleBoom = true; } - @Override - protected void parametersInstantiation_EM() { - scanConfiguration=new Parameters.Group.ParameterIn[20]; - for (int i = 0; i < 10; i++) { - Parameters.Group hatch = parametrization.getGroup(i); - scanConfiguration[i*2] = hatch.makeInParameter(0, 0, CONFIG_NAME, CONFIG_STATUS); - scanConfiguration[i*2+1] = hatch.makeInParameter(1, 0, CONFIG_NAME, CONFIG_STATUS); + private void quantumStuff(boolean shouldExist) { + IGregTechTileEntity base = getBaseMetaTileEntity(); + if (base != null && base.getWorld() != null) { + int xDir = ForgeDirection.getOrientation(base.getBackFacing()).offsetX * 4 + base.getXCoord(); + int yDir = ForgeDirection.getOrientation(base.getBackFacing()).offsetY * 4 + base.getYCoord(); + int zDir = ForgeDirection.getOrientation(base.getBackFacing()).offsetZ * 4 + base.getZCoord(); + Block block = base.getWorld().getBlock(xDir, yDir, zDir); + if (shouldExist) { + if (block != null && block.getMaterial() == Material.air) { + base.getWorld().setBlock(xDir, yDir, zDir, QuantumStuffBlock.INSTANCE, 0, 2); + } + } else { + if (block instanceof QuantumStuffBlock) { + base.getWorld().setBlock(xDir, yDir, zDir, Blocks.air, 0, 2); + } + } } } - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_EM_scanner(mName); - } + private void addComputationRequirements(int depthPlus, int capabilities) { + if (areBitsSet(SCAN_GET_NOMENCLATURE, capabilities)) { + computationRequired += depthPlus * 5L; + eRequiredData += depthPlus; + } + if (areBitsSet(SCAN_GET_DEPTH_LEVEL, capabilities)) { + computationRequired += depthPlus * 10L; + eRequiredData += depthPlus; - @Override - public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - if (!structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0)) { - return false; } - return eInputHatches.size() == 1 && eOutputHatches.size() == 1 && eOutputHatches.get(0).getBaseMetaTileEntity().getFrontFacing() == iGregTechTileEntity.getFrontFacing(); - } + if (areBitsSet(SCAN_GET_AMOUNT, capabilities)) { + computationRequired += depthPlus * 64L; + eRequiredData += depthPlus * 8L; - @Override - public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),this,hintsOnly); - } + } + if (areBitsSet(SCAN_GET_CHARGE, capabilities)) { + computationRequired += depthPlus * 128L; + eRequiredData += depthPlus * 4L; - @Override - public String[] getStructureDescription(int stackSize) { - return description; - } + } + if (areBitsSet(SCAN_GET_MASS, capabilities)) { + computationRequired += depthPlus * 256L; + eRequiredData += depthPlus * 4L; - @Override - public String[] getDescription() { - return new String[]{ - CommonValues.TEC_MARK_EM, - "What is existing here?", - EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "I HAVE NO IDEA (yet)!" - }; - } + } + if (areBitsSet(SCAN_GET_ENERGY_LEVEL, capabilities)) { + computationRequired += depthPlus * 512L; + eRequiredData += depthPlus * 16L; - @Override - public void saveNBTData(NBTTagCompound aNBT) { - super.saveNBTData(aNBT); - aNBT.setLong("eComputationRemaining", totalComputationRemaining); - aNBT.setLong("eComputationRequired", totalComputationRequired); - if(objectResearched!=null) { - aNBT.setTag("eObject", objectResearched.toNBT()); - } else { - aNBT.removeTag("eObject"); } - if(scanComplexity!=null) { - aNBT.setIntArray("eScanComplexity", scanComplexity); - } else { - aNBT.removeTag("eScanComplexity"); + if (areBitsSet(SCAN_GET_TIMESPAN_INFO, capabilities)) { + computationRequired += depthPlus * 1024L; + eRequiredData += depthPlus * 32L; + } - if(objectsScanned!=null) { - aNBT.setTag("eScanObjects", objectsScanned.toNBT()); - } else { - aNBT.removeTag("eScanObjects"); + if (areBitsSet(SCAN_GET_ENERGY_STATES, capabilities)) { + computationRequired += depthPlus * 2048L; + eRequiredData += depthPlus * 32L; + } - } + if (areBitsSet(SCAN_GET_COLOR, capabilities)) { + computationRequired += depthPlus * 1024L; + eRequiredData += depthPlus * 48L; - @Override - public void loadNBTData(NBTTagCompound aNBT) { - super.loadNBTData(aNBT); - totalComputationRemaining =aNBT.getLong("eComputationRemaining"); - totalComputationRequired =aNBT.getLong("eComputationRequired"); - if(aNBT.hasKey("eObject")) { - objectResearched = cElementalDefinitionStack.fromNBT(aNBT.getCompoundTag("eObject")); - if(objectResearched.definition==nbtE__) { - objectResearched = null; - } - }else { - objectResearched = null; } - if(aNBT.hasKey("eScanComplexity")) { - scanComplexity = aNBT.getIntArray("eScanComplexity"); - } else { - scanComplexity = null; + if (areBitsSet(SCAN_GET_AGE, capabilities)) { + computationRequired += depthPlus * 2048L; + eRequiredData += depthPlus * 64L; + } - try { - if (aNBT.hasKey("eScanObjects")) { - objectsScanned = cElementalInstanceStackMap.fromNBT(aNBT.getCompoundTag("eScanObjects")); - } - }catch (tElementalException e){ - objectsScanned=new cElementalInstanceStackMap(); + if (areBitsSet(SCAN_GET_TIMESPAN_MULT, capabilities)) { + computationRequired += depthPlus * 2048L; + eRequiredData += depthPlus * 64L; + } } @Override - public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if(aBaseMetaTileEntity.isActive() && (aTick & 0x2)==0 && aBaseMetaTileEntity.isClientSide()){ - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX*4+aBaseMetaTileEntity.getXCoord(); - int yDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetY*4+aBaseMetaTileEntity.getYCoord(); - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ*4+aBaseMetaTileEntity.getZCoord(); - aBaseMetaTileEntity.getWorld().markBlockRangeForRenderUpdate(xDir,yDir,zDir,xDir,yDir,zDir); - } + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_EM_scanner(mName); } @Override - public void onFirstTick_EM(IGregTechTileEntity aBaseMetaTileEntity) { - if(aBaseMetaTileEntity.isServerSide()) { - if (totalComputationRemaining > 0 && objectResearched!=null) { - eRecipe = null; - if (ItemList.Tool_DataOrb.isStackEqual(mInventory[1], false, true)) { - eRecipe = TT_recipe.TT_Recipe_Map_EM.sMachineRecipesEM.findRecipe(objectResearched.definition); - if (eRecipe != null) { - machineType = machine; - } else { - eRecipe = TT_recipe.TT_Recipe_Map_EM.sCrafterRecipesEM.findRecipe(objectResearched.definition); - if (eRecipe != null) { - machineType = crafter; - } - } - } - if (eRecipe == null) { - quantumStuff(false); - objectResearched = null; - eRequiredData=0; - totalComputationRequired = totalComputationRemaining = 0; - mMaxProgresstime = 0; - mEfficiencyIncrease = 0; - } else { - quantumStuff(true); - } - } + public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + if (!structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0)) { + return false; } + return eInputHatches.size() == 1 && eOutputHatches.size() == 1 && eOutputHatches.get(0).getBaseMetaTileEntity().getFrontFacing() == iGregTechTileEntity.getFrontFacing(); } @Override public boolean checkRecipe_EM(ItemStack itemStack) { - eRecipe=null; - if(!eInputHatches.isEmpty() && eInputHatches.get(0).getContainerHandler().hasStacks() && !eOutputHatches.isEmpty()) { + eRecipe = null; + if (!eInputHatches.isEmpty() && eInputHatches.get(0).getContainerHandler().hasStacks() && !eOutputHatches.isEmpty()) { cElementalInstanceStackMap researchEM = eInputHatches.get(0).getContainerHandler(); - if(ItemList.Tool_DataOrb.isStackEqual(itemStack, false, true)) { - GT_Recipe scannerRecipe=null; - for(cElementalInstanceStack stackEM:researchEM.values()){ - objectsScanned=null; + if (ItemList.Tool_DataOrb.isStackEqual(itemStack, false, true)) { + GT_Recipe scannerRecipe = null; + for (cElementalInstanceStack stackEM : researchEM.values()) { + objectsScanned = null; eRecipe = TT_recipe.TT_Recipe_Map_EM.sMachineRecipesEM.findRecipe(stackEM.definition); - if(eRecipe!=null) { - scannerRecipe=eRecipe.scannerRecipe; - machineType= machine; - objectResearched=new cElementalDefinitionStack(stackEM.definition,1); + if (eRecipe != null) { + scannerRecipe = eRecipe.scannerRecipe; + machineType = machine; + objectResearched = new cElementalDefinitionStack(stackEM.definition, 1); //cleanMassEM_EM(objectResearched.getMass()); researchEM.remove(objectResearched.definition); break; } eRecipe = TT_recipe.TT_Recipe_Map_EM.sCrafterRecipesEM.findRecipe(stackEM.definition); - if(eRecipe!=null) { - scannerRecipe=eRecipe.scannerRecipe; - machineType= crafter; - objectResearched=new cElementalDefinitionStack(stackEM.definition,1); + if (eRecipe != null) { + scannerRecipe = eRecipe.scannerRecipe; + machineType = crafter; + objectResearched = new cElementalDefinitionStack(stackEM.definition, 1); //cleanMassEM_EM(objectResearched.getMass()); researchEM.remove(objectResearched.definition); break; @@ -281,8 +243,8 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa cleanStackEM_EM(stackEM); researchEM.remove(stackEM.definition); } - if(eRecipe!=null && scannerRecipe!=null){//todo make sure it werks - totalComputationRequired = totalComputationRemaining = scannerRecipe.mDuration * 20L; + if (eRecipe != null && scannerRecipe != null) {//todo make sure it werks + computationRequired = computationRemaining = scannerRecipe.mDuration * 20L; mMaxProgresstime = 20;//const mEfficiencyIncrease = 10000; eRequiredData = (short) (scannerRecipe.mSpecialValue >>> 16); @@ -291,39 +253,39 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa quantumStuff(true); return true; } - }else if(CustomItemList.scanContainer.isStackEqual(itemStack, false, true)) { - eRecipe=null; - if(researchEM.hasStacks()) { + } else if (CustomItemList.scanContainer.isStackEqual(itemStack, false, true)) { + eRecipe = null; + if (researchEM.hasStacks()) { objectsScanned = researchEM.takeAllToNewMap(); cleanMassEM_EM(objectsScanned.getMass()); - totalComputationRequired =0; - eRequiredData=0; - eAmpereFlow=objectsScanned.size() + TecTech.RANDOM.next(objectsScanned.size()); - mEUt=-(int)V[8]; + computationRequired = 0; + eRequiredData = 0; + eAmpereFlow = objectsScanned.size() + TecTech.RANDOM.next(objectsScanned.size()); + mEUt = -(int) V[8]; //get depth scan complexity array { int[] scanComplexityTemp = new int[20]; for (int i = 0; i < 20; i++) { - scanComplexityTemp[i]=(int)scanConfiguration[i].get(); + scanComplexityTemp[i] = (int) scanConfiguration[i].get(); } int maxDepth = 0; for (int i = 0; i < 20; i++) { if (scanComplexityTemp[i] != SCAN_DO_NOTHING) { maxDepth = i; - if(!DEBUG_MODE) { + if (!DEBUG_MODE) { scanComplexityTemp[i] &= ~SCAN_GET_CLASS_TYPE; } - addComputationRequirements(i+1,scanComplexityTemp[i]); + addComputationRequirements(i + 1, scanComplexityTemp[i]); } } - maxDepth+=1;//from index to len + maxDepth += 1;//from index to len scanComplexity = new int[maxDepth]; - System.arraycopy(scanComplexityTemp,0,scanComplexity,0,maxDepth); + System.arraycopy(scanComplexityTemp, 0, scanComplexity, 0, maxDepth); } - totalComputationRemaining = totalComputationRequired*=20; + computationRemaining = computationRequired *= 20; mMaxProgresstime = 20;//const mEfficiencyIncrease = 10000; quantumStuff(true); @@ -332,102 +294,36 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa } } quantumStuff(false); - objectResearched=null; - totalComputationRemaining =0; + objectResearched = null; + computationRemaining = 0; return false; } - private void addComputationRequirements(int depthPlus, int capabilities){ - if(areBitsSet(SCAN_GET_NOMENCLATURE,capabilities)){ - totalComputationRequired +=depthPlus*5L; - eRequiredData+=depthPlus; - } - if(areBitsSet(SCAN_GET_DEPTH_LEVEL,capabilities)){ - totalComputationRequired +=depthPlus*10L; - eRequiredData+=depthPlus; - - } - if(areBitsSet(SCAN_GET_AMOUNT,capabilities)){ - totalComputationRequired +=depthPlus*64L; - eRequiredData+=depthPlus*8L; - - } - if(areBitsSet(SCAN_GET_CHARGE,capabilities)){ - totalComputationRequired +=depthPlus*128L; - eRequiredData+=depthPlus*4L; - - } - if(areBitsSet(SCAN_GET_MASS,capabilities)){ - totalComputationRequired +=depthPlus*256L; - eRequiredData+=depthPlus*4L; - - } - if(areBitsSet(SCAN_GET_ENERGY_LEVEL,capabilities)){ - totalComputationRequired +=depthPlus*512L; - eRequiredData+=depthPlus*16L; - - } - if(areBitsSet(SCAN_GET_TIMESPAN_INFO,capabilities)){ - totalComputationRequired +=depthPlus*1024L; - eRequiredData+=depthPlus*32L; - - } - if(areBitsSet(SCAN_GET_ENERGY_STATES,capabilities)){ - totalComputationRequired +=depthPlus*2048L; - eRequiredData+=depthPlus*32L; - - } - if(areBitsSet(SCAN_GET_COLOR,capabilities)){ - totalComputationRequired +=depthPlus*1024L; - eRequiredData+=depthPlus*48L; - - } - if(areBitsSet(SCAN_GET_AGE,capabilities)){ - totalComputationRequired +=depthPlus*2048L; - eRequiredData+=depthPlus*64L; - - } - if(areBitsSet(SCAN_GET_TIMESPAN_MULT,capabilities)){ - totalComputationRequired +=depthPlus*2048L; - eRequiredData+=depthPlus*64L; - - } - } - - @Override - public boolean onRunningTick(ItemStack aStack) { - if(totalComputationRemaining <=0) { - totalComputationRemaining =0; - mProgresstime=mMaxProgresstime; - return true; - }else{ - totalComputationRemaining -=eAvailableData; - mProgresstime=1; - return super.onRunningTick(aStack); - } - } - @Override public void outputAfterRecipe_EM() { - if (eRecipe != null && ItemList.Tool_DataOrb.isStackEqual(mInventory[1], false, true)){ + if (eRecipe != null && ItemList.Tool_DataOrb.isStackEqual(mInventory[1], false, true)) { - mInventory[1].setStackDisplayName(GT_LanguageManager.getTranslation(eRecipe.mOutputs[0].getDisplayName()) + ' ' + machineType +" Construction Data"); + mInventory[1].setStackDisplayName(GT_LanguageManager.getTranslation(eRecipe.mOutputs[0].getDisplayName()) + ' ' + machineType + " Construction Data"); NBTTagCompound tNBT = mInventory[1].getTagCompound();//code above makes it not null tNBT.setString("eMachineType", machineType); tNBT.setTag(E_RECIPE_ID, objectResearched.toNBT()); - tNBT.setString("author", EnumChatFormatting.BLUE + "Tec" + EnumChatFormatting.DARK_BLUE + "Tech" + EnumChatFormatting.WHITE + ' ' + machineType+ " EM Recipe Generator"); - }else if(objectsScanned!=null && CustomItemList.scanContainer.isStackEqual(mInventory[1], false, true)){ - ElementalDefinitionScanStorage_EM.setContent(mInventory[1],objectsScanned,scanComplexity); + tNBT.setString("author", EnumChatFormatting.BLUE + "Tec" + EnumChatFormatting.DARK_BLUE + "Tech" + EnumChatFormatting.WHITE + ' ' + machineType + " EM Recipe Generator"); + } else if (objectsScanned != null && CustomItemList.scanContainer.isStackEqual(mInventory[1], false, true)) { + ElementalDefinitionScanStorage_EM.setContent(mInventory[1], objectsScanned, scanComplexity); } - objectResearched=null; - totalComputationRemaining =0; + objectResearched = null; + computationRemaining = 0; quantumStuff(false); } @Override - public int getInventoryStackLimit() { - return 1; + public String[] getDescription() { + return new String[]{ + CommonValues.TEC_MARK_EM, + translateToLocal("gt.blockmachines.multimachine.em.scanner.desc.0"),//What is existing here? + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.em.scanner.desc.1")//I HAVE NO IDEA (yet)! + }; } @Override @@ -448,22 +344,22 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa } return new String[]{ - "Energy Hatches:", + translateToLocalFormatted("tt.keyphrase.Energy_Hatches", clientLocale) + ":", EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU", - (mEUt <= 0 ? "Probably uses: " : "Probably makes: ") + - EnumChatFormatting.RED + Math.abs(mEUt) + EnumChatFormatting.RESET + " EU/t at " + + (mEUt <= 0 ? translateToLocalFormatted("tt.keyphrase.Probably_uses", clientLocale) + ": " : translateToLocalFormatted("tt.keyphrase.Probably_makes", clientLocale) + ": ") + + EnumChatFormatting.RED + Math.abs(mEUt) + EnumChatFormatting.RESET + " EU/t " + translateToLocalFormatted("tt.keyword.at", clientLocale) + " " + EnumChatFormatting.RED + eAmpereFlow + EnumChatFormatting.RESET + " A", - "Tier Rating: " + EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier_EM()] + EnumChatFormatting.RESET + " / " + EnumChatFormatting.GREEN + VN[getMinEnergyInputTier_EM()] + EnumChatFormatting.RESET + - " Amp Rating: " + EnumChatFormatting.GREEN + eMaxAmpereFlow + EnumChatFormatting.RESET + " A", - "Problems: " + EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + - " Efficiency: " + EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", - "PowerPass: " + EnumChatFormatting.BLUE + ePowerPass + EnumChatFormatting.RESET + - " SafeVoid: " + EnumChatFormatting.BLUE + eSafeVoid, - "Computation Available: " + EnumChatFormatting.GREEN + eAvailableData +EnumChatFormatting.RESET+" / "+EnumChatFormatting.YELLOW + eRequiredData + EnumChatFormatting.RESET, - "Computation Remaining:", - EnumChatFormatting.GREEN + Long.toString(totalComputationRemaining / 20L) + EnumChatFormatting.RESET + " / " + - EnumChatFormatting.YELLOW + totalComputationRequired / 20L + translateToLocalFormatted("tt.keyphrase.Tier_Rating", clientLocale) + ": " + EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier_EM()] + EnumChatFormatting.RESET + " / " + EnumChatFormatting.GREEN + VN[getMinEnergyInputTier_EM()] + EnumChatFormatting.RESET + + " " + translateToLocalFormatted("tt.keyphrase.Amp_Rating", clientLocale) + ": " + EnumChatFormatting.GREEN + eMaxAmpereFlow + EnumChatFormatting.RESET + " A", + translateToLocalFormatted("tt.keyword.Problems", clientLocale) + ": " + EnumChatFormatting.RED + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + + " " + translateToLocalFormatted("tt.keyword.Efficiency", clientLocale) + ": " + EnumChatFormatting.YELLOW + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", + translateToLocalFormatted("tt.keyword.PowerPass", clientLocale) + ": " + EnumChatFormatting.BLUE + ePowerPass + EnumChatFormatting.RESET + + " " + translateToLocalFormatted("tt.keyword.SafeVoid", clientLocale) + ": " + EnumChatFormatting.BLUE + eSafeVoid, + translateToLocalFormatted("tt.keyphrase.Computation_Available", clientLocale) + ": " + EnumChatFormatting.GREEN + eAvailableData + EnumChatFormatting.RESET + " / " + EnumChatFormatting.YELLOW + eRequiredData + EnumChatFormatting.RESET, + translateToLocalFormatted("tt.keyphrase.Computation_Remaining", clientLocale) + ":", + EnumChatFormatting.GREEN + Long.toString(computationRemaining / 20L) + EnumChatFormatting.RESET + " / " + + EnumChatFormatting.YELLOW + computationRequired / 20L }; } @@ -474,30 +370,156 @@ public class GT_MetaTileEntity_EM_scanner extends GT_MetaTileEntity_MultiblockBa } @Override + protected void parametersInstantiation_EM() { + scanConfiguration = new Parameters.Group.ParameterIn[20]; + for (int i = 0; i < 10; i++) { + Parameters.Group hatch = parametrization.getGroup(i); + scanConfiguration[i * 2] = hatch.makeInParameter(0, 0, CONFIG_NAME, CONFIG_STATUS); + scanConfiguration[i * 2 + 1] = hatch.makeInParameter(1, 0, CONFIG_NAME, CONFIG_STATUS); + } + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setLong("eComputationRemaining", computationRemaining); + aNBT.setLong("eComputationRequired", computationRequired); + if (objectResearched != null) { + aNBT.setTag("eObject", objectResearched.toNBT()); + } else { + aNBT.removeTag("eObject"); + } + if (scanComplexity != null) { + aNBT.setIntArray("eScanComplexity", scanComplexity); + } else { + aNBT.removeTag("eScanComplexity"); + } + if (objectsScanned != null) { + aNBT.setTag("eScanObjects", objectsScanned.toNBT()); + } else { + aNBT.removeTag("eScanObjects"); + } + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + computationRemaining = aNBT.getLong("eComputationRemaining"); + computationRequired = aNBT.getLong("eComputationRequired"); + if (aNBT.hasKey("eObject")) { + objectResearched = cElementalDefinitionStack.fromNBT(aNBT.getCompoundTag("eObject")); + if (objectResearched.definition == nbtE__) { + objectResearched = null; + } + } else { + objectResearched = null; + } + if (aNBT.hasKey("eScanComplexity")) { + scanComplexity = aNBT.getIntArray("eScanComplexity"); + } else { + scanComplexity = null; + } + try { + if (aNBT.hasKey("eScanObjects")) { + objectsScanned = cElementalInstanceStackMap.fromNBT(aNBT.getCompoundTag("eScanObjects")); + } + } catch (tElementalException e) { + objectsScanned = new cElementalInstanceStackMap(); + } + } + + @Override public void stopMachine() { quantumStuff(false); super.stopMachine(); - totalComputationRequired = totalComputationRemaining =0; - objectResearched=null; + computationRequired = computationRemaining = 0; + objectResearched = null; } - private void quantumStuff(boolean shouldExist){ - IGregTechTileEntity base=getBaseMetaTileEntity(); - if(base!=null && base.getWorld()!=null) { - int xDir = ForgeDirection.getOrientation(base.getBackFacing()).offsetX * 4+base.getXCoord(); - int yDir = ForgeDirection.getOrientation(base.getBackFacing()).offsetY * 4+base.getYCoord(); - int zDir = ForgeDirection.getOrientation(base.getBackFacing()).offsetZ * 4+base.getZCoord(); - Block block = base.getWorld().getBlock(xDir, yDir, zDir); - if (shouldExist) { - if(block != null && block.getMaterial()== Material.air) { - base.getWorld().setBlock(xDir, yDir, zDir, QuantumStuffBlock.INSTANCE, 0, 2); + @Override + public void onFirstTick_EM(IGregTechTileEntity aBaseMetaTileEntity) { + if (aBaseMetaTileEntity.isServerSide()) { + if (computationRemaining > 0 && objectResearched != null) { + eRecipe = null; + if (ItemList.Tool_DataOrb.isStackEqual(mInventory[1], false, true)) { + eRecipe = TT_recipe.TT_Recipe_Map_EM.sMachineRecipesEM.findRecipe(objectResearched.definition); + if (eRecipe != null) { + machineType = machine; + } else { + eRecipe = TT_recipe.TT_Recipe_Map_EM.sCrafterRecipesEM.findRecipe(objectResearched.definition); + if (eRecipe != null) { + machineType = crafter; + } + } } - } else { - if (block instanceof QuantumStuffBlock) { - base.getWorld().setBlock(xDir, yDir, zDir, Blocks.air, 0, 2); + if (eRecipe == null) { + quantumStuff(false); + objectResearched = null; + eRequiredData = 0; + computationRequired = computationRemaining = 0; + mMaxProgresstime = 0; + mEfficiencyIncrease = 0; + } else { + quantumStuff(true); } } } } -} + + @Override + public boolean onRunningTick(ItemStack aStack) { + if (computationRemaining <= 0) { + computationRemaining = 0; + mProgresstime = mMaxProgresstime; + return true; + } else { + computationRemaining -= eAvailableData; + mProgresstime = 1; + return super.onRunningTick(aStack); + } + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + super.onRightclick(aBaseMetaTileEntity, aPlayer); + + if (!aBaseMetaTileEntity.isClientSide() && aPlayer instanceof EntityPlayerMP) { + try { + EntityPlayerMP player = (EntityPlayerMP) aPlayer; + clientLocale = (String) FieldUtils.readField(player, "translator", true); + } catch (Exception e) { + clientLocale = "en_US"; + } + } else { + return true; + } + System.out.println(clientLocale); + return true; + } + + @Override + public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isActive() && (aTick & 0x2) == 0 && aBaseMetaTileEntity.isClientSide()) { + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 4 + aBaseMetaTileEntity.getXCoord(); + int yDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetY * 4 + aBaseMetaTileEntity.getYCoord(); + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 4 + aBaseMetaTileEntity.getZCoord(); + aBaseMetaTileEntity.getWorld().markBlockRangeForRenderUpdate(xDir, yDir, zDir, xDir, yDir, zDir); + } + } + + @Override + public int getInventoryStackLimit() { + return 1; + } + + @Override + public void construct(int stackSize, boolean hintsOnly) { + StructureBuilderExtreme(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), this, hintsOnly); + } + + @Override + public String[] getStructureDescription(int stackSize) { + return description; + } +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java index 30794ca47e..b159827012 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java @@ -14,6 +14,7 @@ import net.minecraft.util.EnumChatFormatting; import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; +import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by danie_000 on 17.12.2016. @@ -21,22 +22,22 @@ import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBloc public class GT_MetaTileEntity_EM_stabilizer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { //region structure private static final String[][] shape = new String[][]{ - {"A010","0 0","1 . 1","0 0","A010",}, - {"23232","32223","22222","32223","23232",}, - {"12!21","22422","!444!","22422","12!21",}, - {"23232","32223","22222","32223","23232",}, - {"A010","0 0","1 1","0 0","A010",}, + {"A010", "0 0", "1 . 1", "0 0", "A010",}, + {"23232", "32223", "22222", "32223", "23232",}, + {"12!21", "22422", "!444!", "22422", "12!21",}, + {"23232", "32223", "22222", "32223", "23232",}, + {"A010", "0 0", "1 1", "0 0", "A010",}, }; - private static final Block[] blockType = new Block[]{sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT ,sBlockCasingsTT, sBlockCasingsTT}; + private static final Block[] blockType = new Block[]{sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{4, 0, 5, 6, 9}; private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; private static final String[] description = new String[]{ - EnumChatFormatting.AQUA+"Hint Details:", - "1 - Classic Hatches or High Power Casing", - "2 - Elemental Hatches or Molecular Casing", + EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", + translateToLocal("gt.blockmachines.multimachine.em.stabilizer.hint.0"),//1 - Classic Hatches or High Power Casing + translateToLocal("gt.blockmachines.multimachine.em.stabilizer.hint.1"),//2 - Elemental Hatches or Molecular Casing }; //endregion @@ -59,21 +60,21 @@ public class GT_MetaTileEntity_EM_stabilizer extends GT_MetaTileEntity_Multibloc } @Override - public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMeta,2, 2, 0, getBaseMetaTileEntity(),this,hintsOnly); + public String[] getDescription() { + return new String[]{ + CommonValues.TEC_MARK_EM, + translateToLocal("gt.blockmachines.multimachine.em.stabilizer.desc.0"),//Alters time to stabilize matter + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.em.stabilizer.desc.1")//Wibbly wobbly timey wimey, stuff. + }; } @Override - public String[] getStructureDescription(int stackSize) { - return description; + public void construct(int stackSize, boolean hintsOnly) { + StructureBuilderExtreme(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), this, hintsOnly); } @Override - public String[] getDescription() { - return new String[]{ - CommonValues.TEC_MARK_EM, - "Alters time to stabilize matter", - EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Wibbly wobbly timey wimey, stuff." - }; + public String[] getStructureDescription(int stackSize) { + return description; } -} +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java index 1c5d1bccdd..795349c50c 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java @@ -7,11 +7,7 @@ import com.github.technus.tectech.mechanics.dataTransport.QuantumDataPacket; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputData; import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OutputData; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IHatchAdder; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.INameFunction; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.IStatusFunction; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.*; import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -30,44 +26,45 @@ import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texture import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*; +import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable{ - //region Structure +public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { + //region structure private static final String[][] shape = new String[][]{ - {" "," . "," ",}, - {" "," 0 "," ",}, - {" "," "," ",}, + {" ", " . ", " ",}, + {" ", " 0 ", " ",}, + {" ", " ", " ",}, }; private static final Block[] blockType = new Block[]{sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{3}; private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList}; - private static final short[] casingTextures = new short[]{textureOffset+1}; + private static final short[] casingTextures = new short[]{textureOffset + 1}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{1}; private static final String[] description = new String[]{ - EnumChatFormatting.AQUA+"Hint Details:", - "1 - Classic/Data Hatches or Computer casing", + EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", + "1 - Classic/Data Hatches or Computer casing",//1 - Classic/Data Hatches or Computer casing }; //endregion //region parameters - private static final INameFunction<GT_MetaTileEntity_EM_switch> ROUTE_NAME= - (base,p)->(p.parameterId()==0?"Destination ":"Weight ")+p.hatchId(); + private static final INameFunction<GT_MetaTileEntity_EM_switch> ROUTE_NAME = + (base, p) -> (p.parameterId() == 0 ? translateToLocal("tt.keyword.Destination") + " " : translateToLocal("tt.keyword.Weight") + " ") + p.hatchId(); private static final IStatusFunction<GT_MetaTileEntity_EM_switch> WEI_STATUS = - (base,p)-> { - double v=p.get(); + (base, p) -> { + double v = p.get(); if (Double.isNaN(v)) return STATUS_WRONG; - if(v<0) return STATUS_TOO_LOW; - if(v==0) return STATUS_LOW; - if(Double.isInfinite(v)) return STATUS_HIGH; + if (v < 0) return STATUS_TOO_LOW; + if (v == 0) return STATUS_LOW; + if (Double.isInfinite(v)) return STATUS_HIGH; return STATUS_OK; }; private static final IStatusFunction<GT_MetaTileEntity_EM_switch> DST_STATUS = - (base,p)->{ - if(base.weight[p.hatchId()].getStatus(false).isOk) { + (base, p) -> { + if (base.weight[p.hatchId()].getStatus(false).isOk) { double v = p.get(); if (Double.isNaN(v)) return STATUS_WRONG; v = (int) v; @@ -90,53 +87,16 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas } @Override - protected void parametersInstantiation_EM() { - dst=new Parameters.Group.ParameterIn[10]; - weight =new Parameters.Group.ParameterIn[10]; - for (int i = 0; i < 10; i++) { - Parameters.Group hatch = parametrization.getGroup(i); - dst[i] = hatch.makeInParameter(0, i, ROUTE_NAME, DST_STATUS); - weight[i] = hatch.makeInParameter(1,0, ROUTE_NAME, WEI_STATUS); - } - } - - public final static ResourceLocation activitySound=new ResourceLocation(Reference.MODID+":fx_hi_freq"); - - @Override - @SideOnly(Side.CLIENT) - protected ResourceLocation getActivitySound(){ - return activitySound; - } - - @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_EM_switch(mName); } @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][1], new TT_RenderedTexture(aActive ? GT_MetaTileEntity_MultiblockBase_EM.ScreenON : GT_MetaTileEntity_MultiblockBase_EM.ScreenOFF)}; - } - return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][1]}; - } - - @Override public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 1, 0); } @Override - public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMeta,1, 1, 0, getBaseMetaTileEntity(),this,hintsOnly); - } - - @Override - public String[] getStructureDescription(int stackSize) { - return description; - } - - @Override public boolean checkRecipe_EM(ItemStack itemStack) { short thingsActive = 0; for (GT_MetaTileEntity_Hatch_InputData di : eInputData) { @@ -162,7 +122,7 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas double total = 0; double weight; for (int i = 0; i < 10; i++) {//each param pair - weight= this.weight[i].get(); + weight = this.weight[i].get(); if (weight > 0 && dst[i].get() >= 0) { total += weight;//Total weighted div } @@ -170,7 +130,7 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas Vec3pos pos = new Vec3pos(getBaseMetaTileEntity()); QuantumDataPacket pack = new QuantumDataPacket(0L).unifyTraceWith(pos); - if(pack==null) { + if (pack == null) { return; } for (GT_MetaTileEntity_Hatch_InputData hatch : eInputData) { @@ -187,27 +147,27 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas double dest; for (int i = 0; i < 10; i++) { - dest= dst[i].get(); - weight= this.weight[i].get(); + dest = dst[i].get(); + weight = this.weight[i].get(); if (weight > 0 && dest >= 0) { - int outIndex = (int)dest - 1; + int outIndex = (int) dest - 1; if (outIndex < 0 || outIndex >= eOutputData.size()) { continue; } GT_MetaTileEntity_Hatch_OutputData out = eOutputData.get(outIndex); - if(Double.isInfinite(total)){ - if(Double.isInfinite(weight)){ + if (Double.isInfinite(total)) { + if (Double.isInfinite(weight)) { out.q = new QuantumDataPacket(remaining).unifyTraceWith(pack); break; } - }else{ + } else { long part = (long) Math.floor(pack.getContent() * weight / total); if (part > 0) { remaining -= part; if (remaining > 0) { out.q = new QuantumDataPacket(part).unifyTraceWith(pack); } else if (part + remaining > 0) { - out.q = new QuantumDataPacket( part + remaining).unifyTraceWith(pack); + out.q = new QuantumDataPacket(part + remaining).unifyTraceWith(pack); break; } else { break; @@ -223,8 +183,45 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas public String[] getDescription() { return new String[]{ CommonValues.TEC_MARK_EM, - "User controlled computation power routing", - EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Quality of service is a must" + translateToLocal("gt.blockmachines.multimachine.em.switch.desc.0"),//User controlled computation power routing + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.em.switch.desc.1")//Quality of service is a must }; } -} + + @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][1], new TT_RenderedTexture(aActive ? GT_MetaTileEntity_MultiblockBase_EM.ScreenON : GT_MetaTileEntity_MultiblockBase_EM.ScreenOFF)}; + } + return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][1]}; + } + + public final static ResourceLocation activitySound = new ResourceLocation(Reference.MODID + ":fx_hi_freq"); + + @Override + @SideOnly(Side.CLIENT) + protected ResourceLocation getActivitySound() { + return activitySound; + } + + @Override + protected void parametersInstantiation_EM() { + dst = new Parameters.Group.ParameterIn[10]; + weight = new Parameters.Group.ParameterIn[10]; + for (int i = 0; i < 10; i++) { + Parameters.Group hatch = parametrization.getGroup(i); + dst[i] = hatch.makeInParameter(0, i, ROUTE_NAME, DST_STATUS); + weight[i] = hatch.makeInParameter(1, 0, ROUTE_NAME, WEI_STATUS); + } + } + + @Override + public void construct(int stackSize, boolean hintsOnly) { + StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), this, hintsOnly); + } + + @Override + public String[] getStructureDescription(int stackSize) { + return description; + } +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java index e384a8d7e2..1a3bebf59b 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java @@ -25,16 +25,17 @@ import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texture import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; import static gregtech.api.GregTech_API.sBlockCasings1; +import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable{ - //region Structure +public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { + //region structure private static final String[][] shape = new String[][]{ - {" "," . "," ",}, - {" "," 0 "," ",}, - {" "," "," ",}, + {" ", " . ", " ",}, + {" ", " 0 ", " ",}, + {" ", " ", " ",}, }; private static final Block[] blockType = new Block[]{sBlockCasings1}; private static final byte[] blockMeta = new byte[]{15}; @@ -43,8 +44,8 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0}; private static final String[] description = new String[]{ - EnumChatFormatting.AQUA+"Hint Details:", - "1 - Energy IO Hatches or High Power Casing", + EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", + translateToLocal("gt.blockmachines.multimachine.em.transformer.hint"),//1 - Energy IO Hatches or High Power Casing }; //endregion @@ -56,7 +57,7 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo mHardHammer = true; mSolderingTool = true; mCrowbar = true; - eDismantleBoom=true; + eDismantleBoom = true; } public GT_MetaTileEntity_EM_transformer(String aName) { @@ -67,15 +68,7 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo mHardHammer = true; mSolderingTool = true; mCrowbar = true; - eDismantleBoom=true; - } - - public final static ResourceLocation activitySound=new ResourceLocation(Reference.MODID+":fx_noise"); - - @Override - @SideOnly(Side.CLIENT) - protected ResourceLocation getActivitySound(){ - return activitySound; + eDismantleBoom = true; } @Override @@ -89,23 +82,37 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo } @Override - public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMeta,1, 1, 0, getBaseMetaTileEntity(),this,hintsOnly); + public boolean checkRecipe_EM(ItemStack itemStack) { + if (ePowerPass) { + mEfficiencyIncrease = 10000; + mMaxProgresstime = 20; + } else { + mEfficiencyIncrease = 0; + mMaxProgresstime = 0; + } + eAmpereFlow = 0; + mEUt = 0; + return ePowerPass; } @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity,true,false,false); + public String[] getDescription() { + return new String[]{ + CommonValues.TEC_MARK_GENERAL, + translateToLocal("gt.blockmachines.multimachine.em.transformer.desc.0"),//Power substation + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.em.transformer.desc.1"),//All the transformation! + EnumChatFormatting.BLUE + translateToLocal("gt.blockmachines.multimachine.em.transformer.desc.2"),//Only 0.78125% power loss, HAYO! + }; } @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png",true,false,false); + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, true, false, false); } @Override - public String[] getStructureDescription(int stackSize) { - return description; + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png", true, false, false); } @Override @@ -116,32 +123,21 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][0]}; } + public final static ResourceLocation activitySound = new ResourceLocation(Reference.MODID + ":fx_noise"); + @Override - public String[] getDescription() { - return new String[]{ - CommonValues.TEC_MARK_GENERAL, - "Power substation", - EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "All the transformation!", - EnumChatFormatting.BLUE + "Only 0.78125% power loss, HAYO!", - }; + @SideOnly(Side.CLIENT) + protected ResourceLocation getActivitySound() { + return activitySound; } @Override - public boolean checkRecipe_EM(ItemStack itemStack) { - if (ePowerPass) { - mEfficiencyIncrease = 10000; - mMaxProgresstime = 20; - } else { - mEfficiencyIncrease = 0; - mMaxProgresstime = 0; - } - eAmpereFlow = 0; - mEUt = 0; - return ePowerPass; + public boolean onRunningTick(ItemStack aStack) { + return true; } @Override - public boolean onRunningTick(ItemStack aStack) { + public boolean doRandomMaintenanceDamage() { return true; } @@ -153,7 +149,12 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo } @Override - public boolean doRandomMaintenanceDamage() { - return true; + public void construct(int stackSize, boolean hintsOnly) { + StructureBuilderExtreme(shape, blockType, blockMeta, 1, 1, 0, getBaseMetaTileEntity(), this, hintsOnly); + } + + @Override + public String[] getStructureDescription(int stackSize) { + return description; } -} +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java index 7f69f459f9..034fdca334 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_wormhole.java @@ -22,38 +22,41 @@ import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texture import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; import static gregtech.api.enums.GT_Values.E; +import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by danie_000 on 17.12.2016. */ public class GT_MetaTileEntity_EM_wormhole extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable {//TODO MAKE COMPATIBLE WITH STARGATES XD + //region variables private static Textures.BlockIcons.CustomIcon ScreenOFF; private static Textures.BlockIcons.CustomIcon ScreenON; + //endregion //region structure private static final String[][] shape = new String[][]{ - {E,E,E,"C ","C . ","C "/*,E,E,E,*/}, - {E,E,"D0","C000","B00100","C000","D0"/*,E,E,*/}, - {E,E,"D0","C2A2","B0C0","C2A2","D0"/*,E,E,*/}, - {E,"D0","D0",E,"A00C00",E,"D0","D0"/*,E,*/}, - {E,"D0",E,E,"A0E0",E,E,"D0"/*,E,*/}, - {"D0","D0",E,E,"00E00",E,E,"D0","D0",}, - {"B00000","A0033300","003C300","03E30","03E30","03E30","003C300","A0033300","B00000",}, - {"B0!!!0","A 31113 ","031222130","!12C21!","!12C21!","!12C21!","031222130","A 31113 ","B0!!!0",}, - {"B0!!!0","A 31113 ","031444130","!14C41!","!14C41!","!14C41!","031444130","A 31113 ","B0!!!0",}, - {"B0!!!0","A 31113 ","031222130","!12C21!","!12C21!","!12C21!","031222130","A 31113 ","B0!!!0",}, - {"B00000","A0033300","003C300","03E30","03E30","03E30","003C300","A0033300","B00000",}, + {E, E, E, "C ", "C . ", "C "/*,E,E,E,*/}, + {E, E, "D0", "C000", "B00100", "C000", "D0"/*,E,E,*/}, + {E, E, "D0", "C2A2", "B0C0", "C2A2", "D0"/*,E,E,*/}, + {E, "D0", "D0", E, "A00C00", E, "D0", "D0"/*,E,*/}, + {E, "D0", E, E, "A0E0", E, E, "D0"/*,E,*/}, + {"D0", "D0", E, E, "00E00", E, E, "D0", "D0",}, + {"B00000", "A0033300", "003C300", "03E30", "03E30", "03E30", "003C300", "A0033300", "B00000",}, + {"B0!!!0", "A 31113 ", "031222130", "!12C21!", "!12C21!", "!12C21!", "031222130", "A 31113 ", "B0!!!0",}, + {"B0!!!0", "A 31113 ", "031444130", "!14C41!", "!14C41!", "!14C41!", "031444130", "A 31113 ", "B0!!!0",}, + {"B0!!!0", "A 31113 ", "031222130", "!12C21!", "!12C21!", "!12C21!", "031222130", "A 31113 ", "B0!!!0",}, + {"B00000", "A0033300", "003C300", "03E30", "03E30", "03E30", "003C300", "A0033300", "B00000",}, }; - private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, QuantumGlassBlock.INSTANCE ,sBlockCasingsTT, sBlockCasingsTT}; + private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{12, 10, 0, 5, 11}; private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; private static final String[] description = new String[]{ - EnumChatFormatting.AQUA+"Hint Details:", - "1 - Classic Hatches or High Power Casing", - "2 - Elemental Hatches or Molecular Casing", + EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", + translateToLocal("gt.blockmachines.multimachine.em.wormhole.hint.0"),//1 - Classic Hatches or High Power Casing + translateToLocal("gt.blockmachines.multimachine.em.wormhole.hint.1"),//2 - Elemental Hatches or Molecular Casing }; //endregion @@ -71,6 +74,20 @@ public class GT_MetaTileEntity_EM_wormhole extends GT_MetaTileEntity_MultiblockB } @Override + public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 4, 4, 0); + } + + @Override + public String[] getDescription() { + return new String[]{ + CommonValues.TEC_MARK_EM, + translateToLocal("gt.blockmachines.multimachine.em.wormhole.desc.0"),//It is not full of worms. + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.em.wormhole.desc.1")//It is full of anti-worms!!! + }; + } + + @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister aBlockIconRegister) { ScreenOFF = new Textures.BlockIcons.CustomIcon("iconsets/EM_WH"); @@ -87,26 +104,12 @@ public class GT_MetaTileEntity_EM_wormhole extends GT_MetaTileEntity_MultiblockB } @Override - public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 4, 4, 0); - } - - @Override public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMeta,4, 4, 0, getBaseMetaTileEntity(),this,hintsOnly); + StructureBuilderExtreme(shape, blockType, blockMeta, 4, 4, 0, getBaseMetaTileEntity(), this, hintsOnly); } @Override public String[] getStructureDescription(int stackSize) { return description; } - - @Override - public String[] getDescription() { - return new String[]{ - CommonValues.TEC_MARK_EM, - "It is not full of worms.", - EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "It is full of anti-worms!!!" - }; - } -} +}
\ No newline at end of file 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..60a642ee95 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java @@ -28,14 +28,17 @@ import static com.github.technus.tectech.loader.MainLoader.microwaving; import static com.github.technus.tectech.recipe.TT_recipeAdder.nullItem; import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*; import static gregtech.api.GregTech_API.sBlockCasings4; +import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by danie_000 on 17.12.2016. */ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { - private boolean hasBeenPausedThisCycle=false; + //region variables + private boolean hasBeenPausedThisCycle = false; + //endregion - //region Structure + //region structure //use multi A energy inputs, use less power the longer it runs private static final String[][] shape = new String[][]{ {"00000", "00000", "00.00", "0 0",}, @@ -52,27 +55,28 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock private static final Block[] blockTypeFallback = new Block[]{sBlockCasings4}; private static final byte[] blockMetaFallback = new byte[]{1}; private static final String[] description = new String[]{ - EnumChatFormatting.AQUA+"Hint Details:", - "1 - Classic Hatches or Clean Stainless Steel Casing", - "Also acts like a hopper so give it an Output Bus", + EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", + translateToLocal("gt.blockmachines.multimachine.tm.microwave.hint.0"),//1 - Classic Hatches or Clean Stainless Steel Casing + translateToLocal("gt.blockmachines.multimachine.tm.microwave.hint.1"),//Also acts like a hopper so give it an Output Bus }; //endregion //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> 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"; - private static final IStatusFunction<GT_MetaTileEntity_TM_microwave> POWER_STATUS= - (base,p)-> LedStatus.fromLimitsInclusiveOuterBoundary(p.get(),300,1000,1000,Double.POSITIVE_INFINITY); - private static final IStatusFunction<GT_MetaTileEntity_TM_microwave> TIMER_STATUS=(base, p)->{ - double value=p.get(); - if(Double.isNaN(value)) return STATUS_WRONG; - value=(int)value; - if(value<=0) return STATUS_TOO_LOW; - if(value>3000) return STATUS_TOO_HIGH; + protected Parameters.Group.ParameterIn powerSetting, timerSetting; + protected Parameters.Group.ParameterOut timerValue, remainingTime; + private static final INameFunction<GT_MetaTileEntity_TM_microwave> POWER_SETTING_NAME = (base, p) -> translateToLocal("gt.blockmachines.multimachine.tm.microwave.cfgi.0");//Power setting + private static final INameFunction<GT_MetaTileEntity_TM_microwave> TIMER_SETTING_NAME = (base, p) -> translateToLocal("gt.blockmachines.multimachine.tm.microwave.cfgi.1");//Timer setting + + private static final INameFunction<GT_MetaTileEntity_TM_microwave> TIMER_VALUE_NAME = (base, p) -> translateToLocal("gt.blockmachines.multimachine.tm.microwave.cfgo.0");//Timer value + private static final INameFunction<GT_MetaTileEntity_TM_microwave> TIMER_REMAINING_NAME = (base, p) -> translateToLocal("gt.blockmachines.multimachine.tm.microwave.cfgo.1");//Timer remaining + private static final IStatusFunction<GT_MetaTileEntity_TM_microwave> POWER_STATUS = + (base, p) -> LedStatus.fromLimitsInclusiveOuterBoundary(p.get(), 300, 1000, 1000, Double.POSITIVE_INFINITY); + private static final IStatusFunction<GT_MetaTileEntity_TM_microwave> TIMER_STATUS = (base, p) -> { + double value = p.get(); + if (Double.isNaN(value)) return STATUS_WRONG; + value = (int) value; + if (value <= 0) return STATUS_TOO_LOW; + if (value > 3000) return STATUS_TOO_HIGH; return STATUS_OK; }; //endregion @@ -86,75 +90,26 @@ 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); - 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); - } - - @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_TM_microwave(mName); } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[49], new TT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)}; - }else if(aSide == GT_Utility.getOppositeSide(aFacing)) { - return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[49], aActive ? Textures.BlockIcons.CASING_BLOCKS[52] : Textures.BlockIcons.CASING_BLOCKS[53]}; - } - return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[49]}; - } - - @Override - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, false, true, true); - } - - @Override - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png", false, true, true);//todo texture - } - - @Override public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0); } @Override - public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(),this, hintsOnly); - } - - @Override - public String[] getStructureDescription(int stackSize) { - return description; - } - - @Override - public String[] getDescription() { - return new String[]{ - CommonValues.BASS_MARK, - "High Frequency Oven", - EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "From live to done in seconds!", - EnumChatFormatting.BLUE + "I said nuke the... I meant microwave supper!", - }; - } - - @Override public boolean checkRecipe_EM(ItemStack itemStack) { - hasBeenPausedThisCycle =false; - if((int)powerSetting.get()<300 || timerSetting.get()<=0 || timerSetting.get()>3000) { + hasBeenPausedThisCycle = false; + if ((int) powerSetting.get() < 300 || timerSetting.get() <= 0 || timerSetting.get() > 3000) { return false; } if (remainingTime.get() <= 0) { remainingTime.set(timerSetting.get()); timerValue.set(0); } - mEUt = -((int)powerSetting.get() >> 1); + mEUt = -((int) powerSetting.get() >> 1); eAmpereFlow = 1; mMaxProgresstime = 20; mEfficiencyIncrease = 10000; @@ -163,37 +118,37 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock @Override public void outputAfterRecipe_EM() { - if(hasBeenPausedThisCycle) { + if (hasBeenPausedThisCycle) { return;//skip timer and actions if paused } - timerValue.set(timerValue.get()+1); - remainingTime.set(timerSetting.get()-timerValue.get()); - IGregTechTileEntity mte=getBaseMetaTileEntity(); - int[] xyzOffsets= getTranslatedOffsets(0,-1,2); - double xPos=mte.getXCoord()+0.5f+xyzOffsets[0]; - double yPos=mte.getYCoord()+0.5f+xyzOffsets[1]; - double zPos=mte.getZCoord()+0.5f+xyzOffsets[2]; - AxisAlignedBB aabb=getBoundingBox(-2,-2,-2,2,2,2).offset(xPos,yPos,zPos); - xyzOffsets= getTranslatedOffsets(0,-4,0); - double[] xyzExpansion= getTranslatedOffsets(1.5,0,1.5); - for(int i=0;i<3;i++){//gets ABS from translated to get expansion values - if(xyzExpansion[i]<0)xyzExpansion[i]=-xyzExpansion[i]; + timerValue.set(timerValue.get() + 1); + remainingTime.set(timerSetting.get() - timerValue.get()); + IGregTechTileEntity mte = getBaseMetaTileEntity(); + int[] xyzOffsets = getTranslatedOffsets(0, -1, 2); + double xPos = mte.getXCoord() + 0.5f + xyzOffsets[0]; + double yPos = mte.getYCoord() + 0.5f + xyzOffsets[1]; + double zPos = mte.getZCoord() + 0.5f + xyzOffsets[2]; + AxisAlignedBB aabb = getBoundingBox(-2, -2, -2, 2, 2, 2).offset(xPos, yPos, zPos); + xyzOffsets = getTranslatedOffsets(0, -4, 0); + double[] xyzExpansion = getTranslatedOffsets(1.5, 0, 1.5); + for (int i = 0; i < 3; i++) {//gets ABS from translated to get expansion values + if (xyzExpansion[i] < 0) xyzExpansion[i] = -xyzExpansion[i]; } - int power=(int)powerSetting.get(); + int power = (int) powerSetting.get(); int damagingFactor = - Math.min(power >> 6,8)+ - Math.min(power >> 8,24)+ - Math.min(power >> 12,48)+ + Math.min(power >> 6, 8) + + Math.min(power >> 8, 24) + + Math.min(power >> 12, 48) + (power >> 18); - ArrayList<ItemStack> itemsToOutput=new ArrayList<>(); - HashSet<Entity> tickedStuff=new HashSet<>(); + ArrayList<ItemStack> itemsToOutput = new ArrayList<>(); + HashSet<Entity> tickedStuff = new HashSet<>(); - boolean inside=true; + boolean inside = true; do { for (Object entity : mte.getWorld().getEntitiesWithinAABBExcludingEntity(null, aabb)) { if (entity instanceof Entity) { - if(tickedStuff.add((Entity)entity)) { + if (tickedStuff.add((Entity) entity)) { if (inside && entity instanceof EntityItem) { GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMicrowaveRecipes.findRecipe( mte, null, true, 128, null, null, new ItemStack[]{((EntityItem) entity).getEntityItem()}); @@ -204,36 +159,68 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock newStuff.stackSize = ((EntityItem) entity).getEntityItem().stackSize; itemsToOutput.add(newStuff); } - ((EntityItem) entity).delayBeforeCanPickup=2; + ((EntityItem) entity).delayBeforeCanPickup = 2; ((EntityItem) entity).setDead(); } else if (entity instanceof EntityLivingBase) { - if(!GT_Utility.isWearingFullElectroHazmat((EntityLivingBase) entity)) { + if (!GT_Utility.isWearingFullElectroHazmat((EntityLivingBase) entity)) { ((EntityLivingBase) entity).attackEntityFrom(microwaving, damagingFactor); } } } } } - aabb.offset(xyzOffsets[0],xyzOffsets[1],xyzOffsets[2]); - aabb=aabb.expand(xyzExpansion[0],xyzExpansion[1],xyzExpansion[2]); - inside=false; - damagingFactor>>=1; - } while(damagingFactor>0); + aabb.offset(xyzOffsets[0], xyzOffsets[1], xyzOffsets[2]); + aabb = aabb.expand(xyzExpansion[0], xyzExpansion[1], xyzExpansion[2]); + inside = false; + damagingFactor >>= 1; + } while (damagingFactor > 0); - mOutputItems= itemsToOutput.toArray(nullItem); + mOutputItems = itemsToOutput.toArray(nullItem); - if(remainingTime.get() <=0) { - mte.getWorld().playSoundEffect(xPos,yPos,zPos, Reference.MODID+":microwave_ding", 1, 1); + if (remainingTime.get() <= 0) { + mte.getWorld().playSoundEffect(xPos, yPos, zPos, Reference.MODID + ":microwave_ding", 1, 1); stopMachine(); } } @Override - public boolean onRunningTick(ItemStack aStack) { - if(eSafeVoid) { - hasBeenPausedThisCycle = true; + public String[] getDescription() { + return new String[]{ + CommonValues.BASS_MARK, + translateToLocal("gt.blockmachines.multimachine.tm.microwave.desc.0"),//High Frequency Oven + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.tm.microwave.desc.1"),//From live to done in seconds! + EnumChatFormatting.BLUE + translateToLocal("gt.blockmachines.multimachine.tm.microwave.desc.2"),//I said nuke the... I meant microwave supper! + }; + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, false, true, true); + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachineEM(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "EMDisplay.png", false, true, true);//todo texture + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[49], new TT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)}; + } else if (aSide == GT_Utility.getOppositeSide(aFacing)) { + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[49], aActive ? Textures.BlockIcons.CASING_BLOCKS[52] : Textures.BlockIcons.CASING_BLOCKS[53]}; } - return hasBeenPausedThisCycle || super.onRunningTick(aStack);//consume eu and other resources if not paused + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[49]}; + } + + @Override + protected void parametersInstantiation_EM() { + Parameters.Group hatch_0 = parametrization.getGroup(0, true); + 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); } @Override @@ -244,7 +231,26 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock } @Override + public boolean onRunningTick(ItemStack aStack) { + if (eSafeVoid) { + hasBeenPausedThisCycle = true; + } + return hasBeenPausedThisCycle || super.onRunningTick(aStack);//consume eu and other resources if not paused + } + + //TODO Why is the basetype 1?? + @Override public byte getTileEntityBaseType() { return 1; } -} + + @Override + public void construct(int stackSize, boolean hintsOnly) { + StructureBuilderExtreme(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), this, hintsOnly); + } + + @Override + public String[] getStructureDescription(int stackSize) { + return description; + } +}
\ No newline at end of file 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..a95963f1a7 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,20 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.loader.NetworkDispatcher; +import com.github.technus.tectech.mechanics.data.RendererMessage; +import com.github.technus.tectech.mechanics.data.ThaumSpark; +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.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.multi.base.render.TT_RenderedTexture; +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; @@ -14,38 +22,63 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.*; -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.HashSet; +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.*; 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; +import static net.minecraft.util.StatCollector.translateToLocal; + +public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { + //region variables + private final static HashSet<ThaumSpark> sparkList = new HashSet<>(); -/** - * 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 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 maxTier = 6; //Max tier for efficiency calcuation + + private float energyEfficiency = 1; + private float overdriveEfficiency = 1; + private float minEfficiency = TecTech.configTecTech.TESLA_MULTI_MIN_EFFICIENCY;//Default is 0.955F + private float maxEfficiency = TecTech.configTecTech.TESLA_MULTI_MAX_EFFICIENCY;//Default is 0.98F; + private float overdriveEfficiencyExtra = TecTech.configTecTech.TESLA_MULTI_OVERDRIVE_LOSS;//Default is 0.005F + + 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 long energyCapacity = 0; //Total energy storage limited by capacitors + private long outputVoltageMax = 0; //Tesla voltage output limited by capacitors + private int vTier = -1; //Tesla voltage tier limited by capacitors + private long outputCurrentMax = 0; //Tesla current output limited by capacitors + + //Prevents unnecessary offset calculation + private byte oldRotation = -1; + private byte oldOrientation = -1; + + //Coordinate Arrays + private int[][] scanPosOffsets = new int[10][3]; + private int[] posZap = new int[3];//Power Transfer Origin + public int[] posTop = new int[3];//Lightning Origin + //endregion //region structure - private static final String[][] shape0 = new String[][]{//3 16 0 + private static final String[][] shape = new String[][]{//3 16 0 {"\u000F", "A . ",}, {E, "B000", "B000", "B000", "\u0001", "B000", E, "B000", E, "B000", E, "B000", "\u0001", "B111", " 22222 ",}, {"B000", "A00000", "A00000", "A00000", "B000", E, "A0A!A0", E, "A0A!A0", E, "A0A!A0", E, "A0A!A0", "\u0001", "A1C1", " 21112 ",}, @@ -54,48 +87,141 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock {E, "B000", "B000", "B000", "\u0001", "B000", E, "B000", E, "B000", E, "B000", "\u0001", "B111", " 22222 ",}, {"\u000F", "A ",}, }; - private static final String[][] shape1 = new String[][]{//3 0 0 - {"A . ",}, - {" 22222 ","A11111","\u0001","B000",E,"B000",E,"B000",E,"B000","\u0001","B000","B000","B000",}, - {" 21112 ","A1C1","\u0001","A0A!A0",E,"A0A!A0",E,"A0A!A0",E,"A0A!A0",E,"B000","A00000","A00000","A00000","B000",}, - {" 21212 ","A1A3A1","C3","C3","A0!3!0","C3","A0!3!0","C3","A0!3!0","C3","A0!3!0","C3","B030","A00000","A00000","A00000","B000",}, - {" 21112 ","A1C1","\u0001","A0A!A0",E,"A0A!A0",E,"A0A!A0",E,"A0A!A0",E,"B000","A00000","A00000","A00000","B000",}, - {" 22222 ","A11111","\u0001","B000",E,"B000",E,"B000",E,"B000","\u0001","B000","B000","B000",}, - {"A ",}, + 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[]{(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 + translateToLocal("tt.keyphrase.Hint_Details") + ":", + translateToLocal("gt.blockmachines.multimachine.tm.teslaCoil.hint.0"),//1 - Classic Hatches, Capacitor Hatches or Tesla Base Casing + translateToLocal("gt.blockmachines.multimachine.tm.teslaCoil.hint.1"),//2 - Titanium Frames }; - private static final String[][] shape2 = new String[][]{//16 3 0 - {E,"P ","P ","P.","P ","P ",}, - {"P ","O12","A000B0A0A0A0B12","A000B0A0A0A0B12","A000B0A0A0A0B12","O12","P ",}, - {"P ","A000B0A0A0A0B12","00000K1","00000A!A!A!A!C1","00000K1","A000B0A0A0A0B12","P ",}, - {"P ","A000B0A0A0A0B12","00000A!A!A!A!C1","00003333333333332","00000A!A!A!A!C1","A000B0A0A0A0B12","P ",}, - {"P ","A000B0A0A0A0B12","00000K1","00000A!A!A!A!C1","00000K1","A000B0A0A0A0B12","P ",}, - {"P ","O12","A000B0A0A0A0B12","A000B0A0A0A0B12","A000B0A0A0A0B12","F0H12","P ",}, - {E,"P ","P ","P ","P ","P ",}, + //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) -> translateToLocal("gt.blockmachines.multimachine.tm.teslaCoil.cfgi.0");//Hysteresis low setting + private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> HYSTERESIS_HIGH_SETTING_NAME = (base, p) -> translateToLocal("gt.blockmachines.multimachine.tm.teslaCoil.cfgi.1");//Hysteresis high setting + private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> TRANSFER_RADIUS_TOWER_SETTING_NAME = (base, p) -> translateToLocal("gt.blockmachines.multimachine.tm.teslaCoil.cfgi.2");//Tesla Towers transfer radius setting + private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> TRANSFER_RADIUS_TRANSCEIVER_SETTING_NAME = (base, p) -> translateToLocal("gt.blockmachines.multimachine.tm.teslaCoil.cfgi.3");//Tesla Transceiver transfer radius setting + private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> TRANSFER_RADIUS_COVER_ULTIMATE_SETTING_NAME = (base, p) -> translateToLocal("gt.blockmachines.multimachine.tm.teslaCoil.cfgi.4");//Tesla Ultimate Cover transfer radius setting + private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> OUTPUT_VOLTAGE_SETTING_NAME = (base, p) -> translateToLocal("gt.blockmachines.multimachine.tm.teslaCoil.cfgi.5");//Output voltage setting + private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> OUTPUT_CURRENT_SETTING_NAME = (base, p) -> translateToLocal("gt.blockmachines.multimachine.tm.teslaCoil.cfgi.6");//Output current setting + private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> SCAN_TIME_MIN_SETTING_NAME = (base, p) -> translateToLocal("gt.blockmachines.multimachine.tm.teslaCoil.cfgi.7");//Scan time Min setting + private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> OVERDRIVE_SETTING_NAME = (base, p) -> translateToLocal("gt.blockmachines.multimachine.tm.teslaCoil.cfgi.8");//Overdrive setting + private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> POPOGA_NAME = (base, p) -> translateToLocal("gt.blockmachines.multimachine.tm.teslaCoil.cfgi.9");//Unused + + private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> TRANSFER_RADIUS_TOWER_DISPLAY_NAME = (base, p) -> translateToLocal("gt.blockmachines.multimachine.tm.teslaCoil.cfgo.0");//Tesla Towers transfer radius display + private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> TRANSFER_RADIUS_TRANSCEIVER_DISPLAY_NAME = (base, p) -> translateToLocal("gt.blockmachines.multimachine.tm.teslaCoil.cfgo.1");//Tesla Transceiver transfer radius display + private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> TRANSFER_RADIUS_COVER_ULTIMATE_DISPLAY_NAME = (base, p) -> translateToLocal("gt.blockmachines.multimachine.tm.teslaCoil.cfgo.2");//Tesla Ultimate Cover transfer radius display + private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> OUTPUT_VOLTAGE_DISPLAY_NAME = (base, p) -> translateToLocal("gt.blockmachines.multimachine.tm.teslaCoil.cfgo.3");//Output voltage display + private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> OUTPUT_CURRENT_DISPLAY_NAME = (base, p) -> translateToLocal("gt.blockmachines.multimachine.tm.teslaCoil.cfgo.4");//Output current display + private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> ENERGY_CAPACITY_DISPLAY_NAME = (base, p) -> translateToLocal("gt.blockmachines.multimachine.tm.teslaCoil.cfgo.5");//Energy Capacity display + private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> ENERGY_STORED_DISPLAY_NAME = (base, p) -> translateToLocal("gt.blockmachines.multimachine.tm.teslaCoil.cfgo.6");//Energy Stored display + private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> ENERGY_FRACTION_DISPLAY_NAME = (base, p) -> translateToLocal("gt.blockmachines.multimachine.tm.teslaCoil.cfgo.7");//Energy Fraction display + private static final INameFunction<GT_MetaTileEntity_TM_teslaCoil> SCAN_TIME_DISPLAY_NAME = (base, p) -> translateToLocal("gt.blockmachines.multimachine.tm.teslaCoil.cfgo.8");//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 String[][] shape3 = new String[][]{//0 3 0 - {E," "," ","."," "," ",}, - {" ","21","21B0A0A0A0B000","21B0A0A0A0B000","21B0A0A0A0B000","21H0"," ",}, - {" ","21B0A0A0A0B000","1K00000","1C!A!A!A!A00000","1K00000","21B0A0A0A0B000"," ",}, - {" ","21B0A0A0A0B000","1C!A!A!A!A00000","23333333333330000","1C!A!A!A!A00000","21B0A0A0A0B000"," ",}, - {" ","21B0A0A0A0B000","1K00000","1C!A!A!A!A00000","1K00000","21B0A0A0A0B000"," ",}, - {" ","21","21B0A0A0A0B000","21B0A0A0A0B000","21B0A0A0A0B000","21"," ",}, - {E," "," "," "," "," ",}, + 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 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 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 String[] description = new String[]{ - EnumChatFormatting.AQUA + "Hint Details:", - "1 - Classic Hatches or Steel Pipe Casing", - "2 - Titanium Frames", + 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 || value == 20 || value == 40 || value == 60 || value == 80) 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 @@ -107,214 +233,553 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock super(aName); } + private long getEnergyEfficiency(long voltage, int distance, boolean overDriveToggle) { + if (overDriveToggle) { + return (long) ((voltage * 2) - (voltage * Math.pow(overdriveEfficiency, distance))); + } else { + return (long) (voltage * Math.pow(energyEfficiency, distance)); + } + } + + private float getRangeMulti(int mTier, int vTier) { + //Over-tiered coils will add +25% range + if (vTier > mTier) { + return 1.25F; + } + return 1F; + } + + private void scanForTransmissionTargets(int[] coordsMin, int[] coordsMax) { + //This makes sure the minimums are actually smaller than the maximums + int xMin = coordsMin[0] < coordsMax[0] ? coordsMin[0] : coordsMax[0]; + int yMin = coordsMin[1] < coordsMax[1] ? coordsMin[1] : coordsMax[1]; + int zMin = coordsMin[2] < coordsMax[2] ? coordsMin[2] : coordsMax[2]; + //And vice versa + int xMax = coordsMin[0] > coordsMax[0] ? coordsMin[0] : coordsMax[0]; + int yMax = coordsMin[1] > coordsMax[1] ? coordsMin[1] : coordsMax[1]; + int zMax = coordsMin[2] > coordsMax[2] ? coordsMin[2] : coordsMax[2]; + + for (int xPos = xMin; xPos <= xMax; xPos++) { + for (int yPos = yMin; yPos <= yMax; yPos++) { + for (int zPos = zMin; zPos <= zMax; zPos++) { + if (xPos == 0 && yPos == 0 && zPos == 0) { + continue; + } + IGregTechTileEntity node = getBaseMetaTileEntity().getIGregTechTileEntityOffset(xPos, yPos, zPos); + 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)) { + eTeslaMap.put(node, (int) Math.ceil(Math.sqrt(Math.pow(xPos, 2) + Math.pow(yPos, 2) + Math.pow(zPos, 2)))); + } + } + } + } + + } + + private void thaumLightning(IGregTechTileEntity mte, IGregTechTileEntity node) { + byte xR = (byte) (node.getXCoord() - posTop[0]); + byte yR = (byte) (node.getYCoord() - posTop[1]); + byte zR = (byte) (node.getZCoord() - posTop[2]); + + int wID = mte.getWorld().provider.dimensionId; + + sparkList.add(new ThaumSpark(posTop[0], posTop[1], posTop[2], xR, yR, zR, wID)); + } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_TM_teslaCoil(mName); } @Override - @SideOnly(Side.CLIENT) - 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); + public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + for (GT_MetaTileEntity_Hatch_Capacitor cap : eCapacitorHatches) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(cap)) { + cap.getBaseMetaTileEntity().setActive(false); + } + } + eCapacitorHatches.clear(); + + int[] xyzOffsets; + xyzOffsets = getTranslatedOffsets(0, -1, 1); + mTier = iGregTechTileEntity.getMetaIDOffset(xyzOffsets[0], xyzOffsets[1], xyzOffsets[2]); + + if (structureCheck_EM(shape, blockType, blockMetas[mTier], addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 3, 16, 0) && eCapacitorHatches.size() > 0) { + for (GT_MetaTileEntity_Hatch_Capacitor cap : eCapacitorHatches) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(cap)) { + cap.getBaseMetaTileEntity().setActive(iGregTechTileEntity.isActive()); + } + } + + //Only recalculate offsets on orientation or rotation change + if (oldRotation != getFrontRotation() || oldOrientation != iGregTechTileEntity.getFrontFacing()) { + oldRotation = getFrontRotation(); + oldOrientation = iGregTechTileEntity.getFrontFacing(); + + //Calculate coordinates of the middle bottom + xyzOffsets = getTranslatedOffsets(0, 0, 2); + posZap[0] = iGregTechTileEntity.getXCoord() + xyzOffsets[0]; + posZap[1] = iGregTechTileEntity.getYCoord() + xyzOffsets[1]; + posZap[2] = iGregTechTileEntity.getZCoord() + xyzOffsets[2]; + + //Calculate coordinates of the top sphere + xyzOffsets = getTranslatedOffsets(0, -14, 2); + posTop[0] = iGregTechTileEntity.getXCoord() + xyzOffsets[0]; + posTop[1] = iGregTechTileEntity.getYCoord() + xyzOffsets[1]; + posTop[2] = iGregTechTileEntity.getZCoord() + xyzOffsets[2]; + + //Calculate offsets for scanning + scanPosOffsets[0] = getTranslatedOffsets(40, 0, 43); + scanPosOffsets[1] = getTranslatedOffsets(-40, -4, -37); + + scanPosOffsets[2] = getTranslatedOffsets(40, -5, 43); + scanPosOffsets[3] = getTranslatedOffsets(-40, -8, -37); + + scanPosOffsets[4] = getTranslatedOffsets(40, -9, 43); + scanPosOffsets[5] = getTranslatedOffsets(-40, -12, -37); + + scanPosOffsets[6] = getTranslatedOffsets(40, -13, 43); + scanPosOffsets[7] = getTranslatedOffsets(-40, -16, -37); + + scanPosOffsets[8] = getTranslatedOffsets(40, -17, 43); + scanPosOffsets[9] = getTranslatedOffsets(-40, -20, -37); + } + return true; + } + return false; } @Override - public long maxEUStore() { - return V[9] * 2; + 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]; + } + } + + //Calculate Efficiency values + energyEfficiency = map(mTier + 1, 1, maxTier, minEfficiency, maxEfficiency); + overdriveEfficiency = energyEfficiency - overdriveEfficiencyExtra; + + energyCapacity = 0; + outputCurrentMax = 0; + + if (vTier < 0) { + //Returning true to allow for 'passive running' + outputVoltageMax = 0; + return true; + } else if (vTier > mTier && getEUVar() > 0) { + explodeMultiblock(); + } + + 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 String[] getDescription() { + return new String[]{ + CommonValues.BASS_MARK, + translateToLocal("gt.blockmachines.multimachine.tm.teslaCoil.desc.0"),//Tower of Wireless Power + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.tm.teslaCoil.desc.1"),//Fewer pesky cables! + EnumChatFormatting.BLUE + translateToLocal("gt.blockmachines.multimachine.tm.teslaCoil.desc.2"),//Survival chances might be affected + }; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister aBlockIconRegister) { + ScreenOFF = new Textures.BlockIcons.CustomIcon("iconsets/TM_TESLA_TOWER"); + ScreenON = new Textures.BlockIcons.CustomIcon("iconsets/TM_TESLA_TOWER_ACTIVE"); + super.registerIcons(aBlockIconRegister); } @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 TT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; } - return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][4]}; + return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][16 + 6]}; } @Override - public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - eCaps.clear(); - int coilX0 = 0; - int coilX1 = 0; - int coilX2 = 0; - - int coilY0 = 1; - int coilY1 = 0; - int coilY2 = 0; - - int coilZ0 = 0; - int coilZ1 = 0; - int coilZ2 = 0; - - switch (iGregTechTileEntity.getFrontFacing()) { - case 2: - coilZ0 = 1; - coilZ1 = 1; - coilZ2 = 1; - coilX1 = 1; - coilX2 = -1; - break; - case 3: - coilZ0 = -1; - coilZ1 = -1; - coilZ2 = -1; - coilX1 = -1; - coilX2 = 1; - break; - case 4: - coilX0 = 1; - coilX1 = 1; - coilX2 = 1; - coilZ1 = -1; - coilZ2 = 1; - break; - case 5: - coilX0 = -1; - coilX1 = -1; - coilX2 = -1; - coilZ1 = 1; - coilZ2 = -1; - break; - default: - return false; + public void onRemoval() { + super.onRemoval(); + for (GT_MetaTileEntity_Hatch_Capacitor cap : eCapacitorHatches) { + cap.getBaseMetaTileEntity().setActive(false); } - - Block coil0 = iGregTechTileEntity.getBlockOffset(coilX0, coilY0, coilZ0); - Block coil1 = iGregTechTileEntity.getBlockOffset(coilX0, -coilY0, coilZ0); - Block coil2 = iGregTechTileEntity.getBlockOffset(coilX1, coilY1, coilZ1); - Block coil3 = iGregTechTileEntity.getBlockOffset(coilX2, coilY2, coilZ2); - - int xOffset; - int yOffset; - int zOffset; - - if (coil0 == sBlockCasings5) { - xOffset = 3; - yOffset = 16; - zOffset = 0; - orientation = 0; - tier = iGregTechTileEntity.getMetaIDOffset(coilX0, coilY0, coilZ0); - } else if (coil1 == sBlockCasings5) { - xOffset = 3; - yOffset = 0; - zOffset = 0; - orientation = 1; - tier = iGregTechTileEntity.getMetaIDOffset(coilX0, -coilY0, coilZ0); - } else if (coil2 == sBlockCasings5) { - xOffset = 16; - yOffset = 3; - zOffset = 0; - orientation = 2; - tier = iGregTechTileEntity.getMetaIDOffset(coilX1, coilY1, coilZ1); - } else if (coil3 == sBlockCasings5) { - xOffset = 0; - yOffset = 3; - zOffset = 0; - orientation = 3; - tier = iGregTechTileEntity.getMetaIDOffset(coilX2, coilY2, coilZ2); - } else { - return false; - } - - return structureCheck_EM(shapes[orientation], blockType, blockMetas[tier], addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, xOffset, yOffset, zOffset); } @Override - public void construct(int stackSize, boolean hintsOnly) { - StructureBuilder(shapes[0], blockType, blockMetas[(stackSize-1)%3], 3, 16, 0, getBaseMetaTileEntity(), hintsOnly); + 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); + 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 String[] getStructureDescription(int stackSize) { - return description; + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setLong("eEnergyCapacity", energyCapacity); } @Override - public String[] getDescription() { - return new String[]{ - CommonValues.BASS_MARK, - "Tower of Wireless Power", - EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Fewer pesky cables!", - EnumChatFormatting.BLUE + "Survival chances might be affected", - }; + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + energyCapacity = aNBT.getLong("eEnergyCapacity"); } @Override - public boolean checkRecipe_EM(ItemStack itemStack) { - mEfficiencyIncrease = 10000; - mMaxProgresstime = 20; - return true; + public void stopMachine() { + super.stopMachine(); + for (GT_MetaTileEntity_Hatch_Capacitor cap : eCapacitorHatches) { + cap.getBaseMetaTileEntity().setActive(false); + } + + setEUVar(0); + energyStoredDisplay.set(0); + energyFractionDisplay.set(0); } @Override public boolean onRunningTick(ItemStack aStack) { IGregTechTileEntity mte = getBaseMetaTileEntity(); - if (mte.isClientSide()) { - return true; - } + //Hysteresis based ePowerPass setting + long energyMax = maxEUStore() / 2; + long energyStored = getEUVar(); + + float energyFrac = (float) energyStored / energyMax; + + energyCapacityDisplay.set(energyMax); + energyStoredDisplay.set(energyStored); + energyFractionDisplay.set(energyFrac); - if (!ePowerPass && getEUVar() > maxEUStore() / 2 * 0.8) { + if (!ePowerPass && energyFrac > histHighSetting.get()) { ePowerPass = true; - } else if (ePowerPass && getEUVar() < maxEUStore() / 2 * 0.2) { + } else if (ePowerPass && energyFrac < histLowSetting.get()) { ePowerPass = false; } + //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 (nodeInside instanceof GT_MetaTileEntity_TeslaCoil) { + GT_MetaTileEntity_TeslaCoil teslaTransceiver = (GT_MetaTileEntity_TeslaCoil) nodeInside; + if (teslaTransceiver.mBatteryCount > 0) { + continue; + } + } else if ((node.getCoverBehaviorAtSide((byte) 1) instanceof GT_Cover_TM_TeslaCoil) && node.getEUCapacity() > 0) { + continue; + } + } catch (Exception e) { + } + } + eTeslaMap.remove(Rx.getKey()); + } + + //Scan for transmission targets + switch (scanTime) { + case 0: + scanTimeDisplay.updateStatus(); + scanForTransmissionTargets(scanPosOffsets[0], scanPosOffsets[1]); + break; + case 20: + scanTimeDisplay.updateStatus(); + scanForTransmissionTargets(scanPosOffsets[2], scanPosOffsets[3]); + break; + case 40: + scanTimeDisplay.updateStatus(); + scanForTransmissionTargets(scanPosOffsets[4], scanPosOffsets[5]); + break; + case 60: + scanTimeDisplay.updateStatus(); + scanForTransmissionTargets(scanPosOffsets[6], scanPosOffsets[7]); + break; + case 80: + scanTimeDisplay.updateStatus(); + scanForTransmissionTargets(scanPosOffsets[8], scanPosOffsets[9]); + break; + default: + if (scanTime == (int) scanTimeMinSetting.get() - 1) { + scanTime = -1; + + 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_TeslaCoil) { + GT_MetaTileEntity_TeslaCoil teslaCoil = (GT_MetaTileEntity_TeslaCoil) nodeInside; + + int tX = node.getXCoord(); + int tY = node.getYCoord(); + int tZ = node.getZCoord(); + + int tXN = posZap[0]; + int tYN = posZap[1]; + int tZN = posZap[2]; + + int tOffset = (int) Math.ceil(Math.sqrt(Math.pow(tX - tXN, 2) + Math.pow(tY - tYN, 2) + Math.pow(tZ - tZN, 2))); + teslaCoil.eTeslaMap.put(mte, tOffset); + + for (Map.Entry<IGregTechTileEntity, Integer> RRx : eTeslaMap.entrySet()) { + IGregTechTileEntity nodeN = RRx.getKey(); + if (nodeN == node) { + continue; + } + tXN = nodeN.getXCoord(); + tYN = nodeN.getYCoord(); + tZN = nodeN.getZCoord(); + tOffset = (int) Math.ceil(Math.sqrt(Math.pow(tX - tXN, 2) + Math.pow(tY - tYN, 2) + Math.pow(tZ - tZN, 2))); + if (tOffset > 20) { + continue; + } + teslaCoil.eTeslaMap.put(nodeN, tOffset); + } + } + } catch (Exception e) { + eTeslaMap.remove(Rx.getKey()); + } + } + } + } + break; + } + + scanTime++; + scanTimeDisplay.set(scanTime); + + //Power Limit Settings + long outputVoltage; + if (outputVoltageSetting.get() > 0) { + outputVoltage = Math.min(outputVoltageMax, (long) outputVoltageSetting.get()); + } else { + outputVoltage = outputVoltageMax; + } + outputVoltageDisplay.set(outputVoltage); + + long outputCurrent; + 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 + float rangeFrac = (float) ((-0.5 * Math.pow(energyFrac, 2)) + (1.5 * energyFrac)); + int transferRadiusTower = (int) (transferRadiusTowerSetting.get() * getRangeMulti(mTier, vTier) * rangeFrac); + transferRadiusTowerDisplay.set(transferRadiusTower); + int transferRadiusTransceiver = (int) (transferRadiusTransceiverSetting.get() * getRangeMulti(mTier, vTier) * rangeFrac); + transferRadiusTransceiverDisplay.set(transferRadiusTransceiver); + int 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) && 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 overdriveToggle = overDriveSetting.get() > 0; + boolean idle = true; + for (Map.Entry<IGregTechTileEntity, Integer> Rx : entriesSortedByValues(eTeslaMap)) { + if (energyStored >= (overdriveToggle ? outputVoltage * 2 : outputVoltage)) { + IGregTechTileEntity node = Rx.getKey(); + IMetaTileEntity nodeInside = node.getMetaTileEntity(); + + long outputVoltageInjectable; + long outputVoltageConsumption; + if (overdriveToggle) { + outputVoltageInjectable = outputVoltage; + outputVoltageConsumption = getEnergyEfficiency(outputVoltage, Rx.getValue(), true); + } else { + outputVoltageInjectable = getEnergyEfficiency(outputVoltage, Rx.getValue(), false); + 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); + thaumLightning(mte, node); + 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); + thaumLightning(mte, node); + 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); + thaumLightning(mte, node); + sparks--; + idle = false; + } + } + if (sparks == 0) { + break; + } + } else { + idle = true; + break; } } + if (idle) { + break; + } + } + outputCurrentDisplay.set(outputCurrent - sparks); + if (scanTime % 60 == 0 && !sparkList.isEmpty()) { + NetworkDispatcher.INSTANCE.sendToAllAround(new RendererMessage.RendererData(sparkList), + mte.getWorld().provider.dimensionId, + mte.getXCoord(), + mte.getYCoord(), + mte.getZCoord(), + 256); } + sparkList.clear(); + } else { + outputCurrentDisplay.set(0); } return true; } - public final boolean addFrameToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - return aTileEntity != null && aTileEntity.getMetaTileEntity() instanceof GT_MetaPipeEntity_Frame; + @Override + public long maxEUStore() { + return energyCapacity * 2; } - public final boolean addCapacitorToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + private boolean addCapacitorToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (aTileEntity == null) { return false; } @@ -324,7 +789,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 +811,24 @@ 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; } -} + + private boolean addFrameToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + return aTileEntity != null && aTileEntity.getMetaTileEntity() instanceof GT_MetaPipeEntity_Frame; + } + + @Override + public void construct(int stackSize, boolean hintsOnly) { + StructureBuilderExtreme(shape, blockType, blockMetas[(stackSize - 1) % 6], 3, 16, 0, getBaseMetaTileEntity(), this, hintsOnly); + } + + @Override + public String[] getStructureDescription(int stackSize) { + return description; + } +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_Container_MultiMachineEM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_Container_MultiMachineEM.java index dd2eb0a7be..c42c15bd8d 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_Container_MultiMachineEM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_Container_MultiMachineEM.java @@ -15,7 +15,9 @@ public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { public LedStatus[] eParamsInStatus = LedStatus.makeArray(20,LedStatus.STATUS_UNDEFINED); public LedStatus[] eParamsOutStatus = LedStatus.makeArray(20,LedStatus.STATUS_UNDEFINED); public double[] eParamsIn = new double[20];//number I from parametrizers + public long[] eParamsInl = new long[20]; public double[] eParamsOut = new double[20];//number O to parametrizers + public long[] eParamsOutl = new long[20]; public byte eCertainMode = 5, eCertainStatus = 127; public boolean ePowerPass = false, eSafeVoid = false, allowedToWork = false; public final boolean ePowerPassButton, eSafeVoidButton, allowedToWorkButton; @@ -151,10 +153,10 @@ public class GT_Container_MultiMachineEM extends GT_ContainerMetaTile_Machine { allowedToWork = (par2 & 4) == 4; } else if(par1>=128 && par1<208){ int pos=(par1-128)>>2; - eParamsOut[pos]=Util.receiveDouble(eParamsOut[pos],par1&0xFFFFFFFC,par1,par2); + eParamsOut[pos]=Double.longBitsToDouble(eParamsOutl[pos]=Util.receiveLong(eParamsOutl[pos],par1&0xFFFFFFFC,par1,par2)); }else if(par1>=208 && par1<288){ int pos=(par1-208)>>2; - eParamsIn[pos]=Util.receiveDouble(eParamsIn[pos],par1&0xFFFFFFFC,par1,par2); + eParamsIn[pos]=Double.longBitsToDouble(eParamsInl[pos]=Util.receiveLong(eParamsInl[pos],par1&0xFFFFFFFC,par1,par2)); } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java index 0ec865b1e2..54f438aa9f 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java @@ -55,7 +55,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt protected static Textures.BlockIcons.CustomIcon ScreenON; //Sound resource - same as with screen but override getActivitySound - public final static ResourceLocation activitySound=new ResourceLocation(Reference.MODID+":fx_lo_freq"); + public final static ResourceLocation activitySound = new ResourceLocation(Reference.MODID + ":fx_lo_freq"); @SideOnly(Side.CLIENT) private SoundLoop activitySoundLoop; //endregion @@ -117,16 +117,16 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt //region READ ONLY unless u really need to change it //max amperes machine can take in after computing it to the lowest tier (exchange packets to min tier count) - protected long eMaxAmpereFlow = 0,eMaxAmpereGen=0; + protected long eMaxAmpereFlow = 0, eMaxAmpereGen = 0; //What is the max and minimal tier of eu hatches installed - private long maxEUinputMin = 0, maxEUinputMax = 0,maxEUoutputMin = 0, maxEUoutputMax = 0; + private long maxEUinputMin = 0, maxEUinputMax = 0, maxEUoutputMin = 0, maxEUoutputMax = 0; //read only unless you are making computation generator - read computer class protected long eAvailableData = 0; // data being available //just some info - private so hidden - private boolean explodedThisTick=false; + private boolean explodedThisTick = false; //front rotation val private byte frontRotation = 0; @@ -135,37 +135,37 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt protected GT_MetaTileEntity_MultiblockBase_EM(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); - parametrization=new Parameters(this); + parametrization = new Parameters(this); parametersInstantiation_EM(); - parametrization.setToDefaults(true,true); + parametrization.setToDefaults(true, true); } protected GT_MetaTileEntity_MultiblockBase_EM(String aName) { super(aName); - parametrization=new Parameters(this); + parametrization = new Parameters(this); parametersInstantiation_EM(); - parametrization.setToDefaults(true,true); + parametrization.setToDefaults(true, true); } //region SUPER STRUCT @Override - public boolean isFrontRotationValid(byte frontRotation, byte frontFacing){ + public boolean isFrontRotationValid(byte frontRotation, byte frontFacing) { return true; } - public boolean isFacingValid_EM(byte aFacing){ + public boolean isFacingValid_EM(byte aFacing) { return true; } @Override public void rotateAroundFrontPlane(boolean direction) { - if(direction){ + if (direction) { frontRotation++; - if(frontRotation>3) frontRotation=0; - }else { + if (frontRotation > 3) frontRotation = 0; + } else { frontRotation--; - if(frontRotation<0) frontRotation=3; + if (frontRotation < 0) frontRotation = 3; } if (isFrontRotationValid(frontRotation, getBaseMetaTileEntity().getFrontFacing())) { updateRotationOnClients(); @@ -176,6 +176,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt /** * Gets AABB based on abc and not xyz, without offsetting to controller position!!! + * * @param minA * @param minB * @param minC @@ -184,291 +185,292 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt * @param maxC * @return */ - public final AxisAlignedBB getBoundingBox(double minA,double minB,double minC,double maxA,double maxB,double maxC){ - double[] offSetsMin= getTranslatedOffsets(minA,minB,minC); - double[] offSetsMax= getTranslatedOffsets(maxA,maxB,maxC); - for (int i=0;i<3;i++){ - if(offSetsMax[i]<offSetsMin[i]){ - double temp=offSetsMax[i]; - offSetsMax[i]=offSetsMin[i]; - offSetsMin[i]=temp; + public final AxisAlignedBB getBoundingBox(double minA, double minB, double minC, double maxA, double maxB, double maxC) { + double[] offSetsMin = getTranslatedOffsets(minA, minB, minC); + double[] offSetsMax = getTranslatedOffsets(maxA, maxB, maxC); + for (int i = 0; i < 3; i++) { + if (offSetsMax[i] < offSetsMin[i]) { + double temp = offSetsMax[i]; + offSetsMax[i] = offSetsMin[i]; + offSetsMin[i] = temp; } } return AxisAlignedBB.getBoundingBox( - offSetsMin[0],offSetsMin[1],offSetsMin[2], - offSetsMax[0],offSetsMax[1],offSetsMax[2] + offSetsMin[0], offSetsMin[1], offSetsMin[2], + offSetsMax[0], offSetsMax[1], offSetsMax[2] ); } /** * Translates relative axis coordinates abc to absolute axis coordinates xyz * abc from the CONTROLLER! + * * @param a * @param b * @param c * @return */ - public final double[] getTranslatedOffsets(double a, double b, double c){ - double[] result=new double[3]; - switch (getBaseMetaTileEntity().getFrontFacing() +(frontRotation<<3)){ + public final double[] getTranslatedOffsets(double a, double b, double c) { + double[] result = new double[3]; + switch (getBaseMetaTileEntity().getFrontFacing() + (frontRotation << 3)) { case 4: - result[0]= c; - result[2]= a; - result[1]=- b; + result[0] = c; + result[2] = a; + result[1] = -b; break; case 12: - result[0]= c; - result[1]=- a; - result[2]=- b; + result[0] = c; + result[1] = -a; + result[2] = -b; break; case 20: - result[0]= c; - result[2]=- a; - result[1]= b; + result[0] = c; + result[2] = -a; + result[1] = b; break; case 28: - result[0]= c; - result[1]= a; - result[2]= b; + result[0] = c; + result[1] = a; + result[2] = b; break; case 3: - result[0]= a; - result[2]=- c; - result[1]=- b; + result[0] = a; + result[2] = -c; + result[1] = -b; break; case 11: - result[1]=- a; - result[2]=- c; - result[0]=- b; + result[1] = -a; + result[2] = -c; + result[0] = -b; break; case 19: - result[0]=- a; - result[2]=- c; - result[1]= b; + result[0] = -a; + result[2] = -c; + result[1] = b; break; case 27: - result[1]= a; - result[2]=- c; - result[0]= b; + result[1] = a; + result[2] = -c; + result[0] = b; break; case 5: - result[0]=- c; - result[2]=- a; - result[1]=- b; + result[0] = -c; + result[2] = -a; + result[1] = -b; break; case 13: - result[0]=- c; - result[1]=- a; - result[2]= b; + result[0] = -c; + result[1] = -a; + result[2] = b; break; case 21: - result[0]=- c; - result[2]= a; - result[1]= b; + result[0] = -c; + result[2] = a; + result[1] = b; break; case 29: - result[0]=- c; - result[1]= a; - result[2]=- b; + result[0] = -c; + result[1] = a; + result[2] = -b; break; case 2: - result[0]=- a; - result[2]= c; - result[1]=- b; + result[0] = -a; + result[2] = c; + result[1] = -b; break; case 10: - result[1]=- a; - result[2]= c; - result[0]= b; + result[1] = -a; + result[2] = c; + result[0] = b; break; case 18: - result[0]= a; - result[2]= c; - result[1]= b; + result[0] = a; + result[2] = c; + result[1] = b; break; case 26: - result[1]= a; - result[2]= c; - result[0]=- b; + result[1] = a; + result[2] = c; + result[0] = -b; break; //Things get odd if the block faces up or down... case 1: - result[0]= a; - result[2]= b; - result[1]=- c; + result[0] = a; + result[2] = b; + result[1] = -c; break;//similar to 3 case 9: - result[2]= a; - result[0]=- b; - result[1]=- c; + result[2] = a; + result[0] = -b; + result[1] = -c; break;//similar to 3 case 17: - result[0]=- a; - result[2]=- b; - result[1]=- c; + result[0] = -a; + result[2] = -b; + result[1] = -c; break;//similar to 3 case 25: - result[2]=- a; - result[0]= b; - result[1]=- c; + result[2] = -a; + result[0] = b; + result[1] = -c; break;//similar to 3 case 0: - result[0]=- a; - result[2]= b; - result[1]= c; + result[0] = -a; + result[2] = b; + result[1] = c; break;//similar to 2 case 8: - result[2]= a; - result[0]= b; - result[1]= c; + result[2] = a; + result[0] = b; + result[1] = c; break; case 16: - result[0]= a; - result[2]=- b; - result[1]= c; + result[0] = a; + result[2] = -b; + result[1] = c; break; case 24: - result[2]=- a; - result[0]=- b; - result[0]=- b; - result[1]=+ c; + result[2] = -a; + result[0] = -b; + result[0] = -b; + result[1] = +c; break; } return result; } - public final int[] getTranslatedOffsets(int a, int b, int c){ - int[] result=new int[3]; - switch (getBaseMetaTileEntity().getFrontFacing() +(frontRotation<<3)){ + public final int[] getTranslatedOffsets(int a, int b, int c) { + int[] result = new int[3]; + switch (getBaseMetaTileEntity().getFrontFacing() + (frontRotation << 3)) { case 4: - result[0]= c; - result[2]= a; - result[1]=- b; + result[0] = c; + result[2] = a; + result[1] = -b; break; case 12: - result[0]= c; - result[1]=- a; - result[2]=- b; + result[0] = c; + result[1] = -a; + result[2] = -b; break; case 20: - result[0]= c; - result[2]=- a; - result[1]= b; + result[0] = c; + result[2] = -a; + result[1] = b; break; case 28: - result[0]= c; - result[1]= a; - result[2]= b; + result[0] = c; + result[1] = a; + result[2] = b; break; case 3: - result[0]= a; - result[2]=- c; - result[1]=- b; + result[0] = a; + result[2] = -c; + result[1] = -b; break; case 11: - result[1]=- a; - result[2]=- c; - result[0]=- b; + result[1] = -a; + result[2] = -c; + result[0] = -b; break; case 19: - result[0]=- a; - result[2]=- c; - result[1]= b; + result[0] = -a; + result[2] = -c; + result[1] = b; break; case 27: - result[1]= a; - result[2]=- c; - result[0]= b; + result[1] = a; + result[2] = -c; + result[0] = b; break; case 5: - result[0]=- c; - result[2]=- a; - result[1]=- b; + result[0] = -c; + result[2] = -a; + result[1] = -b; break; case 13: - result[0]=- c; - result[1]=- a; - result[2]= b; + result[0] = -c; + result[1] = -a; + result[2] = b; break; case 21: - result[0]=- c; - result[2]= a; - result[1]= b; + result[0] = -c; + result[2] = a; + result[1] = b; break; case 29: - result[0]=- c; - result[1]= a; - result[2]=- b; + result[0] = -c; + result[1] = a; + result[2] = -b; break; case 2: - result[0]=- a; - result[2]= c; - result[1]=- b; + result[0] = -a; + result[2] = c; + result[1] = -b; break; case 10: - result[1]=- a; - result[2]= c; - result[0]= b; + result[1] = -a; + result[2] = c; + result[0] = b; break; case 18: - result[0]= a; - result[2]= c; - result[1]= b; + result[0] = a; + result[2] = c; + result[1] = b; break; case 26: - result[1]= a; - result[2]= c; - result[0]=- b; + result[1] = a; + result[2] = c; + result[0] = -b; break; //Things get odd if the block faces up or down... case 1: - result[0]= a; - result[2]= b; - result[1]=- c; + result[0] = a; + result[2] = b; + result[1] = -c; break;//similar to 3 case 9: - result[2]= a; - result[0]=- b; - result[1]=- c; + result[2] = a; + result[0] = -b; + result[1] = -c; break;//similar to 3 case 17: - result[0]=- a; - result[2]=- b; - result[1]=- c; + result[0] = -a; + result[2] = -b; + result[1] = -c; break;//similar to 3 case 25: - result[2]=- a; - result[0]= b; - result[1]=- c; + result[2] = -a; + result[0] = b; + result[1] = -c; break;//similar to 3 case 0: - result[0]=- a; - result[2]= b; - result[1]= c; + result[0] = -a; + result[2] = b; + result[1] = c; break;//similar to 2 case 8: - result[2]= a; - result[0]= b; - result[1]= c; + result[2] = a; + result[0] = b; + result[1] = c; break; case 16: - result[0]= a; - result[2]=- b; - result[1]= c; + result[0] = a; + result[2] = -b; + result[1] = c; break; case 24: - result[2]=- a; - result[0]=- b; - result[0]=- b; - result[1]=+ c; + result[2] = -a; + result[0] = -b; + result[0] = -b; + result[1] = +c; break; } return result; @@ -505,8 +507,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt /** * Check structure here, also add hatches + * * @param iGregTechTileEntity - the tile entity - * @param itemStack - what is in the controller input slot + * @param itemStack - what is in the controller input slot * @return is structure valid */ protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { @@ -515,12 +518,12 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt /** * Checks Recipes (when all machine is complete and can work) - * + * <p> * can get/set Parameters here also * * @param itemStack item in the controller * @return is recipe is valid - * */ + */ public boolean checkRecipe_EM(ItemStack itemStack) { return false; } @@ -528,22 +531,24 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt /** * Put EM stuff from outputEM into EM output hatches here * or do other stuff - it is basically on recipe succeded - * + * <p> * based on "machine state" do output, * this must move to outputEM to EM output hatches * and can also modify output items/fluids/EM, remaining EM is NOT overflowed. * (Well it can be overflowed if machine didn't finished, soft-hammered/disabled/not enough EU) * Setting available data processing */ - public void outputAfterRecipe_EM() {} + public void outputAfterRecipe_EM() { + } /** * to add fluids into hatches + * * @param mOutputFluids */ @Override protected void addFluidOutputs(FluidStack[] mOutputFluids) { - int min=mOutputFluids.length>mOutputHatches.size()?mOutputHatches.size():mOutputFluids.length; + int min = mOutputFluids.length > mOutputHatches.size() ? mOutputHatches.size() : mOutputFluids.length; for (int i = 0; i < min; ++i) { if (mOutputHatches.get(i) != null && mOutputFluids[i] != null && GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(mOutputHatches.get(i))) { mOutputHatches.get(i).fill(mOutputFluids[i], true); @@ -555,48 +560,46 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt //region tooltip and scanner result /** - * * @param hatchNo * @param paramID * @return */ - public ArrayList<String> getFullLedDescriptionIn(int hatchNo, int paramID){ - ArrayList<String> list=new ArrayList<>(); - list.add(EnumChatFormatting.WHITE+"ID: " + - EnumChatFormatting.AQUA+hatchNo + - EnumChatFormatting.YELLOW+ ":" + - EnumChatFormatting.AQUA+paramID + - EnumChatFormatting.YELLOW+ ":"+ - EnumChatFormatting.AQUA+"I "+parametrization.getStatusIn(hatchNo, paramID).name.get()); - list.add(EnumChatFormatting.WHITE+"Value: "+ - EnumChatFormatting.AQUA+ Util.doubleToString(parametrization.getIn(hatchNo,paramID))); - try{ + public ArrayList<String> getFullLedDescriptionIn(int hatchNo, int paramID) { + ArrayList<String> list = new ArrayList<>(); + list.add(EnumChatFormatting.WHITE + "ID: " + + EnumChatFormatting.AQUA + hatchNo + + EnumChatFormatting.YELLOW + ":" + + EnumChatFormatting.AQUA + paramID + + EnumChatFormatting.YELLOW + ":" + + EnumChatFormatting.AQUA + "I " + parametrization.getStatusIn(hatchNo, paramID).name.get()); + list.add(EnumChatFormatting.WHITE + "Value: " + + EnumChatFormatting.AQUA + Util.doubleToString(parametrization.getIn(hatchNo, paramID))); + try { list.add(parametrization.groups[hatchNo].parameterIn[paramID].getBrief()); - }catch (NullPointerException|IndexOutOfBoundsException e){ + } catch (NullPointerException | IndexOutOfBoundsException e) { list.add("Unused"); } return list; } /** - * * @param hatchNo * @param paramID * @return */ - public ArrayList<String> getFullLedDescriptionOut(int hatchNo, int paramID){ - ArrayList<String> list=new ArrayList<>(); - list.add(EnumChatFormatting.WHITE+"ID: " + - EnumChatFormatting.AQUA+hatchNo + - EnumChatFormatting.YELLOW+ ":" + - EnumChatFormatting.AQUA+paramID + - EnumChatFormatting.YELLOW+ ":"+ - EnumChatFormatting.AQUA+"O "+parametrization.getStatusOut(hatchNo, paramID).name.get()); - list.add(EnumChatFormatting.WHITE+"Value: "+ - EnumChatFormatting.AQUA+Util.doubleToString(parametrization.getOut(hatchNo,paramID))); - try{ + public ArrayList<String> getFullLedDescriptionOut(int hatchNo, int paramID) { + ArrayList<String> list = new ArrayList<>(); + list.add(EnumChatFormatting.WHITE + "ID: " + + EnumChatFormatting.AQUA + hatchNo + + EnumChatFormatting.YELLOW + ":" + + EnumChatFormatting.AQUA + paramID + + EnumChatFormatting.YELLOW + ":" + + EnumChatFormatting.AQUA + "O " + parametrization.getStatusOut(hatchNo, paramID).name.get()); + list.add(EnumChatFormatting.WHITE + "Value: " + + EnumChatFormatting.AQUA + Util.doubleToString(parametrization.getOut(hatchNo, paramID))); + try { list.add(parametrization.groups[hatchNo].parameterOut[paramID].getBrief()); - }catch (NullPointerException|IndexOutOfBoundsException e){ + } catch (NullPointerException | IndexOutOfBoundsException e) { list.add("Unused"); } return list; @@ -604,6 +607,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt /** * TOOLTIP + * * @return strings in tooltip */ @Override @@ -616,6 +620,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt /** * scanner gives it + * * @return */ @Override @@ -642,7 +647,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt "Energy Hatches:", EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU", - (mEUt*eAmpereFlow <= 0 ? "Probably uses: " : "Probably makes: ") + + (mEUt * eAmpereFlow <= 0 ? "Probably uses: " : "Probably makes: ") + EnumChatFormatting.RED + Math.abs(mEUt) + EnumChatFormatting.RESET + " EU/t at " + EnumChatFormatting.RED + eAmpereFlow + EnumChatFormatting.RESET + " A", "Tier Rating: " + EnumChatFormatting.YELLOW + VN[getMaxEnergyInputTier_EM()] + EnumChatFormatting.RESET + " / " + EnumChatFormatting.GREEN + VN[getMinEnergyInputTier_EM()] + EnumChatFormatting.RESET + @@ -657,6 +662,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt /** * should it work with scanner? HELL YES + * * @return */ @Override @@ -670,6 +676,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt /** * Server side container + * * @param aID * @param aPlayerInventory * @param aBaseMetaTileEntity @@ -682,6 +689,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt /** * Client side gui + * * @param aID * @param aPlayerInventory * @param aBaseMetaTileEntity @@ -695,6 +703,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt /** * add more textures + * * @param aBlockIconRegister */ @Override @@ -707,6 +716,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt /** * actually use textures + * * @param aBaseMetaTileEntity * @param aSide * @param aFacing @@ -725,26 +735,28 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt /** * should return your activity sound + * * @return */ @SideOnly(Side.CLIENT) - protected ResourceLocation getActivitySound(){ + protected ResourceLocation getActivitySound() { return activitySound; } /** * plays the sounds auto magically + * * @param activitySound */ @SideOnly(Side.CLIENT) - protected void soundMagic(ResourceLocation activitySound){ - if(getBaseMetaTileEntity().isActive()){ - if(activitySoundLoop==null){ - activitySoundLoop =new SoundLoop(activitySound,getBaseMetaTileEntity(),false,true); + protected void soundMagic(ResourceLocation activitySound) { + if (getBaseMetaTileEntity().isActive()) { + if (activitySoundLoop == null) { + activitySoundLoop = new SoundLoop(activitySound, getBaseMetaTileEntity(), false, true); Minecraft.getMinecraft().getSoundHandler().playSound(activitySoundLoop); } - }else { - if(activitySoundLoop!=null) { + } else { + if (activitySoundLoop != null) { activitySoundLoop = null; } } @@ -756,6 +768,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt /** * is the thing inside controller a valid item to make the machine work + * * @param itemStack * @return */ @@ -766,6 +779,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt /** * how much damage to apply to thing in controller - not sure how it does it + * * @param itemStack * @return */ @@ -802,7 +816,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } } cleanOutputEM_EM(); - if (ePowerPass && getEUVar()>V[3] || eDismantleBoom && mMaxProgresstime > 0 && areChunksAroundLoaded_EM()) { + if (ePowerPass && getEUVar() > V[3] || eDismantleBoom && mMaxProgresstime > 0 && areChunksAroundLoaded_EM()) { explodeMultiblock(); } } catch (Exception e) { @@ -815,14 +829,15 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt /** * prevents spontaneous explosions when the chunks unloading would cause them * should cover 3 chunks radius + * * @return */ - protected boolean areChunksAroundLoaded_EM(){ - if(GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(this) && getBaseMetaTileEntity().isServerSide()){ - IGregTechTileEntity base=getBaseMetaTileEntity(); - return base.getWorld().doChunksNearChunkExist(base.getXCoord(),base.getYCoord(),base.getZCoord(),3); + protected boolean areChunksAroundLoaded_EM() { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(this) && getBaseMetaTileEntity().isServerSide()) { + IGregTechTileEntity base = getBaseMetaTileEntity(); + return base.getWorld().doChunksNearChunkExist(base.getXCoord(), base.getYCoord(), base.getZCoord(), 3); //todo check if it is actually checking if chunks are loaded - }else { + } else { return false; } } @@ -830,29 +845,30 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt /** * instantiate parameters in CONSTRUCTOR! CALLED ONCE on creation, don't call it in your classes */ - protected void parametersInstantiation_EM(){} + protected void parametersInstantiation_EM() { + } /** * It is automatically called OFTEN * update status of parameters in guis (and "machine state" if u wish) * Called before check recipe, before outputting, and every second the machine is complete - * + * <p> * good place to update parameter statuses, default implementation handles it well * * @param machineBusy is machine doing SHIT */ protected void parametersStatusesWrite_EM(boolean machineBusy) {//todo unimplement? - if(!machineBusy){ + if (!machineBusy) { for (Parameters.Group.ParameterIn parameterIn : parametrization.parameterInArrayList) { if (parameterIn != null) { parameterIn.updateStatus(); } } - }else{ - for (Parameters.Group hatch:parametrization.groups){ - if(hatch!=null && hatch.updateWhileRunning){ - for (Parameters.Group.ParameterIn in:hatch.parameterIn) { - if(in!=null){ + } else { + for (Parameters.Group hatch : parametrization.groups) { + if (hatch != null && hatch.updateWhileRunning) { + for (Parameters.Group.ParameterIn in : hatch.parameterIn) { + if (in != null) { in.updateStatus(); } } @@ -868,17 +884,21 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt /** * For extra types of hatches initiation, LOOK HOW IT IS CALLED! in onPostTick + * * @param mMachine was the machine considered complete at that point in onPostTick */ - protected void hatchInit_EM(boolean mMachine) {} + protected void hatchInit_EM(boolean mMachine) { + } /** * called when the multiblock is exploding - if u want to add more EXPLOSIONS, for ex. new types of hatches also have to explode */ - protected void extraExplosions_EM() {}//For that extra hatches explosions, and maybe some MOORE EXPLOSIONS + protected void extraExplosions_EM() { + }//For that extra hatches explosions, and maybe some MOORE EXPLOSIONS /** * Get Available data, Override only on data outputters should return mAvailableData that is set in check recipe + * * @return available data */ protected long getAvailableData_EM() { @@ -886,8 +906,8 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt Vec3pos pos = new Vec3pos(getBaseMetaTileEntity()); for (GT_MetaTileEntity_Hatch_InputData in : eInputData) { if (in.q != null) { - Long value=in.q.contentIfNotInTrace(pos); - if(value!=null) { + Long value = in.q.contentIfNotInTrace(pos); + if (value != null) { result += value; } } @@ -906,6 +926,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt /** * get pollution per tick + * * @param itemStack what is in controller * @return how much pollution is produced */ @@ -916,6 +937,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt /** * EM pollution per tick + * * @param itemStack - item in controller * @return how much excess matter is there */ @@ -926,15 +948,16 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt /** * triggered if machine is not allowed to work after completing a recipe, override to make it not shutdown for instance (like turbines). * bu just replacing it with blank - active transformer is doing it - * + * <p> * CALLED DIRECTLY when soft hammered to offline state - usually should stop the machine unless some other mechanics should do it */ - protected void notAllowedToWork_stopMachine_EM(){ + protected void notAllowedToWork_stopMachine_EM() { stopMachine(); } /** * store data + * * @param aNBT */ @Override @@ -952,7 +975,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt aNBT.setByte("eCertainM", eCertainMode); aNBT.setByte("eCertainS", eCertainStatus); aNBT.setByte("eMinRepair", minRepairStatus); - aNBT.setByte("eRotation",frontRotation); + aNBT.setByte("eRotation", frontRotation); aNBT.setBoolean("eParam", eParameters); aNBT.setBoolean("ePass", ePowerPass); aNBT.setBoolean("eVoid", eSafeVoid); @@ -1024,6 +1047,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt /** * load data + * * @param aNBT */ @Override @@ -1069,7 +1093,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt int outputLen = aNBT.getInteger("eOutputStackCount"); if (outputLen > 0) { outputEM = new cElementalInstanceStackMap[outputLen]; - NBTTagCompound compound=aNBT.getCompoundTag("outputEM"); + NBTTagCompound compound = aNBT.getCompoundTag("outputEM"); for (int i = 0; i < outputEM.length; i++) { if (compound.hasKey(Integer.toString(i))) { try { @@ -1086,20 +1110,20 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt outputEM = null; } - if(aNBT.hasKey("eParamsIn") && aNBT.hasKey("eParamsOut") && aNBT.hasKey("eParamsB")){ + if (aNBT.hasKey("eParamsIn") && aNBT.hasKey("eParamsOut") && aNBT.hasKey("eParamsB")) { NBTTagCompound paramI = aNBT.getCompoundTag("eParamsIn"); NBTTagCompound paramO = aNBT.getCompoundTag("eParamsOut"); NBTTagCompound paramB = aNBT.getCompoundTag("eParamsB"); for (int i = 0; i < 10; i++) { - if(paramB.getBoolean(Integer.toString(i))){ + if (paramB.getBoolean(Integer.toString(i))) { parametrization.iParamsIn[i] = Float.intBitsToFloat(paramI.getInteger(Integer.toString(i))); - parametrization.iParamsOut[i] =Float.intBitsToFloat(paramO.getInteger(Integer.toString(i))); - }else { + parametrization.iParamsOut[i] = Float.intBitsToFloat(paramO.getInteger(Integer.toString(i))); + } else { parametrization.iParamsIn[i] = paramI.getInteger(Integer.toString(i)); parametrization.iParamsOut[i] = paramO.getInteger(Integer.toString(i)); } } - }else{ + } else { NBTTagCompound paramI = aNBT.getCompoundTag("eParamsInD"); for (int i = 0; i < parametrization.iParamsIn.length; i++) { parametrization.iParamsIn[i] = paramI.getDouble(Integer.toString(i)); @@ -1123,6 +1147,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt /** * if u want to use gt recipe maps... + * * @return */ @Override @@ -1170,7 +1195,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt * After recipe check failed * helper method so i don't have to set that params to nothing at all times */ - protected void afterRecipeCheckFailed(){ + protected void afterRecipeCheckFailed() { cleanOrExplode(); for (GT_MetaTileEntity_Hatch_OutputData data : eOutputData) { @@ -1214,6 +1239,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt /** * cyclic check even when not working, called LESS frequently + * * @return */ private boolean cyclicUpdate() { @@ -1226,6 +1252,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt /** * mining level... + * * @return */ @Override @@ -1245,15 +1272,15 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt @Override public final void forceSetRotationDoRender(byte rotation) { frontRotation = rotation; - IGregTechTileEntity base=getBaseMetaTileEntity(); - if(base.isClientSide()) { + IGregTechTileEntity base = getBaseMetaTileEntity(); + if (base.isClientSide()) { base.issueTextureUpdate(); } } - protected final void updateRotationOnClients(){ - if(getBaseMetaTileEntity().isServerSide()){ - IGregTechTileEntity base=getBaseMetaTileEntity(); + protected final void updateRotationOnClients() { + if (getBaseMetaTileEntity().isServerSide()) { + IGregTechTileEntity base = getBaseMetaTileEntity(); NetworkDispatcher.INSTANCE.sendToAllAround(new RotationMessage.RotationData(this), base.getWorld().provider.dimensionId, base.getXCoord(), @@ -1273,6 +1300,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt /** * internal check machine + * * @param iGregTechTileEntity * @param itemStack * @return @@ -1284,13 +1312,14 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt /** * internal check recipe + * * @param itemStack * @return */ @Override public final boolean checkRecipe(ItemStack itemStack) {//do recipe checks, based on "machine content and state" hatchesStatusUpdate_EM(); - boolean result= checkRecipe_EM(itemStack);//if had no - set default params + boolean result = checkRecipe_EM(itemStack);//if had no - set default params hatchesStatusUpdate_EM(); return result; } @@ -1299,17 +1328,17 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt * callback for updating parameters and new hatches */ protected void hatchesStatusUpdate_EM() { - if(getBaseMetaTileEntity().isClientSide()){ + if (getBaseMetaTileEntity().isClientSide()) { return; } - boolean busy=mMaxProgresstime>0; + boolean busy = mMaxProgresstime > 0; if (busy) {//write from buffer to hatches only for (GT_MetaTileEntity_Hatch_Param hatch : eParamHatches) { if (!GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch) || hatch.param < 0) { continue; } int hatchId = hatch.param; - if(parametrization.groups[hatchId]!=null && parametrization.groups[hatchId].updateWhileRunning){ + if (parametrization.groups[hatchId] != null && parametrization.groups[hatchId].updateWhileRunning) { parametrization.iParamsIn[hatchId] = hatch.value0D; parametrization.iParamsIn[hatchId + 10] = hatch.value1D; } @@ -1343,12 +1372,13 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt //region TICKING functions - public void onFirstTick_EM(IGregTechTileEntity aBaseMetaTileEntity){} + public void onFirstTick_EM(IGregTechTileEntity aBaseMetaTileEntity) { + } @Override public final void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { isFacingValid(aBaseMetaTileEntity.getFrontFacing()); - if(getBaseMetaTileEntity().isClientSide()){ + if (getBaseMetaTileEntity().isClientSide()) { NetworkDispatcher.INSTANCE.sendToServer(new RotationMessage.RotationQuery(this)); } onFirstTick_EM(aBaseMetaTileEntity); @@ -1356,18 +1386,19 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt /** * called every tick the machines is active + * * @param aStack * @return */ @Override public boolean onRunningTick(ItemStack aStack) { if (eRequiredData > eAvailableData) { - if(energyFlowOnRunningTick(aStack,false)) { + if (energyFlowOnRunningTick(aStack, false)) { stopMachine(); } return false; } - return energyFlowOnRunningTick(aStack,true); + return energyFlowOnRunningTick(aStack, true); } /** @@ -1376,7 +1407,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide()) { - explodedThisTick=false; + explodedThisTick = false; if (mEfficiency < 0) { mEfficiency = 0; } @@ -1568,7 +1599,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt hatch.getBaseMetaTileEntity().setActive(true); } } - for (GT_MetaTileEntity_Hatch_Param hatch : eParamHatches){ + for (GT_MetaTileEntity_Hatch_Param hatch : eParamHatches) { if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) { hatch.getBaseMetaTileEntity().setActive(true); } @@ -1649,7 +1680,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } for (GT_MetaTileEntity_Hatch_OutputElemental out : eOutputHatches) { for (cElementalInstanceStack instance : out.getContainerHandler().values()) { - long qty = (long)Math.floor(remaining / instance.definition.getMass()); + long qty = (long) Math.floor(remaining / instance.definition.getMass()); if (qty > 0) { qty = Math.min(qty, instance.amount); if (voider.addOverflowMatter(instance.definition.getMass() * qty)) { @@ -1692,12 +1723,12 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } } } - if (ePowerPass && getEUVar()>getMinimumStoredEU()) { + if (ePowerPass && getEUVar() > getMinimumStoredEU()) { for (GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) { if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { euVar = tHatch.maxEUOutput(); if (tHatch.getBaseMetaTileEntity().getStoredEU() <= tHatch.maxEUStore() - euVar && - aBaseMetaTileEntity.decreaseStoredEnergyUnits(euVar + Math.min(euVar >> 7,1), false)) { + aBaseMetaTileEntity.decreaseStoredEnergyUnits(euVar + Math.min(euVar >> 7, 1), false)) { tHatch.setEUVar(tHatch.getBaseMetaTileEntity().getStoredEU() + euVar); } } @@ -1706,7 +1737,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { euVar = tHatch.maxEUOutput() * tHatch.Amperes; if (tHatch.getBaseMetaTileEntity().getStoredEU() <= tHatch.maxEUStore() - euVar && - aBaseMetaTileEntity.decreaseStoredEnergyUnits(euVar + Math.min(euVar >> 7,tHatch.Amperes), false)) { + aBaseMetaTileEntity.decreaseStoredEnergyUnits(euVar + Math.min(euVar >> 7, tHatch.Amperes), false)) { tHatch.setEUVar(tHatch.getBaseMetaTileEntity().getStoredEU() + euVar); } } @@ -1757,7 +1788,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt if (aBaseMetaTileEntity.isAllowedToWork()) { if (checkRecipe(mInventory[1])) { mEfficiency = Math.max(0, Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1]) - (getIdealStatus() - getRepairStatus()) * 1000)); - }else { + } else { afterRecipeCheckFailed(); } updateSlots(); @@ -1772,7 +1803,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt if (aBaseMetaTileEntity.isAllowedToWork()) { if (checkRecipe(mInventory[1])) { mEfficiency = Math.max(0, Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1]) - (getIdealStatus() - getRepairStatus()) * 1000)); - }else { + } else { afterRecipeCheckFailed(); } updateSlots(); @@ -1792,7 +1823,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt for (GT_MetaTileEntity_Hatch_Muffler aMuffler : mMufflerHatches) { aMuffler.getBaseMetaTileEntity().setActive(active); } - }else{ + } else { soundMagic(getActivitySound()); } } @@ -1826,7 +1857,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt if (allowProduction && euFlow > 0) { addEnergyOutput_EM((long) mEUt * (long) mEfficiency / getMaxEfficiency(aStack), eAmpereFlow); } else if (euFlow < 0) { - if (!drainEnergyInput_EM(mEUt,(long) mEUt * getMaxEfficiency(aStack) / Math.max(1000L, mEfficiency), eAmpereFlow)) { + if (!drainEnergyInput_EM(mEUt, (long) mEUt * getMaxEfficiency(aStack) / Math.max(1000L, mEfficiency), eAmpereFlow)) { stopMachine(); return false; } @@ -1849,7 +1880,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt @Override public long maxEUStore() { - return Math.max(maxEUinputMin * (eMaxAmpereFlow << 3),maxEUoutputMin*(eMaxAmpereGen << 3)); + return Math.max(maxEUinputMin * (eMaxAmpereFlow << 3), maxEUoutputMin * (eMaxAmpereGen << 3)); } @Override @@ -1897,16 +1928,15 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } /** - * * @param EU * @param Amperes * @return if was able to put inside the hatches */ private boolean addEnergyOutput_EM(long EU, long Amperes) { - if(EU<0) { + if (EU < 0) { EU = -EU; } - if(Amperes<0) { + if (Amperes < 0) { Amperes = -Amperes; } long euVar = EU * Amperes; @@ -1945,7 +1975,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } } } - setEUVar(Math.min(getEUVar() + euVar,maxEUStore())); + setEUVar(Math.min(getEUVar() + euVar, maxEUStore())); return false; } @@ -1969,19 +1999,19 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } private boolean drainEnergyInput_EM(long EUtTierVoltage, long EUtEffective, long Amperes) { - if(EUtTierVoltage<0) { + if (EUtTierVoltage < 0) { EUtTierVoltage = -EUtTierVoltage; } - if(EUtEffective<0) { + if (EUtEffective < 0) { EUtEffective = -EUtEffective; } - if(Amperes<0) { + if (Amperes < 0) { Amperes = -Amperes; } long EUuse = EUtEffective * Amperes; if (EUuse > getEUVar() || //not enough power EUtTierVoltage > maxEUinputMax || //TIER IS BASED ON BEST HATCH! not total EUtEffective input - (EUtTierVoltage*Amperes - 1) / maxEUinputMin + 1 > eMaxAmpereFlow) {// EUuse==0? --> (EUuse - 1) / maxEUinputMin + 1 = 1! //if not too much A + (EUtTierVoltage * Amperes - 1) / maxEUinputMin + 1 > eMaxAmpereFlow) {// EUuse==0? --> (EUuse - 1) / maxEUinputMin + 1 = 1! //if not too much A if (DEBUG_MODE) { TecTech.LOGGER.debug("L1 " + EUuse + ' ' + getEUVar() + ' ' + (EUuse > getEUVar())); TecTech.LOGGER.debug("L2 " + EUtEffective + ' ' + maxEUinputMax + ' ' + (EUtEffective > maxEUinputMax)); @@ -2036,7 +2066,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } //new Method - public final long getMaxInputEnergy(){ + public final long getMaxInputEnergy() { long energy = 0; for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) { if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { @@ -2061,7 +2091,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt return getTier(maxEUinputMin); } - public final long getMaxAmpereFlowAtMinTierOfEnergyHatches(){ + public final long getMaxAmpereFlowAtMinTierOfEnergyHatches() { return eAmpereFlow; } @@ -2069,21 +2099,21 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt //region convenience copies input and output EM //new Method - public final cElementalInstanceStackMap getInputsClone_EM(){ - cElementalInstanceStackMap in=new cElementalInstanceStackMap(); - for(GT_MetaTileEntity_Hatch_ElementalContainer hatch:eInputHatches){ + public final cElementalInstanceStackMap getInputsClone_EM() { + cElementalInstanceStackMap in = new cElementalInstanceStackMap(); + for (GT_MetaTileEntity_Hatch_ElementalContainer hatch : eInputHatches) { in.putUnifyAll(hatch.getContainerHandler()); } - return in.hasStacks()?in:null; + return in.hasStacks() ? in : null; } //new Method - public final cElementalInstanceStackMap getOutputsClone_EM(){ - cElementalInstanceStackMap out=new cElementalInstanceStackMap(); - for(GT_MetaTileEntity_Hatch_ElementalContainer hatch:eOutputHatches){ + public final cElementalInstanceStackMap getOutputsClone_EM() { + cElementalInstanceStackMap out = new cElementalInstanceStackMap(); + for (GT_MetaTileEntity_Hatch_ElementalContainer hatch : eOutputHatches) { out.putUnifyAll(hatch.getContainerHandler()); } - return out.hasStacks()?out:null; + return out.hasStacks() ? out : null; } //endregion @@ -2124,18 +2154,18 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt public void cleanMassEM_EM(float mass) { if (mass > 0) { if (eMufflerHatches.size() < 1) { - TecTech.anomalyHandler.addAnomaly(getBaseMetaTileEntity(),mass); + TecTech.anomalyHandler.addAnomaly(getBaseMetaTileEntity(), mass); explodeMultiblock(); return; } mass /= eMufflerHatches.size(); - boolean shouldExplode=false; + boolean shouldExplode = false; for (GT_MetaTileEntity_Hatch_OverflowElemental dump : eMufflerHatches) { if (dump.addOverflowMatter(mass)) { - shouldExplode=true; + shouldExplode = true; } } - if(shouldExplode){ + if (shouldExplode) { explodeMultiblock(); } } @@ -2165,10 +2195,10 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt @Override public final void explodeMultiblock() { - if(explodedThisTick) { + if (explodedThisTick) { return; } - explodedThisTick=true; + explodedThisTick = true; if (!TecTech.configTecTech.BOOM_ENABLE) { TecTech.proxy.broadcast("Multi Explode BOOM! " + getBaseMetaTileEntity().getXCoord() + ' ' + getBaseMetaTileEntity().getYCoord() + ' ' + getBaseMetaTileEntity().getZCoord()); StackTraceElement[] ste = Thread.currentThread().getStackTrace(); @@ -2728,4 +2758,5 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } return false; } -} + //endregion +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/LedStatus.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/LedStatus.java index 5fce024cfc..d1173933f7 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/LedStatus.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/LedStatus.java @@ -57,7 +57,7 @@ public enum LedStatus { if(val==value) return STATUS_WRONG; } if(Double.isNaN(value)) return STATUS_WRONG; - return STATUS_UNDEFINED; + return STATUS_OK; } public static LedStatus fromLimitsExclusiveOuterBoundary(double value, double min,double low, double high,double max, double... excludedNumbers){ diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/render/TT_RenderedTexture.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/render/TT_RenderedTexture.java index 142214f43c..39a12f1f86 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/render/TT_RenderedTexture.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/render/TT_RenderedTexture.java @@ -229,6 +229,7 @@ public class TT_RenderedTexture implements ITexture,IColorModulationContainer { if (aRenderer.renderMinZ < 0.0D || aRenderer.renderMaxZ > 1.0D) { d5 = (double) icon.getMinV(); + d6 = (double) icon.getMaxV(); } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java index 39871910d9..d45fbc31d7 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java @@ -25,15 +25,18 @@ import static com.github.technus.tectech.Util.StructureBuilderExtreme; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*; +import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by danie_000 on 17.12.2016. */ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { + //region variables public static final String machine = "EM Machinery"; private ItemStack loadedMachine; private IBehaviour currentBehaviour; + //endregion //region structure private static final String[][] shape = new String[][]{ @@ -46,35 +49,35 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa {"B0", "A!!!", "0!!!0", "A!!!", "B0",},}; private static final Block[] blockType = new Block[]{sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{4, 0, 5, 6}; - private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList,this::addElementalToMachineList}; + private final IHatchAdder[] addingMethods = new IHatchAdder[]{this::addClassicToMachineList, this::addElementalToMachineList}; private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMetaFallback = new byte[]{0, 4}; private static final String[] description = new String[]{ - EnumChatFormatting.AQUA + "Hint Details:", - "1 - Classic Hatches or High Power Casing", - "2 - Elemental Hatches or Molecular Casing",}; + EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", + translateToLocal("gt.blockmachines.multimachine.em.processing.hint.0"),//1 - Classic Hatches or High Power Casing + translateToLocal("gt.blockmachines.multimachine.em.processing.hint.1"),};//2 - Elemental Hatches or Molecular Casing //endregion //region parameters protected Parameters.Group.ParameterIn[] inputMux; protected Parameters.Group.ParameterIn[] outputMux; private static final IStatusFunction<GT_MetaTileEntity_EM_machine> SRC_STATUS = - (base,p)-> { + (base, p) -> { double v = p.get(); if (Double.isNaN(v)) return STATUS_WRONG; - v=(int)v; + v = (int) v; if (v < 0) return STATUS_TOO_LOW; if (v == 0) return STATUS_NEUTRAL; if (v >= base.eInputHatches.size()) return STATUS_TOO_HIGH; return STATUS_OK; }; private static final IStatusFunction<GT_MetaTileEntity_EM_machine> DST_STATUS = - (base,p)->{ - if(base.inputMux[p.hatchId()].getStatus(false)== STATUS_OK){ + (base, p) -> { + if (base.inputMux[p.hatchId()].getStatus(false) == STATUS_OK) { double v = p.get(); if (Double.isNaN(v)) return STATUS_WRONG; - v=(int)v; + v = (int) v; if (v < 0) return STATUS_TOO_LOW; if (v == 0) return STATUS_LOW; if (v >= base.eInputHatches.size()) return STATUS_TOO_HIGH; @@ -82,8 +85,8 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa } return STATUS_NEUTRAL; }; - private static final INameFunction<GT_MetaTileEntity_EM_machine> ROUTE_NAME= - (base,p)->(p.parameterId()==0?"Source ":"Destination ")+p.hatchId(); + private static final INameFunction<GT_MetaTileEntity_EM_machine> ROUTE_NAME = + (base, p) -> (p.parameterId() == 0 ? translateToLocal("tt.keyword.Source") + " " : translateToLocal("tt.keyword.Destination") + " ") + p.hatchId(); //endregion public GT_MetaTileEntity_EM_machine(int aID, String aName, String aNameRegional) { @@ -94,30 +97,85 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa super(aName); } - @Override - public void saveNBTData(NBTTagCompound aNBT) { - super.saveNBTData(aNBT); - if(aNBT.hasKey("eLoadedMachine")){ - loadedMachine = ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("eLoadedMachine")); + private boolean setCurrentBehaviour() { + ItemStack newMachine = mInventory[1]; + if (ItemStack.areItemStacksEqual(newMachine, loadedMachine)) { + return false; + } + loadedMachine = newMachine; + Supplier<IBehaviour> behaviourSupplier = GT_MetaTileEntity_EM_machine.BEHAVIOUR_MAP.get(new Util.ItemStack_NoNBT(newMachine)); + if (currentBehaviour == null && behaviourSupplier == null) { + return false; } + if (currentBehaviour != null) { + for (int i = 6; i < 10; i++) { + parametrization.removeGroup(i); + } + } + if (behaviourSupplier != null) { + currentBehaviour = behaviourSupplier.get(); + currentBehaviour.parametersInstantiation(this, parametrization); + for (int i = 6; i < 10; i++) { + parametrization.setToDefaults(i, true, true); + } + } else { + currentBehaviour = null; + } + + return true; } - @Override - public void loadNBTData(NBTTagCompound aNBT) { - super.loadNBTData(aNBT); - if(loadedMachine !=null) { - aNBT.setTag("eLoadedMachine", loadedMachine.writeToNBT(new NBTTagCompound())); - } + private static final HashMap<Util.ItemStack_NoNBT, Supplier<IBehaviour>> BEHAVIOUR_MAP = new HashMap<>(); + + public static void registerBehaviour(Supplier<IBehaviour> behaviour, ItemStack is) { + BEHAVIOUR_MAP.put(new Util.ItemStack_NoNBT(is), behaviour); + TecTech.LOGGER.info("Registered EM machine behaviour " + behaviour.get().getClass().getSimpleName() + ' ' + new Util.ItemStack_NoNBT(is).toString()); } - @Override - protected void parametersInstantiation_EM() { - inputMux=new Parameters.Group.ParameterIn[6]; - outputMux=new Parameters.Group.ParameterIn[6]; - for (int i=0;i<6;i++){ - Parameters.Group hatch=parametrization.getGroup(i); - inputMux[i]=hatch.makeInParameter(0,i,ROUTE_NAME,SRC_STATUS); - outputMux[i]=hatch.makeInParameter(1,i,ROUTE_NAME,DST_STATUS); + public interface IBehaviour { + /** + * instantiate parameters, u can also check machine tier here + * + * @param te + * @param parameters + */ + void parametersInstantiation(GT_MetaTileEntity_EM_machine te, Parameters parameters); + + /** + * handle parameters per recipe + * + * @param te this te instance + * @param parameters of this te + * @return return true if machine can start with current parameters, false if not + */ + boolean checkParametersInAndSetStatuses(GT_MetaTileEntity_EM_machine te, Parameters parameters); + + /** + * do recipe handling + * + * @param inputs from muxed inputs + * @param parameters array passed from previous method! + * @return null if recipe should not start, control object to set machine state and start recipe + */ + MultiblockControl<cElementalInstanceStackMap[]> process(cElementalInstanceStackMap[] inputs, GT_MetaTileEntity_EM_machine te, Parameters parameters); + } + + private void quantumStuff(boolean shouldIExist) { + IGregTechTileEntity base = getBaseMetaTileEntity(); + if (base != null && base.getWorld() != null) { + int xDir = ForgeDirection.getOrientation(base.getBackFacing()).offsetX * 2 + base.getXCoord(); + int yDir = ForgeDirection.getOrientation(base.getBackFacing()).offsetY * 2 + base.getYCoord(); + int zDir = ForgeDirection.getOrientation(base.getBackFacing()).offsetZ * 2 + base.getZCoord(); + Block block = base.getWorld().getBlock(xDir, yDir, zDir); + if (shouldIExist) { + if (block != null && block.getMaterial() == Material.air) { + base.getWorld().setBlock(xDir, yDir, zDir, QuantumStuffBlock.INSTANCE, 0, 2); + } + } else { + if (block instanceof QuantumStuffBlock) { + base.getWorld().setBlock(xDir, yDir, zDir, Blocks.air, 0, 2); + } + } } } @@ -132,44 +190,50 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa } @Override - public void construct(int stackSize, boolean hintsOnly) { - StructureBuilderExtreme(shape, blockType, blockMeta, 2, 2, 1, getBaseMetaTileEntity(), this,hintsOnly); + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + if (aNBT.hasKey("eLoadedMachine")) { + loadedMachine = ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("eLoadedMachine")); + } } @Override - public String[] getStructureDescription(int stackSize) { - return description; + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + if (loadedMachine != null) { + aNBT.setTag("eLoadedMachine", loadedMachine.writeToNBT(new NBTTagCompound())); + } + } + + @Override + protected void parametersInstantiation_EM() { + inputMux = new Parameters.Group.ParameterIn[6]; + outputMux = new Parameters.Group.ParameterIn[6]; + for (int i = 0; i < 6; i++) { + Parameters.Group hatch = parametrization.getGroup(i); + inputMux[i] = hatch.makeInParameter(0, i, ROUTE_NAME, SRC_STATUS); + outputMux[i] = hatch.makeInParameter(1, i, ROUTE_NAME, DST_STATUS); + } } @Override public String[] getDescription() { - return new String[]{CommonValues.TEC_MARK_EM, "Processing quantum matter since...", EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "the time u started using it."}; + return new String[]{ + CommonValues.TEC_MARK_EM, + translateToLocal("gt.blockmachines.multimachine.em.processing.desc.0"),//Processing quantum matter since... + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.em.processing.desc.1")//the time u started using it. + }; } @Override public void onFirstTick_EM(IGregTechTileEntity aBaseMetaTileEntity) { setCurrentBehaviour(); - if(aBaseMetaTileEntity.isServerSide()) { + if (aBaseMetaTileEntity.isServerSide()) { quantumStuff(aBaseMetaTileEntity.isActive()); } } @Override - public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if(aBaseMetaTileEntity.isClientSide() && (aTick & 0x2)==0){ - if((aTick&0x10)==0) { - setCurrentBehaviour(); - } - if(aBaseMetaTileEntity.isActive()){ - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX*2+aBaseMetaTileEntity.getXCoord(); - int yDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetY*2+aBaseMetaTileEntity.getYCoord(); - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ*2+aBaseMetaTileEntity.getZCoord(); - aBaseMetaTileEntity.getWorld().markBlockRangeForRenderUpdate(xDir,yDir,zDir,xDir,yDir,zDir); - } - } - } - - @Override public void onRemoval() { quantumStuff(false); super.onRemoval(); @@ -178,7 +242,7 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa @Override public boolean checkRecipe_EM(ItemStack itemStack) { setCurrentBehaviour(); - if(currentBehaviour==null){ + if (currentBehaviour == null) { return false; } @@ -188,7 +252,7 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa cElementalInstanceStackMap[] handles = new cElementalInstanceStackMap[6]; for (int i = 0; i < 6; i++) { - int pointer = (int)inputMux[i].get(); + int pointer = (int) inputMux[i].get(); if (pointer >= 0 && pointer < eInputHatches.size()) { handles[i] = eInputHatches.get(pointer).getContainerHandler(); } @@ -204,7 +268,7 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa } } - MultiblockControl<cElementalInstanceStackMap[]> control = currentBehaviour.process(handles,this, parametrization); + MultiblockControl<cElementalInstanceStackMap[]> control = currentBehaviour.process(handles, this, parametrization); if (control == null) { return false; } @@ -220,12 +284,18 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa mMaxProgresstime = control.getMaxProgressTime(); eRequiredData = control.getRequiredData(); mEfficiencyIncrease = control.getEffIncrease(); - boolean polluted=polluteEnvironment(control.getPollutionToAdd()); + boolean polluted = polluteEnvironment(control.getPollutionToAdd()); quantumStuff(polluted); return polluted; } @Override + public void stopMachine() { + quantumStuff(false); + super.stopMachine(); + } + + @Override protected void afterRecipeCheckFailed() { quantumStuff(false); super.afterRecipeCheckFailed(); @@ -239,7 +309,7 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa cElementalInstanceStackMap[] handles = new cElementalInstanceStackMap[6]; for (int i = 0; i < 6; i++) { - int pointer = (int)outputMux[i].get(); + int pointer = (int) outputMux[i].get(); if (pointer >= 0 && pointer < eOutputHatches.size()) { handles[i] = eOutputHatches.get(pointer).getContainerHandler(); } @@ -256,12 +326,6 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa } @Override - public void stopMachine() { - quantumStuff(false); - super.stopMachine(); - } - - @Override public void parametersStatusesWrite_EM(boolean machineBusy) { if (!machineBusy) { setCurrentBehaviour(); @@ -269,82 +333,28 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa super.parametersStatusesWrite_EM(machineBusy); } - private boolean setCurrentBehaviour(){ - ItemStack newMachine=mInventory[1]; - if(ItemStack.areItemStacksEqual(newMachine, loadedMachine)){ - return false; - } - loadedMachine=newMachine; - Supplier<IBehaviour> behaviourSupplier=GT_MetaTileEntity_EM_machine.BEHAVIOUR_MAP.get(new Util.ItemStack_NoNBT(newMachine)); - if(currentBehaviour==null && behaviourSupplier==null) { - return false; - } - if(currentBehaviour!=null){ - for(int i=6;i<10;i++){ - parametrization.removeGroup(i); + @Override + public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isClientSide() && (aTick & 0x2) == 0) { + if ((aTick & 0x10) == 0) { + setCurrentBehaviour(); } - } - if(behaviourSupplier!=null){ - currentBehaviour=behaviourSupplier.get(); - currentBehaviour.parametersInstantiation(this, parametrization); - for(int i=6;i<10;i++){ - parametrization.setToDefaults(i,true,true); + if (aBaseMetaTileEntity.isActive()) { + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2 + aBaseMetaTileEntity.getXCoord(); + int yDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetY * 2 + aBaseMetaTileEntity.getYCoord(); + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2 + aBaseMetaTileEntity.getZCoord(); + aBaseMetaTileEntity.getWorld().markBlockRangeForRenderUpdate(xDir, yDir, zDir, xDir, yDir, zDir); } - } else { - currentBehaviour=null; } - - return true; } - private static final HashMap<Util.ItemStack_NoNBT, Supplier<IBehaviour>> BEHAVIOUR_MAP = new HashMap<>(); - - public static void registerBehaviour(Supplier<IBehaviour> behaviour, ItemStack is) { - BEHAVIOUR_MAP.put(new Util.ItemStack_NoNBT(is), behaviour); - TecTech.LOGGER.info("Registered EM machine behaviour "+behaviour.get().getClass().getSimpleName()+' '+new Util.ItemStack_NoNBT(is).toString()); - } - - public interface IBehaviour { - /** - * instantiate parameters, u can also check machine tier here - * @param te - * @param parameters - */ - void parametersInstantiation(GT_MetaTileEntity_EM_machine te, Parameters parameters); - - /** - * handle parameters per recipe - * @param te this te instance - * @param parameters of this te - * @return return true if machine can start with current parameters, false if not - */ - boolean checkParametersInAndSetStatuses(GT_MetaTileEntity_EM_machine te, Parameters parameters); - - /** - * do recipe handling - * @param inputs from muxed inputs - * @param parameters array passed from previous method! - * @return null if recipe should not start, control object to set machine state and start recipe - */ - MultiblockControl<cElementalInstanceStackMap[]> process(cElementalInstanceStackMap[] inputs, GT_MetaTileEntity_EM_machine te, Parameters parameters); + @Override + public void construct(int stackSize, boolean hintsOnly) { + StructureBuilderExtreme(shape, blockType, blockMeta, 2, 2, 1, getBaseMetaTileEntity(), this, hintsOnly); } - private void quantumStuff(boolean shouldExist){ - IGregTechTileEntity base=getBaseMetaTileEntity(); - if(base!=null && base.getWorld()!=null) { - int xDir = ForgeDirection.getOrientation(base.getBackFacing()).offsetX * 2+base.getXCoord(); - int yDir = ForgeDirection.getOrientation(base.getBackFacing()).offsetY * 2+base.getYCoord(); - int zDir = ForgeDirection.getOrientation(base.getBackFacing()).offsetZ * 2+base.getZCoord(); - Block block = base.getWorld().getBlock(xDir, yDir, zDir); - if (shouldExist) { - if(block != null && block.getMaterial()== Material.air) { - base.getWorld().setBlock(xDir, yDir, zDir, QuantumStuffBlock.INSTANCE, 0, 2); - } - } else { - if (block instanceof QuantumStuffBlock) { - base.getWorld().setBlock(xDir, yDir, zDir, Blocks.air, 0, 2); - } - } - } + @Override + public String[] getStructureDescription(int stackSize) { + return description; } -} +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java index d8b230995f..6d594512bd 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DataReader.java @@ -39,7 +39,7 @@ import static com.github.technus.tectech.recipe.TT_recipeAdder.nullItem; */ public class GT_MetaTileEntity_DataReader extends GT_MetaTileEntity_BasicMachine { private static final HashMap<Util.ItemStack_NoNBT,ArrayList<IDataRender>> RENDER_REGISTRY =new HashMap<>(); - private static GT_RenderedTexture READER_ONLINE, READER_OFFLINE; + public static GT_RenderedTexture READER_ONLINE, READER_OFFLINE; public GT_MetaTileEntity_DataReader(int aID, String aName, String aNameRegional, int aTier) { super(aID,aName,aNameRegional,aTier,1,"Reads Data Sticks and Orbs",1,1,"dataReader.png",""); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_MicroController.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_MicroController.java new file mode 100644 index 0000000000..ef5426a272 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_MicroController.java @@ -0,0 +1,187 @@ +package com.github.technus.tectech.thing.metaTileEntity.single; + +import com.github.technus.avrClone.AvrCore; +import com.github.technus.avrClone.instructions.ExecutionEvent; +import com.github.technus.avrClone.instructions.Instruction; +import com.github.technus.avrClone.instructions.InstructionRegistry; +import com.github.technus.avrClone.instructions.exceptions.DebugEvent; +import com.github.technus.avrClone.instructions.exceptions.DelayEvent; +import com.github.technus.avrClone.memory.EepromMemory; +import com.github.technus.avrClone.memory.RemovableMemory; +import com.github.technus.avrClone.memory.program.ProgramMemory; +import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.Util; +import com.github.technus.tectech.mechanics.avr.SidedRedstone; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; +import gregtech.api.objects.GT_RenderedTexture; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +import static com.github.technus.tectech.thing.metaTileEntity.single.GT_MetaTileEntity_DataReader.READER_OFFLINE; +import static com.github.technus.tectech.thing.metaTileEntity.single.GT_MetaTileEntity_DataReader.READER_ONLINE; + +public class GT_MetaTileEntity_MicroController extends GT_MetaTileEntity_TieredMachineBlock { + public static final int OPS_PER_TICK_MAX =512; + + static { + Instruction.random= TecTech.RANDOM; + } + public AvrCore core; + private int[] tempData; + public boolean debugRun; + private int delay; + private int maxLoad; + + public static final SidedRedstone sidedRedstone=new SidedRedstone(0x16); + + public GT_MetaTileEntity_MicroController(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 0, "AVR Micro-controller"); + Util.setTier(aTier,this); + } + + public GT_MetaTileEntity_MicroController(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 0, aDescription, aTextures); + Util.setTier(aTier,this); + core=new AvrCore(); + core.setUsingImmersiveOperands(false); + core.setInstructionRegistry(InstructionRegistry.INSTRUCTION_REGISTRY_OP); + core.setDataMemory(Math.max(64,1<<aTier),Math.max(64,1<<aTier)); + core.setCpuRegisters(0x30); + core.putDataBindings(sidedRedstone); + maxLoad=Math.min(1 << mTier, OPS_PER_TICK_MAX); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_MetaTileEntity_MicroController(mName, mTier, mDescription, mTextures); + } + + @Override + public void loadNBTData(NBTTagCompound tag) { + NBTTagCompound avr=tag.getCompoundTag("avr"); + debugRun=avr.getBoolean("debugRun"); + delay=avr.getInteger("delay"); + core.active =avr.getBoolean("active"); + core.awoken=(avr.getBoolean("awoken")); + core.programCounter=avr.getInteger("programCounter"); + if(avr.hasKey("instructions")){ + InstructionRegistry registry= + InstructionRegistry.REGISTRIES. + get(avr.getString("instructionRegistry")); + if(registry!=null) { + core.setProgramMemory(new ProgramMemory( + registry, + avr.getBoolean("immersive"), + avr.getIntArray("instructions"), + avr.getIntArray("param0"), + avr.getIntArray("param1"))); + } + } + if(avr.hasKey("eepromSize")){ + core.restoreEepromDefinition(EepromMemory.make(avr.getInteger("eepromSize"))); + } + if(avr.hasKey("dataMemory")){ + tempData=avr.getIntArray("dataMemory"); + } + core.checkValid(); + } + + @Override + public void saveNBTData(NBTTagCompound tag) { + NBTTagCompound avr=new NBTTagCompound(); + avr.setBoolean("debugRun",debugRun); + avr.setInteger("delay",delay); + avr.setBoolean("active",core.active); + avr.setBoolean("awoken",core.awoken); + avr.setInteger("programCounter",core.programCounter); + ProgramMemory programMemory=core.getProgramMemory(); + if(programMemory!=null){ + avr.setIntArray("instructions",programMemory.instructions); + avr.setIntArray("param0",programMemory.param0); + avr.setIntArray("param1",programMemory.param1); + avr.setBoolean("immersive",programMemory.immersiveOperands); + avr.setString("instructionRegistry",programMemory.registry.toString()); + } + RemovableMemory<EepromMemory> eeprom=core.getEepromMemory(); + if(eeprom!=null){ + avr.setInteger("eepromSize",eeprom.getDefinition().getSize()); + } + if(core.dataMemory!=null){ + avr.setIntArray("dataMemory",core.dataMemory); + } + tag.setTag("avr",avr); + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (tempData != null) { + //todo discovery of components + core.dataMemory = tempData; + tempData = null; + } + if (aBaseMetaTileEntity.isActive()) { + sidedRedstone.preSync(core,aBaseMetaTileEntity); + core.interruptsHandle(); + if (core.awoken) { + delay=0; + for (int load=0; load < maxLoad;) { + load+=core.getInstruction().getCost(core); + ExecutionEvent executionEvent = core.cpuCycleForce(); + if (executionEvent != null) { + if (executionEvent.throwable instanceof DelayEvent) { + delay = executionEvent.data[0]; + break; + } else if (executionEvent.throwable instanceof DebugEvent) { + if(debugRun) { + aBaseMetaTileEntity.setActive(false); + break; + } + } + } + } + }else if(delay>0){ + delay--; + if(delay==0){ + core.awoken=true; + } + } + sidedRedstone.postSync(core,aBaseMetaTileEntity); + } + core.active=aBaseMetaTileEntity.isActive(); + } + + @Override + public boolean allowPullStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { + return true; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { + return true; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if(aBaseMetaTileEntity.getWorld()==null){ + if(aSide==aFacing){ + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], aActive ? READER_ONLINE : READER_OFFLINE}; + } + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1]}; + } + if(aSide==aBaseMetaTileEntity.getFrontFacing()){ + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], aActive ? READER_ONLINE : READER_OFFLINE}; + }else if(aSide==aFacing){ + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + } + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1]}; + } + + @Override + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + return null; + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TT_Transformer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TT_Transformer.java new file mode 100644 index 0000000000..09ab5fe508 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TT_Transformer.java @@ -0,0 +1,54 @@ +package com.github.technus.tectech.thing.metaTileEntity.single; + +import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.Util; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Transformer; + +import static com.github.technus.tectech.thing.metaTileEntity.Textures.*; +import static net.minecraft.util.StatCollector.translateToLocal; + +public class GT_MetaTileEntity_TT_Transformer extends GT_MetaTileEntity_Transformer { + public GT_MetaTileEntity_TT_Transformer(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, ""); + Util.setTier(aTier, this); + } + + public GT_MetaTileEntity_TT_Transformer(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + Util.setTier(aTier, this); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_TT_Transformer(mName, mTier, mDescription, mTextures); + } + + @Override + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + ITexture[][][] rTextures = new ITexture[12][17][]; + for (byte b = -1; b < 16; b++) { + rTextures[0][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_OUT_MULTI_TT[mTier]}; + rTextures[1][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_OUT_MULTI_TT[mTier]}; + rTextures[2][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_OUT_MULTI_TT[mTier]}; + rTextures[3][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_IN_POWER_TT[mTier + 1]}; + rTextures[4][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_IN_POWER_TT[mTier + 1]}; + rTextures[5][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_IN_POWER_TT[mTier + 1]}; + rTextures[6][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_IN_MULTI_TT[mTier]}; + rTextures[7][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_IN_MULTI_TT[mTier]}; + rTextures[8][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_IN_MULTI_TT[mTier]}; + rTextures[9][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_OUT_POWER_TT[mTier + 1]}; + rTextures[10][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_OUT_POWER_TT[mTier + 1]}; + rTextures[11][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_OUT_POWER_TT[mTier + 1]}; + } + return rTextures; + } + + @Override + public String[] getDescription() { + return new String[]{translateToLocal("gt.blockmachines.tt.transformer.tier." + (mTier > 9 ? "" : "0") + mTier + ".desc"), CommonValues.TEC_MARK_GENERAL}; + } +}
\ No newline at end of file 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..7abb46b47a --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_TeslaCoil.java @@ -0,0 +1,339 @@ +package com.github.technus.tectech.thing.metaTileEntity.single;
+
+import com.github.technus.tectech.CommonValues;
+import com.github.technus.tectech.TecTech;
+import com.github.technus.tectech.Util;
+import com.github.technus.tectech.loader.NetworkDispatcher;
+import com.github.technus.tectech.mechanics.data.RendererMessage;
+import com.github.technus.tectech.mechanics.data.ThaumSpark;
+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.enums.Textures;
+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 net.minecraft.util.EnumChatFormatting;
+import org.apache.commons.lang3.ArrayUtils;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+
+import static com.github.technus.tectech.CommonValues.V;
+import static com.github.technus.tectech.Util.entriesSortedByValues;
+import static com.github.technus.tectech.Util.map;
+import static com.github.technus.tectech.thing.metaTileEntity.Textures.TESLA_TRANSCEIVER_TOP_BA;
+import static java.lang.Math.round;
+
+
+public class GT_MetaTileEntity_TeslaCoil extends GT_MetaTileEntity_BasicBatteryBuffer {
+ private final static HashSet<ThaumSpark> sparkList = new HashSet<>();
+ private byte sparkCount = 0;
+
+ private int maxTier = 4; //Max tier of transceiver
+ private int minTier = 0; //Min tier of transceiver
+
+ public Map<IGregTechTileEntity, Integer> eTeslaMap = new HashMap<>();//Tesla Map to map them tesla bois!
+
+ private int transferRadiusMax = 20;
+ private int transferRadiusMin = 4;
+ private int transferRadiusLimitTop = (int) map(mTier + 1, minTier + 1, maxTier + 1, transferRadiusMin, transferRadiusMax);
+ private int transferRadiusLimitBottom = 1; //Minimum user configurable
+ private int transferRadius = transferRadiusLimitTop; //Default transferRadius 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 = 19; //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 outputVoltage = V[mTier];
+ private float minEfficiency = TecTech.configTecTech.TESLA_SINGLE_MIN_EFFICIENCY;//Default is 0.91F
+ private float maxEfficiency = TecTech.configTecTech.TESLA_SINGLE_MAX_EFFICIENCY;//Default is 0.95F
+ private float overdriveEfficiencyExtra = TecTech.configTecTech.TESLA_SINGLE_OVERDRIVE_LOSS;//Default is 0.010F
+ private float energyEfficiency = map(mTier + 1, minTier + 1, maxTier + 1, minEfficiency, maxEfficiency);
+ private float overdriveEfficiency = energyEfficiency - overdriveEfficiencyExtra;
+ private boolean overdriveToggle = false;
+
+ 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 String[] getDescription() {
+ String[] jargon = new String[3];
+ jargon[0] = CommonValues.BASS_MARK;
+ jargon[1] = "Your Tesla I/O machine of choice";
+ jargon[2] = EnumChatFormatting.AQUA + "Lightning stoves for the rich";
+ String[] sDesc = super.getDescription();
+ sDesc = Arrays.copyOfRange(sDesc, 1, sDesc.length);
+ String[] desc = ArrayUtils.addAll(jargon, sDesc);
+ return desc;
+ }
+
+ @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 set to " + round(histHigh * 100F) + "%");
+ } else {
+ if (histSettingLow > histLowLimit) {
+ histSettingLow--;
+ } else {
+ histSettingLow = histSettingHigh - 1;
+ }
+ histLow = (float) histSettingLow / histSteps;
+ PlayerChatHelper.SendInfo(aPlayer, "Hysteresis low set to " + round(histLow * 100F) + "%");
+ }
+ }
+
+ @Override
+ public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (aPlayer.isSneaking()) {
+ if (transferRadius > transferRadiusLimitBottom) {
+ transferRadius--;
+ }
+ } else {
+ if (transferRadius < 0) {
+ transferRadius++;
+ }
+ }
+ PlayerChatHelper.SendInfo(aPlayer, "Tesla radius set to " + transferRadius + "m");
+ 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 boolean isFacingValid(byte aSide) {
+ return aSide != 1;
+ }//Prevents output at the top side
+
+ @Override
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ ITexture[][][] rTextures = new ITexture[3][17][];
+
+ for (byte i = -1; i < 16; ++i) {
+ rTextures[0][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1]};
+ rTextures[1][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], TESLA_TRANSCEIVER_TOP_BA};
+ rTextures[2][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], this.mInventory.length == 16 ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_POWER[this.mTier] : (this.mInventory.length > 4 ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] : Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier])};
+ }
+
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ return this.mTextures[aSide == aFacing ? 2 : aSide == 1 ? 1 : 0][aColorIndex + 1];
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_TeslaCoil(mName, mTier, mDescription, mTextures, mInventory.length);
+ }
+
+ private void thaumLightning(IGregTechTileEntity mte, IGregTechTileEntity node) {
+ int x = mte.getXCoord();
+ int y = mte.getYCoord();
+ int z = mte.getZCoord();
+
+ byte xR;
+ byte yR;
+ byte zR;
+
+ IMetaTileEntity nodeInside = node.getMetaTileEntity();
+ if (nodeInside instanceof GT_MetaTileEntity_TM_teslaCoil) {
+ GT_MetaTileEntity_TM_teslaCoil nodeTesla = (GT_MetaTileEntity_TM_teslaCoil) nodeInside;
+ xR = (byte) (nodeTesla.posTop[0] - x);
+ yR = (byte) (nodeTesla.posTop[1] - y);
+ zR = (byte) (nodeTesla.posTop[2] - z);
+ } else {
+ xR = (byte) (node.getXCoord() - x);
+ yR = (byte) (node.getYCoord() - y);
+ zR = (byte) (node.getZCoord() - z);
+ }
+
+ int wID = mte.getWorld().provider.dimensionId;
+
+ sparkList.add(new ThaumSpark(x, y, z, xR, yR, zR, wID));
+ }
+
+ private long getEnergyEfficiency(long voltage, int distance, boolean overDriveToggle) {
+ if (overDriveToggle) {
+ return (long) ((voltage * 2) - (voltage * Math.pow(overdriveEfficiency, distance)));
+ } else {
+ return (long) (voltage * Math.pow(energyEfficiency, distance));
+ }
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return;
+ }
+
+ //Hysteresis based ePowerPass Config
+ long energyMax = getStoredEnergy()[1];
+ long energyStored = getStoredEnergy()[0];
+ float energyFrac = (float) energyStored / energyMax;
+
+ //ePowerPass hist toggle
+ if (!powerPassToggle && energyFrac > histHigh) {
+ powerPassToggle = true;
+ } else if (powerPassToggle && energyFrac < histLow) {
+ powerPassToggle = false;
+ }
+
+ //Stuff to do if ePowerPass
+ if (powerPassToggle) {
+ float rangeFrac = (float) ((-0.5 * Math.pow(energyFrac, 2)) + (1.5 * energyFrac));
+ long outputCurrent = mBatteryCount;
+ transferRadiusTower = (int) (transferRadius * rangeFrac);
+ transferRadiusCover = (int) (transferRadiusTower / 1.25);
+
+ //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();
+
+ long outputVoltageInjectable;
+ long outputVoltageConsumption;
+ if (overdriveToggle) {
+ outputVoltageInjectable = outputVoltage;
+ outputVoltageConsumption = getEnergyEfficiency(outputVoltage, Rx.getValue(), true);
+ } else {
+ outputVoltageInjectable = getEnergyEfficiency(outputVoltage, Rx.getValue(), false);
+ 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);
+ thaumLightning(aBaseMetaTileEntity, node);
+ 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 (nodeInside instanceof GT_MetaTileEntity_TeslaCoil){
+ GT_MetaTileEntity_TeslaCoil nodeTesla = (GT_MetaTileEntity_TeslaCoil) nodeInside;
+ if (nodeTesla.powerPassToggle){
+ continue;
+ }
+ }
+ if (node.injectEnergyUnits((byte) 1, outputVoltageInjectable, 1L) > 0L) {
+ setEUVar(getEUVar() - outputVoltageConsumption);
+ thaumLightning(aBaseMetaTileEntity, node);
+ outputCurrent--;
+ idle = false;
+ }
+ }
+ if (outputCurrent == 0) {
+ break;
+ }
+ } else {
+ idle = true;
+ break;
+ }
+ }
+ if (idle) {
+ break;
+ }
+ }
+ }
+ sparkCount++;
+ if (sparkCount == 60 && !sparkList.isEmpty()) {
+ sparkCount = 0;
+ NetworkDispatcher.INSTANCE.sendToAllAround(new RendererMessage.RendererData(sparkList),
+ aBaseMetaTileEntity.getWorld().provider.dimensionId,
+ aBaseMetaTileEntity.getXCoord(),
+ aBaseMetaTileEntity.getYCoord(),
+ aBaseMetaTileEntity.getZCoord(),
+ 256);
+ }
+ sparkList.clear();
+ }
+}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_WetTransformer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_WetTransformer.java index 375e8ba655..02f84bd7c3 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_WetTransformer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_WetTransformer.java @@ -1,25 +1,20 @@ package com.github.technus.tectech.thing.metaTileEntity.single; import com.github.technus.tectech.CommonValues; -import com.github.technus.tectech.Util; -import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Transformer; import static com.github.technus.tectech.CommonValues.V; -import static com.github.technus.tectech.thing.metaTileEntity.Textures.*; +import static net.minecraft.util.StatCollector.translateToLocal; -public class GT_MetaTileEntity_WetTransformer extends GT_MetaTileEntity_Transformer { - public GT_MetaTileEntity_WetTransformer(int aID, String aName, String aNameRegional, int aTier, String aDescription) { - super(aID,aName,aNameRegional,aTier,aDescription); - Util.setTier(aTier,this); +public class GT_MetaTileEntity_WetTransformer extends GT_MetaTileEntity_TT_Transformer { + public GT_MetaTileEntity_WetTransformer(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier); } public GT_MetaTileEntity_WetTransformer(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { - super(aName,aTier,aDescription,aTextures); - Util.setTier(aTier,this); + super(aName, aTier, aDescription, aTextures); } @Override @@ -28,28 +23,8 @@ public class GT_MetaTileEntity_WetTransformer extends GT_MetaTileEntity_Transfor } @Override - public ITexture[][][] getTextureSet(ITexture[] aTextures) { - ITexture[][][] rTextures = new ITexture[12][17][]; - for (byte b = -1; b < 16; b++) { - rTextures[0][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_OUT_MULTI_TT[mTier]}; - rTextures[1][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_OUT_MULTI_TT[mTier]}; - rTextures[2][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_OUT_MULTI_TT[mTier]}; - rTextures[3][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_IN_POWER_TT[mTier + 1]}; - rTextures[4][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_IN_POWER_TT[mTier + 1]}; - rTextures[5][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_IN_POWER_TT[mTier + 1]}; - rTextures[6][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_IN_MULTI_TT[mTier]}; - rTextures[7][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_IN_MULTI_TT[mTier]}; - rTextures[8][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_IN_MULTI_TT[mTier]}; - rTextures[9][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_OUT_POWER_TT[mTier + 1]}; - rTextures[10][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_OUT_POWER_TT[mTier + 1]}; - rTextures[11][b + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][b + 1], OVERLAYS_ENERGY_OUT_POWER_TT[mTier + 1]}; - } - return rTextures; - } - - @Override public String[] getDescription() { - return new String[]{mDescription, "Accepts 16A and outputs 64A", CommonValues.TEC_MARK_GENERAL}; + return new String[]{translateToLocal("gt.blockmachines.wetransformer.tier." + (mTier > 9 ? "" : "0") + mTier + ".desc"), "Accepts 16A and outputs 64A", CommonValues.TEC_MARK_GENERAL}; } @Override @@ -72,4 +47,4 @@ public class GT_MetaTileEntity_WetTransformer extends GT_MetaTileEntity_Transfor public long maxAmperesIn() { return getBaseMetaTileEntity().isAllowedToWork() ? 16 : 64; } -} +}
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPollutor.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPollutor.java index 3374d874d4..ebeb266c64 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPollutor.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/gui/GT_Container_DebugPollutor.java @@ -15,8 +15,9 @@ import net.minecraft.item.ItemStack; public class GT_Container_DebugPollutor extends GT_ContainerMetaTile_Machine { - public int pollution =0; - public float anomaly =0; + public int pollution; + public float anomaly; + private int anomalyInt; public GT_Container_DebugPollutor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(aInventoryPlayer, aTileEntity); @@ -124,6 +125,7 @@ public class GT_Container_DebugPollutor GT_MetaTileEntity_DebugPollutor dpg = (GT_MetaTileEntity_DebugPollutor) mTileEntity.getMetaTileEntity(); pollution =dpg.pollution; anomaly =dpg.anomaly; + anomalyInt=Float.floatToIntBits(anomaly); for (Object crafter : crafters) { ICrafting var1 = (ICrafting) crafter; @@ -143,7 +145,7 @@ public class GT_Container_DebugPollutor break; case 102: case 103: - anomaly = Util.receiveFloat(anomaly,102,par1,par2); + anomaly = Float.intBitsToFloat(anomalyInt=Util.receiveInteger(anomalyInt,102,par1,par2)); break; } } |