diff options
25 files changed, 824 insertions, 8 deletions
diff --git a/src/main/java/gregtech/api/util/GTPP_Recipe.java b/src/main/java/gregtech/api/util/GTPP_Recipe.java index 1d04e8af6e..c22341856d 100644 --- a/src/main/java/gregtech/api/util/GTPP_Recipe.java +++ b/src/main/java/gregtech/api/util/GTPP_Recipe.java @@ -358,6 +358,10 @@ public class GTPP_Recipe extends GT_Recipe implements IComparableRecipe { //Basic Washer Map public static final GTPP_Recipe_Map_Internal sSimpleWasherRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(3), "gtpp.recipe.simplewasher", "Simple Dust Washer", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 1, 1, 0, 0, 1, E, 1, E, true, true); + //Molecular Transformer Map + public static final GTPP_Recipe_Map_Internal sMolecularTransformerRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(3), "gtpp.recipe.moleculartransformer", "Molecular Transformer", null, RES_PATH_GUI + "basicmachines/Scanner", 1, 1, 0, 0, 1, E, 1, E, true, true); + + //public static final GT_Recipe_Map sSimpleWasherRecipes_FakeFuckBW = new GT_Recipe_Map(new HashSet<GT_Recipe>(3), "gtpp.recipe.simplewasher", "Fuck you Bart", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 1, 1, 0, 0, 1, E, 1, E, true, false); public static final GTPP_Recipe_Map_Internal sChemicalPlantRecipes = new GTPP_Recipe_Map_Internal( diff --git a/src/main/java/gtPlusPlus/core/config/ConfigHandler.java b/src/main/java/gtPlusPlus/core/config/ConfigHandler.java index 61610a03e9..94193e8dab 100644 --- a/src/main/java/gtPlusPlus/core/config/ConfigHandler.java +++ b/src/main/java/gtPlusPlus/core/config/ConfigHandler.java @@ -206,6 +206,7 @@ public class ConfigHandler { pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc = config.get("pollution", "pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc", pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc,"pollution rate in gibbl/s for the Large processing factory in misc mode").getInt(pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc); pollutionPerSecondMultiIndustrialPlatePress_ModeForming = config.get("pollution", "pollutionPerSecondMultiIndustrialPlatePress_ModeForming", pollutionPerSecondMultiIndustrialPlatePress_ModeForming,"pollution rate in gibbl/s for the Industrial material press in forming mode").getInt(pollutionPerSecondMultiIndustrialPlatePress_ModeForming); pollutionPerSecondMultiIndustrialPlatePress_ModeBending = config.get("pollution", "pollutionPerSecondMultiIndustrialPlatePress_ModeBending", pollutionPerSecondMultiIndustrialPlatePress_ModeBending,"pollution rate in gibbl/s for the Industrial material press in bending mode").getInt(pollutionPerSecondMultiIndustrialPlatePress_ModeBending); + pollutionPerSecondMultiIndustrialForgeHammer = config.get("pollution", "pollutionPerSecondMultiIndustrialForgeHammer", pollutionPerSecondMultiIndustrialForgeHammer,"pollution rate in gibbl/s for the Industrial Forge Hammer").getInt(pollutionPerSecondMultiIndustrialForgeHammer); pollutionPerSecondMultiIndustrialSifter = config.get("pollution", "pollutionPerSecondMultiIndustrialSifter", pollutionPerSecondMultiIndustrialSifter,"pollution rate in gibbl/s for the Large Sifter").getInt(pollutionPerSecondMultiIndustrialSifter); pollutionPerSecondMultiIndustrialThermalCentrifuge = config.get("pollution", "pollutionPerSecondMultiIndustrialThermalCentrifuge", pollutionPerSecondMultiIndustrialThermalCentrifuge,"pollution rate in gibbl/s for the Large thermal refinery").getInt(pollutionPerSecondMultiIndustrialThermalCentrifuge); pollutionPerSecondMultiIndustrialVacuumFreezer = config.get("pollution", "pollutionPerSecondMultiIndustrialVacuumFreezer", pollutionPerSecondMultiIndustrialVacuumFreezer,"pollution rate in gibbl/s for the Cryogenic freezer").getInt(pollutionPerSecondMultiIndustrialVacuumFreezer); diff --git a/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java index 53d63499a6..3460d207b4 100644 --- a/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java +++ b/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java @@ -159,6 +159,8 @@ public class COMPAT_HANDLER { GregtechIndustrialAlloySmelter.run(); GregtechIsaMill.run(); GregtechSteamMultis.run(); + GregtechIndustrialForgeHammer.run(); + GregtechMolecularTransformer.run(); //GregtechIndustrialElementDuplicator.run(); //New Horizons Content diff --git a/src/main/java/gtPlusPlus/core/lib/CORE.java b/src/main/java/gtPlusPlus/core/lib/CORE.java index 1ef04aa154..cf5539e572 100644 --- a/src/main/java/gtPlusPlus/core/lib/CORE.java +++ b/src/main/java/gtPlusPlus/core/lib/CORE.java @@ -276,6 +276,7 @@ public class CORE { public static int pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc = 600; public static int pollutionPerSecondMultiIndustrialPlatePress_ModeForming = 240; public static int pollutionPerSecondMultiIndustrialPlatePress_ModeBending = 480; + public static int pollutionPerSecondMultiIndustrialForgeHammer = 250; public static int pollutionPerSecondMultiIndustrialSifter = 40; public static int pollutionPerSecondMultiIndustrialThermalCentrifuge = 1000; public static int pollutionPerSecondMultiIndustrialVacuumFreezer = 500; diff --git a/src/main/java/gtPlusPlus/core/lib/LoadedMods.java b/src/main/java/gtPlusPlus/core/lib/LoadedMods.java index 1eb8351d65..15b0d8629c 100644 --- a/src/main/java/gtPlusPlus/core/lib/LoadedMods.java +++ b/src/main/java/gtPlusPlus/core/lib/LoadedMods.java @@ -24,6 +24,7 @@ public class LoadedMods { public static boolean Simply_Jetpacks = false; public static boolean RFTools = false; public static boolean Thaumcraft = false; + public static boolean ThaumicBases = false; public static boolean Baubles = false; public static boolean Extra_Utils = false; public static boolean PneumaticCraft = false; @@ -41,6 +42,7 @@ public class LoadedMods { public static boolean MiscUtils = true; //Dummy For MetaData Lookups in MT Wrapper public static boolean ThermalFoundation = false; public static boolean IHL = false; + public static boolean AdvancedSolarPanel = false; public static boolean OpenComputers = false; //OpenComputers public static boolean OpenBlocks = false; public static boolean Computronics = false; //computronics @@ -117,6 +119,11 @@ public class LoadedMods { Logger.INFO("Components enabled for: Tinkers Construct"); totalMods++; } + if (isModLoaded("AdvancedSolarPanel")){ + AdvancedSolarPanel = true; + Logger.INFO("Components enabled for: Advanced Solar Panels"); + totalMods++; + } if (isModLoaded("BuildCraft")){ BuildCraft = true; Logger.INFO("Components enabled for: BuildCraft"); @@ -161,12 +168,17 @@ public class LoadedMods { OpenBlocks = true; Logger.INFO("Components enabled for: OpenBlocks"); totalMods++; - } + } if (isModLoaded("Thaumcraft")){ Thaumcraft = true; Logger.INFO("Components enabled for: Thaumcraft"); totalMods++; } + if (isModLoaded("thaumicbases")){ + ThaumicBases = true; + Logger.INFO("Components enabled for: Thaumic Bases"); + totalMods++; + } if (isModLoaded("BiomesOPlenty")){ BiomesOPlenty = true; Logger.INFO("Components enabled for: BiomesOPlenty"); diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_MolecularTransformer.java b/src/main/java/gtPlusPlus/nei/GT_NEI_MolecularTransformer.java new file mode 100644 index 0000000000..33672b8a76 --- /dev/null +++ b/src/main/java/gtPlusPlus/nei/GT_NEI_MolecularTransformer.java @@ -0,0 +1,35 @@ +package gtPlusPlus.nei; + +import codechicken.nei.recipe.TemplateRecipeHandler; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; +import gregtech.api.util.GT_Recipe; +import gtPlusPlus.core.util.math.MathUtils; + +public class GT_NEI_MolecularTransformer extends GTPP_NEI_DefaultHandler { + + public GT_NEI_MolecularTransformer() { + super(GTPP_Recipe_Map.sMolecularTransformerRecipes); + } + + @Override + public TemplateRecipeHandler newInstance() { + return new GT_NEI_MolecularTransformer(); + } + + @Override + public void drawExtras(final int aRecipeIndex) { + GT_Recipe aRecipe = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe; + final long tEUt = aRecipe.mEUt; + final long tDuration = aRecipe.mDuration; + if (tEUt != 0) { + drawText(10, 73, "Total: " + MathUtils.formatNumbers((long) (tDuration * tEUt)) + " EU", -16777216); + drawText(10, 83, "Usage: " + MathUtils.formatNumbers(tEUt * aRecipe.mSpecialValue) + " EU/t", -16777216); + drawText(10, 93, "Voltage: " + MathUtils.formatNumbers(tEUt) + " EU", -16777216); + drawText(10, 103, "Amperage: " + aRecipe.mSpecialValue, -16777216); + } + if (tDuration > 0) { + drawText(10, 113, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(Long.valueOf(tDuration / 20 / aRecipe.mSpecialValue))) + " secs", -16777216); + } + } + +} diff --git a/src/main/java/gtPlusPlus/nei/NEI_GT_Config.java b/src/main/java/gtPlusPlus/nei/NEI_GT_Config.java index 0b3cf8e66e..c566301e4e 100644 --- a/src/main/java/gtPlusPlus/nei/NEI_GT_Config.java +++ b/src/main/java/gtPlusPlus/nei/NEI_GT_Config.java @@ -25,7 +25,8 @@ implements IConfigureNEI { mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sChemicalPlantRecipes.mUnlocalizedName); mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sOreMillRecipes.mUnlocalizedName); mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sFlotationCellRecipes.mUnlocalizedName); - mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sVacuumFurnaceRecipes.mUnlocalizedName); + mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sVacuumFurnaceRecipes.mUnlocalizedName); + mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sMolecularTransformerRecipes.mUnlocalizedName); mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sAdvFreezerRecipes_GT.mUnlocalizedName); mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT.mUnlocalizedName); @@ -52,6 +53,8 @@ implements IConfigureNEI { Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sChemicalPlantRecipes.mNEIName); new GT_NEI_FluidReactor(); + Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sMolecularTransformerRecipes.mNEIName); + new GT_NEI_MolecularTransformer(); Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sOreMillRecipes.mNEIName); new GT_NEI_MillingMachine(); Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sFlotationCellRecipes.mNEIName); diff --git a/src/main/java/gtPlusPlus/nei/NEI_IMC_Sender.java b/src/main/java/gtPlusPlus/nei/NEI_IMC_Sender.java index 7bc2316a04..382d52cc9b 100644 --- a/src/main/java/gtPlusPlus/nei/NEI_IMC_Sender.java +++ b/src/main/java/gtPlusPlus/nei/NEI_IMC_Sender.java @@ -1,6 +1,7 @@ package gtPlusPlus.nei; import cpw.mods.fml.common.event.FMLInterModComms; +import gtPlusPlus.core.lib.LoadedMods; import net.minecraft.nbt.NBTTagCompound; public class NEI_IMC_Sender { @@ -28,6 +29,9 @@ public class NEI_IMC_Sender { setNBTInfoAndSendIt("gtpp.recipe.lftr.sparging", "gregtech:gt.blockmachines:31035", 1); setNBTInfoAndSendIt("gtpp.recipe.coldtrap", "gregtech:gt.blockmachines:31034"); setNBTInfoAndSendIt("gtpp.recipe.reactorprocessingunit", "gregtech:gt.blockmachines:31032"); + if (LoadedMods.AdvancedSolarPanel) { + setNBTInfoAndSendIt("gtpp.recipe.moleculartransformer", "AdvancedSolarPanel:BlockMolecularTransformer"); + } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java b/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java index a375f77cda..7396915483 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java @@ -32,6 +32,7 @@ import gtPlusPlus.core.handler.COMPAT_HANDLER; import gtPlusPlus.core.handler.OldCircuitHandler; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.CORE.ConfigSwitches; +import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.ELEMENT; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.ItemUtils; @@ -57,6 +58,7 @@ import gtPlusPlus.xmod.gregtech.loaders.ProcessingElectricSnips; import gtPlusPlus.xmod.gregtech.loaders.ProcessingToolHeadChoocher; import gtPlusPlus.xmod.gregtech.loaders.misc.AddCustomMachineToPA; import gtPlusPlus.xmod.gregtech.loaders.recipe.RecipeLoader_AlgaeFarm; +import gtPlusPlus.xmod.gregtech.loaders.recipe.RecipeLoader_MolecularTransformer; import gtPlusPlus.xmod.gregtech.recipes.RecipesToRemove; import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechConduits; import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechNitroDieselFix; @@ -167,6 +169,9 @@ public class HANDLER_GT { convertPyroToCokeOven(); Meta_GT_Proxy.fixIC2FluidNames(); RecipeLoader_AlgaeFarm.generateRecipes(); + if (LoadedMods.AdvancedSolarPanel) { + RecipeLoader_MolecularTransformer.run(); + } } public static void addNewOrePrefixes() { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index 8c814489f2..6bfcf1fb67 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -407,6 +407,14 @@ public enum GregtechItemList implements GregtechItemContainer { Controller_ElementalDuplicator, Casing_ElementalDuplicator, + // Forge Hammer + Controller_IndustrialForgeHammer, + Casing_IndustrialForgeHammer, + + // Molecular Transformer + Controller_MolecularTransformer, + Casing_MolecularTransformer, + // Big Steam Macerator Controller_SteamMaceratorMulti, diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java index 6bf048320f..f1e79360d1 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java @@ -1,11 +1,8 @@ package gtPlusPlus.xmod.gregtech.api.interfaces.internal; -import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; -import gregtech.api.util.GT_Recipe; import gtPlusPlus.core.material.Material; import net.minecraft.item.ItemStack; - import net.minecraftforge.fluids.FluidStack; public interface IGregtech_RecipeAdder { @@ -339,5 +336,7 @@ public interface IGregtech_RecipeAdder { public boolean addFluidHeaterRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt); public boolean addVacuumFreezerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEU); + + public boolean addMolecularTransformerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEU, int aAmps); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java index 61c71ba552..841ea582ad 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java @@ -32,7 +32,8 @@ extends GregtechMetaCasingBlocksAbstract { GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Sparge Tower Exterior Casing"); // Sparge Tower Casing TAE.registerTexture(0, 4, new GT_CopiedBlockTexture(this, 6, 4)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", ""); // Unused - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Forge Casing"); // Forge Hammer Casing + TAE.registerTexture(1, 11, new GT_CopiedBlockTexture(this, 6, 6)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", ""); // Unused GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", ""); // Unused GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", ""); // Unused @@ -48,6 +49,7 @@ extends GregtechMetaCasingBlocksAbstract { GregtechItemList.Casing_IsaMill_Gearbox.set(new ItemStack(this, 1, 2)); GregtechItemList.Casing_ElementalDuplicator.set(new ItemStack(this, 1, 3)); GregtechItemList.Casing_Sparge_Tower_Exterior.set(new ItemStack(this, 1, 4)); + GregtechItemList.Casing_IndustrialForgeHammer.set(new ItemStack(this, 1, 6)); } @Override @@ -69,6 +71,8 @@ extends GregtechMetaCasingBlocksAbstract { return TexturesGtBlock.TEXTURE_TECH_PANEL_D.getIcon(); case 4: return TexturesGtBlock.Casing_Machine_Metal_Sheet_H.getIcon(); + case 6: + return TexturesGtBlock.TEXTURE_TECH_PANEL_H.getIcon(); } } return Textures.BlockIcons.RENDERING_ERROR.getIcon(); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java index 518ffe0eae..59e4f2e4b3 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java @@ -494,6 +494,11 @@ public class TexturesGtBlock { public static final CustomIcon TEXTURE_TECH_PANEL_B = new CustomIcon("metro/TEXTURE_TECH_PANEL_B"); public static final CustomIcon TEXTURE_TECH_PANEL_C = new CustomIcon("metro/TEXTURE_TECH_PANEL_C"); public static final CustomIcon TEXTURE_TECH_PANEL_D = new CustomIcon("metro/TEXTURE_TECH_PANEL_D"); + public static final CustomIcon TEXTURE_TECH_PANEL_E = new CustomIcon("metro/TEXTURE_TECH_PANEL_E"); + public static final CustomIcon TEXTURE_TECH_PANEL_F = new CustomIcon("metro/TEXTURE_TECH_PANEL_F"); + public static final CustomIcon TEXTURE_TECH_PANEL_G = new CustomIcon("metro/TEXTURE_TECH_PANEL_G"); + public static final CustomIcon TEXTURE_TECH_PANEL_H = new CustomIcon("metro/TEXTURE_TECH_PANEL_H"); + public static final CustomIcon TEXTURE_TECH_PANEL_I = new CustomIcon("metro/TEXTURE_TECH_PANEL_I"); public static final CustomIcon TEXTURE_TECH_PANEL_RADIOACTIVE = new CustomIcon("TileEntities/DecayablesChest_bottom"); public static final CustomIcon TEXTURE_TECH_PANEL_RADIOACTIVE_ALT = new CustomIcon("TileEntities/DecayablesChest_top"); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialForgeHammer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialForgeHammer.java new file mode 100644 index 0000000000..03197c47ca --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialForgeHammer.java @@ -0,0 +1,327 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing; + +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + +import java.util.ArrayList; + +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; + +import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.GregTech_API; +import gregtech.api.enums.TAE; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.core.block.ModBlocks; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +public class GregtechMetaTileEntity_IndustrialForgeHammer extends GregtechMeta_MultiBlockBase { + + private int mCasing; + private IStructureDefinition<GregtechMetaTileEntity_IndustrialForgeHammer> STRUCTURE_DEFINITION = null; + + public GregtechMetaTileEntity_IndustrialForgeHammer(final int aID, final String aName, final String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GregtechMetaTileEntity_IndustrialForgeHammer(final String aName) { + super(aName); + } + + @Override + public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { + return new GregtechMetaTileEntity_IndustrialForgeHammer(this.mName); + } + + @Override + public String getMachineType() { + return "Forge Hammer"; + } + + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Industrial Forge Hammer") + .addInfo("Speed: 100% x Anvil Tier | Eu Usage: 100% | Parallel: Tier x 8") + .addInfo("T1 - Vanilla Anvil"); + if (LoadedMods.Railcraft) { + tt.addInfo("T2 - Steel Anvil"); + } + if (LoadedMods.EnderIO) { + tt.addInfo("T3 - Dark Steel Anvil"); + } + if (LoadedMods.ThaumicBases) { + tt.addInfo("T3 - Thaumic Anvil"); + tt.addInfo("T4 - Void Anvil"); + } + tt.addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front Center") + .addCasingInfo("Forge Casing", 10) + .addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1) + .addEnergyHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder); + return tt; + } + + @Override + public IStructureDefinition<GregtechMetaTileEntity_IndustrialForgeHammer> getStructureDefinition() { + if (STRUCTURE_DEFINITION == null) { + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialForgeHammer>builder() + .addShape(mName, transpose(new String[][]{ + {"CCC", "CCC", "CCC"}, + {"C~C", "CAC", "CCC"}, + {"CCC", "CCC", "CCC"}, + })) + .addElement( + 'C', + ofChain( + ofHatchAdder( + GregtechMetaTileEntity_IndustrialForgeHammer::addIndustrialForgeHammerList, TAE.getIndexFromPage(1, 11), 1 + ), + onElementPass( + x -> ++x.mCasing, + ofBlock( + ModBlocks.blockCasings5Misc, 6 + ) + ) + ) + ) + .addElement( + 'A', + ofChain( + ofHatchAdder( + GregtechMetaTileEntity_IndustrialForgeHammer::addIndustrialForgeHammerList, TAE.getIndexFromPage(1, 11), 1 + ), + onElementPass( + x -> ++x.mCasing, + ofBlock( + ModBlocks.blockCasings5Misc, 6 + ) + ) + ) + ) + + .build(); + } + return STRUCTURE_DEFINITION; + } + + @Override + public void construct(ItemStack stackSize, boolean hintsOnly) { + buildPiece(mName , stackSize, hintsOnly, 1, 1, 0); + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + mCasing = 0; + return checkPiece(mName, 1, 1, 0) && mCasing >= 10 && checkHatch(); + } + + public final boolean addIndustrialForgeHammerList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + } + return false; + } + + @Override + public String getSound() { + return GregTech_API.sSoundList.get(1); + } + + @Override + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.getIndexFromPage(1, 11)), new GT_RenderedTexture(aActive ? TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active : TexturesGtBlock.Overlay_Machine_Controller_Advanced)}; + } + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.getIndexFromPage(1, 11))}; + } + + @Override + public boolean hasSlotInGUI() { + return false; + } + + @Override + public String getCustomGUIResourceName() { + return "MaterialPress"; + } + + @Override + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return GT_Recipe.GT_Recipe_Map.sHammerRecipes; + } + + @Override + public boolean checkRecipe(final ItemStack aStack) { + Block aAnvil = this.getBaseMetaTileEntity().getBlockAtSide(this.getBaseMetaTileEntity().getBackFacing()); + if (aAnvil != null) { + int aAnvilTier = getAnvilTier(aAnvil); + if (aAnvilTier > 0) { + for (GT_MetaTileEntity_Hatch_InputBus tBus : mInputBusses) { + ArrayList<ItemStack> tBusItems = new ArrayList<ItemStack>(); + tBus.mRecipeMap = getRecipeMap(); + if (isValidMetaTileEntity(tBus)) { + for (int i = tBus.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) { + if (tBus.getBaseMetaTileEntity().getStackInSlot(i) != null) + tBusItems.add(tBus.getBaseMetaTileEntity().getStackInSlot(i)); + } + } + if (checkRecipeGeneric(tBusItems.toArray(new ItemStack[]{}), new FluidStack[]{}, getMaxParallelRecipes(), 100, 100 * aAnvilTier, 10000)) { + return true; + } + } + } + } + return false; + } + + @Override + public int getMaxParallelRecipes() { + return (8 * GT_Utility.getTier(this.getMaxInputVoltage())); + } + + @Override + public int getEuDiscountForParallelism() { + return 100; + } + + @Override + public void startProcess() { + this.sendLoopStart((byte) 1); + } + + @Override + public int getMaxEfficiency(final ItemStack aStack) { + return 10000; + } + + @Override + public int getPollutionPerSecond(final ItemStack aStack) { + return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialForgeHammer; + } + + @Override + public int getAmountOfOutputs() { + return 1; + } + + @Override + public boolean explodesOnComponentBreak(final ItemStack aStack) { + return false; + } + + private static Block sAnvil; + private static Block sSteelAnvil; + private static Block sDarkSteelAnvil; + private static Block sThaumiumAnvil; + private static Block sVoidAnvil; + + private static void setAnvilBlocks() { + if (sAnvil == null) { + sAnvil = Blocks.anvil; + if (LoadedMods.Railcraft) { + sSteelAnvil = GameRegistry.findBlock("Railcraft", "anvil"); + } + if (LoadedMods.EnderIO) { + sDarkSteelAnvil = GameRegistry.findBlock("EnderIO", "blockDarkSteelAnvil"); + } + if (LoadedMods.ThaumicBases) { + sThaumiumAnvil = GameRegistry.findBlock("thaumicbases", "thaumicAnvil"); + sVoidAnvil = GameRegistry.findBlock("thaumicbases", "voidAnvil"); + } + } + } + + public static boolean isBlockAnvil(Block aBlock) { + setAnvilBlocks(); + if (sAnvil == aBlock) { + return true; + } + if (LoadedMods.Railcraft) { + if (sSteelAnvil == aBlock) { + return true; + } + } + if (LoadedMods.EnderIO) { + if (sDarkSteelAnvil == aBlock) { + return true; + } + } + if (LoadedMods.ThaumicBases) { + if (sThaumiumAnvil == aBlock || sVoidAnvil == aBlock) { + return true; + } + } + return false; + } + + public static int getAnvilTier(Block aBlock) { + if (isBlockAnvil(aBlock)) { + if (sAnvil == aBlock) { + return 1; + } + if (LoadedMods.Railcraft) { + if (sSteelAnvil == aBlock) { + return 2; + } + } + if (LoadedMods.EnderIO) { + if (sDarkSteelAnvil == aBlock) { + return 3; + } + } + if (LoadedMods.ThaumicBases) { + if (sThaumiumAnvil == aBlock) { + return 3; + } + if (sVoidAnvil == aBlock) { + return 4; + } + } + } + return 0; + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMolecularTransformer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMolecularTransformer.java new file mode 100644 index 0000000000..b8e8a904b7 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMolecularTransformer.java @@ -0,0 +1,312 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing; + +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; + +import gregtech.api.enums.TAE; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.core.block.ModBlocks; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +public class GregtechMetaTileEntity_IndustrialMolecularTransformer extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialMolecularTransformer> { + + public static int CASING_TEXTURE_ID; + private int mCasing; + private IStructureDefinition<GregtechMetaTileEntity_IndustrialMolecularTransformer> STRUCTURE_DEFINITION = null; + + + public GregtechMetaTileEntity_IndustrialMolecularTransformer(final int aID, final String aName, final String aNameRegional) { + super(aID, aName, aNameRegional); + CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 10); + } + + public GregtechMetaTileEntity_IndustrialMolecularTransformer(final String aName) { + super(aName); + CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 10); + } + + public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { + return new GregtechMetaTileEntity_IndustrialMolecularTransformer(this.mName); + } + + @Override + public String getMachineType() { + return "Molecular Transformer"; + } + + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + + GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType(getMachineType()) + .addInfo("Factory Grade Advanced Vacuum Freezer") + .addInfo("Speed: 200% | Eu Usage: 100% | Parallel: 4") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front Center") + .addCasingInfo("CASING", 10) + .addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1) + .addInputHatch("Any Casing", 1) + .addOutputHatch("Any Casing", 1) + .addEnergyHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder); + return tt; + } + + @Override + public IStructureDefinition<GregtechMetaTileEntity_IndustrialMolecularTransformer> getStructureDefinition() { + if (STRUCTURE_DEFINITION == null) { + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialMolecularTransformer>builder() + .addShape(mName, transpose(new String[][]{ + {"CCC", "CCC", "CCC"}, + {"C~C", "C-C", "CCC"}, + {"CCC", "CCC", "CCC"}, + })) + .addElement( + 'C', + ofChain( + ofHatchAdder( + GregtechMetaTileEntity_IndustrialMolecularTransformer::addIndustrialVacuumFreezerList, CASING_TEXTURE_ID, 1 + ), + onElementPass( + x -> ++x.mCasing, + ofBlock( + ModBlocks.blockCasings3Misc, 10 + ) + ) + ) + ) + .build(); + } + return STRUCTURE_DEFINITION; + } + + @Override + public void construct(ItemStack stackSize, boolean hintsOnly) { + buildPiece(mName , stackSize, hintsOnly, 1, 1, 0); + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + mCasing = 0; + return checkPiece(mName, 1, 1, 0) && mCasing >= 10 && checkHatch(); + } + + public final boolean addIndustrialVacuumFreezerList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + } + return false; + } + + + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_TEXTURE_ID), + new GT_RenderedTexture((IIconContainer) (aActive ? TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active : TexturesGtBlock.Overlay_Machine_Controller_Advanced))}; + } + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_TEXTURE_ID)}; + } + + @Override + public boolean hasSlotInGUI() { + return true; + } + + @Override + public boolean requiresVanillaGtGUI() { + return true; + } + + @Override + public String getCustomGUIResourceName() { + return "VacuumFreezer"; + } + + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return GTPP_Recipe_Map.sMolecularTransformerRecipes; + } + + public boolean isCorrectMachinePart(final ItemStack aStack) { + return true; + } + + @Override + public boolean checkRecipe(final ItemStack aStack) { + return this.checkRecipeGeneric(4, 100, 100); + } + + @Override + public boolean checkRecipeGeneric( + ItemStack[] aItemInputs, FluidStack[] aFluidInputs, + int aMaxParallelRecipes, int aEUPercent, + int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe, boolean isPerpectOC) { + // Based on the Processing Array. A bit overkill, but very flexible. + + // Reset outputs and progress stats + this.mEUt = 0; + this.mMaxProgresstime = 0; + this.mOutputItems = new ItemStack[]{}; + this.mOutputFluids = new FluidStack[]{}; + + ItemStack[] tInputs = getCompactedInputs(); + FluidStack[] tFluids = new FluidStack[] {}; + + if (tInputs.length <= 0) { + log("Error 1"); + return false; + } + + long tVoltage = getMaxInputVoltage(); + log("Voltage: "+tVoltage); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + log("Tier: "+tTier); + GT_Recipe tRecipe = getRecipeMap().findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); + + if (tRecipe == null || !tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { + log("Error 2"); + return false; + } + + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + + calculateOverclockedNessMulti(tRecipe.mEUt*tRecipe.mSpecialValue, tRecipe.mDuration, 1, tVoltage); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) { + log("Error 3"); + return false; + } + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + log("EU/t: "+this.mEUt); + this.mMaxProgresstime = Math.max(mMaxProgresstime/tRecipe.mSpecialValue, 1); + log("Total Time: "+this.mMaxProgresstime); + if (tRecipe.mOutputs.length > 0) { + this.mOutputItems = tRecipe.mOutputs.clone(); + } + updateSlots(); + // Play sounds (GT++ addition - GT multiblocks play no sounds) + startProcess(); + + log("Running"); + return true; + } + + @Override + public int getMaxParallelRecipes() { + return 1; + } + + @Override + public int getEuDiscountForParallelism() { + return 100; + } + + public int getMaxEfficiency(final ItemStack aStack) { + return 10000; + } + + public int getPollutionPerSecond(final ItemStack aStack) { + return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialVacuumFreezer; + } + + public int getDamageToComponent(final ItemStack aStack) { + return 0; + } + + public boolean explodesOnComponentBreak(final ItemStack aStack) { + return false; + } + + @Override + public boolean drainEnergyInput(long aEU) { + if (aEU <= 0) { + return true; + } + for (GT_MetaTileEntity_Hatch tHatch : this.mAllEnergyHatches) { + if (isValidMetaTileEntity(tHatch)) { + if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)) { + return true; + } + } + } + return false; + } + + @Override + public long getMaxInputVoltage() { + long rVoltage = 0; + for (GT_MetaTileEntity_Hatch tHatch : mAllEnergyHatches) { + if (isValidMetaTileEntity(tHatch)) { + rVoltage += tHatch.getBaseMetaTileEntity().getInputVoltage(); + } + } + return rVoltage; + } + + /** + * Called every tick the Machine runs + */ + @Override + public boolean onRunningTick(ItemStack aStack) { + if (mEUt < 0) { + if (!drainEnergyInput(((long) -mEUt * 10000) / Math.max(1000, mEfficiency))) { + criticalStopMachine(); + return false; + } + } + return true; + } + +}
\ No newline at end of file diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_MolecularTransformer.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_MolecularTransformer.java new file mode 100644 index 0000000000..2ae16af406 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_MolecularTransformer.java @@ -0,0 +1,32 @@ +package gtPlusPlus.xmod.gregtech.loaders.recipe; + +import static advsolar.utils.MTRecipeManager.transformerRecipes; + +import advsolar.utils.MTRecipeRecord; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.math.MathUtils; +import gtPlusPlus.core.util.minecraft.MaterialUtils; + +public class RecipeLoader_MolecularTransformer { + + public static void run() { + + for (int i = 0; i < transformerRecipes.size(); i++) { + MTRecipeRecord aRecipe = transformerRecipes.get(i); + int aEU = MaterialUtils.getVoltageForTier(5); + Logger.INFO("======================="); + Logger.INFO("Generating GT recipe for Molecular Transformer."); + Logger.INFO("Input: "+aRecipe.inputStack.getDisplayName()+", Output: "+aRecipe.outputStack.getDisplayName()+", EU/t: "+aEU); + float aTicks = (float) aRecipe.energyPerOperation / (float) aEU; + Logger.INFO("Ticks: "+aTicks); + int aTicksRoundedUp = MathUtils.roundToClosestInt(Math.ceil(aTicks)); + Logger.INFO("Ticks: "+aTicksRoundedUp); + Logger.INFO("Total EU equal or greater? "+((aTicksRoundedUp * aEU) >= aRecipe.energyPerOperation)); + CORE.RA.addMolecularTransformerRecipe(aRecipe.inputStack, aRecipe.outputStack, aTicksRoundedUp, aEU, 2); + Logger.INFO("======================="); + } + + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java index be4d6a8f7d..7a84940b6f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java @@ -1843,7 +1843,26 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } - + public boolean addMolecularTransformerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt, int aAmps) { + if ((aInput == null) || (aOutput == null)) { + return false; + } + GTPP_Recipe aRecipe = new GTPP_Recipe( + false, + new ItemStack[] {aInput}, + new ItemStack[] {aOutput}, + null, + new int[] {10000}, + new FluidStack[] {}, + new FluidStack[] {}, + aDuration, + aEUt, + aAmps); + + int aSize = GTPP_Recipe_Map.sMolecularTransformerRecipes.mRecipeList.size(); + GTPP_Recipe_Map.sMolecularTransformerRecipes.add(aRecipe); + return GTPP_Recipe_Map.sMolecularTransformerRecipes.mRecipeList.size() > aSize; +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFactoryGradeReplacementMultis.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFactoryGradeReplacementMultis.java index 8340b7088c..6af1515c05 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFactoryGradeReplacementMultis.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFactoryGradeReplacementMultis.java @@ -1,7 +1,6 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialVacuumFreezer; //import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced.GregtechMetaTileEntity_Adv_AssemblyLine; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialForgeHammer.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialForgeHammer.java new file mode 100644 index 0000000000..0e4b412d99 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialForgeHammer.java @@ -0,0 +1,22 @@ +package gtPlusPlus.xmod.gregtech.registration.gregtech; + +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialForgeHammer; + +public class GregtechIndustrialForgeHammer { + + public static void run() { + if (gtPlusPlus.core.lib.LoadedMods.Gregtech) { + Logger.INFO("Gregtech5u Content | Registering Industrial Forge Hammer Multiblock."); + run1(); + } + + } + + private static void run1() { + GregtechItemList.Controller_IndustrialForgeHammer.set(new GregtechMetaTileEntity_IndustrialForgeHammer(31071, + "industrialhammer.controller.tier.single", "Industrial Sledgehammer").getStackForm(1L)); + + } +}
\ No newline at end of file diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechMolecularTransformer.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechMolecularTransformer.java new file mode 100644 index 0000000000..4a0a0dc1b2 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechMolecularTransformer.java @@ -0,0 +1,22 @@ +package gtPlusPlus.xmod.gregtech.registration.gregtech; + +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialMolecularTransformer; + +public class GregtechMolecularTransformer { + + public static void run() { + if (gtPlusPlus.core.lib.LoadedMods.Gregtech) { + Logger.INFO("Gregtech5u Content | Registering Molecular Transformer Multiblock."); + run1(); + } + + } + + private static void run1() { + GregtechItemList.Controller_MolecularTransformer.set(new GregtechMetaTileEntity_IndustrialMolecularTransformer(31072, + "moleculartransformer.controller.tier.single", "Molecular Transformer").getStackForm(1L)); + + } +}
\ No newline at end of file diff --git a/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_TECH_PANEL_E.png b/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_TECH_PANEL_E.png Binary files differnew file mode 100644 index 0000000000..9880dcab11 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_TECH_PANEL_E.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_TECH_PANEL_F.png b/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_TECH_PANEL_F.png Binary files differnew file mode 100644 index 0000000000..882115d975 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_TECH_PANEL_F.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_TECH_PANEL_G.png b/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_TECH_PANEL_G.png Binary files differnew file mode 100644 index 0000000000..3c19830902 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_TECH_PANEL_G.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_TECH_PANEL_H.png b/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_TECH_PANEL_H.png Binary files differnew file mode 100644 index 0000000000..b4bc37fbda --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_TECH_PANEL_H.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_TECH_PANEL_I.png b/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_TECH_PANEL_I.png Binary files differnew file mode 100644 index 0000000000..4a59e02f78 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_TECH_PANEL_I.png |