From f11457d1adbc0448a99b5742f1cc7d95d8e34cb3 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Thu, 31 Jan 2019 06:49:16 +0100 Subject: [PATCH] hughe code refractor and hughe multis +added tooltip for Vat glas +enhanched code quality +moved glass from biolab -> new stuff +fixed diodes not working after restart +added MEBF and MVFZ +version number increase Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> --- build.properties | 2 +- .../bartworks/API/BioVatLogicAdder.java | 2 +- .../bartimaeusnek/bartworks/GuiHandler.java | 24 +- .../bartimaeusnek/bartworks/MainMod.java | 35 +- .../ClientEventHandler.java | 62 ++++ .../client/gui/BW_GUIContainer_RadLevel.java | 2 +- .../gui/BW_GUIContainer_RotorBlock.java | 2 +- .../client/gui/BW_GUIContainer_Windmill.java | 5 +- .../GT_GUIContainer_CircuitProgrammer.java | 5 +- .../gui/GT_GUIContainer_Destructopack.java | 5 +- .../client/gui/GT_GUIContainer_LESU.java | 7 +- .../gui/GT_GUIContainer_RadioHatch.java | 17 +- .../client/renderer/RendererGlasBlock.java | 7 +- .../renderer/RendererSwitchingColorFluid.java | 4 +- .../common/blocks/BW_TileEntityContainer.java | 2 +- .../common/blocks/BioFluidBlock.java | 2 +- .../common/configs/ConfigHandler.java | 4 +- .../bartworks/common/items/BW_ItemBlocks.java | 6 + .../common/items/BW_SimpleWindMeter.java | 2 +- .../common/items/BW_Stonage_Rotors.java | 2 +- .../bartworks/common/items/LabModule.java | 2 +- .../bartworks/common/items/LabParts.java | 2 +- .../common/items/SimpleSubItemClass.java | 2 +- .../bartworks/common/loaders/BioItemList.java | 46 +-- .../common/loaders/BioRecipeLoader.java | 41 +-- .../bartworks/common/loaders/FluidLoader.java | 2 +- .../bartworks/common/loaders/GTNHBlocks.java | 2 +- .../common/loaders/ItemRegistry.java | 72 ++++- .../common/loaders/RecipeLoader.java | 45 ++- .../bartworks/common/net/RendererPacket.java | 4 +- .../BWTileEntityDimIDBridge.java | 2 +- .../{ => classic}/BW_RotorBlock.java | 2 +- .../{ => multis}/GT_TileEntity_BioVat.java | 59 +--- .../{ => multis}/GT_TileEntity_DEHP.java | 101 +++--- .../{ => multis}/GT_TileEntity_LESU.java | 8 +- .../GT_TileEntity_ManualTrafo.java | 9 +- .../{ => multis}/GT_TileEntity_Windmill.java | 9 +- .../mega/GT_TileEntity_MegaBlastFurnace.java | 303 ++++++++++++++++++ .../mega/GT_TileEntity_MegaVacuumFreezer.java | 131 ++++++++ .../GT_MetaTileEntity_AcidGenerator.java | 4 +- .../GT_MetaTileEntity_BioLab.java | 2 +- .../{ => tiered}/GT_MetaTileEntity_Diode.java | 50 ++- .../GT_MetaTileEntity_EnergyDistributor.java | 4 +- .../GT_MetaTileEntity_RadioHatch.java | 10 +- .../tiered/GT_MetaTileEntity_Transistor.java | 153 +++++++++ .../container/BW_Container_RadioHatch.java | 2 +- .../container/GT_Container_RadioHatch.java | 2 +- .../bartimaeusnek/bartworks/util/BW_Util.java | 185 +++++++++-- .../bartworks/util/BioCulture.java | 2 +- .../bartworks/util/NEIbartworksConfig.java | 7 +- 50 files changed, 1136 insertions(+), 324 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java rename src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/{ => classic}/BWTileEntityDimIDBridge.java (94%) rename src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/{ => classic}/BW_RotorBlock.java (96%) rename src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/{ => multis}/GT_TileEntity_BioVat.java (92%) rename src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/{ => multis}/GT_TileEntity_DEHP.java (70%) rename src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/{ => multis}/GT_TileEntity_LESU.java (98%) rename src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/{ => multis}/GT_TileEntity_ManualTrafo.java (99%) rename src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/{ => multis}/GT_TileEntity_Windmill.java (98%) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java rename src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/{ => tiered}/GT_MetaTileEntity_AcidGenerator.java (97%) rename src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/{ => tiered}/GT_MetaTileEntity_BioLab.java (99%) rename src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/{ => tiered}/GT_MetaTileEntity_Diode.java (62%) rename src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/{ => tiered}/GT_MetaTileEntity_EnergyDistributor.java (95%) rename src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/{ => tiered}/GT_MetaTileEntity_RadioHatch.java (97%) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java diff --git a/build.properties b/build.properties index 19a81a00d..790f06e74 100644 --- a/build.properties +++ b/build.properties @@ -23,7 +23,7 @@ mc_version=1.7.10 majorUpdate=0 minorUpdate=3 -buildNumber=17 +buildNumber=18 ic2.version=2.2.828-experimental gregtech.version=5.09.32.36 gregtech.jenkinsbuild=143 diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java index 483b4a67e..81b0d894a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java @@ -94,7 +94,7 @@ public static boolean addCustomGlass(String sModname, String sUnlocBlockName, in if (ret) BioVatGlass.glasses.put(new BlockMetaPair(block, (byte) meta), (byte) tier); else - MainMod.logger.warn("Block: " + sUnlocBlockName + " of the Mod: " + sModname + " was NOT found!"); + MainMod.LOGGER.warn("Block: " + sUnlocBlockName + " of the Mod: " + sModname + " was NOT found!"); block = null; return ret; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java index f45ac8657..00b9317d5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java @@ -28,6 +28,7 @@ import com.github.bartimaeusnek.bartworks.server.container.BW_Container_RadioHatch; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_CircuitProgrammer; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_Item_Destructopack; +import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.network.IGuiHandler; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.EntityPlayer; @@ -54,18 +55,21 @@ public Object getServerGuiElement(int ID, EntityPlayer player, World world, int @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - switch (ID) { - case 0: - return new GT_GUIContainer_Destructopack(player.inventory); - case 1: - return new GT_GUIContainer_CircuitProgrammer(player.inventory); - case 2: { - if (world.getTileEntity(x, y, z) instanceof IGregTechTileEntity) { - IGregTechTileEntity te = (IGregTechTileEntity) world.getTileEntity(x, y, z); - return new BW_GUIContainer_RadLevel(new BW_Container_RadioHatch(player.inventory, te.getMetaTileEntity())); + if (FMLCommonHandler.instance().getSide().isClient()) { + switch (ID) { + case 0: + return new GT_GUIContainer_Destructopack(player.inventory); + case 1: + return new GT_GUIContainer_CircuitProgrammer(player.inventory); + case 2: { + if (world.getTileEntity(x, y, z) instanceof IGregTechTileEntity) { + IGregTechTileEntity te = (IGregTechTileEntity) world.getTileEntity(x, y, z); + return new BW_GUIContainer_RadLevel(new BW_Container_RadioHatch(player.inventory, te.getMetaTileEntity())); + } } } - } + } else + return getServerGuiElement(ID, player, world, x, y, z); return null; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index a0364772a..52b282646 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -23,6 +23,8 @@ package com.github.bartimaeusnek.bartworks; +import com.github.bartimaeusnek.bartworks.API.API_REFERENCE; +import com.github.bartimaeusnek.bartworks.client.ClientEventHandler.ClientEventHandler; import com.github.bartimaeusnek.bartworks.client.creativetabs.BioTab; import com.github.bartimaeusnek.bartworks.client.creativetabs.GT2Tab; import com.github.bartimaeusnek.bartworks.client.creativetabs.bartworksTab; @@ -30,6 +32,7 @@ import com.github.bartimaeusnek.bartworks.common.loaders.GTNHBlocks; import com.github.bartimaeusnek.bartworks.common.loaders.LoaderRegistry; import com.github.bartimaeusnek.bartworks.common.net.BW_Network; +import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; @@ -37,37 +40,40 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; +import gregtech.api.enums.Materials; +import gregtech.api.enums.SubTag; import net.minecraft.creativetab.CreativeTabs; +import net.minecraftforge.common.MinecraftForge; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import static com.github.bartimaeusnek.bartworks.API.API_REFERENCE.VERSION; - @Mod( - modid = MainMod.modID, name = MainMod.name, version = MainMod.version, + modid = MainMod.MOD_ID, name = MainMod.NAME, version = MainMod.VERSION, dependencies = "required-after:IC2; " + "required-after:gregtech; " ) public final class MainMod { - public static final String name = "BartWorks"; - public static final String version = "@version@"; - public static final String modID = "bartworks"; - public static final Logger logger = LogManager.getLogger(name); + public static final String NAME = "BartWorks"; + public static final String VERSION = "@version@"; + public static final String MOD_ID = "bartworks"; + public static final Logger LOGGER = LogManager.getLogger(NAME); public static final CreativeTabs GT2 = new GT2Tab("GT2C"); - public static final CreativeTabs BioTab = new BioTab("BioTab"); + public static final CreativeTabs BIO_TAB = new BioTab("BioTab"); public static final CreativeTabs BWT = new bartworksTab("bartworks"); public static final IGuiHandler GH = new GuiHandler(); public static boolean GTNH = false; - @Mod.Instance(modID) + @Mod.Instance(MOD_ID) public static MainMod instance; public static ConfigHandler CHandler; public static BW_Network BW_Network_instance = new BW_Network(); @Mod.EventHandler public void preInit(FMLPreInitializationEvent preinit) { - if (!(VERSION.equals(version))) { - logger.error("Something has loaded an old API. Please contact the Mod authors to update!"); + //fixing BorosilicateGlass... -_-' + Materials.BorosilicateGlass.add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_RECYCLING, SubTag.SMELTING_TO_FLUID); + if (!(API_REFERENCE.VERSION.equals(VERSION))) { + LOGGER.error("Something has loaded an old API. Please contact the Mod authors to update!"); } if (Loader.isModLoaded("dreamcraft")) { @@ -75,14 +81,14 @@ public void preInit(FMLPreInitializationEvent preinit) { } CHandler = new ConfigHandler(preinit); if (GTNH) - logger.info("GTNH-Detected . . . ACTIVATE HARDMODE."); - + LOGGER.info("GTNH-Detected . . . ACTIVATE HARDMODE."); } @Mod.EventHandler public void init(FMLInitializationEvent init) { + if (FMLCommonHandler.instance().getSide().isClient() && ConfigHandler.BioLab) + MinecraftForge.EVENT_BUS.register(new ClientEventHandler()); new LoaderRegistry().run(); - } @Mod.EventHandler @@ -91,5 +97,4 @@ public void postInit(FMLPostInitializationEvent postinit) { if (ConfigHandler.BioLab) new GTNHBlocks().run(); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java new file mode 100644 index 000000000..377632c4b --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/ClientEventHandler.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.client.ClientEventHandler; + +import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; +import com.github.bartimaeusnek.bartworks.common.blocks.BW_Blocks; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +import cpw.mods.fml.common.eventhandler.EventPriority; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.GT_Values; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraftforge.event.entity.player.ItemTooltipEvent; + +import java.util.HashMap; + +@SideOnly(Side.CLIENT) +public class ClientEventHandler { + + @SideOnly(Side.CLIENT) + @SubscribeEvent(priority = EventPriority.HIGHEST) + public void getTooltip(ItemTooltipEvent event) { + if (event.itemStack == null || event.itemStack.getItem() == null || Block.getBlockFromItem(event.itemStack.getItem()) == null || event.itemStack.getItemDamage() > 127) + return; + + final Block BLOCK = Block.getBlockFromItem(event.itemStack.getItem()); + if (BLOCK instanceof BW_Blocks) { + return; + } + final BioVatLogicAdder.BlockMetaPair PAIR = new BioVatLogicAdder.BlockMetaPair(BLOCK, (byte) event.itemStack.getItemDamage()); + final HashMap GLASSMAP = BioVatLogicAdder.BioVatGlass.getGlassMap(); + if (GLASSMAP.containsKey(PAIR)) { + int tier = GLASSMAP.get(PAIR); + event.toolTip.add("Glass-Tier: " + BW_Util.getColorForTier(tier) + GT_Values.VN[tier] + ChatColorHelper.RESET); + } else if (BLOCK.getMaterial().equals(Material.glass)) { + event.toolTip.add("Glass-Tier: " + BW_Util.getColorForTier(3) + GT_Values.VN[3] + ChatColorHelper.RESET); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java index 91dfa14c2..bdffce07e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java @@ -44,7 +44,7 @@ public BW_GUIContainer_RadLevel(Container p_i1072_1_) { @Override protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { GL11.glColor3f(1, 1, 1); - this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.modID, "textures/GUI/GUI_RSC.png")); + this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.MOD_ID, "textures/GUI/GUI_RSC.png")); drawTexturedModalRect(guiLeft - 79, guiTop, 0, 0, 256, 165); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java index 61b87019e..0ad5c5982 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java @@ -64,7 +64,7 @@ protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { GL11.glColor3f(0.5f, 0.25f, 0.07f); - this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.modID, "textures/GUI/GUIPrimitiveKUBox.png")); + this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.MOD_ID, "textures/GUI/GUIPrimitiveKUBox.png")); int j = (this.width - this.xSize) / 2; int k = (this.height - this.ySize) / 2; this.drawTexturedModalRect(j, k, 0, 0, this.xSize, this.ySize); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java index 09dec26e2..df4d721b0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java @@ -23,6 +23,8 @@ package com.github.bartimaeusnek.bartworks.client.gui; import com.github.bartimaeusnek.bartworks.MainMod; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_Container_MultiMachine; import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -30,6 +32,7 @@ import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; +@SideOnly(Side.CLIENT) public class BW_GUIContainer_Windmill extends GT_GUIContainer_MultiMachine { public BW_GUIContainer_Windmill(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { @@ -46,7 +49,7 @@ protected void drawGuiContainerForegroundLayer(int par1, int par2) { protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { GL11.glColor3f(0.5f, 0.25f, 0.07f); - this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.modID, "textures/GUI/GUI_Windmill.png")); + this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.MOD_ID, "textures/GUI/GUI_Windmill.png")); int x = (this.width - this.xSize) / 2; int y = (this.height - this.ySize) / 2; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java index 2a699035f..34574929d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java @@ -24,15 +24,18 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_CircuitProgrammer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; +@SideOnly(Side.CLIENT) public class GT_GUIContainer_CircuitProgrammer extends GuiContainer { - public static final ResourceLocation texture = new ResourceLocation(MainMod.modID, "textures/GUI/GUI_CircuitP.png"); + public static final ResourceLocation texture = new ResourceLocation(MainMod.MOD_ID, "textures/GUI/GUI_CircuitP.png"); public GT_GUIContainer_CircuitProgrammer(InventoryPlayer p_i1072_1_) { super(new GT_Container_CircuitProgrammer(p_i1072_1_)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java index feaf22fcc..c1998f4bf 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java @@ -24,14 +24,17 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_Item_Destructopack; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; +@SideOnly(Side.CLIENT) public class GT_GUIContainer_Destructopack extends GuiContainer { - public static final ResourceLocation texture = new ResourceLocation(MainMod.modID, "textures/GT2/gui/Destructopack.png"); + public static final ResourceLocation texture = new ResourceLocation(MainMod.MOD_ID, "textures/GT2/gui/Destructopack.png"); public GT_GUIContainer_Destructopack(InventoryPlayer inventory) { super(new GT_Container_Item_Destructopack(inventory)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java index 1378d9e94..8b96ba44f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java @@ -24,8 +24,10 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_LESU; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_LESU; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_LESU; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_GUIContainer; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.client.Minecraft; @@ -35,9 +37,10 @@ import java.awt.*; +@SideOnly(Side.CLIENT) public class GT_GUIContainer_LESU extends GT_GUIContainer { - public static final ResourceLocation texture = new ResourceLocation(MainMod.modID, "textures/GT2/gui/LESU.png"); + public static final ResourceLocation texture = new ResourceLocation(MainMod.MOD_ID, "textures/GT2/gui/LESU.png"); protected GT_Container_LESU mContainer; private GT_TileEntity_LESU c; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java index 220d88d7a..3cdaddc85 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java @@ -24,9 +24,10 @@ import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_RadioHatch; +import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_RadioHatch; -import com.github.bartimaeusnek.bartworks.util.BW_Util; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.InventoryPlayer; @@ -35,12 +36,13 @@ import java.nio.ByteBuffer; +@SideOnly(Side.CLIENT) public class GT_GUIContainer_RadioHatch extends GT_GUIContainerMetaTile_Machine { private static int maxSv; private final String mName; public GT_GUIContainer_RadioHatch(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { - super(new GT_Container_RadioHatch(aInventoryPlayer, aTileEntity), MainMod.modID + ":textures/GUI/RadHatch.png"); + super(new GT_Container_RadioHatch(aInventoryPlayer, aTileEntity), MainMod.MOD_ID + ":textures/GUI/RadHatch.png"); this.mName = "Radio Hatch"; this.mContainer.detectAndSendChanges(); maxSv = BioVatLogicAdder.RadioHatch.getMaxSv(); @@ -52,7 +54,7 @@ protected void drawGuiContainerForegroundLayer(int par1, int par2) { double rem = maxT - timer % maxT; this.fontRendererObj.drawString(this.mName, 8, 4, 4210752); - this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.modID + ":textures/GUI/RadHatch.png")); + this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.MOD_ID + ":textures/GUI/RadHatch.png")); if (((GT_Container_RadioHatch) mContainer).mass > 0) { GL11.glColor3f(((GT_Container_RadioHatch) mContainer).r / 255f, ((GT_Container_RadioHatch) mContainer).g / 255f, ((GT_Container_RadioHatch) mContainer).b / 255f); this.drawTexturedModalRect(124, 18, 124, 18, 16, 48); @@ -61,9 +63,10 @@ protected void drawGuiContainerForegroundLayer(int par1, int par2) { this.drawTexturedModalRect(124, 18, 176, 0, 16, 48 - (int) Math.ceil(48 * (rem / maxT))); this.drawTexturedModalRect(65, 13, 192, 0, (48 * (((GT_Container_RadioHatch) mContainer).sv)) / (maxSv), 16); - this.fontRendererObj.drawString("Sv: " + ((GT_Container_RadioHatch) mContainer).sievert, 8, 50, BW_Util.getColorFromArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); - this.fontRendererObj.drawString("Kg: " + ((GT_Container_RadioHatch) mContainer).mass, 8, 68, BW_Util.getColorFromArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); - this.fontRendererObj.drawString("Time: " + timer, 8, 76, BW_Util.getColorFromArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); + +// this.fontRendererObj.drawString("Sv: " + ((GT_Container_RadioHatch) mContainer).sievert, 8, 50, BW_Util.getColorFromArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); +// this.fontRendererObj.drawString("Kg: " + ((GT_Container_RadioHatch) mContainer).mass, 8, 68, BW_Util.getColorFromArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); +// this.fontRendererObj.drawString("Time: " + timer, 8, 76, BW_Util.getColorFromArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java index 25f5c9220..423fb2046 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java @@ -23,15 +23,18 @@ package com.github.bartimaeusnek.bartworks.client.renderer; import com.github.bartimaeusnek.bartworks.common.blocks.BW_GlasBlocks; -import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.world.IBlockAccess; import org.lwjgl.opengl.GL11; +@SideOnly(Side.CLIENT) public class RendererGlasBlock implements ISimpleBlockRenderingHandler { public static final int RID = RenderingRegistry.getNextAvailableRenderId(); @@ -74,7 +77,7 @@ public void renderInventoryBlock(Block block, int metadata, int modelId, RenderB @Override public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { //renderer.setRenderBounds(0.001,0.001,0.001,0.999,0.999,0.999); - renderer.renderStandardBlock(BioItemList.bw_fake_glasses, x, y, z); + renderer.renderStandardBlock(ItemRegistry.bw_fake_glasses, x, y, z); //renderer.setRenderBounds(0,0,0,1,1,1); renderer.renderStandardBlockWithColorMultiplier(block, x, y, z, ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[0] / 255f, ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[1] / 255f, ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[2] / 255f); return true; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java index 4f7a19e0c..0a2bf2d99 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java @@ -24,7 +24,7 @@ import com.github.bartimaeusnek.bartworks.common.blocks.BioFluidBlock; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_BioVat; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_BioVat; import com.github.bartimaeusnek.bartworks.util.Coords; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.relauncher.Side; @@ -40,7 +40,7 @@ import net.minecraftforge.fluids.BlockFluidBase; import net.minecraftforge.fluids.IFluidBlock; - +@SideOnly(Side.CLIENT) public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler { private static final float LIGHT_Y_NEG = 0.5f; private static final float LIGHT_Y_POS = 1f; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java index b0be51a5c..b9d59c229 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java @@ -44,7 +44,7 @@ public BW_TileEntityContainer(Material p_i45386_1_, Class this.tileEntity = tileEntity; this.setCreativeTab(MainMod.BWT); this.setBlockName(blockName); - this.setBlockTextureName(MainMod.modID + ":" + blockName); + this.setBlockTextureName(MainMod.MOD_ID + ":" + blockName); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java index 3a17a3759..ea1b074c6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java @@ -23,7 +23,7 @@ package com.github.bartimaeusnek.bartworks.common.blocks; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; -import com.github.bartimaeusnek.bartworks.common.tileentities.BWTileEntityDimIDBridge; +import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BWTileEntityDimIDBridge; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.ITileEntityProvider; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index 0db716071..01af8ef53 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -40,10 +40,11 @@ public class ConfigHandler { public static boolean BioLab = true; public static Configuration c; public static boolean DEHPDirectSteam = false; + public static int megaMachinesMax = 256; private static boolean ezmode = false; public ConfigHandler(@Nonnull FMLPreInitializationEvent e) { - c = new Configuration(new File(e.getModConfigurationDirectory().toString() + "/" + MainMod.modID + ".cfg")); + c = new Configuration(new File(e.getModConfigurationDirectory().toString() + "/" + MainMod.MOD_ID + ".cfg")); IDOffset = c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").getInt(12600); energyPerCell = c.get("Multiblocks", "energyPerLESUCell", 1000000, "This will set Up the Energy per LESU Cell", 1000000, Integer.MAX_VALUE).getInt(1000000); @@ -53,6 +54,7 @@ public ConfigHandler(@Nonnull FMLPreInitializationEvent e) { newStuff = !c.get("System", "Disable non-original-GT-stuff", false, "This switch disables my new content, that is not part of the GT2 compat").getBoolean(false); BioLab = !c.get("System", "Disable BioLab", false, "This switch disables the BioLab, BioVat etc. If you use GT5.08 or equivalent, this needs to be turned off!").getBoolean(false); DEHPDirectSteam = c.get("Multiblocks", "DEHP Direct Steam Mode", false, "This switch enables the Direct Steam Mode of the DEHP. If enabled it will take in Waterand output steam. If disabled it will Input IC2Coolant and output hot coolant").getBoolean(false); + megaMachinesMax = c.get("Multiblocks", "Mega Machines Maximum Recipes per Operation", 256, "This changes the Maximum Recipes per Operation to the specified Valure").getInt(256); if (ConfigHandler.IDOffset == 0) { ConfigHandler.IDOffset = 12600; c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").set(12600); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java index 2066ac3b8..1b631cc5f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java @@ -23,9 +23,12 @@ package com.github.bartimaeusnek.bartworks.common.items; import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.common.blocks.BW_GlasBlocks; +import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_LanguageManager; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; @@ -58,7 +61,10 @@ public String getUnlocalizedName(final ItemStack aStack) { } @Override + @SideOnly(Side.CLIENT) public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) { + if (this.field_150939_a instanceof BW_GlasBlocks) + aList.add("Glass-Tier: " + BW_Util.getColorForTier(BW_Util.getTierFromGlasMeta(aStack.getItemDamage())) + GT_Values.VN[BW_Util.getTierFromGlasMeta(aStack.getItemDamage())]); aList.add(this.mNoMobsToolTip); aList.add(this.mNoTileEntityToolTip); aList.add("Added by" + ChatColorHelper.DARKGREEN + " BartWorks"); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java index f526e5a60..d4184dfc0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java @@ -49,7 +49,7 @@ public BW_SimpleWindMeter() { @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister p_94581_1_) { - this.itemIcon = p_94581_1_.registerIcon(MainMod.modID + ":BW_SimpleWindMeter"); + this.itemIcon = p_94581_1_.registerIcon(MainMod.MOD_ID + ":BW_SimpleWindMeter"); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java index 2227cae93..cbe4ce0b2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java @@ -65,7 +65,7 @@ public BW_Stonage_Rotors(int diameter, float eff, int min, int max, int durabili @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon(MainMod.modID + ":" + itemTex); + this.itemIcon = iconRegister.registerIcon(MainMod.MOD_ID + ":" + itemTex); } public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean b) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java index f434fd5d5..9f18e6c45 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java @@ -31,7 +31,7 @@ public class LabModule extends SimpleSubItemClass { public LabModule(String[] tex) { super(tex); - this.setCreativeTab(MainMod.BioTab); + this.setCreativeTab(MainMod.BIO_TAB); } public String getUnlocalizedName(ItemStack p_77667_1_) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java index da80a83eb..67c1222a2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java @@ -40,7 +40,7 @@ public class LabParts extends SimpleSubItemClass { public LabParts(String[] tex) { super(tex); - this.setCreativeTab(MainMod.BioTab); + this.setCreativeTab(MainMod.BIO_TAB); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java index 365efb5c8..d2c2e1747 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java @@ -50,7 +50,7 @@ public SimpleSubItemClass(String[] tex) { public void registerIcons(IIconRegister iconRegister) { itemIcon = new IIcon[tex.length]; for (int i = 0; i < tex.length; i++) { - itemIcon[i] = iconRegister.registerIcon(MainMod.modID + ":" + tex[i]); + itemIcon[i] = iconRegister.registerIcon(MainMod.MOD_ID + ":" + tex[i]); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java index 0c7b559b0..590cc6048 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java @@ -22,9 +22,6 @@ package com.github.bartimaeusnek.bartworks.common.loaders; -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.common.blocks.BW_GlasBlocks; -import com.github.bartimaeusnek.bartworks.common.items.BW_ItemBlocks; import com.github.bartimaeusnek.bartworks.common.items.LabModule; import com.github.bartimaeusnek.bartworks.common.items.LabParts; import com.github.bartimaeusnek.bartworks.util.BioCulture; @@ -32,11 +29,6 @@ import com.github.bartimaeusnek.bartworks.util.BioData; import com.github.bartimaeusnek.bartworks.util.BioPlasmid; import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.enums.SubTag; -import gregtech.api.util.GT_OreDictUnificator; -import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -47,47 +39,13 @@ public class BioItemList { - public static final Block[] bw_glasses = { - new BW_GlasBlocks( - "BW_GlasBlocks", - new String[]{ - MainMod.modID + ":BoronSilicateGlassBlock", - MainMod.modID + ":NickelReinforcedBoronSilicateGlassBlock", - MainMod.modID + ":TungstenReinforcedBoronSilicateGlassBlock", - MainMod.modID + ":ChromeReinforcedBoronSilicateGlassBlock", - MainMod.modID + ":IridiumReinforcedBoronSilicateGlassBlock", - MainMod.modID + ":OsmiumReinforcedBoronSilicateGlassBlock", - MainMod.modID + ":ColoredBoronSilicateGlassBlock1", - MainMod.modID + ":ColoredBoronSilicateGlassBlock2", - MainMod.modID + ":ColoredBoronSilicateGlassBlock3", - MainMod.modID + ":ColoredBoronSilicateGlassBlock4", - MainMod.modID + ":ColoredBoronSilicateGlassBlock5", - MainMod.modID + ":ColoredBoronSilicateGlassBlock6", - }, - new short[][]{Materials.BorosilicateGlass.getRGBA(), Materials.Nickel.getRGBA(), Materials.Tungsten.getRGBA(), Materials.Chrome.getRGBA(), Materials.Iridium.getRGBA(), Materials.Osmium.getRGBA(), new short[]{0xff, 0, 0}, new short[]{0, 0xff, 0}, new short[]{0x80, 0, 0xff}, new short[]{0xff, 0xff, 0}, new short[]{0, 0xff, 0x80}, new short[]{0x80, 0x33, 0}}, - MainMod.BioTab, - true, false - ) - }; - - public static final Block bw_fake_glasses = - new BW_GlasBlocks("BW_GlasBlocks", new String[]{ - MainMod.modID + ":BoronSilicateGlassBlockRandlos" - }, null, null, true, true); - - - private static final Item mItemBioLabParts = new LabModule(new String[]{"DNAExtractionModule", "PCRThermoclyclingModule", "PlasmidSynthesisModule", "TransformationModule", "ClonalCellularSynthesisModule" }); + private static final Item mItemBioLabParts = new LabModule(new String[]{"DNAExtractionModule", "PCRThermoclyclingModule", "PlasmidSynthesisModule", "TransformationModule", "ClonalCellularSynthesisModule"}); public static final ItemStack[] mBioLabParts = {new ItemStack(mItemBioLabParts), new ItemStack(mItemBioLabParts, 1, 1), new ItemStack(mItemBioLabParts, 1, 2), new ItemStack(mItemBioLabParts, 1, 3), new ItemStack(mItemBioLabParts, 1, 4)}; - private static final Item vanillaBioLabParts = new LabParts(new String[]{"petriDish", "DNASampleFlask", "PlasmidCell", "DetergentPowder", "Agarose", "IncubationModule", "PlasmaMembrane" }); + private static final Item vanillaBioLabParts = new LabParts(new String[]{"petriDish", "DNASampleFlask", "PlasmidCell", "DetergentPowder", "Agarose", "IncubationModule", "PlasmaMembrane"}); public BioItemList() { GameRegistry.registerItem(mItemBioLabParts, "BioLabModules"); GameRegistry.registerItem(vanillaBioLabParts, "BioLabParts"); - GameRegistry.registerBlock(bw_glasses[0], BW_ItemBlocks.class, "BW_GlasBlocks"); - GameRegistry.registerBlock(bw_fake_glasses, "BW_FakeGlasBlock"); - //fixing BorosilicateGlass... -_-' - Materials.BorosilicateGlass.add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_RECYCLING, SubTag.SMELTING_TO_FLUID); - GT_OreDictUnificator.add(OrePrefixes.block, Materials.BorosilicateGlass, new ItemStack(bw_glasses[0], 1, 0)); } public static Collection getAllPetriDishes() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java index 0987005a7..05c63ef0c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java @@ -23,14 +23,17 @@ package com.github.bartimaeusnek.bartworks.common.loaders; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_BioLab; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_RadioHatch; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_BioVat; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_BioVat; +import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_BioLab; +import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.BioCulture; import cpw.mods.fml.common.Loader; -import gregtech.api.enums.*; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; @@ -197,7 +200,7 @@ public void run() { "GCG", "KHK", "GCG", - 'G', new ItemStack(BioItemList.bw_glasses[0], 1, 1), + 'G', new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), 'C', "circuit" + Materials.Data, 'K', GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Silver, 1L), 'H', ItemList.MACHINE_HULLS[3].get(1L) @@ -354,33 +357,5 @@ public void run() { 400, BW_Util.getMachineVoltageFromTier(1) ); - - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 0), Materials.Nickel.getMolten(5184), new ItemStack(BioItemList.bw_glasses[0], 1, 1), 800, BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 1), Materials.Tungsten.getMolten(1296), new ItemStack(BioItemList.bw_glasses[0], 1, 2), 800, BW_Util.getMachineVoltageFromTier(5)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 2), Materials.Chrome.getMolten(1296), new ItemStack(BioItemList.bw_glasses[0], 1, 3), 800, BW_Util.getMachineVoltageFromTier(6)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 3), Materials.Iridium.getMolten(3888), new ItemStack(BioItemList.bw_glasses[0], 1, 4), 800, BW_Util.getMachineVoltageFromTier(7)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 4), Materials.Osmium.getMolten(1296), new ItemStack(BioItemList.bw_glasses[0], 1, 5), 800, BW_Util.getMachineVoltageFromTier(8)); - - for (int i = 0; i < Dyes.dyeBrown.getSizeOfFluidList(); ++i) { - GT_Values.RA.addChemicalBathRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 0), Dyes.dyeRed.getFluidDye(i, 36), new ItemStack(BioItemList.bw_glasses[0], 1, 6), null, null, null, 64, 2); - GT_Values.RA.addChemicalBathRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 0), Dyes.dyeGreen.getFluidDye(i, 36), new ItemStack(BioItemList.bw_glasses[0], 1, 7), null, null, null, 64, 2); - GT_Values.RA.addChemicalBathRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 0), Dyes.dyePurple.getFluidDye(i, 36), new ItemStack(BioItemList.bw_glasses[0], 1, 8), null, null, null, 64, 2); - GT_Values.RA.addChemicalBathRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 0), Dyes.dyeYellow.getFluidDye(i, 36), new ItemStack(BioItemList.bw_glasses[0], 1, 9), null, null, null, 64, 2); - GT_Values.RA.addChemicalBathRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 0), Dyes.dyeLime.getFluidDye(i, 36), new ItemStack(BioItemList.bw_glasses[0], 1, 10), null, null, null, 64, 2); - GT_Values.RA.addChemicalBathRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 0), Dyes.dyeBrown.getFluidDye(i, 36), new ItemStack(BioItemList.bw_glasses[0], 1, 11), null, null, null, 64, 2); - } - //and reverse recipes... cause im nice :P - GT_Values.RA.addPulveriserRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 1), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nickel.getDust(36)}, null, 800, BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addPulveriserRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 2), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nickel.getDust(36), Materials.Tungsten.getDust(9)}, null, 800, BW_Util.getMachineVoltageFromTier(5)); - GT_Values.RA.addPulveriserRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 3), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nichrome.getDust(45), Materials.Tungsten.getDust(9)}, null, 800, BW_Util.getMachineVoltageFromTier(6)); - GT_Values.RA.addPulveriserRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 4), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nichrome.getDust(45), Materials.Tungsten.getDust(9), Materials.Iridium.getDust(27)}, null, 800, BW_Util.getMachineVoltageFromTier(7)); - GT_Values.RA.addPulveriserRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, 5), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nichrome.getDust(45), Materials.Tungsten.getDust(9), Materials.Osmiridium.getDust(36)}, null, 800, BW_Util.getMachineVoltageFromTier(8)); - - for (int i = 6; i < 11; i++) { - GT_Values.RA.addPulveriserRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, i), new ItemStack[]{Materials.BorosilicateGlass.getDust(9)}, null, 400, BW_Util.getMachineVoltageFromTier(1)); - GT_Values.RA.addChemicalBathRecipe(new ItemStack(BioItemList.bw_glasses[0], 1, i), Materials.Chlorine.getGas(50), new ItemStack(BioItemList.bw_glasses[0], 1, 0), null, null, null, 64, 2); - } - - } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java index 4646d850e..1f41d225a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java @@ -25,7 +25,7 @@ import com.github.bartimaeusnek.bartworks.client.renderer.RendererGlasBlock; import com.github.bartimaeusnek.bartworks.client.renderer.RendererSwitchingColorFluid; import com.github.bartimaeusnek.bartworks.common.blocks.BioFluidBlock; -import com.github.bartimaeusnek.bartworks.common.tileentities.BWTileEntityDimIDBridge; +import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BWTileEntityDimIDBridge; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.BioCulture; import cpw.mods.fml.client.registry.RenderingRegistry; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java index 8d54f44d8..095e679dc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java @@ -66,7 +66,7 @@ public void run() { if (Loader.isModLoaded("TConstruct")) BioVatLogicAdder.BioVatGlass.addCustomGlass("TConstruct", "GlassBlock", 0, 3); if (Loader.isModLoaded("tectech")) - BioVatLogicAdder.BioVatGlass.addCustomGlass("tectech", "tile.quantumGlass", 0, 5); + BioVatLogicAdder.BioVatGlass.addCustomGlass("tectech", "tile.quantumGlass", 0, 8); if (Loader.isModLoaded("chisel")) BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "glass2", 0, 3); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index 4ca992e98..169655c4a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -24,10 +24,17 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.blocks.BW_Blocks; +import com.github.bartimaeusnek.bartworks.common.blocks.BW_GlasBlocks; import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.items.*; -import com.github.bartimaeusnek.bartworks.common.tileentities.*; +import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_RotorBlock; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_DEHP; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaBlastFurnace; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaVacuumFreezer; +import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_AcidGenerator; +import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_Diode; +import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_EnergyDistributor; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -53,33 +60,59 @@ public class ItemRegistry { public static final Item ROCKCUTTER_HV = new GT_Rockcutter_Item(3); public static final Item CIRCUIT_PROGRAMMER = new Circuit_Programmer(); public static final Block ROTORBLOCK = new BW_TileEntityContainer(Material.wood, BW_RotorBlock.class, "BWRotorBlock"); - public static final Item LEATHER_ROTOR = new BW_Stonage_Rotors(5, 0.15f, 15, 30, 2400, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.modID, "textures/items/rotors/rotorLeather.png"), "BW_LeatherRotor", "rotors/itemRotorLeather"); - public static final Item WOOL_ROTOR = new BW_Stonage_Rotors(7, 0.18f, 10, 20, 1600, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.modID, "textures/items/rotors/rotorWool.png"), "BW_WoolRotor", "rotors/itemRotorWool"); - public static final Item PAPER_ROTOR = new BW_Stonage_Rotors(9, 0.2f, 1, 10, 800, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.modID, "textures/items/rotors/rotorPaper.png"), "BW_PaperRotor", "rotors/itemRotorPaper"); - public static final Item COMBINED_ROTOR = new BW_Stonage_Rotors(11, 0.22f, 1, 50, 5800, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.modID, "textures/items/rotors/rotorCombined.png"), "BW_CombinedRotor", "rotors/itemRotorCombined"); - public static final Item CRAFTING_PARTS = new SimpleSubItemClass(new String[]{"grindstone_top", "grindstone_bottom", "completed_grindstone", "rotors/leatherParts", "rotors/woolParts", "rotors/paperParts", "rotors/combinedParts" }); + public static final Item LEATHER_ROTOR = new BW_Stonage_Rotors(5, 0.15f, 15, 30, 2400, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorLeather.png"), "BW_LeatherRotor", "rotors/itemRotorLeather"); + public static final Item WOOL_ROTOR = new BW_Stonage_Rotors(7, 0.18f, 10, 20, 1600, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorWool.png"), "BW_WoolRotor", "rotors/itemRotorWool"); + public static final Item PAPER_ROTOR = new BW_Stonage_Rotors(9, 0.2f, 1, 10, 800, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorPaper.png"), "BW_PaperRotor", "rotors/itemRotorPaper"); + public static final Item COMBINED_ROTOR = new BW_Stonage_Rotors(11, 0.22f, 1, 50, 5800, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorCombined.png"), "BW_CombinedRotor", "rotors/itemRotorCombined"); + public static final Item CRAFTING_PARTS = new SimpleSubItemClass(new String[]{"grindstone_top", "grindstone_bottom", "completed_grindstone", "rotors/leatherParts", "rotors/woolParts", "rotors/paperParts", "rotors/combinedParts"}); public static final Item TAB = new SimpleIconItem("GT2Coin"); public static final Item WINDMETER = new BW_SimpleWindMeter(); - public static ItemStack dehp; + + public static final Block[] bw_glasses = { + new BW_GlasBlocks( + "BW_GlasBlocks", + new String[]{ + MainMod.MOD_ID + ":BoronSilicateGlassBlock", + MainMod.MOD_ID + ":NickelReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":TungstenReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":ChromeReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":IridiumReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":OsmiumReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock1", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock2", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock3", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock4", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock5", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock6", + }, + new short[][]{Materials.BorosilicateGlass.getRGBA(), Materials.Nickel.getRGBA(), Materials.Tungsten.getRGBA(), Materials.Chrome.getRGBA(), Materials.Iridium.getRGBA(), Materials.Osmium.getRGBA(), new short[]{0xff, 0, 0}, new short[]{0, 0xff, 0}, new short[]{0x80, 0, 0xff}, new short[]{0xff, 0xff, 0}, new short[]{0, 0xff, 0x80}, new short[]{0x80, 0x33, 0}}, + MainMod.BIO_TAB, + true, false + ) + }; + public static final Block bw_fake_glasses = + new BW_GlasBlocks("BW_GlasBlocks", new String[]{ + MainMod.MOD_ID + ":BoronSilicateGlassBlockRandlos" + }, null, null, true, true); public static final Block[] BW_BLOCKS = { new BW_Blocks("BW_ItemBlocks", new String[] { - MainMod.modID + ":EtchedLapisCell", - MainMod.modID + ":PlatedLapisCell", + MainMod.MOD_ID + ":EtchedLapisCell", + MainMod.MOD_ID + ":PlatedLapisCell", }, GT2), new BW_Blocks("GT_LESU_CASING", new String[]{ - MainMod.modID + ":LESU_CELL", + MainMod.MOD_ID + ":LESU_CELL", }, GT2), new BW_Blocks("BW_Machinery_Casings", new String[]{ - MainMod.modID + ":NickelFerriteBlocks", - MainMod.modID + ":TransformerCoil", - // MainMod.modID+":DEHP_Casing", - // MainMod.modID+":DEHP_Casing_Base" + MainMod.MOD_ID + ":NickelFerriteBlocks", + MainMod.MOD_ID + ":TransformerCoil", + // MainMod.MOD_ID+":DEHP_Casing", + // MainMod.MOD_ID+":DEHP_Casing_Base" }, BWT), }; - + public static ItemStack dehp; public static ItemStack[] diode2A = new ItemStack[GT_Values.VN.length]; public static ItemStack[] diode4A = new ItemStack[GT_Values.VN.length]; public static ItemStack[] diode8A = new ItemStack[GT_Values.VN.length]; @@ -87,10 +120,14 @@ public class ItemRegistry { public static ItemStack[] diode16A = new ItemStack[GT_Values.VN.length]; public static ItemStack[] energyDistributor = new ItemStack[GT_Values.VN.length]; public static ItemStack[] acidGens = new ItemStack[3]; + public static ItemStack[] megaMachines = new ItemStack[2]; public static void run() { if (newStuff) { + GameRegistry.registerBlock(ItemRegistry.bw_glasses[0], BW_ItemBlocks.class, "BW_GlasBlocks"); + GameRegistry.registerBlock(ItemRegistry.bw_fake_glasses, "BW_FakeGlasBlock"); + GT_OreDictUnificator.add(OrePrefixes.block, Materials.BorosilicateGlass, new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)); GameRegistry.registerBlock(BW_BLOCKS[2], BW_ItemBlocks.class, "BW_Machinery_Casings"); GT_OreDictUnificator.registerOre(OrePrefixes.block, Materials.NickelZincFerrite, new ItemStack(BW_BLOCKS[2])); GameRegistry.registerItem(LEATHER_ROTOR, "BW_LeatherRotor"); @@ -112,9 +149,12 @@ public static void run() { } for (int i = 0; i < 3; i++) { - ItemRegistry.acidGens[i] = new GT_MetaTileEntity_AcidGenerator(ConfigHandler.IDOffset + GT_Values.VN.length * 8 - 2 + i, "Acid Generator " + GT_Values.VN[i + 2], "Acid Generator " + GT_Values.VN[i + 2], i + 2, new String[]{"An Acid Generator", "Creates Power from Chemical Energy Potentials." }).getStackForm(1); + ItemRegistry.acidGens[i] = new GT_MetaTileEntity_AcidGenerator(ConfigHandler.IDOffset + GT_Values.VN.length * 8 - 2 + i, "Acid Generator " + GT_Values.VN[i + 2], "Acid Generator " + GT_Values.VN[i + 2], i + 2, new String[]{"An Acid Generator", "Creates Power from Chemical Energy Potentials."}).getStackForm(1); } dehp = new GT_TileEntity_DEHP(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 1, 1, "DEHP", "Deep Earth Heating Pump").getStackForm(1L); + megaMachines[0] = new GT_TileEntity_MegaBlastFurnace(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 2, "MegaBlastFurnace", "Mega Blast Furnace").getStackForm(1L); + megaMachines[1] = new GT_TileEntity_MegaVacuumFreezer(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 3, "MegaVaccumFreezer", "Mega Vaccum Freezer").getStackForm(1L); + } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index 5e191fbc8..6a4094170 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -24,15 +24,12 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_LESU; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_ManualTrafo; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_Windmill; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_LESU; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ManualTrafo; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_Windmill; import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.GregTech_API; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.*; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; @@ -201,6 +198,36 @@ public void run() { else GT_Values.RA.addAssemblylineRecipe(ItemList.Pump_IV.get(1L), 72000, new ItemStack[]{ItemList.Pump_IV.get(16), GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Ultimate, 32L), GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 32L), ItemList.Field_Generator_LuV.get(8)}, new FluidStack[]{Materials.SolderingAlloy.getMolten(32 * 144), Materials.Polytetrafluoroethylene.getMolten(32 * 144)}, ItemRegistry.dehp, 5000, BW_Util.getMachineVoltageFromTier(6)); + GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1000), GT_Utility.getIntegratedCircuit(17), Materials.SolderingAlloy.getMolten(9216), ItemRegistry.megaMachines[0], 72000, BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1002), GT_Utility.getIntegratedCircuit(17), Materials.SolderingAlloy.getMolten(9216), ItemRegistry.megaMachines[1], 72000, BW_Util.getMachineVoltageFromTier(3)); + + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Materials.Nickel.getMolten(5184), new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), 800, BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), Materials.Tungsten.getMolten(1296), new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), 800, BW_Util.getMachineVoltageFromTier(5)); + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), Materials.Chrome.getMolten(1296), new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), 800, BW_Util.getMachineVoltageFromTier(6)); + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), Materials.Iridium.getMolten(3888), new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), 800, BW_Util.getMachineVoltageFromTier(7)); + GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), Materials.Osmium.getMolten(1296), new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), 800, BW_Util.getMachineVoltageFromTier(8)); + + for (int i = 0; i < Dyes.dyeBrown.getSizeOfFluidList(); ++i) { + GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Dyes.dyeRed.getFluidDye(i, 36), new ItemStack(ItemRegistry.bw_glasses[0], 1, 6), null, null, null, 64, 2); + GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Dyes.dyeGreen.getFluidDye(i, 36), new ItemStack(ItemRegistry.bw_glasses[0], 1, 7), null, null, null, 64, 2); + GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Dyes.dyePurple.getFluidDye(i, 36), new ItemStack(ItemRegistry.bw_glasses[0], 1, 8), null, null, null, 64, 2); + GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Dyes.dyeYellow.getFluidDye(i, 36), new ItemStack(ItemRegistry.bw_glasses[0], 1, 9), null, null, null, 64, 2); + GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Dyes.dyeLime.getFluidDye(i, 36), new ItemStack(ItemRegistry.bw_glasses[0], 1, 10), null, null, null, 64, 2); + GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Dyes.dyeBrown.getFluidDye(i, 36), new ItemStack(ItemRegistry.bw_glasses[0], 1, 11), null, null, null, 64, 2); + } + //and reverse recipes... cause im nice :P + GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nickel.getDust(36)}, null, 800, BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nickel.getDust(36), Materials.Tungsten.getDust(9)}, null, 800, BW_Util.getMachineVoltageFromTier(5)); + GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nichrome.getDust(45), Materials.Tungsten.getDust(9)}, null, 800, BW_Util.getMachineVoltageFromTier(6)); + GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nichrome.getDust(45), Materials.Tungsten.getDust(9), Materials.Iridium.getDust(27)}, null, 800, BW_Util.getMachineVoltageFromTier(7)); + GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Nichrome.getDust(45), Materials.Tungsten.getDust(9), Materials.Osmiridium.getDust(36)}, null, 800, BW_Util.getMachineVoltageFromTier(8)); + + for (int i = 6; i < 11; i++) { + GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, i), new ItemStack[]{Materials.BorosilicateGlass.getDust(9)}, null, 400, BW_Util.getMachineVoltageFromTier(1)); + GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, i), Materials.Chlorine.getGas(50), new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), null, null, null, 64, 2); + } + + GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.WINDMETER), GT_ModHandler.RecipeBits.NOT_REMOVABLE, @@ -430,8 +457,8 @@ public void run() { } ); - String[] stones = {"stone", "stoneSmooth" }; - String[] granites = {"blockGranite", "stoneGranite", "Granite", "granite" }; + String[] stones = {"stone", "stoneSmooth"}; + String[] granites = {"blockGranite", "stoneGranite", "Granite", "granite"}; for (String granite : granites) { for (String stone : stones) { GT_ModHandler.addCraftingRecipe( diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java index 1427cc291..71aa50c82 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java @@ -23,7 +23,7 @@ package com.github.bartimaeusnek.bartworks.common.net; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_BioVat; +import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_BioVat; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.Coords; import com.google.common.io.ByteArrayDataInput; @@ -93,7 +93,7 @@ public GT_Packet decode(ByteArrayDataInput dataInput) { byte checksum = (byte) (coords.x % 25 + coords.y % 25 + coords.z % 25 + coords.wID % 25 + integer % 25 + removal); if (checksum != ByteBuffer.wrap(buffer).get(18)) { - MainMod.logger.error("BW Packet was corrupted or modified!"); + MainMod.LOGGER.error("BW Packet was corrupted or modified!"); return null; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/BWTileEntityDimIDBridge.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java similarity index 94% rename from src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/BWTileEntityDimIDBridge.java rename to src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java index d403b5407..9d492bb87 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/BWTileEntityDimIDBridge.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java @@ -20,7 +20,7 @@ * SOFTWARE. */ -package com.github.bartimaeusnek.bartworks.common.tileentities; +package com.github.bartimaeusnek.bartworks.common.tileentities.classic; import net.minecraft.tileentity.TileEntity; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/BW_RotorBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java similarity index 96% rename from src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/BW_RotorBlock.java rename to src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java index ee35c3743..767e6bd38 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/BW_RotorBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java @@ -20,7 +20,7 @@ * SOFTWARE. */ -package com.github.bartimaeusnek.bartworks.common.tileentities; +package com.github.bartimaeusnek.bartworks.common.tileentities.classic; import com.github.bartimaeusnek.bartworks.client.gui.BW_GUIContainer_RotorBlock; import cpw.mods.fml.relauncher.Side; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java similarity index 92% rename from src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_BioVat.java rename to src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index f7f5024f4..30ff2f4b0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -20,14 +20,15 @@ * SOFTWARE. */ -package com.github.bartimaeusnek.bartworks.common.tileentities; +package com.github.bartimaeusnek.bartworks.common.tileentities.multis; import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.items.LabParts; -import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.common.net.RendererPacket; +import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; import com.github.bartimaeusnek.bartworks.util.*; import cpw.mods.fml.common.FMLCommonHandler; import gregtech.api.GregTech_API; @@ -61,8 +62,6 @@ import java.util.HashSet; import java.util.Iterator; -import static gregtech.api.enums.GT_Values.V; - public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { public static final HashMap staticColorMap = new HashMap<>(); @@ -242,7 +241,7 @@ public boolean checkRecipe(ItemStack itemStack) { } else return false; - calculateOverclockedNessMulti(gtRecipe.mEUt, gtRecipe.mDuration, 1, this.getMaxInputVoltage()); + BW_Util.calculateOverclockedNessMulti(gtRecipe.mEUt, gtRecipe.mDuration, 1, this.getMaxInputVoltage(), this); if (mEUt > 0) mEUt = -mEUt; @@ -257,54 +256,6 @@ public boolean checkRecipe(ItemStack itemStack) { return false; } - /** - * Taken from the GTNH fork, made originally by Tec? - * Calcualtes overclocked ness using long integers - * - * @param aEUt - recipe EUt - * @param aDuration - recipe Duration - * @param mAmperage - should be 1 ? - */ - protected void calculateOverclockedNessMulti(@Nonnegative int aEUt, @Nonnegative int aDuration, @Nonnegative int mAmperage, @Nonnegative long maxInputVoltage) { - byte mTier = (byte) Math.max(0, GT_Utility.getTier(maxInputVoltage)); - if (mTier == 0) { - //Long time calculation - long xMaxProgresstime = ((long) aDuration) << 1; - if (xMaxProgresstime > Integer.MAX_VALUE - 1) { - //make impossible if too long - mEUt = Integer.MAX_VALUE - 1; - mMaxProgresstime = Integer.MAX_VALUE - 1; - } else { - mEUt = aEUt >> 2; - mMaxProgresstime = (int) xMaxProgresstime; - } - } else { - //Long EUt calculation - long xEUt = aEUt; - //Isnt too low EUt check? - long tempEUt = xEUt < V[1] ? V[1] : xEUt; - - mMaxProgresstime = aDuration; - - while (tempEUt <= V[mTier - 1] * mAmperage) { - tempEUt <<= 2;//this actually controls overclocking - //xEUt *= 4;//this is effect of everclocking - mMaxProgresstime >>= 1;//this is effect of overclocking - xEUt = mMaxProgresstime == 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power - } - if (xEUt > Integer.MAX_VALUE - 1) { - mEUt = Integer.MAX_VALUE - 1; - mMaxProgresstime = Integer.MAX_VALUE - 1; - } else { - mEUt = (int) xEUt; - if (mEUt == 0) - mEUt = 1; - if (mMaxProgresstime == 0) - mMaxProgresstime = 1;//set time to 1 tick - } - } - } - public ArrayList getStoredFluidOutputs() { ArrayList rList = new ArrayList(); Iterator var2 = this.mOutputHatches.iterator(); @@ -389,7 +340,7 @@ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack i private byte calculateGlassTier(@Nonnull Block block, @Nonnegative Byte meta) { - if (block.equals(BioItemList.bw_glasses[0])) + if (block.equals(ItemRegistry.bw_glasses[0])) return meta > 1 && meta < 6 ? (byte) (meta + 3) : 4; if (block.getUnlocalizedName().equals("blockAlloyGlass")) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_DEHP.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java similarity index 70% rename from src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_DEHP.java rename to src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java index adbb63e8d..0a6948077 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_DEHP.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java @@ -20,10 +20,9 @@ * SOFTWARE. */ -package com.github.bartimaeusnek.bartworks.common.tileentities; +package com.github.bartimaeusnek.bartworks.common.tileentities.multis; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -47,18 +46,18 @@ import java.util.Arrays; public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { + private static float nulearHeatMod = 2f; private byte mMode; private byte mTier; - private static float nulearHeatMod = 2f; public GT_TileEntity_DEHP(int aID, int tier, String aName, String aNameRegional) { super(aID, aName, aNameRegional); - mTier= (byte) tier; + mTier = (byte) tier; } - public GT_TileEntity_DEHP(String aName,byte mTier) { + public GT_TileEntity_DEHP(String aName, byte mTier) { super(aName); - this.mTier= (byte) mTier; + this.mTier = (byte) mTier; } @Override @@ -68,7 +67,7 @@ public void onConfigLoad(GT_Config aConfig) { Field f = c.getDeclaredField("huOutputModifier"); f.setAccessible(true); nulearHeatMod = f.getFloat(f); - }catch (SecurityException | IllegalArgumentException | ExceptionInInitializerError | NullPointerException | IllegalAccessException | NoSuchFieldException e){ + } catch (SecurityException | IllegalArgumentException | ExceptionInInitializerError | NullPointerException | IllegalAccessException | NoSuchFieldException e) { e.printStackTrace(); } super.onConfigLoad(aConfig); @@ -76,21 +75,21 @@ public void onConfigLoad(GT_Config aConfig) { @Override public void saveNBTData(NBTTagCompound aNBT) { - aNBT.setByte("mTier",mTier); - aNBT.setByte("mMode",mMode); + aNBT.setByte("mTier", mTier); + aNBT.setByte("mMode", mMode); super.saveNBTData(aNBT); } @Override public void loadNBTData(NBTTagCompound aNBT) { - mTier=aNBT.getByte("mTier"); - mMode=aNBT.getByte("mMode"); + mTier = aNBT.getByte("mTier"); + mMode = aNBT.getByte("mMode"); super.loadNBTData(aNBT); } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new GT_TileEntity_DEHP(this.mName,mTier); + return new GT_TileEntity_DEHP(this.mName, mTier); } @Override @@ -100,8 +99,8 @@ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechT @Override public String[] getDescription() { - String[] dscSteam = {"Controller Block for the Deep Earth Heat Pump " + (mTier > 1 ? mTier : ""), "Size(WxHxD): 3x7x3", "Controller (Front middle at bottom)", "3x1x3 Base of " + getCasingBlockItem().name(), "1x3x1 " + getCasingBlockItem().name() + " pillar (Center of base)", "1x3x1 " + this.getFrameMaterial().mName + " Frame Boxes (Each pillar side and on top)", "1x Input Hatch (One of base casings)","1x Output Hatch (One of base casings)", "1x Maintenance Hatch (One of base casings)", "1x " + GT_Values.VN[this.getMinTier()] + "+ Energy Hatch (Any bottom layer casing)","Consumes "+GT_Values.V[mTier+2]+"EU/t","Has 4 Modes, use the Screwdriver to change them:","0 Idle, 1 Steam, 2 Superheated Steam (requires Distilled Water), 3 Retract","Explodes when it runs out of Water/Distilled Water","Converts "+(long) (mTier*1200*20)+"L/s Water(minus 10% per Maintenance Problem) to Steam","Converts "+(long) (mTier*600*20)+"L/s Distilled Water(minus 10% per Maintenance Problem) to SuperheatedSteam"}; - String[] dscCooleant = {"Controller Block for the Deep Earth Heat Pump " + (mTier > 1 ? mTier : ""), "Size(WxHxD): 3x7x3", "Controller (Front middle at bottom)", "3x1x3 Base of " + getCasingBlockItem().name(), "1x3x1 " + getCasingBlockItem().name() + " pillar (Center of base)", "1x3x1 " + this.getFrameMaterial().mName + " Frame Boxes (Each pillar side and on top)", "1x Input Hatch (One of base casings)","1x Output Hatch (One of base casings)", "1x Maintenance Hatch (One of base casings)", "1x " + GT_Values.VN[this.getMinTier()] + "+ Energy Hatch (Any bottom layer casing)","Consumes "+GT_Values.V[mTier+2]+"EU/t","Has 4 Modes, use the Screwdriver to change them:","0 Idle, 1 & 2 Coolant Heating Mode (no Difference between them), 3 Retract","Explodes when it runs out of Coolant","Heats up "+(long) (mTier*24*((double) nulearHeatMod))*20+"L/s Coolant(minus 10% per Maintenance Problem)"}; + String[] dscSteam = {"Controller Block for the Deep Earth Heat Pump " + (mTier > 1 ? mTier : ""), "Size(WxHxD): 3x7x3", "Controller (Front middle at bottom)", "3x1x3 Base of " + getCasingBlockItem().name(), "1x3x1 " + getCasingBlockItem().name() + " pillar (Center of base)", "1x3x1 " + this.getFrameMaterial().mName + " Frame Boxes (Each pillar side and on top)", "1x Input Hatch (One of base casings)", "1x Output Hatch (One of base casings)", "1x Maintenance Hatch (One of base casings)", "1x " + GT_Values.VN[this.getMinTier()] + "+ Energy Hatch (Any bottom layer casing)", "Consumes " + GT_Values.V[mTier + 2] + "EU/t", "Has 4 Modes, use the Screwdriver to change them:", "0 Idle, 1 Steam, 2 Superheated Steam (requires Distilled Water), 3 Retract", "Explodes when it runs out of Water/Distilled Water", "Converts " + (long) (mTier * 1200 * 20) + "L/s Water(minus 10% per Maintenance Problem) to Steam", "Converts " + (long) (mTier * 600 * 20) + "L/s Distilled Water(minus 10% per Maintenance Problem) to SuperheatedSteam"}; + String[] dscCooleant = {"Controller Block for the Deep Earth Heat Pump " + (mTier > 1 ? mTier : ""), "Size(WxHxD): 3x7x3", "Controller (Front middle at bottom)", "3x1x3 Base of " + getCasingBlockItem().name(), "1x3x1 " + getCasingBlockItem().name() + " pillar (Center of base)", "1x3x1 " + this.getFrameMaterial().mName + " Frame Boxes (Each pillar side and on top)", "1x Input Hatch (One of base casings)", "1x Output Hatch (One of base casings)", "1x Maintenance Hatch (One of base casings)", "1x " + GT_Values.VN[this.getMinTier()] + "+ Energy Hatch (Any bottom layer casing)", "Consumes " + GT_Values.V[mTier + 2] + "EU/t", "Has 4 Modes, use the Screwdriver to change them:", "0 Idle, 1 & 2 Coolant Heating Mode (no Difference between them), 3 Retract", "Explodes when it runs out of Coolant", "Heats up " + (long) (mTier * 24 * ((double) nulearHeatMod)) * 20 + "L/s Coolant(minus 10% per Maintenance Problem)"}; return ConfigHandler.DEHPDirectSteam ? dscSteam : dscCooleant; } @@ -122,7 +121,7 @@ protected int getCasingTextureIndex() { @Override protected int getMinTier() { - return 2+mTier; + return 2 + mTier; } @Override @@ -130,22 +129,22 @@ protected boolean checkHatches() { return !this.mMaintenanceHatches.isEmpty() && !this.mOutputHatches.isEmpty() && !this.mInputHatches.isEmpty(); } - private long getFluidFromHatches(Fluid f){ + private long getFluidFromHatches(Fluid f) { long ret = 0; - for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches){ + for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches) { if (ih.getFluid().getFluid().equals(f)) ret += ih.getFluidAmount(); } return ret; } - private long getWaterFromHatches(boolean onlyDistilled){ + private long getWaterFromHatches(boolean onlyDistilled) { Fluid toConsume1 = FluidRegistry.WATER; Fluid toConsume2 = GT_ModHandler.getDistilledWater(1L).getFluid(); if (onlyDistilled) - toConsume1=toConsume2; + toConsume1 = toConsume2; long ret = 0; - for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches){ + for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches) { if (ih.getFluid().getFluid().equals(toConsume1) || ih.getFluid().getFluid().equals(toConsume2)) ret += ih.getFluidAmount(); } @@ -154,7 +153,7 @@ private long getWaterFromHatches(boolean onlyDistilled){ @Override protected boolean workingUpward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { - if (mMode != 3){ + if (mMode != 3) { this.isPickingPipes = false; return true; } @@ -164,14 +163,14 @@ protected boolean workingUpward(ItemStack aStack, int xDrill, int yDrill, int zD @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { ++mMode; - if (mMode >=4) + if (mMode >= 4) mMode = 0; - GT_Utility.sendChatToPlayer(aPlayer,"Mode: "+mMode); + GT_Utility.sendChatToPlayer(aPlayer, "Mode: " + mMode); super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); } protected boolean workingDownward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { - if (mMode==3){ + if (mMode == 3) { this.isPickingPipes = true; return true; } @@ -181,35 +180,35 @@ protected boolean workingDownward(ItemStack aStack, int xDrill, int yDrill, int return false; } else { if (ConfigHandler.DEHPDirectSteam) { - if (mMode==1) { + if (mMode == 1) { long steamProduced = (mTier * 600 * 2L * this.mEfficiency / 10000L); long waterConsume = ((steamProduced + 160) / 160); if (getWaterFromHatches(false) - waterConsume > 0) { - consumeFluid(FluidRegistry.WATER,waterConsume); + consumeFluid(FluidRegistry.WATER, waterConsume); addOutput(GT_ModHandler.getSteam(steamProduced)); } else { explodeMultiblock(); return false; } - } else if (mMode==2) { + } else if (mMode == 2) { long steamProduced = (mTier * 300 * 2L * this.mEfficiency / 10000L); long waterConsume = ((steamProduced + 160) / 160); if (getWaterFromHatches(true) - waterConsume > 0) { - consumeFluid(GT_ModHandler.getDistilledWater(1).getFluid(),waterConsume); + consumeFluid(GT_ModHandler.getDistilledWater(1).getFluid(), waterConsume); addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", (int) steamProduced)); } else { explodeMultiblock(); return false; } } - }else{ - if (mMode==1 || mMode==2) { - long coolantConverted = (long) (mTier*24*((double) nulearHeatMod)*this.mEfficiency / 10000L); - if (getFluidFromHatches(FluidRegistry.getFluid("ic2coolant"))-coolantConverted > 0){ - consumeFluid(FluidRegistry.getFluid("ic2coolant"),coolantConverted); - addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", (int) coolantConverted )); + } else { + if (mMode == 1 || mMode == 2) { + long coolantConverted = (long) (mTier * 24 * ((double) nulearHeatMod) * this.mEfficiency / 10000L); + if (getFluidFromHatches(FluidRegistry.getFluid("ic2coolant")) - coolantConverted > 0) { + consumeFluid(FluidRegistry.getFluid("ic2coolant"), coolantConverted); + addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", (int) coolantConverted)); } else { explodeMultiblock(); return false; @@ -223,22 +222,22 @@ protected boolean workingDownward(ItemStack aStack, int xDrill, int yDrill, int return true; } - private boolean consumeFluid(Fluid fluid,long ammount){ + private boolean consumeFluid(Fluid fluid, long ammount) { - if (ammount> Integer.MAX_VALUE){ - int[] tmp = new int[(int) (ammount/Integer.MAX_VALUE)]; - Arrays.fill(tmp,(int) (ammount/Integer.MAX_VALUE)); + if (ammount > Integer.MAX_VALUE) { + int[] tmp = new int[(int) (ammount / Integer.MAX_VALUE)]; + Arrays.fill(tmp, (int) (ammount / Integer.MAX_VALUE)); for (int i = 0; i < tmp.length; i++) { - for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches){ - if (fluid.equals(FluidRegistry.WATER) ? ih.getFluid().getFluid().equals(fluid) ||ih.getFluid().getFluid().equals(GT_ModHandler.getDistilledWater(1).getFluid()) :ih.getFluid().getFluid().equals(fluid) ) - tmp[i] -= ih.drain((int) ammount,true).amount; + for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches) { + if (fluid.equals(FluidRegistry.WATER) ? ih.getFluid().getFluid().equals(fluid) || ih.getFluid().getFluid().equals(GT_ModHandler.getDistilledWater(1).getFluid()) : ih.getFluid().getFluid().equals(fluid)) + tmp[i] -= ih.drain((int) ammount, true).amount; if (tmp[i] <= 0) break; } } - if (tmp[tmp.length-1] <= 0){ + if (tmp[tmp.length - 1] <= 0) { return true; } @@ -246,9 +245,9 @@ private boolean consumeFluid(Fluid fluid,long ammount){ } long tmp = ammount; - for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches){ - if (fluid.equals(FluidRegistry.WATER) ? ih.getFluid().getFluid().equals(fluid) ||ih.getFluid().getFluid().equals(GT_ModHandler.getDistilledWater(1).getFluid()) :ih.getFluid().getFluid().equals(fluid) ) - tmp -= ih.drain((int) ammount,true).amount; + for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches) { + if (fluid.equals(FluidRegistry.WATER) ? ih.getFluid().getFluid().equals(fluid) || ih.getFluid().getFluid().equals(GT_ModHandler.getDistilledWater(1).getFluid()) : ih.getFluid().getFluid().equals(fluid)) + tmp -= ih.drain((int) ammount, true).amount; if (tmp <= 0) return true; } @@ -258,14 +257,14 @@ private boolean consumeFluid(Fluid fluid,long ammount){ @Override protected void setElectricityStats() { try { - this.mEUt=isPickingPipes ? 60 : Math.toIntExact(GT_Values.V[getMinTier()]); - }catch (ArithmeticException e){ + this.mEUt = isPickingPipes ? 60 : Math.toIntExact(GT_Values.V[getMinTier()]); + } catch (ArithmeticException e) { e.printStackTrace(); - this.mEUt = Integer.MAX_VALUE-7; + this.mEUt = Integer.MAX_VALUE - 7; } - this.mProgresstime=0; - this.mMaxProgresstime=1; - this.mEfficiency = this.getCurrentEfficiency((ItemStack)null); + this.mProgresstime = 0; + this.mMaxProgresstime = 1; + this.mEfficiency = this.getCurrentEfficiency((ItemStack) null); this.mEfficiencyIncrease = 10000; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java similarity index 98% rename from src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java rename to src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java index f23fb5900..b3504b764 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java @@ -20,7 +20,7 @@ * SOFTWARE. */ -package com.github.bartimaeusnek.bartworks.common.tileentities; +package com.github.bartimaeusnek.bartworks.common.tileentities.multis; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_LESU; @@ -169,7 +169,7 @@ public String[] getDescription() { public void registerIcons(IIconRegister aBlockIconRegister) { for (int i = 0; i < iTextures.length; i++) { - iIcons[i] = aBlockIconRegister.registerIcon(MainMod.modID + ":LESU_CASING_" + i); + iIcons[i] = aBlockIconRegister.registerIcon(MainMod.MOD_ID + ":LESU_CASING_" + i); final int finalI = i; iIconContainers[i] = new IIconContainer() { @Override @@ -184,7 +184,7 @@ public IIcon getOverlayIcon() { @Override public ResourceLocation getTextureFile() { - return new ResourceLocation(MainMod.modID + ":LESU_CASING_" + finalI); + return new ResourceLocation(MainMod.MOD_ID + ":LESU_CASING_" + finalI); } }; } @@ -397,7 +397,7 @@ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack i long finishedTime = System.nanoTime(); if (finishedTime - startingTime > 5000000) - MainMod.logger.warn("LESU LookUp took longer than 5ms!(" + (finishedTime - startingTime) + "ns / " + ((finishedTime - startingTime) / 1000000) + "ms) Check at x:" + this.getBaseMetaTileEntity().getXCoord() + " y:" + this.getBaseMetaTileEntity().getYCoord() + " z:" + this.getBaseMetaTileEntity().getZCoord() + " DIM-ID: " + this.getBaseMetaTileEntity().getWorld().provider.dimensionId); + MainMod.LOGGER.warn("LESU LookUp took longer than 5ms!(" + (finishedTime - startingTime) + "ns / " + ((finishedTime - startingTime) / 1000000) + "ms) Check at x:" + this.getBaseMetaTileEntity().getXCoord() + " y:" + this.getBaseMetaTileEntity().getYCoord() + " z:" + this.getBaseMetaTileEntity().getZCoord() + " DIM-ID: " + this.getBaseMetaTileEntity().getWorld().provider.dimensionId); return true; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java similarity index 99% rename from src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_ManualTrafo.java rename to src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java index 5ae36c80d..2f6169663 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java @@ -20,7 +20,7 @@ * SOFTWARE. */ -package com.github.bartimaeusnek.bartworks.common.tileentities; +package com.github.bartimaeusnek.bartworks.common.tileentities.multis; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; @@ -98,7 +98,7 @@ public boolean onRunningTick(ItemStack aStack) { } public boolean onRunningTickTabbedMode() { - + boolean ret = false; for (GT_MetaTileEntity_Hatch_Dynamo E : mDynamoHatches) { for (GT_MetaTileEntity_Hatch_Energy I : mEnergyHatches) { @@ -111,11 +111,10 @@ public boolean onRunningTickTabbedMode() { long avt = vtp < E.maxEUStore() ? vtp : E.maxEUStore(); E.setEUVar(avt); I.setEUVar(I.getEUVar() - vtt); + ret = true; } - } - - return true; + return ret; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java similarity index 98% rename from src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java rename to src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index aff4e196c..bf9133385 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -20,10 +20,11 @@ * SOFTWARE. */ -package com.github.bartimaeusnek.bartworks.common.tileentities; +package com.github.bartimaeusnek.bartworks.common.tileentities.multis; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.gui.BW_GUIContainer_Windmill; +import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_RotorBlock; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import cpw.mods.fml.common.FMLCommonHandler; @@ -578,7 +579,7 @@ public String[] getDescription() { @Override public String[] getInfoData() { - return new String[]{"Progress:", this.mProgresstime + " Grindings of " + this.mMaxProgresstime + " needed Grindings", "GrindPower:", Integer.toString(this.rotorBlock.getGrindPower()) + "KU/t" }; + return new String[]{"Progress:", this.mProgresstime + " Grindings of " + this.mMaxProgresstime + " needed Grindings", "GrindPower:", Integer.toString(this.rotorBlock.getGrindPower()) + "KU/t"}; } @SideOnly(Side.CLIENT) @@ -601,7 +602,7 @@ public ResourceLocation getTextureFile() { } }; - iIcons[1] = aBlockIconRegister.registerIcon(MainMod.modID + ":windmill_top"); + iIcons[1] = aBlockIconRegister.registerIcon(MainMod.MOD_ID + ":windmill_top"); iIconContainers[1] = new IIconContainer() { @Override public IIcon getIcon() { @@ -615,7 +616,7 @@ public IIcon getOverlayIcon() { @Override public ResourceLocation getTextureFile() { - return new ResourceLocation(MainMod.modID + ":windmill_top"); + return new ResourceLocation(MainMod.MOD_ID + ":windmill_top"); } }; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java new file mode 100644 index 000000000..04f8f0f7b --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -0,0 +1,303 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; + +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import gregtech.api.GregTech_API; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_ElectricBlastFurnace; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; + +import static gregtech.api.enums.GT_Values.V; + +public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBlastFurnace { + + private int mHeatingCapacity = 0; + private byte glasTier = 0; + private int polPtick = super.getPollutionPerTick(null) * ConfigHandler.megaMachinesMax; + + public GT_TileEntity_MegaBlastFurnace(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_TileEntity_MegaBlastFurnace(String aName) { + super(aName); + } + + public String[] getDescription() { + return new String[]{"Controller Block for the Blast Furnace", + "Size(WxHxD): 15x20x15 (Hollow)", + "Controller 2nd Layer Middle Center", + "Inner 14x18x14 Heating Coils (Hollow)", + "Outer 15x18x15 Boronsilicate Glass", + "The glass limits the the Energy Input tier", + "1+ Input Hatch/Bus (Any casing)", + "1+ Output Hatch/Bus (Any casing)", + "1+ Energy Hatch (Any casing)", + "1x Maintenance Hatch (Any casing)", + "14x14 Muffler Hatches (Top middle)", + "Heat Proof Machine Casings for the outer 15x15 (Layer 20)", + "1+ Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing),", + " Recovery scales with Muffler Hatch tier", + "Heat Proof Machine Casings for Base", + "Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively)", + "Each 1800K over the min. Heat Capacity allows for one upgraded overclock", + "Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%", + "Causes maximal" + 20 * this.getPollutionPerTick((ItemStack) null) + " Pollution per second" + }; + } + + @Override + public boolean checkRecipe(ItemStack itemStack) { + ItemStack[] tInputs = (ItemStack[]) this.getStoredInputs().toArray(new ItemStack[0]); + FluidStack[] tFluids = (FluidStack[]) this.getStoredFluids().toArray(new FluidStack[0]); + + ArrayList outputItems = new ArrayList(); + ArrayList outputFluids = new ArrayList(); + + long tVoltage = this.getMaxInputVoltage(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs); + boolean found_Recipe = false; + int processed = 0; + while (this.getStoredInputs().size() > 0 && processed < ConfigHandler.megaMachinesMax) { + if (tRecipe != null && this.mHeatingCapacity >= tRecipe.mSpecialValue && tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { + found_Recipe = true; + for (int i = 0; i < tRecipe.mOutputs.length; i++) { + outputItems.add(tRecipe.getOutput(i)); + } + for (int i = 0; i < tRecipe.mFluidOutputs.length; i++) { + outputFluids.add(tRecipe.getFluidOutput(i)); + } + ++processed; + } else + break; + } + + if (found_Recipe) { + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + int tHeatCapacityDivTiers = (mHeatingCapacity - tRecipe.mSpecialValue) / 900; + byte overclockCount = 0; + long actualEUT = (long) (tRecipe.mEUt) * processed; + if (actualEUT > Integer.MAX_VALUE) { + byte divider = 0; + while (actualEUT > Integer.MAX_VALUE) { + actualEUT = actualEUT / 2; + divider++; + } + overclockCount = calculateOverclockednessEBF((int) (actualEUT / (divider * 2)), tRecipe.mDuration * (divider * 2), tVoltage); + } else + overclockCount = calculateOverclockednessEBF(tRecipe.mEUt * 64, tRecipe.mDuration, tVoltage); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + if (tHeatCapacityDivTiers > 0) { + this.mEUt = (int) (this.mEUt * (Math.pow(0.95, tHeatCapacityDivTiers))); + this.mMaxProgresstime >>= Math.min(tHeatCapacityDivTiers / 2, overclockCount);//extra free overclocking if possible + if (this.mMaxProgresstime < 1) + this.mMaxProgresstime = 1;//no eu efficiency correction + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + + this.polPtick = super.getPollutionPerTick(null) * processed; + this.mOutputItems = new ItemStack[outputItems.size()]; + this.mOutputItems = outputItems.toArray(this.mOutputItems); + this.mOutputFluids = new FluidStack[outputFluids.size()]; + this.mOutputFluids = outputFluids.toArray(this.mOutputFluids); + this.updateSlots(); + return true; + } + return false; + } + + /** + * Taken from the GTNH fork, made originally by Tec + * Calcualtes overclocked ness using long integers + * + * @param aEUt - recipe EUt + * @param aDuration - recipe Duration + */ + protected byte calculateOverclockednessEBF(int aEUt, int aDuration, long maxInputVoltage) { + byte mTier = (byte) Math.max(0, GT_Utility.getTier(maxInputVoltage)), timesOverclocked = 0; + if (mTier == 0) { + //Long time calculation + long xMaxProgresstime = ((long) aDuration) << 1; + if (xMaxProgresstime > Integer.MAX_VALUE - 1) { + //make impossible if too long + mEUt = Integer.MAX_VALUE - 1; + mMaxProgresstime = Integer.MAX_VALUE - 1; + } else { + mEUt = aEUt >> 2; + mMaxProgresstime = (int) xMaxProgresstime; + } + //return 0; + } else { + //Long EUt calculation + long xEUt = aEUt; + //Isnt too low EUt check? + long tempEUt = xEUt < V[1] ? V[1] : xEUt; + + mMaxProgresstime = aDuration; + + while (tempEUt <= V[mTier - 1]) { + tempEUt <<= 2;//this actually controls overclocking + //xEUt *= 4;//this is effect of everclocking + mMaxProgresstime >>= 1;//this is effect of overclocking + xEUt = mMaxProgresstime == 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power + timesOverclocked++; + } + if (xEUt > Integer.MAX_VALUE - 1) { + mEUt = Integer.MAX_VALUE - 1; + mMaxProgresstime = Integer.MAX_VALUE - 1; + } else { + mEUt = (int) xEUt; + if (mEUt == 0) + mEUt = 1; + if (mMaxProgresstime == 0) + mMaxProgresstime = 1;//set time to 1 tick + } + } + return timesOverclocked; + } + + @Override + public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + mHeatingCapacity = 0; + HashSet ret = new HashSet(); + ret.add(BW_Util.check_layer(iGregTechTileEntity, 7, -2, -1, GregTech_API.sBlockCasings1, 11, 7, 11)); + ret.add(BW_Util.check_layer(iGregTechTileEntity, 7, 17, 18, GregTech_API.sBlockCasings1, 11, 7, false, null, -1, 11)); + ret.add(BW_Util.check_layer(iGregTechTileEntity, 6, -1, 17, GregTech_API.sBlockCasings5, -1, 7, false, false, true, Blocks.air, -1, false, 11)); + for (int y = -1; y < 17; y++) { + ret.add(BW_Util.check_layer(iGregTechTileEntity, 7, y, y + 1, ItemRegistry.bw_glasses[0], -1, 7, y == 0, false, false, null, -1, true, 11)); + if (!getCoilHeat(iGregTechTileEntity, 7, y, 6)) + return false; + List metasFromLayer = BW_Util.getMetasFromLayer(iGregTechTileEntity, 7, y, y + 1, 7, y == 0, false, false); + for (Byte meta : metasFromLayer) { + byte inttier = BW_Util.getTierFromGlasMeta(meta); + if (glasTier > 0 && inttier != glasTier) + return false; + else if (glasTier == 0) + glasTier = inttier; + } + } + int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX * 7; + int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ * 7; + for (int z = -6; z <= 6; z++) + for (int x = -6; x <= 6; x++) { + if (!addMufflerToMachineList(iGregTechTileEntity.getIGregTechTileEntityOffset(xDir + x, 17, zDir + z), 11)) { + return false; + } + } + if (!this.mOutputHatches.isEmpty()) { + for (GT_MetaTileEntity_Hatch_Output hatchOutput : mOutputHatches) + if (hatchOutput.getBaseMetaTileEntity().getYCoord() < iGregTechTileEntity.getYCoord()) + return false; + } + + if (glasTier != 8 && !mEnergyHatches.isEmpty()) + for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : mEnergyHatches) { + if (glasTier > hatchEnergy.mTier) + return false; + } + + return !ret.contains(Boolean.FALSE) && !this.mMaintenanceHatches.isEmpty() && !this.mOutputBusses.isEmpty() && !this.mInputBusses.isEmpty(); + } + + private boolean getCoilHeat(IGregTechTileEntity iGregTechTileEntity, int offset, int y, int radius) { + int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX * offset; + int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ * offset; + int internalH = 0; + for (int x = -radius; x <= radius; x++) { + for (int z = -radius; z <= radius; z++) { + if (Math.abs(x) < radius && Math.abs(z) != radius) + continue; + byte tUsedMeta = iGregTechTileEntity.getMetaIDOffset(xDir + x, y, zDir + z); + switch (tUsedMeta) { + case 0: + internalH = 1801; + break; + case 1: + internalH = 2701; + break; + case 2: + internalH = 3601; + break; + case 3: + internalH = 4501; + break; + case 4: + internalH = 5401; + break; + case 5: + internalH = 7201; + break; + case 6: + internalH = 9001; + break; + case 7: + internalH = 12001; + break; + case 8: + internalH = 15001; + break; + default: + break; + } + if (mHeatingCapacity > 0 && internalH != mHeatingCapacity) + return false; + else if (mHeatingCapacity == 0) + mHeatingCapacity = internalH; + } + } + return true; + } + + @Override + public int getPollutionPerTick(ItemStack aStack) { + return polPtick; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_TileEntity_MegaBlastFurnace(this.mName); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java new file mode 100644 index 000000000..4976db98c --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; + +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.util.BW_Util; +import gregtech.api.GregTech_API; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_VacuumFreezer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; + +import java.util.ArrayList; +import java.util.HashSet; + +import static gregtech.api.enums.GT_Values.V; + +public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFreezer { + + public GT_TileEntity_MegaVacuumFreezer(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_TileEntity_MegaVacuumFreezer(String aName) { + super(aName); + } + + public String[] getDescription() { + return new String[]{ + "Controller Block for the Mega Vacuum Freezer", + "Super cools hot ingots and cells", + "Size(WxHxD): 15x15x15 (Hollow), Controller (Front centered)", + "1x Input Bus (Any casing)", + "1x Output Bus (Any casing)", + "1x Maintenance Hatch (Any casing)", + "1x Energy Hatch (Any casing)", + "Frost Proof Machine Casings for the rest" + }; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_TileEntity_MegaVacuumFreezer(this.mName); + } + + @Override + public boolean checkRecipe(ItemStack itemStack) { + ItemStack[] tInputs = (ItemStack[]) this.getStoredInputs().toArray(new ItemStack[0]); + ArrayList outputItems = new ArrayList(); + + long tVoltage = this.getMaxInputVoltage(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sVacuumRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], null, tInputs); + boolean found_Recipe = false; + int processed = 0; + while (this.getStoredInputs().size() > 0 && processed < ConfigHandler.megaMachinesMax) { + if (tRecipe != null && tRecipe.isRecipeInputEqual(true, null, tInputs)) { + found_Recipe = true; + for (int i = 0; i < tRecipe.mOutputs.length; i++) { + outputItems.add(tRecipe.getOutput(i)); + } + ++processed; + } else + break; + } + + if (found_Recipe) { + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + long actualEUT = (long) (tRecipe.mEUt) * processed; + if (actualEUT > Integer.MAX_VALUE) { + byte divider = 0; + while (actualEUT > Integer.MAX_VALUE) { + actualEUT = actualEUT / 2; + divider++; + } + BW_Util.calculateOverclockedNessMulti((int) (actualEUT / (divider * 2)), tRecipe.mDuration * (divider * 2), 1, this.getMaxInputVoltage(), this); + } else + BW_Util.calculateOverclockedNessMulti((int) actualEUT, tRecipe.mDuration, 1, this.getMaxInputVoltage(), this); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + this.mOutputItems = new ItemStack[outputItems.size()]; + this.mOutputItems = outputItems.toArray(this.mOutputItems); + this.updateSlots(); + return true; + } + return false; + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + HashSet ret = new HashSet(); + ret.add(BW_Util.check_layer(aBaseMetaTileEntity, 7, -7, -6, GregTech_API.sBlockCasings2, 1, 7, false, 17)); + ret.add(BW_Util.check_layer(aBaseMetaTileEntity, 7, -6, 0, GregTech_API.sBlockCasings2, 1, 7, false, false, true, Blocks.air, -1, true, 17)); + ret.add(BW_Util.check_layer(aBaseMetaTileEntity, 7, 0, 1, GregTech_API.sBlockCasings2, 1, 7, true, false, true, Blocks.air, -1, true, 17)); + ret.add(BW_Util.check_layer(aBaseMetaTileEntity, 7, 1, 7, GregTech_API.sBlockCasings2, 1, 7, false, false, true, Blocks.air, -1, true, 17)); + ret.add(BW_Util.check_layer(aBaseMetaTileEntity, 7, 7, 8, GregTech_API.sBlockCasings2, 1, 7, false, 17)); + return !(ret.contains(Boolean.FALSE) || this.mInputBusses.isEmpty() || this.mOutputBusses.isEmpty() || this.mEnergyHatches.isEmpty() || this.mMaintenanceHatches.isEmpty()); + } + + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_AcidGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java similarity index 97% rename from src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_AcidGenerator.java rename to src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java index 4d75f908b..2b5df0d3a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_AcidGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java @@ -20,7 +20,7 @@ * SOFTWARE. */ -package com.github.bartimaeusnek.bartworks.common.tileentities; +package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; @@ -109,6 +109,6 @@ public boolean isOutputFacing(byte aSide) { @SuppressWarnings("deprecation") public String[] getDescription() { - return new String[]{mDescription, "Voltage: " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], "Efficiency: " + ChatColorHelper.YELLOW + getEfficiency(), "Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut(), "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks" }; + return new String[]{mDescription, "Voltage: " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], "Efficiency: " + ChatColorHelper.YELLOW + getEfficiency(), "Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut(), "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks"}; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java similarity index 99% rename from src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_BioLab.java rename to src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java index b6cb2dea3..593e9fee7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_BioLab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java @@ -20,7 +20,7 @@ * SOFTWARE. */ -package com.github.bartimaeusnek.bartworks.common.tileentities; +package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; import com.github.bartimaeusnek.bartworks.common.items.LabModule; import com.github.bartimaeusnek.bartworks.common.items.LabParts; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_Diode.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java similarity index 62% rename from src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_Diode.java rename to src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java index a30ba65f1..0d51cb828 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_Diode.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java @@ -20,7 +20,7 @@ * SOFTWARE. */ -package com.github.bartimaeusnek.bartworks.common.tileentities; +package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import gregtech.api.enums.GT_Values; @@ -28,37 +28,67 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { - private long amps; + private long maxAmps; + private long aAmps; - public GT_MetaTileEntity_Diode(int aID, String aName, String aNameRegional, int aTier, int amps) { + public GT_MetaTileEntity_Diode(int aID, String aName, String aNameRegional, int aTier, int maxAmps) { super(aID, aName, aNameRegional, aTier, "A Simple diode that will allow Energy Flow in only one direction."); - this.amps = amps; + this.maxAmps = maxAmps; + aAmps = maxAmps; } - public GT_MetaTileEntity_Diode(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { - super(aName, aTier, aInvSlotCount, aDescription, aTextures); + public GT_MetaTileEntity_Diode(String aName, int aTier, long maxAmps, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 0, aDescription, aTextures); + this.maxAmps = maxAmps; + aAmps = maxAmps; + } + + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); + --aAmps; + if (aAmps < 0) + aAmps = maxAmps; + GT_Utility.sendChatToPlayer(aPlayer, "Max Amps: " + aAmps); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setLong("maxAmp", maxAmps); + aNBT.setLong("Amps", aAmps); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + maxAmps = aNBT.getLong("maxAmp"); + aAmps = aNBT.getLong("Amps"); + super.loadNBTData(aNBT); } @Override public long maxAmperesOut() { - return amps; + return aAmps; } @Override public long maxAmperesIn() { - return amps; + return aAmps; } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Diode(this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); + return new GT_MetaTileEntity_Diode(this.mName, this.mTier, this.maxAmps, this.mDescriptionArray, this.mTextures); } @SuppressWarnings("deprecation") public String[] getDescription() { - return new String[]{mDescription, "Voltage: " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], "Amperage IN: " + ChatColorHelper.YELLOW + maxAmperesIn(), "Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut(), "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks" }; + return new String[]{mDescription, "Voltage: " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], "Amperage IN: " + ChatColorHelper.YELLOW + maxAmperesIn(), "Amperage OUT: " + ChatColorHelper.YELLOW + maxAmperesOut(), "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks"}; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java similarity index 95% rename from src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java rename to src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java index 822c49588..0dad2c841 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_EnergyDistributor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java @@ -20,7 +20,7 @@ * SOFTWARE. */ -package com.github.bartimaeusnek.bartworks.common.tileentities; +package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import gregtech.api.enums.GT_Values; @@ -70,7 +70,7 @@ public long maxEUStore() { @SuppressWarnings("deprecation") public String[] getDescription() { - return new String[]{this.mDescription, "Voltage: " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], "Amperage IN: " + ChatColorHelper.YELLOW + this.maxAmperesIn(), "Amperage OUT: " + ChatColorHelper.YELLOW + this.maxAmperesOut(), "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks" }; + return new String[]{this.mDescription, "Voltage: " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], "Amperage IN: " + ChatColorHelper.YELLOW + this.maxAmperesIn(), "Amperage OUT: " + ChatColorHelper.YELLOW + this.maxAmperesOut(), "Added by bartimaeusnek via " + ChatColorHelper.DARKGREEN + "BartWorks"}; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java similarity index 97% rename from src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_RadioHatch.java rename to src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index 879d9f7fb..ddab78ea3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -20,7 +20,7 @@ * SOFTWARE. */ -package com.github.bartimaeusnek.bartworks.common.tileentities; +package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import com.github.bartimaeusnek.bartworks.MainMod; @@ -57,7 +57,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { private byte coverage = 0; public GT_MetaTileEntity_RadioHatch(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, new String[]{"Radioactive Item Chamber for Multiblocks", "Capacity: " + (aTier - 2) + " kg" + ((aTier - 2) >= 2 ? "s" : ""), "Use a screwdriver to set the containment level" }); + super(aID, aName, aNameRegional, aTier, 1, new String[]{"Radioactive Item Chamber for Multiblocks", "Capacity: " + (aTier - 2) + " kg" + ((aTier - 2) >= 2 ? "s" : ""), "Use a screwdriver to set the containment level"}); cap = aTier - 2; } @@ -128,7 +128,7 @@ public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - aPlayer.openGui(MainMod.modID, 2, this.getBaseMetaTileEntity().getWorld(), this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()); + aPlayer.openGui(MainMod.MOD_ID, 2, this.getBaseMetaTileEntity().getWorld(), this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()); //super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); } @@ -252,8 +252,8 @@ public boolean isGivingInformation() { @Override public String[] getInfoData() { if (calcDecayTicks(this.sievert) != 0) - return new String[]{"Material: " + material, "Sievert: " + sievert, "Amount: " + mass, "Time (in t/s/m/h) to decay (1kg): " + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert) * 60)) + "t/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 + "s/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 / 60 + "m/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 / 60 / 60 + "h" }; - else return new String[]{"Material: Empty", "Sievert: 0", "Amount: 0" }; + return new String[]{"Material: " + material, "Sievert: " + sievert, "Amount: " + mass, "Time (in t/s/m/h) to decay (1kg): " + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert) * 60)) + "t/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 + "s/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 / 60 + "m/" + ((calcDecayTicks(this.sievert)) - timer % (calcDecayTicks(this.sievert))) / 20 / 60 / 60 + "h"}; + else return new String[]{"Material: Empty", "Sievert: 0", "Amount: 0"}; } public boolean isSimpleMachine() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java new file mode 100644 index 000000000..95625ea9f --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; + +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IBasicEnergyContainer; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + +public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachineBlock { + boolean powered = false; + + public GT_MetaTileEntity_Transistor(int aID, String aName, String aNameRegional, int aTier, String aDescription, ITexture... aTextures) { + super(aID, aName, aNameRegional, aTier, 0, aDescription, aTextures); + } + + public GT_MetaTileEntity_Transistor(int aID, String aName, String aNameRegional, int aTier, String[] aDescription, ITexture... aTextures) { + super(aID, aName, aNameRegional, aTier, 0, aDescription, aTextures); + } + + public GT_MetaTileEntity_Transistor(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 0, aDescription, aTextures); + } + + public GT_MetaTileEntity_Transistor(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 0, aDescription, aTextures); + } + + @Override + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + ITexture[][][] rTextures = new ITexture[12][17][]; + + for (byte i = -1; i < 16; ++i) { + rTextures[0][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + rTextures[1][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + rTextures[2][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + rTextures[3][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier]}; + rTextures[4][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier]}; + rTextures[5][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier]}; + rTextures[6][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier]}; + rTextures[7][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier]}; + rTextures[8][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier]}; + rTextures[9][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]}; + rTextures[10][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]}; + rTextures[11][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]}; + } + + return rTextures; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new GT_MetaTileEntity_Transistor(this.mName, this.mTier, this.getDescription(), null); + } + + @Override + public void saveNBTData(NBTTagCompound nbtTagCompound) { + + } + + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide()) { + byte side = (byte) ForgeDirection.EAST.flag; + if (aBaseMetaTileEntity.inputEnergyFrom(side)) { + TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(side); + if (!(tTileEntity instanceof IBasicEnergyContainer)) { + powered = false; + return; + } + IBasicEnergyContainer tileAtSide = (IBasicEnergyContainer) tTileEntity; + if (!tileAtSide.outputsEnergyTo((byte) ForgeDirection.WEST.flag) || !tileAtSide.isUniversalEnergyStored(4L)) { + powered = false; + return; + } + if (!tileAtSide.decreaseStoredEnergyUnits(4, false)) { + powered = false; + return; + } + if (aBaseMetaTileEntity.injectEnergyUnits(side, 4L, 1L) == 4L) { + powered = true; + } + } + + if (aBaseMetaTileEntity.isAllowedToWork()) + powered = !powered; + } + } + + public long maxEUInput() { + return GT_Values.V[this.mTier]; + } + + @Override + public long maxAmperesIn() { + return 1L; + } + + @Override + public long maxAmperesOut() { + return powered ? 1L : 0; + } + + public long maxEUOutput() { + return powered ? GT_Values.V[this.mTier] : 0; + } + + @Override + public void loadNBTData(NBTTagCompound nbtTagCompound) { + + } + + @Override + public boolean allowPullStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { + return false; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { + return false; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, boolean b4) { + return new ITexture[0]; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java index 135666a13..b30c3fbbd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java @@ -22,7 +22,7 @@ package com.github.bartimaeusnek.bartworks.server.container; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_RadioHatch; +import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; import gregtech.api.gui.GT_Slot_Holo; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import net.minecraft.entity.player.EntityPlayer; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java index ceb6a4cc8..22a3e8ea1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java @@ -22,7 +22,7 @@ package com.github.bartimaeusnek.bartworks.server.container; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_MetaTileEntity_RadioHatch; +import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_Container_1by1; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index 33b661586..5027760ab 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -33,7 +33,12 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; +import javax.annotation.Nonnegative; +import java.util.ArrayList; import java.util.Iterator; +import java.util.List; + +import static gregtech.api.enums.GT_Values.V; public class BW_Util { @@ -112,6 +117,121 @@ else if (rarity.equals(EnumRarity.rare)) return 0; } + public static byte getTierFromGlasMeta(int meta) { + byte ret; + switch (meta) { + case 1: + ret = 4; + break; + case 2: + ret = 5; + break; + case 3: + ret = 6; + break; + case 4: + ret = 7; + break; + case 5: + ret = 8; + break; + default: + ret = 3; + } + return ret; + } + + public static String getColorForTier(int tier) { + String ret; + switch (tier) { + case 0: + ret = ChatColorHelper.RED; + break; + case 1: + ret = ChatColorHelper.GRAY; + break; + case 2: + ret = ChatColorHelper.AQUA; + break; + case 3: + ret = ChatColorHelper.GOLD; + break; + case 4: + ret = ChatColorHelper.DARKPURPLE; + break; + case 5: + ret = ChatColorHelper.DARKBLUE; + break; + case 6: + ret = ChatColorHelper.LIGHT_PURPLE; + break; + case 7: + ret = ChatColorHelper.WHITE; + break; + case 8: + ret = ChatColorHelper.DARKAQUA; + break; + case 9: + ret = ChatColorHelper.DARKRED; + break; + case 10: + ret = ChatColorHelper.GREEN; + break; + default: + ret = ChatColorHelper.OBFUSCATED; + break; + } + return ret; + } + + /** + * Taken from the GTNH fork, made originally by Tec + * Calcualtes overclocked ness using long integers + * + * @param aEUt - recipe EUt + * @param aDuration - recipe Duration + * @param mAmperage - should be 1 ? + */ + public static void calculateOverclockedNessMulti(@Nonnegative int aEUt, @Nonnegative int aDuration, @Nonnegative int mAmperage, @Nonnegative long maxInputVoltage, GT_MetaTileEntity_MultiBlockBase base) { + byte mTier = (byte) Math.max(0, GT_Utility.getTier(maxInputVoltage)); + if (mTier == 0) { + //Long time calculation + long xMaxProgresstime = ((long) aDuration) << 1; + if (xMaxProgresstime > Integer.MAX_VALUE - 1) { + //make impossible if too long + base.mEUt = Integer.MAX_VALUE - 1; + base.mMaxProgresstime = Integer.MAX_VALUE - 1; + } else { + base.mEUt = aEUt >> 2; + base.mMaxProgresstime = (int) xMaxProgresstime; + } + } else { + //Long EUt calculation + long xEUt = aEUt; + //Isnt too low EUt check? + long tempEUt = xEUt < V[1] ? V[1] : xEUt; + + base.mMaxProgresstime = aDuration; + + while (tempEUt <= V[mTier - 1] * mAmperage) { + tempEUt <<= 2;//this actually controls overclocking + //xEUt *= 4;//this is effect of everclocking + base.mMaxProgresstime >>= 1;//this is effect of overclocking + xEUt = base.mMaxProgresstime == 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power + } + if (xEUt > Integer.MAX_VALUE - 1) { + base.mEUt = Integer.MAX_VALUE - 1; + base.mMaxProgresstime = Integer.MAX_VALUE - 1; + } else { + base.mEUt = (int) xEUt; + if (base.mEUt == 0) + base.mEUt = 1; + if (base.mMaxProgresstime == 0) + base.mMaxProgresstime = 1;//set time to 1 tick + } + } + } + public static EnumRarity getRarityFromByte(byte b) { switch (b) { case 1: @@ -125,29 +245,34 @@ public static EnumRarity getRarityFromByte(byte b) { } } - public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int diameter, int yLevel, int height, Block block, int offset, int aBaseCasingIndex) { - return check_layer(aBaseMetaTileEntity, diameter, yLevel, height, block, offset, false, aBaseCasingIndex); + + public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, boolean insideCheck, Block inside, int dmginside, int aBaseCasingIndex) { + return check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, false, insideCheck, inside, dmginside, aBaseCasingIndex); } - public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int diameter, int yLevel, int height, Block block, int offset, boolean controllerLayer, int aBaseCasingIndex) { - return check_layer(aBaseMetaTileEntity, diameter, yLevel, height, block, offset, controllerLayer, false, aBaseCasingIndex); + public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, int aBaseCasingIndex) { + return check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, false, aBaseCasingIndex); } - public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int diameter, int yLevel, int height, Block block, int offset, boolean controllerLayer, boolean freeCorners, int aBaseCasingIndex) { - return check_layer(aBaseMetaTileEntity, diameter, yLevel, height, block, offset, controllerLayer, freeCorners, false, null, true, aBaseCasingIndex); + public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, boolean controllerLayer, int aBaseCasingIndex) { + return check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, controllerLayer, false, aBaseCasingIndex); } - public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int diameter, int yLevel, int height, Block block, int offset, boolean controllerLayer, boolean insideCheck, Block inside, int aBaseCasingIndex) { - return check_layer(aBaseMetaTileEntity, diameter, yLevel, height, block, offset, controllerLayer, false, insideCheck, inside, true, aBaseCasingIndex); + public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, boolean controllerLayer, boolean freeCorners, int aBaseCasingIndex) { + return check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, controllerLayer, freeCorners, true, block, dmg, true, aBaseCasingIndex); + } + + public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, boolean controllerLayer, boolean insideCheck, Block inside, int dmginside, int aBaseCasingIndex) { + return check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, controllerLayer, false, insideCheck, inside, dmginside, true, aBaseCasingIndex); } /** * @param aBaseMetaTileEntity the Multiblock controller, usually a parameter - * @param diameter the diameter of the layer + * @param radius the radius of the layer * @param yLevel the starting y level of the Layer, referenced to the Multiblock * @param height the height of the Layers, referenced to the Multiblock * @param block the block for the walls - * @param offset the offset in most cases should be the same as the diameter + * @param offset the offset in most cases should be the same as the radius * @param controllerLayer if the layer contains the controller * @param freeCorners if the corners should be checked * @param insideCheck if the inside should be empty/filled @@ -156,20 +281,21 @@ public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int d * @param aBaseCasingIndex the Index for the hatches texture * @return if the layer check was completed */ - public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int diameter, int yLevel, int height, Block block, int offset, boolean controllerLayer, boolean freeCorners, boolean insideCheck, Block inside, boolean allowHatches, int aBaseCasingIndex) { + public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, boolean controllerLayer, boolean freeCorners, boolean insideCheck, Block inside, int dmginside, boolean allowHatches, int aBaseCasingIndex) { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * offset; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * offset; - for (int x = -diameter; x < diameter; x++) { + for (int x = -radius; x <= radius; x++) { for (int y = yLevel; y < height; y++) { - for (int z = -diameter; z < diameter; z++) { - if (freeCorners && (((Math.abs(x) == diameter && Math.abs(z) == diameter)))) + for (int z = -radius; z <= radius; z++) { + if (freeCorners && (((Math.abs(x) == radius && Math.abs(z) == radius)))) continue; if (controllerLayer && (xDir + x == 0 && zDir + z == 0)) continue; - if (insideCheck && (Math.abs(x) < diameter && Math.abs(z) != diameter)) - if (!aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(inside)) + if (insideCheck && (Math.abs(x) < radius && Math.abs(z) != radius)) + if (!aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(inside) || (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmginside && dmginside > (-1))) { return false; - if (!aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block)) + } + if (((!(Math.abs(x) < radius && Math.abs(z) != radius))) && (!aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block) || (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmg && dmg > (-1)))) { if (!(allowHatches && ( ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addDynamoToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addEnergyInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || @@ -177,12 +303,35 @@ public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int d ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) - ))) + ))) { return false; + } + } } } } return true; } + public static List getMetasFromLayer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, int offset, boolean controllerLayer, boolean freeCorners, boolean insideCheck) { + ArrayList ret = new ArrayList<>(); + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * offset; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * offset; + for (int x = -radius; x <= radius; x++) { + for (int y = yLevel; y < height; y++) { + for (int z = -radius; z <= radius; z++) { + if (freeCorners && (((Math.abs(x) == radius && Math.abs(z) == radius)))) + continue; + if (controllerLayer && (xDir + x == 0 && zDir + z == 0)) + continue; + if (insideCheck && (Math.abs(x) < radius && Math.abs(z) != radius)) + ret.add(aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)); + if (!(Math.abs(x) < radius && Math.abs(z) != radius)) { + ret.add(aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)); + } + } + } + } + return ret; + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java index f36a8d54a..15f432aab 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java @@ -119,7 +119,7 @@ public static BioCulture getBioCulture(BioDNA DNA) { public Fluid getFluid() { if (this.mFluid == null) - MainMod.logger.error("Fluid has not been set yet! The issuring Culture is: " + this.name); + MainMod.LOGGER.error("Fluid has not been set yet! The issuring Culture is: " + this.name); return this.mFluid; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java index 9c6d12c7b..de262fd73 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java @@ -25,7 +25,6 @@ import codechicken.nei.api.API; import codechicken.nei.api.IConfigureNEI; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import cpw.mods.fml.common.Optional; @@ -37,13 +36,13 @@ public class NEIbartworksConfig implements IConfigureNEI { @Optional.Method(modid = "NotEnoughItems") @Override public String getName() { - return MainMod.name; + return MainMod.NAME; } @Optional.Method(modid = "NotEnoughItems") @Override public String getVersion() { - return MainMod.version; + return MainMod.VERSION; } @Optional.Method(modid = "NotEnoughItems") @@ -51,6 +50,6 @@ public String getVersion() { public void loadConfig() { API.hideItem(new ItemStack(ItemRegistry.TAB)); API.hideItem(new ItemStack(FluidLoader.bioFluidBlock)); - API.hideItem(new ItemStack(BioItemList.bw_fake_glasses)); + API.hideItem(new ItemStack(ItemRegistry.bw_fake_glasses)); } } \ No newline at end of file