From 04d1f031214f3de3b7896ae39776a81535c17103 Mon Sep 17 00:00:00 2001 From: Technus Date: Fri, 1 Jan 2021 15:16:22 +0100 Subject: Add compatibility for upgrading GT controllers --- .../metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/com') 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 8abb027d3f..85111682ee 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 @@ -812,7 +812,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt ForgeDirection.getOrientation(getBaseMetaTileEntity().getFrontFacing()), Rotation.byIndex(aNBT.getByte("eRotation")), Flip.byIndex(aNBT.getByte("eFlip"))); - eParameters = aNBT.getBoolean("eParam"); + eParameters = !aNBT.hasKey("eParam") || aNBT.getBoolean("eParam"); ePowerPass = aNBT.getBoolean("ePass"); eSafeVoid = aNBT.getBoolean("eVoid"); eDismantleBoom = aNBT.getBoolean("eBoom"); -- cgit From 86eb4d90663b2c96325c6746b21993b816127786 Mon Sep 17 00:00:00 2001 From: basdxz Date: Tue, 5 Jan 2021 16:05:17 +0000 Subject: Undo gradle changes on this branch for a touch --- .../dreamcraft/DreamCraftRecipeLoader.java | 114 ++++++++++----------- .../tectech/thing/casing/GT_Block_CasingsBA0.java | 8 +- .../thing/cover/GT_Cover_TM_EnderFluidLink.java | 1 - .../multi/GT_MetaTileEntity_TM_teslaCoil.java | 6 +- 4 files changed, 62 insertions(+), 67 deletions(-) (limited to 'src/main/java/com') 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 2609a81860..4fb21a2387 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 @@ -43,7 +43,7 @@ public class DreamCraftRecipeLoader implements Runnable { try { ADD_ASSEMBLER_RECIPE.invoke(GT_Values.RA, items, fluid, output, time, eut, true); } catch (Exception e) { - throw new RuntimeException("Failed to add clean room assembler recipe! " +output.getDisplayName(),e); + throw new RuntimeException("Failed to add clean room assembler recipe! " + output.getDisplayName(), e); } } //endregion @@ -269,9 +269,9 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_LuV_IV.get(1), CustomItemList.eM_energyMulti4_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_energyMulti16_IV.get(1), 200, 1920); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("WetTransformer_LuV_IV").get(1), CustomItemList.eM_energyMulti16_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_energyMulti64_IV.get(1), 400, 1920); - 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, getOrDefault("Rhodium-PlatedPalladium", Materials.Chrome), 2)}, Materials.Silver.getMolten(288), CustomItemList.eM_energyMulti4_LuV.get(1), 100, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_ZPM_LuV.get(1), CustomItemList.eM_energyMulti4_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Rhodium-PlatedPalladium", Materials.Chrome), 4)}, Materials.Electrum.getMolten(288), CustomItemList.eM_energyMulti16_LuV.get(1), 200, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("WetTransformer_ZPM_LuV").get(1), CustomItemList.eM_energyMulti16_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.VanadiumGallium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Rhodium-PlatedPalladium", Materials.Chrome), 6)}, Materials.Tungsten.getMolten(288), CustomItemList.eM_energyMulti64_LuV.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, getOrDefault("Rhodium-PlatedPalladium", Materials.Chrome), 2)}, Materials.Silver.getMolten(288), CustomItemList.eM_energyMulti4_LuV.get(1), 100, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_ZPM_LuV.get(1), CustomItemList.eM_energyMulti4_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.VanadiumGallium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Rhodium-PlatedPalladium", Materials.Chrome), 4)}, Materials.Electrum.getMolten(288), CustomItemList.eM_energyMulti16_LuV.get(1), 200, 7680); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("WetTransformer_ZPM_LuV").get(1), CustomItemList.eM_energyMulti16_LuV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.VanadiumGallium, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Rhodium-PlatedPalladium", Materials.Chrome), 6)}, Materials.Tungsten.getMolten(288), CustomItemList.eM_energyMulti64_LuV.get(1), 400, 7680); 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)}, Materials.Silver.getMolten(576), CustomItemList.eM_energyMulti4_ZPM.get(1), 100, 30720); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_UV_ZPM.get(1), 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, 30720); @@ -294,9 +294,9 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("WetTransformer_UMV_UIV").get(1), CustomItemList.eM_energyMulti16_UIV.get(1), GT_OreDictUnificator.get(OrePrefixes.wireGt12, Materials.NetherStar, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("BlackPlutonium", Materials.Neutronium), 6)}, Materials.Tungsten.getMolten(8000), CustomItemList.eM_energyMulti64_UIV.get(1), 400, 8000000); //Buck Converter IV-UIV - if(Loader.isModLoaded("bartworks")) { + if (Loader.isModLoaded("bartworks")) { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_LuV_IV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Elite, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 2), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.TungstenSteel, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 2)}, Materials.TungstenSteel.getMolten(288), CustomItemList.Machine_BuckConverter_IV.get(1), 100, 7680); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_ZPM_LuV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Master, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Rhodium-PlatedPalladium", Materials.Chrome), 2), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.NiobiumTitanium, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 3)}, new FluidStack(FluidRegistry.getFluid("molten.rhodium-plated palladium"), 288), CustomItemList.Machine_BuckConverter_LuV.get(1), 100, 30720); + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_ZPM_LuV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Master, 2), GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("Rhodium-PlatedPalladium", Materials.Chrome), 2), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.NiobiumTitanium, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 3)}, new FluidStack(FluidRegistry.getFluid("molten.rhodium-plated palladium"), 288), CustomItemList.Machine_BuckConverter_LuV.get(1), 100, 30720); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_UV_ZPM.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 2), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.TungstenSteel, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 4)}, Materials.Iridium.getMolten(288), CustomItemList.Machine_BuckConverter_ZPM.get(1), 100, 122880); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.Transformer_MAX_UV.get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Superconductor, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Osmium, 2), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Naquadah, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 2L, 5)}, Materials.Osmium.getMolten(288), CustomItemList.Machine_BuckConverter_UV.get(1), 100, 500000); GT_Values.RA.addAssemblerRecipe(new ItemStack[]{getItemContainer("Transformer_UEV_UHV").get(1), getItemContainer("Display").get(1), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Infinite, 2), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 2), GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.ElectrumFlux, 4), GT_ModHandler.getModItem("bartworks", "BW_GlasBlocks", 4L, 5)}, Materials.Neutronium.getMolten(288), CustomItemList.Machine_BuckConverter_UHV.get(1), 100, 2000000); @@ -560,7 +560,7 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ getItemContainer("WetTransformer_ZPM_LuV").get(1), getItemContainer("HighEnergyFlowCircuit").get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt01, getOrDefault("SuperconductorLuV",Materials.Superconductor), 16), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, getOrDefault("SuperconductorLuV", Materials.Superconductor), 16), ItemList.valueOf("Circuit_Chip_UHPIC").get(2), }, Materials.TungstenSteel.getMolten(576), CustomItemList.Machine_Multi_Transformer.get(1), 400, 30720); @@ -608,48 +608,48 @@ public class DreamCraftRecipeLoader implements Runnable { //Matter Junction TT_recipeAdder.addResearchableAssemblylineRecipe(CustomItemList.Machine_Multi_Switch.get(1), 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), - ItemList.Electric_Piston_LuV.get(2), - ItemList.Circuit_Wetwaresupercomputer.get(2), - GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.SuperconductorUHV, 4), - }, new FluidStack[]{ - Materials.UUMatter.getFluid(1000), - Materials.Naquadah.getMolten(1296), - new FluidStack(FluidRegistry.getFluid("ic2coolant"), 2000), - Materials.Osmium.getMolten(1296), - }, CustomItemList.Machine_Multi_EMjunction.get(1), 12000, 100000); + CustomItemList.Machine_Multi_Transformer.get(1), + GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Naquadah, 4), + ItemList.Robot_Arm_LuV.get(2), + ItemList.Electric_Piston_LuV.get(2), + ItemList.Circuit_Wetwaresupercomputer.get(2), + GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.SuperconductorUHV, 4), + }, new FluidStack[]{ + Materials.UUMatter.getFluid(1000), + Materials.Naquadah.getMolten(1296), + new FluidStack(FluidRegistry.getFluid("ic2coolant"), 2000), + Materials.Osmium.getMolten(1296), + }, CustomItemList.Machine_Multi_EMjunction.get(1), 12000, 100000); //Matter Quantizer TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Hatch_Input_UV.get(1), 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), - ItemList.Circuit_Wetwaresupercomputer.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.SuperconductorUHV, 2), - }, new FluidStack[]{ - Materials.UUMatter.getFluid(1000), - Materials.Naquadah.getMolten(1296), - new FluidStack(FluidRegistry.getFluid("ic2coolant"), 2000), - Materials.Osmium.getMolten(1296), - }, CustomItemList.Machine_Multi_MatterToEM.get(1), 12000, 100000); + CustomItemList.Machine_Multi_Transformer.get(1), + GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Naquadah, 4), + ItemList.Emitter_UV.get(2), + ItemList.Circuit_Wetwaresupercomputer.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.SuperconductorUHV, 2), + }, new FluidStack[]{ + Materials.UUMatter.getFluid(1000), + Materials.Naquadah.getMolten(1296), + new FluidStack(FluidRegistry.getFluid("ic2coolant"), 2000), + Materials.Osmium.getMolten(1296), + }, CustomItemList.Machine_Multi_MatterToEM.get(1), 12000, 100000); //Matter DeQuantizer TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Hatch_Output_UV.get(1), 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), - ItemList.Circuit_Wetwaresupercomputer.get(1), - GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.SuperconductorUHV, 2), - }, new FluidStack[]{ - Materials.UUMatter.getFluid(1000), - Materials.Naquadah.getMolten(1296), - new FluidStack(FluidRegistry.getFluid("ic2coolant"), 2000), - Materials.Osmium.getMolten(1296), - }, CustomItemList.Machine_Multi_EMToMatter.get(1), 12000, 100000); + CustomItemList.Machine_Multi_Transformer.get(1), + GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Naquadah, 4), + ItemList.Sensor_UV.get(2), + ItemList.Circuit_Wetwaresupercomputer.get(1), + GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.SuperconductorUHV, 2), + }, new FluidStack[]{ + Materials.UUMatter.getFluid(1000), + Materials.Naquadah.getMolten(1296), + new FluidStack(FluidRegistry.getFluid("ic2coolant"), 2000), + Materials.Osmium.getMolten(1296), + }, CustomItemList.Machine_Multi_EMToMatter.get(1), 12000, 100000); //Essentia Quantizer TT_recipeAdder.addResearchableAssemblylineRecipe(CustomItemList.Machine_Multi_MatterToEM.get(1), @@ -1193,22 +1193,22 @@ public class DreamCraftRecipeLoader implements Runnable { //Deep Dark Portal TT_recipeAdder.addResearchableAssemblylineRecipe(GT_ModHandler.getModItem("dreamcraft", "item.HeavyDutyPlateTier8", 1, 0), 16777216, 2048, 2000000, 64, new Object[]{ - GT_ModHandler.getModItem("ExtraUtilities", "cobblestone_compressed", 1, 7), - GT_ModHandler.getModItem("IC2", "blockMachine2", 1, 0), - GT_OreDictUnificator.get(OrePrefixes.block, Materials.Infinity, 4L), - new Object[]{OrePrefixes.circuit.get(Materials.Nano), 1}, - new Object[]{OrePrefixes.circuit.get(Materials.Nano), 1}, - new Object[]{OrePrefixes.circuit.get(Materials.Nano), 1}, - new Object[]{OrePrefixes.circuit.get(Materials.Nano), 1}, - GT_ModHandler.getModItem("dreamcraft", "item.PicoWafer", 32, 0), - ItemList.Robot_Arm_UEV.get(4), - ItemList.Emitter_UEV.get(4), - ItemList.Sensor_UEV.get(4), - }, new FluidStack[]{ - new FluidStack(FluidRegistry.getFluid("oganesson"), 50000), - Materials.Infinity.getMolten(9216L), - Materials.Cheese.getMolten(232000L), - }, ItemList.Block_BedrockiumCompressed.get(1), 10000, 5000000); + GT_ModHandler.getModItem("ExtraUtilities", "cobblestone_compressed", 1, 7), + GT_ModHandler.getModItem("IC2", "blockMachine2", 1, 0), + GT_OreDictUnificator.get(OrePrefixes.block, Materials.Infinity, 4L), + new Object[]{OrePrefixes.circuit.get(Materials.Nano), 1}, + new Object[]{OrePrefixes.circuit.get(Materials.Nano), 1}, + new Object[]{OrePrefixes.circuit.get(Materials.Nano), 1}, + new Object[]{OrePrefixes.circuit.get(Materials.Nano), 1}, + GT_ModHandler.getModItem("dreamcraft", "item.PicoWafer", 32, 0), + ItemList.Robot_Arm_UEV.get(4), + ItemList.Emitter_UEV.get(4), + ItemList.Sensor_UEV.get(4), + }, new FluidStack[]{ + new FluidStack(FluidRegistry.getFluid("oganesson"), 50000), + Materials.Infinity.getMolten(9216L), + Materials.Cheese.getMolten(232000L), + }, ItemList.Block_BedrockiumCompressed.get(1), 10000, 5000000); //Batteries 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 index 0d2f710ae9..d2c34941ef 100644 --- 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 @@ -18,14 +18,12 @@ import net.minecraft.world.IBlockAccess; import java.util.List; import static com.github.technus.tectech.TecTech.tectechTexturePage1; +import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; /** * 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]; @@ -37,10 +35,12 @@ public class GT_Block_CasingsBA0 extends GT_Block_Casings_Abstract { private static IIcon[] tM8 = new IIcon[2]; private static IIcon[] tM9 = new IIcon[2]; + private static final byte START_INDEX = 16; + 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); + Textures.BlockIcons.casingTexturePages[texturePage][b + START_INDEX] = new GT_CopiedBlockTexture(this, 6, b); /*IMPORTANT for block recoloring**/ } diff --git a/src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_EnderFluidLink.java b/src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_EnderFluidLink.java index 03c612c190..c5243b8bc5 100644 --- a/src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_EnderFluidLink.java +++ b/src/main/java/com/github/technus/tectech/thing/cover/GT_Cover_TM_EnderFluidLink.java @@ -12,7 +12,6 @@ import gregtech.api.gui.widgets.GT_GuiIntegerTextBox; import gregtech.api.interfaces.IGuiScreen; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.metatileentity.BaseMetaTileEntity; -import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.net.GT_Packet_TileEntityCover; import gregtech.api.util.GT_CoverBehavior; import gregtech.api.util.GT_Utility; 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 580e6195ad..864b68e21f 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 @@ -72,10 +72,6 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock private static final float overDriveLoss = TecTech.configTecTech.TESLA_MULTI_LOSS_FACTOR_OVERDRIVE;//Default is 0.25F; private static final boolean doFluidOutput = TecTech.configTecTech.TESLA_MULTI_GAS_OUTPUT; //Default is false - //Face icons - private static Textures.BlockIcons.CustomIcon ScreenOFF; - private static Textures.BlockIcons.CustomIcon ScreenON; - private int mTier = 0; //Determines max voltage (LV to ZPM) private int plasmaTier = 0; //0 is None, 1 is Helium or Nitrogen, 2 is Radon (Does not match actual plasma tiers) @@ -443,9 +439,9 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister aBlockIconRegister) { + super.registerIcons(aBlockIconRegister); ScreenOFF = new Textures.BlockIcons.CustomIcon("iconsets/TM_TESLA_TOWER"); ScreenON = new Textures.BlockIcons.CustomIcon("iconsets/TM_TESLA_TOWER_ACTIVE"); - super.registerIcons(aBlockIconRegister); } @Override -- cgit From 775f3f6ca467af78c0d5b1b530d1a3d8964124f2 Mon Sep 17 00:00:00 2001 From: Prometheus0000 Date: Thu, 7 Jan 2021 12:14:13 -0500 Subject: Add recipe for debug maint hatch (#47) * Add recipe for debug maint hatch * Change name/description of the debug maint hatch * Reduced components * Reduce tape amount * Revert joke description * Revert the comment too --- .../dreamcraft/DreamCraftRecipeLoader.java | 135 ++++++++++++--------- .../tectech/loader/thing/MachineLoader.java | 2 +- ...T_MetaTileEntity_Hatch_CreativeMaintenance.java | 2 +- 3 files changed, 79 insertions(+), 60 deletions(-) (limited to 'src/main/java/com') 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 4fb21a2387..00b31915c2 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 @@ -1190,67 +1190,86 @@ public class DreamCraftRecipeLoader implements Runnable { Materials.Concrete.getMolten(73728L) }, getItemContainer("StargateFramePart").get(1L), 72000, 2000000); - //Deep Dark Portal - TT_recipeAdder.addResearchableAssemblylineRecipe(GT_ModHandler.getModItem("dreamcraft", "item.HeavyDutyPlateTier8", 1, 0), - 16777216, 2048, 2000000, 64, new Object[]{ - GT_ModHandler.getModItem("ExtraUtilities", "cobblestone_compressed", 1, 7), - GT_ModHandler.getModItem("IC2", "blockMachine2", 1, 0), - GT_OreDictUnificator.get(OrePrefixes.block, Materials.Infinity, 4L), - new Object[]{OrePrefixes.circuit.get(Materials.Nano), 1}, - new Object[]{OrePrefixes.circuit.get(Materials.Nano), 1}, - new Object[]{OrePrefixes.circuit.get(Materials.Nano), 1}, - new Object[]{OrePrefixes.circuit.get(Materials.Nano), 1}, - GT_ModHandler.getModItem("dreamcraft", "item.PicoWafer", 32, 0), - ItemList.Robot_Arm_UEV.get(4), - ItemList.Emitter_UEV.get(4), - ItemList.Sensor_UEV.get(4), - }, new FluidStack[]{ - new FluidStack(FluidRegistry.getFluid("oganesson"), 50000), - Materials.Infinity.getMolten(9216L), - Materials.Cheese.getMolten(232000L), - }, ItemList.Block_BedrockiumCompressed.get(1), 10000, 5000000); - - - //Batteries - 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), 1L}, - new Object[]{OrePrefixes.circuit.get(Materials.Infinite), 1L}, - new Object[]{OrePrefixes.circuit.get(Materials.Infinite), 1L}, - new Object[]{OrePrefixes.circuit.get(Materials.Infinite), 1L}, - ItemList.Energy_Cluster.get(8L), - ItemList.Field_Generator_UV.get(2), - ItemList.Circuit_Wafer_HPIC.get(64), - ItemList.Circuit_Wafer_HPIC.get(64), - ItemList.Circuit_Parts_DiodeASMD.get(32), - GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.SuperconductorUHV, 32), - }, new FluidStack[]{ - Materials.SolderingAlloy.getMolten(2880), - 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[]{ - GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Neutronium, 32L), - GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Neutronium, 32L), - new Object[]{OrePrefixes.circuit.get(Materials.Bio), 1L}, - new Object[]{OrePrefixes.circuit.get(Materials.Bio), 1L}, - new Object[]{OrePrefixes.circuit.get(Materials.Bio), 1L}, - new Object[]{OrePrefixes.circuit.get(Materials.Bio), 1L}, - ItemList.ZPM2.get(8), - ItemList.Field_Generator_UHV.get(4), - ItemList.Circuit_Wafer_UHPIC.get(64), - ItemList.Circuit_Wafer_UHPIC.get(64), - ItemList.Circuit_Wafer_SoC2.get(32), - ItemList.Circuit_Parts_DiodeASMD.get(64), - GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.SuperconductorUHV, 64), - }, new FluidStack[]{ - Materials.SolderingAlloy.getMolten(3760), - Materials.Naquadria.getMolten(9216), - new FluidStack(FluidRegistry.getFluid("ic2coolant"), 32000) - }, ItemList.ZPM3.get(1), 4000, 1600000); } //endregion + + //Deep Dark Portal + TT_recipeAdder.addResearchableAssemblylineRecipe(GT_ModHandler.getModItem("dreamcraft", "item.HeavyDutyPlateTier8", 1, 0), + 16777216, 2048, 2000000, 64, new Object[]{ + GT_ModHandler.getModItem("ExtraUtilities", "cobblestone_compressed", 1, 7), + GT_ModHandler.getModItem("IC2", "blockMachine2", 1, 0), + GT_OreDictUnificator.get(OrePrefixes.block, Materials.Infinity, 4L), + new Object[]{OrePrefixes.circuit.get(Materials.Nano), 1}, + new Object[]{OrePrefixes.circuit.get(Materials.Nano), 1}, + new Object[]{OrePrefixes.circuit.get(Materials.Nano), 1}, + new Object[]{OrePrefixes.circuit.get(Materials.Nano), 1}, + GT_ModHandler.getModItem("dreamcraft", "item.PicoWafer", 32, 0), + ItemList.Robot_Arm_UEV.get(4), + ItemList.Emitter_UEV.get(4), + ItemList.Sensor_UEV.get(4), + }, new FluidStack[]{ + new FluidStack(FluidRegistry.getFluid("oganesson"), 50000), + Materials.Infinity.getMolten(9216L), + Materials.Cheese.getMolten(232000L), + }, ItemList.Block_BedrockiumCompressed.get(1), 10000, 5000000); + + //Debug maintenance hatch + TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.Hatch_AutoMaintenance.get(1L), + 2764800, 128, 500000, 6, new Object[]{ + ItemList.Hatch_AutoMaintenance.get(1L), + ItemList.Robot_Arm_UV.get(1L), + ItemList.Electric_Pump_UV.get(1L), + ItemList.Conveyor_Module_UV.get(1L), + new Object[]{OrePrefixes.circuit.get(Materials.Superconductor), 4L}, + ItemList.Energy_LapotronicOrb2.get(1L), + ItemList.Duct_Tape.get(64L), + ItemList.Duct_Tape.get(64L), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Americium, 64L), + }, new FluidStack[]{ + Materials.Lubricant.getFluid(256000), + Materials.SolderingAlloy.getMolten(1296L), + }, CustomItemList.hatch_CreativeMaintenance.get(1), 6000, 500000); + + //Batteries + 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), 1L}, + new Object[]{OrePrefixes.circuit.get(Materials.Infinite), 1L}, + new Object[]{OrePrefixes.circuit.get(Materials.Infinite), 1L}, + new Object[]{OrePrefixes.circuit.get(Materials.Infinite), 1L}, + ItemList.Energy_Cluster.get(8L), + ItemList.Field_Generator_UV.get(2), + ItemList.Circuit_Wafer_HPIC.get(64), + ItemList.Circuit_Wafer_HPIC.get(64), + ItemList.Circuit_Parts_DiodeASMD.get(32), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.SuperconductorUHV, 32), + }, new FluidStack[]{ + Materials.SolderingAlloy.getMolten(2880), + 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[]{ + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Neutronium, 32L), + GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Neutronium, 32L), + new Object[]{OrePrefixes.circuit.get(Materials.Bio), 1L}, + new Object[]{OrePrefixes.circuit.get(Materials.Bio), 1L}, + new Object[]{OrePrefixes.circuit.get(Materials.Bio), 1L}, + new Object[]{OrePrefixes.circuit.get(Materials.Bio), 1L}, + ItemList.ZPM2.get(8), + ItemList.Field_Generator_UHV.get(4), + ItemList.Circuit_Wafer_UHPIC.get(64), + ItemList.Circuit_Wafer_UHPIC.get(64), + ItemList.Circuit_Wafer_SoC2.get(32), + ItemList.Circuit_Parts_DiodeASMD.get(64), + GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.SuperconductorUHV, 64), + }, new FluidStack[]{ + Materials.SolderingAlloy.getMolten(3760), + Materials.Naquadria.getMolten(9216), + new FluidStack(FluidRegistry.getFluid("ic2coolant"), 32000) + }, ItemList.ZPM3.get(1), 4000, 1600000); + + //region singleblocks //Tesla Transceiver LV 1A 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 8a46732e66..0bf8c57f24 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 @@ -664,7 +664,7 @@ public class MachineLoader implements Runnable { // =================================================================================================== 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)); + hatch_CreativeMaintenance.set(new GT_MetaTileEntity_Hatch_CreativeMaintenance(15497, "debug.tt.maintenance", "Auto-Taping 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)); UnusedStuff.set(new ItemStack(Blocks.air)); diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_CreativeMaintenance.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_CreativeMaintenance.java index 4e719f8ec8..d56e622a8f 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_CreativeMaintenance.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_CreativeMaintenance.java @@ -26,7 +26,7 @@ public class GT_MetaTileEntity_Hatch_CreativeMaintenance extends GT_MetaTileEnti public String[] getDescription() { return new String[]{ CommonValues.BASS_MARK, - translateToLocal("gt.blockmachines.debug.tt.maintenance.desc.0"),//For maintaining Multiblocks + translateToLocal("gt.blockmachines.debug.tt.maintenance.desc.0"),//For automatically maintaining Multiblocks translateToLocal("gt.blockmachines.debug.tt.maintenance.desc.1"),//Does fix everything but itself. EnumChatFormatting.AQUA + translateToLocal("gt.blockmachines.debug.tt.maintenance.desc.2")//Fixing is for plebs! }; -- cgit From db2f5941735d34c2cbf375f395d98ee4140231c8 Mon Sep 17 00:00:00 2001 From: Tec Date: Fri, 8 Jan 2021 19:24:34 +0100 Subject: Apply power GT compat --- .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 100 ++++++++++----------- 1 file changed, 50 insertions(+), 50 deletions(-) (limited to 'src/main/java/com') 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 85111682ee..810b02617d 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 @@ -1104,6 +1104,20 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt */ @Override public boolean onRunningTick(ItemStack aStack) { + return onRunningTickCheck(aStack); + } + + public boolean onRunningTickCheck_EM(ItemStack aStack) { + if (eRequiredData > eAvailableData) { + if (energyFlowOnRunningTick_EM(aStack, false)) { + stopMachine(); + } + return false; + } + return energyFlowOnRunningTick_EM(aStack, true); + } + + public boolean onRunningTickCheck(ItemStack aStack) { if (eRequiredData > eAvailableData) { if (energyFlowOnRunningTick(aStack, false)) { stopMachine(); @@ -1564,7 +1578,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt //region ENERGY!!!! //new method - private boolean energyFlowOnRunningTick(ItemStack aStack, boolean allowProduction) { + public boolean energyFlowOnRunningTick_EM(ItemStack aStack, boolean allowProduction) { long euFlow = mEUt * eAmpereFlow;//quick scope sign if (allowProduction && euFlow > 0) { addEnergyOutput_EM((long) mEUt * (long) mEfficiency / getMaxEfficiency(aStack), eAmpereFlow); @@ -1576,6 +1590,18 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } return true; } + public boolean energyFlowOnRunningTick(ItemStack aStack, boolean allowProduction) { + long euFlow = mEUt * eAmpereFlow;//quick scope sign + if (allowProduction && euFlow > 0) { + addEnergyOutput_EM((long) mEUt * (long) mEfficiency / getMaxEfficiency(aStack), eAmpereFlow); + } else if (euFlow < 0) { + if (!drainEnergyInput_EM(getMaxInputEnergy(), (long) mEUt * getMaxEfficiency(aStack) / Math.max(1000L, mEfficiency), eAmpereFlow)) { + stopMachine(); + return false; + } + } + return true; + } //public final boolean energyFlowWithoutEffieciencyComputation(int eu,long ampere) { // long temp = eu * ampere;//quick scope sign @@ -1612,39 +1638,11 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt @Deprecated @Override - public final boolean addEnergyOutput(long EU) { - if (EU <= 0L) { - return true; - } - for (GT_MetaTileEntity_Hatch tHatch : eDynamoMulti) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - if (tHatch.maxEUOutput() < EU) { - explodeMultiblock(); - } - if (tHatch.getBaseMetaTileEntity().increaseStoredEnergyUnits(EU, false)) { - return true; - } - } - } - for (GT_MetaTileEntity_Hatch tHatch : mDynamoHatches) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - if (tHatch.maxEUOutput() < EU) { - explodeMultiblock(); - } - if (tHatch.getBaseMetaTileEntity().increaseStoredEnergyUnits(EU, false)) { - return true; - } - } - } - return false; + public final boolean addEnergyOutput(long eu) { + return addEnergyOutput_EM(eu,1); } - /** - * @param EU - * @param Amperes - * @return if was able to put inside the hatches - */ - private boolean addEnergyOutput_EM(long EU, long Amperes) { + public boolean addEnergyOutput_EM(long EU, long Amperes) { if (EU < 0) { EU = -EU; } @@ -1693,24 +1691,11 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt @Deprecated @Override - public final boolean drainEnergyInput(long EU) { - if (EU <= 0L) { - return true; - } - for (GT_MetaTileEntity_Hatch tHatch : eEnergyMulti) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch) && tHatch.maxEUInput() > EU && tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(EU, false)) { - return true; - } - } - for (GT_MetaTileEntity_Hatch tHatch : mEnergyHatches) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch) && tHatch.maxEUInput() > EU && tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(EU, false)) { - return true; - } - } - return false; + public final boolean drainEnergyInput(long eu) { + return drainEnergyInput_EM(0,eu,1); } - private boolean drainEnergyInput_EM(long EUtTierVoltage, long EUtEffective, long Amperes) { + public boolean drainEnergyInput_EM(long EUtTierVoltage, long EUtEffective, long Amperes) { if(maxEUinputMin==0){ return false; } @@ -1725,7 +1710,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } long EUuse = EUtEffective * Amperes; if (EUuse > getEUVar() || //not enough power - EUtTierVoltage > maxEUinputMax || //TIER IS BASED ON BEST HATCH! not total EUtEffective input + (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 if (DEBUG_MODE) { TecTech.LOGGER.debug("L1 " + EUuse + ' ' + getEUVar() + ' ' + (EUuse > getEUVar())); @@ -1747,7 +1732,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt mMaxProgresstime = time; return true; } - long tempEUt = EU < V[1] ? V[1] : EU; + long tempEUt = Math.max(EU, V[1]); long tempTier = maxEUinputMax >> 2; while (tempEUt < tempTier) { tempEUt <<= 2; @@ -1796,6 +1781,21 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt return energy; } + public final long getMaxTheoreticalInputEnergy() { + long energy = 0; + for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + energy += tHatch.maxEUInput()*tHatch.maxAmperesIn(); + } + } + for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : eEnergyMulti) { + if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { + energy += tHatch.maxEUInput() * tHatch.maxAmperesIn(); + } + } + return energy; + } + //new Method public final int getMaxEnergyInputTier_EM() { return getTier(maxEUinputMax); -- cgit From 27356d36da7b92db4eca6c91637342e7ab28ea75 Mon Sep 17 00:00:00 2001 From: Tec Date: Fri, 8 Jan 2021 19:32:31 +0100 Subject: This oughta do it --- .../multi/base/GT_MetaTileEntity_MultiblockBase_EM.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java/com') 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 810b02617d..05f5109ac8 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 @@ -1595,7 +1595,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(getMaxInputEnergy(), (long) mEUt * getMaxEfficiency(aStack) / Math.max(1000L, mEfficiency), eAmpereFlow)) { + if (!drainEnergyInput_EM(0, (long) mEUt * getMaxEfficiency(aStack) / Math.max(1000L, mEfficiency), eAmpereFlow)) { stopMachine(); return false; } @@ -1710,7 +1710,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } long EUuse = EUtEffective * Amperes; if (EUuse > getEUVar() || //not enough power - (EUtTierVoltage > maxEUinputMax) || //TIER IS BASED ON BEST HATCH! not total EUtEffective input + (EUtTierVoltage==0?EUuse>getMaxInputEnergy():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 if (DEBUG_MODE) { TecTech.LOGGER.debug("L1 " + EUuse + ' ' + getEUVar() + ' ' + (EUuse > getEUVar())); -- cgit From 03f04631e222c533381338197ea69ae0185e71ff Mon Sep 17 00:00:00 2001 From: Tec Date: Fri, 8 Jan 2021 20:26:42 +0100 Subject: Another logic change --- .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 710 ++++++++++++--------- 1 file changed, 392 insertions(+), 318 deletions(-) (limited to 'src/main/java/com') 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 05f5109ac8..d805e5f913 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 @@ -1139,57 +1139,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } if (--mUpdate == 0 || --mStartUpCheck == 0 || cyclicUpdate() || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) { - mInputHatches.clear(); - mInputBusses.clear(); - mOutputHatches.clear(); - mOutputBusses.clear(); - mDynamoHatches.clear(); - mEnergyHatches.clear(); - mMufflerHatches.clear(); - mMaintenanceHatches.clear(); - - for (GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental : eOutputHatches) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch_elemental)) { - hatch_elemental.id = -1; - } - } - for (GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental : eInputHatches) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch_elemental)) { - hatch_elemental.id = -1; - } - } - - for (GT_MetaTileEntity_Hatch_DataConnector hatch_data : eOutputData) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch_data)) { - hatch_data.id = -1; - } - } - for (GT_MetaTileEntity_Hatch_DataConnector hatch_data : eInputData) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch_data)) { - hatch_data.id = -1; - } - } - - for (GT_MetaTileEntity_Hatch_Uncertainty hatch : eUncertainHatches) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) { - hatch.getBaseMetaTileEntity().setActive(false); - } - } - for (GT_MetaTileEntity_Hatch_Param hatch : eParamHatches) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) { - hatch.getBaseMetaTileEntity().setActive(false); - } - } - - eUncertainHatches.clear(); - eEnergyMulti.clear(); - eInputHatches.clear(); - eOutputHatches.clear(); - eParamHatches.clear(); - eMufflerHatches.clear(); - eDynamoMulti.clear(); - eOutputData.clear(); - eInputData.clear(); + clearHatches_EM(); if (aBaseMetaTileEntity instanceof BaseTileEntity) { ((BaseTileEntity) aBaseMetaTileEntity).ignoreUnloadedChunks = mMachine; @@ -1214,122 +1164,13 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } if (mMachine) { - short id = 1; - for (GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental : eOutputHatches) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch_elemental)) { - hatch_elemental.id = id++; - } - } - id = 1; - for (GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental : eInputHatches) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch_elemental)) { - hatch_elemental.id = id++; - } - } + setupHatches_EM(); - id = 1; - for (GT_MetaTileEntity_Hatch_DataConnector hatch_data : eOutputData) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch_data)) { - hatch_data.id = id++; - } - } - id = 1; - for (GT_MetaTileEntity_Hatch_DataConnector hatch_data : eInputData) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch_data)) { - hatch_data.id = id++; - } - } + setupEnergyHatchesVariables_EM(); - if (!mEnergyHatches.isEmpty() || !eEnergyMulti.isEmpty() || !mDynamoHatches.isEmpty() || !eDynamoMulti.isEmpty()) { - maxEUinputMin = V[15]; - maxEUinputMax = V[0]; - maxEUoutputMin = V[15]; - maxEUoutputMax = V[0]; - for (GT_MetaTileEntity_Hatch_Energy hatch : mEnergyHatches) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) { - if (hatch.maxEUInput() < maxEUinputMin) { - maxEUinputMin = hatch.maxEUInput(); - } - if (hatch.maxEUInput() > maxEUinputMax) { - maxEUinputMax = hatch.maxEUInput(); - } - } - } - for (GT_MetaTileEntity_Hatch_EnergyMulti hatch : eEnergyMulti) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) { - if (hatch.maxEUInput() < maxEUinputMin) { - maxEUinputMin = hatch.maxEUInput(); - } - if (hatch.maxEUInput() > maxEUinputMax) { - maxEUinputMax = hatch.maxEUInput(); - } - } - } - for (GT_MetaTileEntity_Hatch_Dynamo hatch : mDynamoHatches) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) { - if (hatch.maxEUOutput() < maxEUoutputMin) { - maxEUoutputMin = hatch.maxEUOutput(); - } - if (hatch.maxEUOutput() > maxEUoutputMax) { - maxEUoutputMax = hatch.maxEUOutput(); - } - } - } - for (GT_MetaTileEntity_Hatch_DynamoMulti hatch : eDynamoMulti) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) { - if (hatch.maxEUOutput() < maxEUoutputMin) { - maxEUoutputMin = hatch.maxEUOutput(); - } - if (hatch.maxEUOutput() > maxEUoutputMax) { - maxEUoutputMax = hatch.maxEUOutput(); - } - } - } - eMaxAmpereFlow = 0; - eMaxAmpereGen = 0; - //counts only full amps - for (GT_MetaTileEntity_Hatch_Energy hatch : mEnergyHatches) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) { - eMaxAmpereFlow += hatch.maxEUInput() / maxEUinputMin; - } - } - for (GT_MetaTileEntity_Hatch_EnergyMulti hatch : eEnergyMulti) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) { - eMaxAmpereFlow += hatch.maxEUInput() / maxEUinputMin * hatch.Amperes; - } - } - for (GT_MetaTileEntity_Hatch_Dynamo hatch : mDynamoHatches) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) { - eMaxAmpereGen += hatch.maxEUOutput() / maxEUoutputMin; - } - } - for (GT_MetaTileEntity_Hatch_DynamoMulti hatch : eDynamoMulti) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) { - eMaxAmpereGen += hatch.maxEUOutput() / maxEUoutputMin * hatch.Amperes; - } - } - } else { - maxEUinputMin = 0; - maxEUinputMax = 0; - eMaxAmpereFlow = 0; - maxEUoutputMin = 0; - maxEUoutputMax = 0; - eMaxAmpereGen = 0; - } if (getEUVar() > maxEUStore()) { setEUVar(maxEUStore()); } - - for (GT_MetaTileEntity_Hatch_Uncertainty hatch : eUncertainHatches) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) { - hatch.getBaseMetaTileEntity().setActive(true); - } - } - for (GT_MetaTileEntity_Hatch_Param hatch : eParamHatches) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(hatch)) { - hatch.getBaseMetaTileEntity().setActive(true); - } - } } else { maxEUinputMin = 0; maxEUinputMax = 0; @@ -1345,78 +1186,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt if (MULTI_PURGE_1_AT == Tick || MULTI_PURGE_2_AT == Tick) { purgeAllOverflowEM_EM(); } else if (MULTI_CHECK_AT == Tick) { - for (GT_MetaTileEntity_Hatch_Maintenance tHatch : mMaintenanceHatches) { - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - if (GT_MetaTileEntity_MultiBlockBase.disableMaintenance) { - mWrench = true; - mScrewdriver = true; - mSoftHammer = true; - mHardHammer = true; - mSolderingTool = true; - mCrowbar = true; - } else { - if (tHatch.mAuto && !(mWrench && mScrewdriver && mSoftHammer && mHardHammer && mSolderingTool && mCrowbar)) { - tHatch.autoMaintainance(); - } - if (tHatch.mWrench) { - mWrench = true; - } - if (tHatch.mScrewdriver) { - mScrewdriver = true; - } - if (tHatch.mSoftHammer) { - mSoftHammer = true; - } - if (tHatch.mHardHammer) { - mHardHammer = true; - } - if (tHatch.mSolderingTool) { - mSolderingTool = true; - } - if (tHatch.mCrowbar) { - mCrowbar = true; - } - - tHatch.mWrench = false; - tHatch.mScrewdriver = false; - tHatch.mSoftHammer = false; - tHatch.mHardHammer = false; - tHatch.mSolderingTool = false; - tHatch.mCrowbar = false; - } - } - } + maintenance_EM(); } else if (MOVE_AT == Tick && eSafeVoid) { - for (GT_MetaTileEntity_Hatch_OverflowElemental voider : eMufflerHatches) { - if (voider.overflowMax < voider.getOverflowMatter()) { - continue; - } - double remaining = voider.overflowMax - voider.getOverflowMatter(); - for (GT_MetaTileEntity_Hatch_InputElemental in : eInputHatches) { - for (cElementalInstanceStack instance : in.getContainerHandler().values()) { - double qty = div(remaining,instance.definition.getMass()); - if (qty > 0) { - qty = min(qty, instance.amount); - if (voider.addOverflowMatter(instance.definition.getMass() * qty)) { - voider.setOverflowMatter(voider.overflowMax); - } - in.getContainerHandler().removeAmount(false, new cElementalDefinitionStack(instance.definition, qty)); - } - } - } - for (GT_MetaTileEntity_Hatch_OutputElemental out : eOutputHatches) { - for (cElementalInstanceStack instance : out.getContainerHandler().values()) { - double qty = div(remaining,instance.definition.getMass()); - if (qty > 0) { - qty = min(qty, instance.amount); - if (voider.addOverflowMatter(instance.definition.getMass() * qty)) { - voider.setOverflowMatter(voider.overflowMax); - } - out.getContainerHandler().removeAmount(false, new cElementalDefinitionStack(instance.definition, qty)); - } - } - } - } + safeVoid_EM(); } if (getRepairStatus() >= minRepairStatus) {//S @@ -1424,53 +1196,8 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt hatchesStatusUpdate_EM(); } - //region power pass and controller charging - {//DO - long euVar; - for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) { - if (getEUVar() > getMinimumStoredEU()) { - break; - } - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - euVar = tHatch.maxEUInput(); - if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euVar, false)) { - setEUVar(getEUVar() + euVar); - } - } - } - for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : eEnergyMulti) { - if (getEUVar() > getMinimumStoredEU()) { - break; - } - if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { - euVar = tHatch.maxEUInput() * tHatch.Amperes; - if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euVar, false)) { - setEUVar(getEUVar() + euVar); - } - } - } - 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 && -