diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java index 00d9ccfd922..0c89e94b7e5 100644 --- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -1094,6 +1094,19 @@ private static void runModRecipes() { aBronzeBricks, GregtechItemList.Controller_SteamCentrifugeMulti.get(1)); + // Steam Forge Hammer Multi + RecipeUtils.addShapedGregtechRecipe( + aBronzeBricks, + "plateWroughtIron", + aBronzeBricks, + "plateWroughtIron", + Blocks.anvil, + "plateWroughtIron", + aBronzeBricks, + ALLOY.TUMBAGA.getFrameBox(1), + aBronzeBricks, + GregtechItemList.Controller_SteamForgeHammerMulti.get(1)); + // Steam Compressor Multi RecipeUtils.addShapedGregtechRecipe( aBronzeBricks, diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMixer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMixer.java index 2d92607a060..ae91b28152b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMixer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMixer.java @@ -1,6 +1,5 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.steam; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlocksTiered; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; @@ -9,11 +8,15 @@ import static gregtech.api.enums.GT_HatchElement.InputHatch; import static gregtech.api.enums.GT_HatchElement.OutputHatch; import static gregtech.api.enums.GT_Values.AuthorEvgenWarGold; +import static gregtech.api.enums.Mods.EnderIO; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; import javax.annotation.Nonnull; @@ -36,8 +39,10 @@ import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; +import com.gtnewhorizon.structurelib.structure.ITierConverter; import com.gtnewhorizon.structurelib.structure.StructureDefinition; +import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; @@ -108,6 +113,10 @@ public String getMachineType() { private int tierMachine = 1; + private int tierSimpleBlock = 0; + + Map simpleBlockTiers = new HashMap<>(); + public int getTierMachineCasing(Block block, int meta) { if (block == sBlockCasings1 && 10 == meta) { tCountCasing++; @@ -132,6 +141,25 @@ public static int getTierPipeCasing(Block block, int meta) { return 0; } + private static List> getAllSimpleBlockTiers(Map simpleBlockTiers) { + return simpleBlockTiers.entrySet() + .stream() + .map(e -> Pair.of(e.getKey(), e.getValue())) + .collect(Collectors.toList()); + } + + private static ITierConverter simpleBlockTierConverter(Map simpleBlockTiers) { + return (block, meta) -> block == null ? 0 : simpleBlockTiers.getOrDefault(block, 1); + } + + private void setSimpleBlockTier(int tier) { + tierSimpleBlock = tier; + } + + private int getSimpleBlockTier() { + return tierSimpleBlock; + } + protected void updateHatchTexture() { for (GT_MetaTileEntity_Hatch h : mSteamInputs) h.updateTexture(getCasingTextureID()); for (GT_MetaTileEntity_Hatch h : mSteamOutputs) h.updateTexture(getCasingTextureID()); @@ -141,7 +169,7 @@ protected void updateHatchTexture() { } private int getCasingTextureID() { - if (tierGearBoxCasing == 2 || tierPipeCasing == 2 || tierMachineCasing == 2) + if (tierGearBoxCasing == 2 || tierPipeCasing == 2 || tierMachineCasing == 2 || tierSimpleBlock == 2) return ((GT_Block_Casings2) GregTech_API.sBlockCasings2).getTextureIndex(0); return ((GT_Block_Casings1) GregTech_API.sBlockCasings1).getTextureIndex(10); } @@ -179,6 +207,11 @@ public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, fina @Override public IStructureDefinition getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { + simpleBlockTiers.put(Blocks.iron_block, 1); + + if (EnderIO.isModLoaded()) { + simpleBlockTiers.put(GameRegistry.findBlock(EnderIO.ID, "blockIngotStorage"), 6); + } else simpleBlockTiers.put(Blocks.iron_block, 2); STRUCTURE_DEFINITION = StructureDefinition.builder() @@ -199,7 +232,14 @@ public IStructureDefinition getStructureDefin -1, (t, m) -> t.tierPipeCasing = m, t -> t.tierPipeCasing)) - .addElement('D', ofBlock(Blocks.iron_block, 0)) + .addElement( + 'D', + ofBlocksTiered( + simpleBlockTierConverter(simpleBlockTiers), + getAllSimpleBlockTiers(simpleBlockTiers), + -1, + GregtechMetaTileEntity_SteamMixer::setSimpleBlockTier, + GregtechMetaTileEntity_SteamMixer::getSimpleBlockTier)) .addElement( 'A', ofChain( @@ -253,11 +293,13 @@ public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBu public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { tierGearBoxCasing = -1; tierPipeCasing = -1; + tierSimpleBlock = -1; tierMachineCasing = -1; tCountCasing = 0; if (!checkPiece(STRUCTUR_PIECE_MAIN, HORIZONTAL_OFF_SET, VERTICAL_OFF_SET, DEPTH_OFF_SET)) return false; if (tierGearBoxCasing < 0 && tierPipeCasing < 0 && tierMachineCasing < 0) return false; if (tierGearBoxCasing == 1 && tierPipeCasing == 1 + && tierSimpleBlock == 1 && tierMachineCasing == 1 && tCountCasing > 90 && !mSteamInputFluids.isEmpty() @@ -270,6 +312,7 @@ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a return true; } if (tierGearBoxCasing == 2 && tierPipeCasing == 2 + && tierSimpleBlock == 2 && tierMachineCasing == 2 && tCountCasing > 90 && !mSteamInputFluids.isEmpty() diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamMultis.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamMultis.java index 9b49bf83489..01f316fa070 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamMultis.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamMultis.java @@ -1,10 +1,10 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; -import static gtPlusPlus.xmod.gregtech.registration.gregtech.MetaTileEntityIDs.ControllerSteamForgeHammer; -import static gtPlusPlus.xmod.gregtech.registration.gregtech.MetaTileEntityIDs.ControllerSteamMixerMulti; import static gtPlusPlus.xmod.gregtech.registration.gregtech.MetaTileEntityIDs.Controller_SteamCentrifugeMulti; import static gtPlusPlus.xmod.gregtech.registration.gregtech.MetaTileEntityIDs.Controller_SteamCompressorMulti; +import static gtPlusPlus.xmod.gregtech.registration.gregtech.MetaTileEntityIDs.Controller_SteamForgeHammer; import static gtPlusPlus.xmod.gregtech.registration.gregtech.MetaTileEntityIDs.Controller_SteamMaceratorMulti; +import static gtPlusPlus.xmod.gregtech.registration.gregtech.MetaTileEntityIDs.Controller_SteamMixerMulti; import static gtPlusPlus.xmod.gregtech.registration.gregtech.MetaTileEntityIDs.Controller_SteamWasherMulti; import static gtPlusPlus.xmod.gregtech.registration.gregtech.MetaTileEntityIDs.Hatch_Input_Bus_Steam; import static gtPlusPlus.xmod.gregtech.registration.gregtech.MetaTileEntityIDs.Hatch_Output_Bus_Steam; @@ -48,12 +48,12 @@ public static void run() { "Steam Washer").getStackForm(1)); GregtechItemList.Controller_SteamForgeHammerMulti.set( new GregtechMetaTileEntity_SteamForgeHammer( - ControllerSteamForgeHammer.ID, + Controller_SteamForgeHammer.ID, "gtpp.multimachine.steam.forge.hammer", "Steam Forge Hammer").getStackForm(1)); GregtechItemList.Controller_SteamMixerMulti.set( new GregtechMetaTileEntity_SteamMixer( - ControllerSteamMixerMulti.ID, + Controller_SteamMixerMulti.ID, "gtpp.multimachine.steam.mixer", "Steam Mixer").getStackForm(1)); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/MetaTileEntityIDs.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/MetaTileEntityIDs.java index 15f2037b6ce..b51ce10ce32 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/MetaTileEntityIDs.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/MetaTileEntityIDs.java @@ -185,8 +185,8 @@ public enum MetaTileEntityIDs { XL_HeatExchanger(31079), Controller_SteamCentrifugeMulti(31080), Controller_SteamWasherMulti(31082), - ControllerSteamForgeHammer(31083), - ControllerSteamMixerMulti(31084), + Controller_SteamForgeHammer(31083), + Controller_SteamMixerMulti(31084), GT4_Electric_Auto_Workbench_LV(31091), GT4_Electric_Auto_Workbench_MV(31092), GT4_Electric_Auto_Workbench_HV(31093),