diff options
author | Glease <4586901+Glease@users.noreply.github.com> | 2021-07-19 19:25:36 +0800 |
---|---|---|
committer | Glease <4586901+Glease@users.noreply.github.com> | 2021-07-30 14:41:39 +0800 |
commit | 875ff766ce3801918c9d726a8a14a6710e655147 (patch) | |
tree | ab77b5cb6a101d6c572a38af340912d6ca10112e /src/main/java/gregtech | |
parent | bfe1836ddc069653d9af9d59008ec23f4dcb6c05 (diff) | |
download | GT5-Unofficial-875ff766ce3801918c9d726a8a14a6710e655147.tar.gz GT5-Unofficial-875ff766ce3801918c9d726a8a14a6710e655147.tar.bz2 GT5-Unofficial-875ff766ce3801918c9d726a8a14a6710e655147.zip |
Make block hint text more informative
Also migrated from defer to lazy where possible
Signed-off-by: Glease <4586901+Glease@users.noreply.github.com>
Diffstat (limited to 'src/main/java/gregtech')
30 files changed, 511 insertions, 309 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_CubicMultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_CubicMultiBlockBase.java index c84ca61eec..5499e756ba 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_CubicMultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_CubicMultiBlockBase.java @@ -6,7 +6,7 @@ import com.gtnewhorizon.structurelib.structure.StructureDefinition; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.item.ItemStack; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.defer; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; @@ -16,7 +16,8 @@ import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; * A simple 3x3x3 hollow cubic multiblock, that can be arbitrarily rotated, made of a single type of machine casing and accepts hatches everywhere. * Controller will be placed in front center of the structure. * <p> - * Note: You cannot use different casing for the same Class. Make a new subclass for it. + * Note: You cannot use different casing for the same Class. Make a new subclass for it. You also should not change the casing + * dynamically, i.e. it should be a dumb method returning some sort of constant. * <p> * Implementation tips: * 1. To restrict hatches, override {@link #addDynamoToMachineList(IGregTechTileEntity, int)} and its cousins instead of overriding the whole @@ -28,20 +29,25 @@ import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; */ public abstract class GT_MetaTileEntity_CubicMultiBlockBase<T extends GT_MetaTileEntity_CubicMultiBlockBase<T>> extends GT_MetaTileEntity_EnhancedMultiBlockBase<T> { protected static final String STRUCTURE_PIECE_MAIN = "main"; - protected static final IStructureDefinition<GT_MetaTileEntity_CubicMultiBlockBase<?>> STRUCTURE_DEFINITION = StructureDefinition.<GT_MetaTileEntity_CubicMultiBlockBase<?>>builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - {"hhh", "hhh", "hhh"}, - {"h-h", "hhh", "hhh"}, - {"hhh", "hhh", "hhh"}, - })) - .addElement('h', ofChain( - defer(t -> ofHatchAdder(GT_MetaTileEntity_CubicMultiBlockBase::addToMachineList, t.getHatchTextureIndex(), 1)), - onElementPass( - GT_MetaTileEntity_CubicMultiBlockBase::onCorrectCasingAdded, - defer(GT_MetaTileEntity_CubicMultiBlockBase::getCasingElement) - ) - )) - .build(); + protected static final ClassValue<IStructureDefinition<GT_MetaTileEntity_CubicMultiBlockBase<?>>> STRUCTURE_DEFINITION = new ClassValue<IStructureDefinition<GT_MetaTileEntity_CubicMultiBlockBase<?>>>() { + @Override + protected IStructureDefinition<GT_MetaTileEntity_CubicMultiBlockBase<?>> computeValue(Class<?> type) { + return StructureDefinition.<GT_MetaTileEntity_CubicMultiBlockBase<?>>builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ + {"hhh", "hhh", "hhh"}, + {"h-h", "hhh", "hhh"}, + {"hhh", "hhh", "hhh"}, + })) + .addElement('h', ofChain( + lazy(t -> ofHatchAdder(GT_MetaTileEntity_CubicMultiBlockBase::addToMachineList, t.getHatchTextureIndex(), 1)), + onElementPass( + GT_MetaTileEntity_CubicMultiBlockBase::onCorrectCasingAdded, + lazy(GT_MetaTileEntity_CubicMultiBlockBase::getCasingElement) + ) + )) + .build(); + } + }; private int mCasingAmount = 0; protected GT_MetaTileEntity_CubicMultiBlockBase(int aID, String aName, String aNameRegional) { diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_EnhancedMultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_EnhancedMultiBlockBase.java index a9b50e6662..cc2513f5c2 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_EnhancedMultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_EnhancedMultiBlockBase.java @@ -128,7 +128,7 @@ public abstract class GT_MetaTileEntity_EnhancedMultiBlockBase<T extends GT_Meta @Override public String[] getStructureDescription(ItemStack stackSize) { - return getTooltip().getStructureInformation(); + return getTooltip().getStructureHint(); } protected IAlignmentLimits getInitialAlignmentLimits() { diff --git a/src/main/java/gregtech/api/util/GT_Multiblock_Tooltip_Builder.java b/src/main/java/gregtech/api/util/GT_Multiblock_Tooltip_Builder.java index e30fe5d606..84d4bbbd48 100644 --- a/src/main/java/gregtech/api/util/GT_Multiblock_Tooltip_Builder.java +++ b/src/main/java/gregtech/api/util/GT_Multiblock_Tooltip_Builder.java @@ -1,11 +1,18 @@ package gregtech.api.util; -import java.util.LinkedList; -import java.util.List; - +import com.google.common.collect.Multimaps; +import com.google.common.collect.SetMultimap; +import gregtech.api.enums.Materials; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.stream.IntStream; +import java.util.stream.Stream; + /** * This makes it easier to build multi tooltips, with a standardized format. <br> * Info section order should be:<br> @@ -32,12 +39,16 @@ import net.minecraft.util.StatCollector; public class GT_Multiblock_Tooltip_Builder { private static final String TAB = " "; private static final String COLON = ": "; - + private static final String SEPARATOR = ", "; + private final List<String> iLines; private final List<String> sLines; - + private final List<String> hLines; + private final SetMultimap<Integer, String> hBlocks; + private String[] iArray; private String[] sArray; + private String[] hArray; //Localized tooltips private static final String TT_machineType = StatCollector.translateToLocal("GT5U.MBTT.MachineType"); @@ -58,11 +69,17 @@ public class GT_Multiblock_Tooltip_Builder { private static final String TT_pps = StatCollector.translateToLocal("GT5U.MBTT.PPS"); private static final String TT_hold = StatCollector.translateToLocal("GT5U.MBTT.Hold"); private static final String TT_todisplay = StatCollector.translateToLocal("GT5U.MBTT.Display"); + private static final String TT_structurehint = StatCollector.translateToLocal("GT5U.MBTT.StructureHint"); private static final String TT_mod = StatCollector.translateToLocal("GT5U.MBTT.Mod"); + private static final String TT_air = StatCollector.translateToLocal("GT5U.MBTT.Air"); + private static final String[] TT_dots = IntStream.range(0, 16).mapToObj(i -> StatCollector.translateToLocal("GT5U.MBTT.Dots." + i)).toArray(String[]::new); public GT_Multiblock_Tooltip_Builder() { iLines = new LinkedList<>(); sLines = new LinkedList<>(); + hLines = new LinkedList<>(); + hBlocks = Multimaps.newSetMultimap(new HashMap<>(), HashSet::new); + hBlocks.put(0, TT_air); } /** @@ -103,11 +120,10 @@ public class GT_Multiblock_Tooltip_Builder { } /** - * Add a line telling you what the machine type is. Usually, this will be the name of a SB version.<br> - * Machine Type: machine + * Add a line telling how much this machine pollutes. * - * @param machine - * Name of the machine type + * @param pollution + * Amount of pollution per second when active * * @return Instance this method was called on. */ @@ -307,7 +323,136 @@ public class GT_Multiblock_Tooltip_Builder { sLines.add(TAB + TT_outputhatch + COLON + info); return this; } - + + /** + * Use this method to add a structural part that isn't covered by the other methods.<br> + * (indent)name: info + * @param name + * Name of the hatch or other component. + * @param info + * Positional information. + * @param dots + * The valid locations for this part when asked to display hints + * @return Instance this method was called on. + */ + public GT_Multiblock_Tooltip_Builder addOtherStructurePart(String name, String info, int... dots) { + sLines.add(TAB + name + COLON + info); + for (int dot : dots) hBlocks.put(dot, name); + return this; + } + + /** + * Add a line of information about the structure:<br> + * (indent)Maintenance Hatch: info + * + * @param info Positional information. + * @param dots The valid locations for this part when asked to display hints + * @return Instance this method was called on. + */ + public GT_Multiblock_Tooltip_Builder addMaintenanceHatch(String info, int... dots) { + sLines.add(TAB + TT_maintenancehatch + COLON + info); + for (int dot : dots) hBlocks.put(dot, TT_maintenancehatch); + return this; + } + + /** + * Add a line of information about the structure:<br> + * (indent)Muffler Hatch: info + * + * @param info Location where the hatch goes + * @param dots The valid locations for this part when asked to display hints + * @return Instance this method was called on. + */ + public GT_Multiblock_Tooltip_Builder addMufflerHatch(String info, int... dots) { + sLines.add(TAB + TT_mufflerhatch + COLON + info); + for (int dot : dots) hBlocks.put(dot, TT_mufflerhatch); + return this; + } + + /** + * Add a line of information about the structure:<br> + * (indent)Energy Hatch: info + * + * @param info Positional information. + * @param dots The valid locations for this part when asked to display hints + * @return Instance this method was called on. + */ + public GT_Multiblock_Tooltip_Builder addEnergyHatch(String info, int... dots) { + sLines.add(TAB + TT_energyhatch + COLON + info); + for (int dot : dots) hBlocks.put(dot, TT_energyhatch); + return this; + } + + /** + * Add a line of information about the structure:<br> + * (indent)Dynamo Hatch: info + * + * @param info Positional information. + * @param dots The valid locations for this part when asked to display hints + * @return Instance this method was called on. + */ + public GT_Multiblock_Tooltip_Builder addDynamoHatch(String info, int... dots) { + sLines.add(TAB + TT_dynamohatch + COLON + info); + for (int dot : dots) hBlocks.put(dot, TT_dynamohatch); + return this; + } + + /** + * Add a line of information about the structure:<br> + * (indent)Input Bus: info + * + * @param info Location where the bus goes + * @param dots The valid locations for this part when asked to display hints + * @return Instance this method was called on. + */ + public GT_Multiblock_Tooltip_Builder addInputBus(String info, int... dots) { + sLines.add(TAB + TT_inputbus + COLON + info); + for (int dot : dots) hBlocks.put(dot, TT_inputbus); + return this; + } + + /** + * Add a line of information about the structure:<br> + * (indent)Input Hatch: info + * + * @param info Location where the hatch goes + * @param dots The valid locations for this part when asked to display hints + * @return Instance this method was called on. + */ + public GT_Multiblock_Tooltip_Builder addInputHatch(String info, int... dots) { + sLines.add(TAB + TT_inputhatch + COLON + info); + for (int dot : dots) hBlocks.put(dot, TT_inputhatch); + return this; + } + + /** + * Add a line of information about the structure:<br> + * (indent)Output Bus: info + * + * @param info Location where the bus goes + * @param dots The valid locations for this part when asked to display hints + * @return Instance this method was called on. + */ + public GT_Multiblock_Tooltip_Builder addOutputBus(String info, int... dots) { + sLines.add(TAB + TT_outputbus + COLON + info); + for (int dot : dots) hBlocks.put(dot, TT_outputbus); + return this; + } + + /** + * Add a line of information about the structure:<br> + * (indent)Output Hatch: info + * + * @param info Location where the bus goes + * @param dots The valid locations for this part when asked to display hints + * @return Instance this method was called on. + */ + public GT_Multiblock_Tooltip_Builder addOutputHatch(String info, int... dots) { + sLines.add(TAB + TT_outputhatch + COLON + info); + for (int dot : dots) hBlocks.put(dot, TT_outputhatch); + return this; + } + /** * Use this method to add non-standard structural info.<br> * (indent)info @@ -319,6 +464,30 @@ public class GT_Multiblock_Tooltip_Builder { sLines.add(TAB + info); return this; } + + /** + * Use this method to add non-standard structural hint. This info will appear before the standard structural hint. + * @param info + * The line to be added. This should be an entry into minecraft's localization system. + * @return Instance this method was called on. + */ + public GT_Multiblock_Tooltip_Builder addStructureHint(String info) { + hLines.add(StatCollector.translateToLocal(info)); + return this; + } + + /** + * Use this method to add an entry to standard structural hint without creating a corresponding line in structure information + * @param name + * The name of block This should be an entry into minecraft's localization system. + * @param dots + * Possible locations of this block + * @return Instance this method was called on. + */ + public GT_Multiblock_Tooltip_Builder addStructureHint(String name, int... dots) { + for (int dot : dots) hBlocks.put(dot, StatCollector.translateToLocal(name)); + return this; + } /** * Call at the very end.<br> @@ -331,10 +500,10 @@ public class GT_Multiblock_Tooltip_Builder { public void toolTipFinisher(String mod) { iLines.add(TT_hold + " " + EnumChatFormatting.BOLD + "[LSHIFT]" + EnumChatFormatting.RESET + EnumChatFormatting.GRAY + " " + TT_todisplay); iLines.add(TT_mod + COLON + EnumChatFormatting.GREEN + mod + EnumChatFormatting.GRAY); - iArray = new String[iLines.size()]; - sArray = new String[sLines.size()]; - iLines.toArray(iArray); - sLines.toArray(sArray); + hLines.add(TT_structurehint); + iArray = iLines.toArray(new String[0]); + sArray = sLines.toArray(new String[0]); + hArray = Stream.concat(hLines.stream(), hBlocks.asMap().entrySet().stream().map(e -> TT_dots[e.getKey()] + COLON + String.join(SEPARATOR, e.getValue()))).toArray(String[]::new); } public String[] getInformation() { @@ -345,4 +514,7 @@ public class GT_Multiblock_Tooltip_Builder { return sArray; } + public String[] getStructureHint() { + return hArray; + } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java index dd10b2465d..60aa372d20 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java @@ -69,18 +69,18 @@ public class GT_MetaTileEntity_AssemblyLine extends GT_MetaTileEntity_EnhancedMu .addElement('m', ofBlock(GregTech_API.sBlockCasings2, 5)) // assembling line casing .addElement('g', ofBlockAnyMeta(GameRegistry.findBlock("IC2", "blockAlloyGlass"))) .addElement('e', ofHatchAdderOptional(GT_MetaTileEntity_AssemblyLine::addEnergyInputToMachineList, 16, 1, GregTech_API.sBlockCasings2, 0)) - .addElement('d', ofHatchAdderOptional(GT_MetaTileEntity_AssemblyLine::addDataAccessToMachineList, 42, 1, GregTech_API.sBlockCasings3, 10)) + .addElement('d', ofHatchAdderOptional(GT_MetaTileEntity_AssemblyLine::addDataAccessToMachineList, 42, 2, GregTech_API.sBlockCasings3, 10)) .addElement('b', ofChain( - ofHatchAdder(GT_MetaTileEntity_AssemblyLine::addMaintenanceToMachineList, 16, 2), - ofHatchAdder(GT_MetaTileEntity_AssemblyLine::addInputHatchToMachineList, 16, 2), + ofHatchAdder(GT_MetaTileEntity_AssemblyLine::addMaintenanceToMachineList, 16, 3), + ofHatchAdder(GT_MetaTileEntity_AssemblyLine::addInputHatchToMachineList, 16, 3), ofBlock(GregTech_API.sBlockCasings2, 0) )) .addElement('I', ofChain( // all blocks nearby use solid steel casing, so let's use the texture of that - ofHatchAdder(GT_MetaTileEntity_AssemblyLine::addInputToMachineList, 16, 2), - ofHatchAdder(GT_MetaTileEntity_AssemblyLine::addOutputToMachineList, 16, 2) + ofHatchAdder(GT_MetaTileEntity_AssemblyLine::addInputToMachineList, 16, 4), + ofHatchAdder(GT_MetaTileEntity_AssemblyLine::addOutputToMachineList, 16,4) )) - .addElement('i', ofHatchAdder(GT_MetaTileEntity_AssemblyLine::addInputToMachineList, 16, 2)) + .addElement('i', ofHatchAdder(GT_MetaTileEntity_AssemblyLine::addInputToMachineList, 16, 5)) .build(); public GT_MetaTileEntity_AssemblyLine(int aID, String aName, String aNameRegional) { @@ -111,15 +111,14 @@ public class GT_MetaTileEntity_AssemblyLine extends GT_MetaTileEntity_EnhancedMu .addStructureInfo("Layer 3 - Grate Machine Casing, Assembler Machine Casing, Grate Machine Casing") .addStructureInfo("Layer 4 - Empty, Solid Steel Machine Casing, Empty") .addStructureInfo("Up to 16 repeating slices, each one allows for 1 more item in recipes, aside from the last") - .addStructureInfo("Optional - Replace 1x Grate with (Advanced) Data Access Hatch next to the Controller") - .addStructureInfo("Optional - Replace 1x Grate with (Advanced) Data Access Hatch next to the Controller")//TT .addController("Either Grate on layer 3 of the first slice") - .addEnergyHatch("Any layer 4 casing") - .addMaintenanceHatch("Any layer 1 casing") - .addInputBus("As specified on layer 1") - .addInputHatch("Any layer 1 casing") - .addOutputBus("Replaces Input Bus on final slice") + .addEnergyHatch("Any layer 4 casing", 1) + .addMaintenanceHatch("Any layer 1 casing", 3) + .addInputBus("As specified on layer 1", 4, 5) + .addInputHatch("Any layer 1 casing", 3) + .addOutputBus("Replaces Input Bus on final slice", 4) + .addOtherStructurePart("Data Access Hatch", "Optional, next to controller", 2) .toolTipFinisher("Gregtech"); return tt; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfillerBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfillerBase.java index 2341452ebe..8c1f28dd1c 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfillerBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfillerBase.java @@ -39,11 +39,11 @@ public abstract class GT_MetaTileEntity_ConcreteBackfillerBase extends GT_MetaTi .addStructureInfo(casings + " form the 3x1x3 Base") .addOtherStructurePart(casings, " 1x3x1 pillar above the center of the base (2 minimum total)") .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top") - .addEnergyHatch(VN[getMinTier()] + "+, Any base casing") - .addMaintenanceHatch("Any base casing") - .addInputBus("Mining Pipes, optional, any base casing") - .addInputHatch("GT Concrete, any base casing") - .addOutputBus("Mining Pipes, optional, any base casing") + .addEnergyHatch(VN[getMinTier()] + "+, Any base casing", 1) + .addMaintenanceHatch("Any base casing", 1) + .addInputBus("Mining Pipes, optional, any base casing", 1) + .addInputHatch("GT Concrete, any base casing", 1) + .addOutputBus("Mining Pipes, optional, any base casing", 1) .toolTipFinisher("Gregtech"); return tt; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java index 567297648a..8dfc605d6b 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java @@ -24,7 +24,7 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.defer; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DIESEL_ENGINE; @@ -37,18 +37,23 @@ import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_DieselEngine> { private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition<GT_MetaTileEntity_DieselEngine> STRUCTURE_DEFINITION = StructureDefinition.<GT_MetaTileEntity_DieselEngine>builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - {"---", "iii", "chc", "chc", "ccc", }, - {"---", "i~i", "hgh", "hgh", "cdc", }, - {"---", "iii", "chc", "chc", "ccc", }, - })) - .addElement('i', defer(t -> ofBlock(t.getIntakeBlock(), t.getIntakeMeta()))) - .addElement('c', defer(t -> ofBlock(t.getCasingBlock(), t.getCasingMeta()))) - .addElement('g', defer(t -> ofBlock(t.getGearboxBlock(), t.getGearboxMeta()))) - .addElement('d', defer(t -> ofHatchAdder(GT_MetaTileEntity_DieselEngine::addDynamoToMachineList, t.getCasingTextureIndex(), 0))) - .addElement('h', defer(t -> ofHatchAdderOptional(GT_MetaTileEntity_DieselEngine::addToMachineList, t.getCasingTextureIndex(), 0, t.getCasingBlock(), t.getCasingMeta()))) - .build(); + private static final ClassValue<IStructureDefinition<GT_MetaTileEntity_DieselEngine>> STRUCTURE_DEFINITION = new ClassValue<IStructureDefinition<GT_MetaTileEntity_DieselEngine>>() { + @Override + protected IStructureDefinition<GT_MetaTileEntity_DieselEngine> computeValue(Class<?> type) { + return StructureDefinition.<GT_MetaTileEntity_DieselEngine>builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ + {"---", "iii", "chc", "chc", "ccc", }, + {"---", "i~i", "hgh", "hgh", "cdc", }, + {"---", "iii", "chc", "chc", "ccc", }, + })) + .addElement('i', lazy(t -> ofBlock(t.getIntakeBlock(), t.getIntakeMeta()))) + .addElement('c', lazy(t -> ofBlock(t.getCasingBlock(), t.getCasingMeta()))) + .addElement('g', lazy(t -> ofBlock(t.getGearboxBlock(), t.getGearboxMeta()))) + .addElement('d', lazy(t -> ofHatchAdder(GT_MetaTileEntity_DieselEngine::addDynamoToMachineList, t.getCasingTextureIndex(), 2))) + .addElement('h', lazy(t -> ofHatchAdderOptional(GT_MetaTileEntity_DieselEngine::addToMachineList, t.getCasingTextureIndex(), 1, t.getCasingBlock(), t.getCasingMeta()))) + .build(); + } + }; protected int fuelConsumption = 0; protected int fuelValue = 0; protected int fuelRemaining = 0; @@ -80,12 +85,12 @@ public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_EnhancedMu .addOtherStructurePart("Titanium Gear Box Machine Casing", "Inner 2 blocks") .addOtherStructurePart("Engine Intake Machine Casing", "8x, ring around controller") .addStructureInfo("Engine Intake Casings must not be obstructed in front (only air blocks)") - .addDynamoHatch("Back center") - .addMaintenanceHatch("One of the casings next to a Gear Box") - .addMufflerHatch("Top middle back, above the rear Gear Box") - .addInputHatch("Diesel Fuel, next to a Gear Box") - .addInputHatch("Lubricant, next to a Gear Box") - .addInputHatch("Oxygen, optional, next to a Gear Box") + .addDynamoHatch("Back center", 2) + .addMaintenanceHatch("One of the casings next to a Gear Box", 1) + .addMufflerHatch("Top middle back, above the rear Gear Box", 1) + .addInputHatch("Diesel Fuel, next to a Gear Box", 1) + .addInputHatch("Lubricant, next to a Gear Box", 1) + .addInputHatch("Oxygen, optional, next to a Gear Box", 1) .toolTipFinisher("Gregtech"); return tt; } @@ -192,7 +197,7 @@ public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_EnhancedMu @Override public IStructureDefinition<GT_MetaTileEntity_DieselEngine> getStructureDefinition() { - return STRUCTURE_DEFINITION; + return STRUCTURE_DEFINITION.get(getClass()); } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java index b35d6e3c56..3710112c9b 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java @@ -53,14 +53,14 @@ public class GT_MetaTileEntity_DistillationTower extends GT_MetaTileEntity_Enhan onElementPass(GT_MetaTileEntity_DistillationTower::onCasingFound, ofBlock(GregTech_API.sBlockCasings4, 1)) )) .addElement('l', ofChain( - ofHatchAdder(GT_MetaTileEntity_DistillationTower::addEnergyInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_MetaTileEntity_DistillationTower::addEnergyInputToMachineList, CASING_INDEX, 2), ofHatchAdder(GT_MetaTileEntity_DistillationTower::addLayerOutputHatch, CASING_INDEX, 2), - ofHatchAdder(GT_MetaTileEntity_DistillationTower::addMaintenanceToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_MetaTileEntity_DistillationTower::addMaintenanceToMachineList, CASING_INDEX, 2), onElementPass(GT_MetaTileEntity_DistillationTower::onCasingFound, ofBlock(GregTech_API.sBlockCasings4, 1)) )) .addElement('c', ofChain( - onElementPass(t -> t.onTopLayerFound(false), ofHatchAdder(GT_MetaTileEntity_DistillationTower::addOutputToMachineList, CASING_INDEX, 1)), - onElementPass(t -> t.onTopLayerFound(false), ofHatchAdder(GT_MetaTileEntity_DistillationTower::addMaintenanceToMachineList, CASING_INDEX, 1)), + onElementPass(t -> t.onTopLayerFound(false), ofHatchAdder(GT_MetaTileEntity_DistillationTower::addOutputToMachineList, CASING_INDEX, 3)), + onElementPass(t -> t.onTopLayerFound(false), ofHatchAdder(GT_MetaTileEntity_DistillationTower::addMaintenanceToMachineList, CASING_INDEX, 3)), onElementPass(t -> t.onTopLayerFound(true), ofBlock(GregTech_API.sBlockCasings4, 1)), isAir() )) @@ -94,11 +94,11 @@ public class GT_MetaTileEntity_DistillationTower extends GT_MetaTileEntity_Enhan .beginVariableStructureBlock(3, 3, 3, 12, 3, 3, true) .addController("Front bottom") .addOtherStructurePart("Clean Stainless Steel Machine Casing", "7 x h - 5 (minimum)") - .addEnergyHatch("Any casing") - .addMaintenanceHatch("Any casing") - .addInputHatch("Any bottom layer casing") - .addOutputBus("Any bottom layer casing") - .addOutputHatch("2-11x Output Hatches (At least one per layer except bottom layer)") + .addEnergyHatch("Any casing", 1, 2) + .addMaintenanceHatch("Any casing", 1, 2, 3) + .addInputHatch("Any bottom layer casing", 1) + .addOutputBus("Any bottom layer casing", 1) + .addOutputHatch("2-11x Output Hatches (At least one per layer except bottom layer)", 2, 3) .toolTipFinisher("Gregtech"); return tt; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase.java index 0ea04f1cfa..a610a502f9 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase.java @@ -30,7 +30,7 @@ import net.minecraftforge.common.util.ForgeDirection; import java.util.ArrayList; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.defer; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; @@ -48,27 +48,32 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_En private static final Block miningPipeBlock = GT_Utility.getBlockFromStack(miningPipe); private static final Block miningPipeTipBlock = GT_Utility.getBlockFromStack(miningPipeTip); protected static final String STRUCTURE_PIECE_MAIN = "main"; - protected static final IStructureDefinition<GT_MetaTileEntity_DrillerBase> STRUCTURE_DEFINITION = StructureDefinition.<GT_MetaTileEntity_DrillerBase>builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - {" ", " f ", " "}, - {" ", " f ", " "}, - {" ", " f ", " "}, - {" f ", "fcf", " f "}, - {" f ", "fcf", " f "}, - {" f ", "fcf", " f "}, - {"b~b", "bbb", "bbb"}, - })) - .addElement('f', defer(t -> ofBlock(GregTech_API.sBlockMachines, t.frameMeta))) - .addElement('c', defer(t -> ofBlock(t.casingBlock, t.casingMeta))) - .addElement('b', defer(t -> ofChain( - ofBlock(t.casingBlock, t.casingMeta), - ofHatchAdder(GT_MetaTileEntity_DrillerBase::addMaintenanceToMachineList, t.casingTextureIndex, 1), - ofHatchAdder(GT_MetaTileEntity_DrillerBase::addInputToMachineList, t.casingTextureIndex, 1), - ofHatchAdder(GT_MetaTileEntity_DrillerBase::addOutputToMachineList, t.casingTextureIndex, 1), - ofHatchAdder(GT_MetaTileEntity_DrillerBase::addEnergyInputToMachineList, t.casingTextureIndex, 1), - ofHatchAdder(GT_MetaTileEntity_DrillerBase::addDataAccessToMachineList, t.casingTextureIndex, 1) - ))) - .build(); + protected static final ClassValue<IStructureDefinition<GT_MetaTileEntity_DrillerBase>> STRUCTURE_DEFINITION = new ClassValue<IStructureDefinition<GT_MetaTileEntity_DrillerBase>>() { + @Override + protected IStructureDefinition<GT_MetaTileEntity_DrillerBase> computeValue(Class<?> type) { + return StructureDefinition.<GT_MetaTileEntity_DrillerBase>builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ + {" ", " f ", " "}, + {" ", " f ", " "}, + {" ", " f ", " "}, + {" f ", "fcf", " f "}, + {" f ", "fcf", " f "}, + {" f ", "fcf", " f "}, + {"b~b", "bbb", "bbb"}, + })) + .addElement('f', lazy(t -> ofBlock(GregTech_API.sBlockMachines, t.frameMeta))) + .addElement('c', lazy(t -> ofBlock(t.casingBlock, t.casingMeta))) + .addElement('b', lazy(t -> ofChain( + ofBlock(t.casingBlock, t.casingMeta), + ofHatchAdder(GT_MetaTileEntity_DrillerBase::addMaintenanceToMachineList, t.casingTextureIndex, 1), + ofHatchAdder(GT_MetaTileEntity_DrillerBase::addInputToMachineList, t.casingTextureIndex, 1), + ofHatchAdder(GT_MetaTileEntity_DrillerBase::addOutputToMachineList, t.casingTextureIndex, 1), + ofHatchAdder(GT_MetaTileEntity_DrillerBase::addEnergyInputToMachineList, t.casingTextureIndex, 1), + ofHatchAdder(GT_MetaTileEntity_DrillerBase::addDataAccessToMachineList, t.casingTextureIndex, 1) + ))) + .build(); + } + }; private Block casingBlock; private int casingMeta; @@ -355,7 +360,7 @@ public abstract class GT_MetaTileEntity_DrillerBase extends GT_MetaTileEntity_En @Override public final IStructureDefinition<GT_MetaTileEntity_DrillerBase> getStructureDefinition() { - return STRUCTURE_DEFINITION; + return STRUCTURE_DEFINITION.get(getClass()); } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java index c7a3c3490d..d3c9e7176b 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java @@ -90,13 +90,13 @@ public class GT_MetaTileEntity_ElectricBlastFurnace extends GT_MetaTileEntity_Ab .addController("Front bottom") .addCasingInfo("Heat Proof Machine Casing", 0) .addOtherStructurePart("Heating Coils", "Two middle Layers") - .addEnergyHatch("Any bottom layer casing") - .addMaintenanceHatch("Any bottom layer casing") - .addMufflerHatch("Top middle") - .addInputBus("Any bottom layer casing") - .addInputHatch("Any bottom layer casing") - .addOutputBus("Any bottom layer casing") - .addOutputHatch("Gasses, Any top layer casing") + .addEnergyHatch("Any bottom layer casing", 3) + .addMaintenanceHatch("Any bottom layer casing", 3) + .addMufflerHatch("Top middle", 2) + .addInputBus("Any bottom layer casing", 3) + .addInputHatch("Any bottom layer casing", 3) + .addOutputBus("Any bottom layer casing", 3) + .addOutputHatch("Gasses, Any top layer casing", 1) .addStructureInfo("Recovery amount scales with Muffler Hatch tier") .addOutputHatch("Platline fluids, Any bottom layer casing") .toolTipFinisher("Gregtech"); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java index f85f27935e..1878f25a5f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java @@ -51,12 +51,12 @@ public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_Die .addOtherStructurePart("Titanium Gear Box Machine Casing", "Inner 2 blocks") .addOtherStructurePart("Extreme Engine Intake Machine Casing", "8x, ring around controller") .addStructureInfo("Extreme Engine Intake Casings must not be obstructed in front (only air blocks)") - .addDynamoHatch("Back center") - .addMaintenanceHatch("One of the casings next to a Gear Box") - .addMufflerHatch("Top middle back, above the rear Gear Box") - .addInputHatch("HOG, next to a Gear Box") - .addInputHatch("Lubricant, next to a Gear Box") - .addInputHatch("Liquid Oxygen, optional, next to a Gear Box") + .addDynamoHatch("Back center", 2) + .addMaintenanceHatch("One of the casings next to a Gear Box", 1) + .addMufflerHatch("Top middle back, above the rear Gear Box", 1) + .addInputHatch("HOG, next to a Gear Box", 1) + .addInputHatch("Lubricant, next to a Gear Box", 1) + .addInputHatch("Liquid Oxygen, optional, next to a Gear Box", 1) .toolTipFinisher("Gregtech"); return tt; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java index bf2aeadcf8..88604979d2 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java @@ -29,7 +29,7 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.defer; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS; @@ -39,66 +39,71 @@ import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_FusionComputer> { public static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition<GT_MetaTileEntity_FusionComputer> STRUCTURE_DEFINITION = StructureDefinition.<GT_MetaTileEntity_FusionComputer>builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - { - " ", - " ihi ", - " hh hh ", - " h h ", - " h h ", - " h h ", - " i i ", - " h h ", - " i i ", - " h h ", - " h h ", - " h h ", - " hh hh ", - " ihi ", - " ", - }, - { - " xhx ", - " hhccchh ", - " eccxhxcce ", - " eceh hece ", - " hce ech ", - " hch hch ", - "xcx xcx", - "hch hch", - "xcx xcx", - " hch hch ", - " hce ech ", - " eceh hece ", - " eccx~xcce ", - " hhccchh ", - " xhx ", - }, - { - " ", - " ihi ", - " hh hh ", - " h h ", - " h h ", - " h h ", - " i i ", - " h h ", - " i i ", - " h h ", - " h h ", - " h h ", - " hh hh ", - " ihi ", - " ", - } - })) - .addElement('c', defer(t -> ofBlock(t.getFusionCoil(), t.getFusionCoilMeta()))) - .addElement('h', defer(t -> ofBlock(t.getCasing(), t.getCasingMeta()))) - .addElement('i', defer(t -> ofHatchAdderOptional(GT_MetaTileEntity_FusionComputer::addInjector, 53, 1, t.getCasing(), t.getCasingMeta()))) - .addElement('e', defer(t -> ofHatchAdderOptional(GT_MetaTileEntity_FusionComputer::addEnergyInjector, 53, 1, t.getCasing(), t.getCasingMeta()))) - .addElement('x', defer(t -> ofHatchAdderOptional(GT_MetaTileEntity_FusionComputer::addExtractor, 53, 1, t.getCasing(), t.getCasingMeta()))) - .build(); + private static final ClassValue<IStructureDefinition<GT_MetaTileEntity_FusionComputer>> STRUCTURE_DEFINITION = new ClassValue<IStructureDefinition<GT_MetaTileEntity_FusionComputer>>() { + @Override + protected IStructureDefinition<GT_MetaTileEntity_FusionComputer> computeValue(Class<?> type) { + return StructureDefinition.<GT_MetaTileEntity_FusionComputer>builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ + { + " ", + " ihi ", + " hh hh ", + " h h ", + " h h ", + " h h ", + " i i ", + " h h ", + " i i ", + " h h ", + " h h ", + " h h ", + " hh hh ", + " ihi ", + " ", + }, + { + " xhx ", + " hhccchh ", + " eccxhxcce ", + " eceh hece ", + " hce ech ", + " hch hch ", + "xcx xcx", + "hch hch", + "xcx xcx", + " hch hch ", + " hce ech ", + " eceh hece ", + " eccx~xcce ", + " hhccchh ", + " xhx ", + }, + { + " ", + " ihi ", + " hh hh ", + " h h ", + " h h ", + " h h ", + " i i ", + " h h ", + " i i ", + " h h ", + " h h ", + " h h ", + " hh hh ", + " ihi ", + " ", + } + })) + .addElement('c', lazy(t -> ofBlock(t.getFusionCoil(), t.getFusionCoilMeta()))) + .addElement('h', lazy(t -> ofBlock(t.getCasing(), t.getCasingMeta()))) + .addElement('i', lazy(t -> ofHatchAdderOptional(GT_MetaTileEntity_FusionComputer::addInjector, 53, 1, t.getCasing(), t.getCasingMeta()))) + .addElement('e', lazy(t -> ofHatchAdderOptional(GT_MetaTileEntity_FusionComputer::addEnergyInjector, 53, 2, t.getCasing(), t.getCasingMeta()))) + .addElement('x', lazy(t -> ofHatchAdderOptional(GT_MetaTileEntity_FusionComputer::addExtractor, 53, 3, t.getCasing(), t.getCasingMeta()))) + .build(); + } + }; public GT_Recipe mLastRecipe; public int mEUStore; @@ -154,7 +159,7 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity @Override public IStructureDefinition<GT_MetaTileEntity_FusionComputer> getStructureDefinition() { - return STRUCTURE_DEFINITION; + return STRUCTURE_DEFINITION.get(getClass()); } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java index 2901a9e4f1..dd942d2635 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java @@ -75,9 +75,9 @@ public class GT_MetaTileEntity_FusionComputer1 extends GT_MetaTileEntity_FusionC .addCasingInfo("LuV Machine Casing", 79) .addStructureInfo("Cover the coils with casing") .addOtherStructurePart("Superconducting Coil Block", "Center part of the ring") - .addEnergyHatch("1-16, Specified casings") - .addInputHatch("2-16, Specified casings") - .addOutputHatch("1-16, Specified casings") + .addEnergyHatch("1-16, Specified casings", 2) + .addInputHatch("2-16, Specified casings", 1) + .addOutputHatch("1-16, Specified casings", 3) .addStructureInfo("ALL Hatches must be LuV or better") .toolTipFinisher("Gregtech"); return tt; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java index 6cefdc6812..de9d863529 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java @@ -75,9 +75,9 @@ public class GT_MetaTileEntity_FusionComputer2 extends GT_MetaTileEntity_FusionC .addCasingInfo("Fusion Machine Casing", 79) .addStructureInfo("Cover the coils with casing") .addOtherStructurePart("Fusion Coil Block", "Center part of the ring") - .addEnergyHatch("1-16, Specified casings") - .addInputHatch("2-16, Specified casings") - .addOutputHatch("1-16, Specified casings") + .addEnergyHatch("1-16, Specified casings", 2) + .addInputHatch("2-16, Specified casings", 1) + .addOutputHatch("1-16, Specified casings", 3) .addStructureInfo("ALL Hatches must be ZPM or better") .toolTipFinisher("Gregtech"); return tt; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java index b879c7923b..4e5c6c3cad 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java @@ -75,9 +75,9 @@ public class GT_MetaTileEntity_FusionComputer3 extends GT_MetaTileEntity_FusionC .addCasingInfo("Fusion Machine Casing Mk II", 79) .addStructureInfo("Cover the coils with casing") .addOtherStructurePart("Fusion Coil Block", "Center part of the ring") - .addEnergyHatch("1-16, Specified casings") - .addInputHatch("2-16, Specified casings") - .addOutputHatch("1-16, Specified casings") + .addEnergyHatch("1-16, Specified casings", 2) + .addInputHatch("2-16, Specified casings", 1) + .addOutputHatch("1-16, Specified casings", 3) .addStructureInfo("ALL Hatches must be UV or better") .toolTipFinisher("Gregtech"); return tt; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java index 392726e13a..e8beb270e0 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java @@ -52,7 +52,6 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_EnhancedM ofHatchAdder(GT_MetaTileEntity_HeatExchanger::addInputToMachineList, CASING_INDEX, 1), ofHatchAdder(GT_MetaTileEntity_HeatExchanger::addOutputToMachineList, CASING_INDEX, 1), ofHatchAdder(GT_MetaTileEntity_HeatExchanger::addMaintenanceToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_MetaTileEntity_HeatExchanger::addEnergyInputToMachineList, CASING_INDEX, 1), onElementPass(GT_MetaTileEntity_HeatExchanger::onCasingAdded, ofBlock(GregTech_API.sBlockCasings4, (byte) 2)) )) .build(); @@ -87,11 +86,11 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_EnhancedM .addController("Front bottom") .addCasingInfo("Stable Titanium Machine Casing", 20) .addOtherStructurePart("Titanium Pipe Casing", "Center 2 blocks") - .addMaintenanceHatch("Any casing") - .addInputHatch("Hot fluid, bottom center") - .addInputHatch("Distilled water, any casing") - .addOutputHatch("Cold fluid, top center") - .addOutputHatch("Steam/SH Steam, any casing") + .addMaintenanceHatch("Any casing", 1) + .addInputHatch("Hot fluid, bottom center", 2) + .addInputHatch("Distilled water, any casing", 1) + .addOutputHatch("Cold fluid, top center", 3) + .addOutputHatch("Steam/SH Steam, any casing", 1) .toolTipFinisher("Gregtech"); return tt; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java index 41b40f56fa..17417a09c8 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java @@ -51,11 +51,11 @@ public class GT_MetaTileEntity_ImplosionCompressor extends GT_MetaTileEntity_Cub .addController("Front center") .addCasingInfo("Solid Steel Machine Casing", 16) .addStructureInfo("Casings can be replaced with Explosion Warning Signs") - .addEnergyHatch("Any casing") - .addMaintenanceHatch("Any casing") - .addMufflerHatch("Any casing") - .addInputBus("Any casing") - .addOutputBus("Any casing") + .addEnergyHatch("Any casing", 1) + .addMaintenanceHatch("Any casing", 1) + .addMufflerHatch("Any casing", 1) + .addInputBus("Any casing", 1) + .addOutputBus("Any casing", 1) .toolTipFinisher("Gregtech"); return tt; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java index 7f409f38f4..8565ae8774 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java @@ -26,7 +26,7 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.defer; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; @@ -40,26 +40,31 @@ import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_LargeBoiler> { private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition<GT_MetaTileEntity_LargeBoiler> STRUCTURE_DEFINITION = StructureDefinition.<GT_MetaTileEntity_LargeBoiler>builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - {"ccc", "ccc", "ccc"}, - {"ccc", "cPc", "ccc"}, - {"ccc", "cPc", "ccc"}, - {"ccc", "cPc", "ccc"}, - {"f~f", "fff", "fff"}, - })) - .addElement('P', defer(t -> ofBlock(t.getPipeBlock(), t.getPipeMeta()))) - .addElement('c', defer(t -> ofChain( - ofHatchAdder(GT_MetaTileEntity_LargeBoiler::addOutputToMachineList, t.getCasingTextureIndex(), 2), - onElementPass(GT_MetaTileEntity_LargeBoiler::onCasingAdded, ofBlock(t.getCasingBlock(), t.getCasingMeta())) - ))) - .addElement('f', defer(t -> ofChain( - ofHatchAdder(GT_MetaTileEntity_LargeBoiler::addMaintenanceToMachineList, t.getCasingTextureIndex(), 1), - ofHatchAdder(GT_MetaTileEntity_LargeBoiler::addInputToMachineList, t.getCasingTextureIndex(), 1), - ofHatchAdder(GT_MetaTileEntity_LargeBoiler::addMufflerToMachineList, t.getCasingTextureIndex(), 1), - onElementPass(GT_MetaTileEntity_LargeBoiler::onFireboxAdded, ofBlock(t.getCasingBlock(), t.getCasingMeta())) - ))) - .build(); + private static final ClassValue<IStructureDefinition<GT_MetaTileEntity_LargeBoiler>> STRUCTURE_DEFINITION =new ClassValue<IStructureDefinition<GT_MetaTileEntity_LargeBoiler>>() { + @Override + protected IStructureDefinition<GT_MetaTileEntity_LargeBoiler> computeValue(Class<?> type) { + return StructureDefinition.<GT_MetaTileEntity_LargeBoiler>builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ + {"ccc", "ccc", "ccc"}, + {"ccc", "cPc", "ccc"}, + {"ccc", "cPc", "ccc"}, + {"ccc", "cPc", "ccc"}, + {"f~f", "fff", "fff"}, + })) + .addElement('P', lazy(t -> ofBlock(t.getPipeBlock(), t.getPipeMeta()))) + .addElement('c', lazy(t -> ofChain( + ofHatchAdder(GT_MetaTileEntity_LargeBoiler::addOutputToMachineList, t.getCasingTextureIndex(), 2), + onElementPass(GT_MetaTileEntity_LargeBoiler::onCasingAdded, ofBlock(t.getCasingBlock(), t.getCasingMeta())) + ))) + .addElement('f', lazy(t -> ofChain( + ofHatchAdder(GT_MetaTileEntity_LargeBoiler::addMaintenanceToMachineList, t.getCasingTextureIndex(), 1), + ofHatchAdder(GT_MetaTileEntity_LargeBoiler::addInputToMachineList, t.getCasingTextureIndex(), 1), + ofHatchAdder(GT_MetaTileEntity_LargeBoiler::addMufflerToMachineList, t.getCasingTextureIndex(), 1), + onElementPass(GT_MetaTileEntity_LargeBoiler::onFireboxAdded, ofBlock(t.getCasingBlock(), t.getCasingMeta())) + ))) + .build(); + } + }; private boolean firstRun = true; private int mSuperEfficencyIncrease = 0; private int integratedCircuitConfig = 0; //Steam output is reduced by 1000L per config @@ -92,13 +97,13 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_En .addCasingInfo(getCasingMaterial() + " " + getCasingBlockType() + " Casing", 24)//? .addOtherStructurePart(getCasingMaterial() + " Fire Boxes", "Bottom layer, 3 minimum") .addOtherStructurePart(getCasingMaterial() + " Pipe Casing Blocks", "Inner 3 blocks") - .addMaintenanceHatch("Any firebox") - .addMufflerHatch("Any firebox") - .addInputBus("Solid fuel, Any firebox") - .addInputHatch("Liquid fuel, Any firebox") + .addMaintenanceHatch("Any firebox", 1) + .addMufflerHatch("Any firebox", 1) + .addInputBus("Solid fuel, Any firebox", 1) + .addInputHatch("Liquid fuel, Any firebox", 1) .addStructureInfo("You can use either, or both") - .addInputHatch("Water, Any firebox") - .addOutputHatch("Steam, any casing") + .addInputHatch("Water, Any firebox", 1) + .addOutputHatch("Steam, any casing", 2) .toolTipFinisher("Gregtech"); return tt; } @@ -271,7 +276,7 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends GT_MetaTileEntity_En @Override public IStructureDefinition<GT_MetaTileEntity_LargeBoiler> getStructureDefinition() { - return STRUCTURE_DEFINITION; + return STRUCTURE_DEFINITION.get(getClass()); } private void onCasingAdded() { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java index 072f54e4af..63b536fc72 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java @@ -47,10 +47,10 @@ public class GT_MetaTileEntity_LargeChemicalReactor extends GT_MetaTileEntity_En onElementPass(GT_MetaTileEntity_LargeChemicalReactor::onCasingAdded, ofBlock(GregTech_API.sBlockCasings8, 0)) )) .addElement('x', ofChain( - ofHatchAdder(GT_MetaTileEntity_LargeChemicalReactor::addInputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_MetaTileEntity_LargeChemicalReactor::addOutputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_MetaTileEntity_LargeChemicalReactor::addMaintenanceToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_MetaTileEntity_LargeChemicalReactor::addEnergyInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_MetaTileEntity_LargeChemicalReactor::addInputToMachineList, CASING_INDEX, 2), + ofHatchAdder(GT_MetaTileEntity_LargeChemicalReactor::addOutputToMachineList, CASING_INDEX, 2), + ofHatchAdder(GT_MetaTileEntity_LargeChemicalReactor::addMaintenanceToMachineList, CASING_INDEX, 2), + ofHatchAdder(GT_MetaTileEntity_LargeChemicalReactor::addEnergyInputToMachineList, CASING_INDEX, 2), onElementPass(GT_MetaTileEntity_LargeChemicalReactor::onCoilAdded, ofBlock(GregTech_API.sBlockCasings5, 0)), onElementPass(GT_MetaTileEntity_LargeChemicalReactor::onCasingAdded, ofBlock(GregTech_API.sBlockCasings8, 0)) )) @@ -84,13 +84,13 @@ public class GT_MetaTileEntity_LargeChemicalReactor extends GT_MetaTileEntity_En .addController("Front center") .addCasingInfo("Chemically Inert Machine Casing", 8) .addOtherStructurePart("PTFE Pipe Machine Casing", "Center") - .addOtherStructurePart("Cupronickel Coil Block", "Adjacent to the PTFE Pipe Machine Casing") - .addEnergyHatch("Any casing") - .addMaintenanceHatch("Any casing") - .addInputBus("Any casing") - .addInputHatch("Any casing") - .addOutputBus("Any casing") - .addOutputHatch("Any casing") + .addOtherStructurePart("Cupronickel Coil Block", "Adjacent to the PTFE Pipe Machine Casing", 1) + .addEnergyHatch("Any casing", 1, 2) + .addMaintenanceHatch("Any casing", 1, 2) + .addInputBus("Any casing", 1, 2) + .addInputHatch("Any casing", 1, 2) + .addOutputBus("Any casing", 1, 2) + .addOutputHatch("Any casing", 1, 2) .addStructureInfo("You can have multiple hatches/busses") .toolTipFinisher("Gregtech"); return tt; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java index fd3117e451..f0a5abbe62 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java @@ -22,7 +22,7 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.defer; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; @@ -30,22 +30,27 @@ import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; public abstract class GT_MetaTileEntity_LargeTurbine extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_LargeTurbine> { private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition<GT_MetaTileEntity_LargeTurbine> STRUCTURE_DEFINITION = StructureDefinition.<GT_MetaTileEntity_LargeTurbine>builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - {" ", "xxxxx", "xxxxx", "xxxxx", "xxxxx",}, - {" --- ", "xcccx", "xchcx", "xchcx", "xcccx",}, - {" --- ", "xc~cx", "xh-hx", "xh-hx", "xcdcx",}, - {" --- ", "xcccx", "xchcx", "xchcx", "xcccx",}, - {" ", "xxxxx", "xxxxx", "xxxxx", "xxxxx",}, - })) - .addElement('c', defer(t -> ofBlock(t.getCasingBlock(), t.getCasingMeta()))) - .addElement('d', defer(t -> ofHatchAdder(GT_MetaTileEntity_LargeTurbine::addDynamoToMachineList, t.getCasingTextureIndex(), 0))) - .addElement('h', defer(t -> ofHatchAdderOptional(GT_MetaTileEntity_LargeTurbine::addToMachineList, t.getCasingTextureIndex(), 0, t.getCasingBlock(), t.getCasingMeta()))) - .addElement('x', (IStructureElementCheckOnly<GT_MetaTileEntity_LargeTurbine>) (aContext, aWorld, aX, aY, aZ) -> { - TileEntity tTile = aWorld.getTileEntity(aX, aY, aZ); - return !(tTile instanceof IGregTechTileEntity) || !(((IGregTechTileEntity) tTile).getMetaTileEntity() instanceof GT_MetaTileEntity_LargeTurbine); - }) - .build(); + private static final ClassValue<IStructureDefinition<GT_MetaTileEntity_LargeTurbine>> STRUCTURE_DEFINITION = new ClassValue<IStructureDefinition<GT_MetaTileEntity_LargeTurbine>>() { + @Override + protected IStructureDefinition<GT_MetaTileEntity_LargeTurbine> computeValue(Class<?> type) { + return StructureDefinition.<GT_MetaTileEntity_LargeTurbine>builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ + {" ", "xxxxx", "xxxxx", "xxxxx", "xxxxx",}, + {" --- ", "xcccx", "xchcx", "xchcx", "xcccx",}, + {" --- ", "xc~cx", "xh-hx", "xh-hx", "xcdcx",}, + {" --- ", "xcccx", "xchcx", "xchcx", "xcccx",}, + {" ", "xxxxx", "xxxxx", "xxxxx", "xxxxx",}, + })) + .addElement('c', lazy(t -> ofBlock(t.getCasingBlock(), t.getCasingMeta()))) + .addElement('d', lazy(t -> ofHatchAdder(GT_MetaTileEntity_LargeTurbine::addDynamoToMachineList, t.getCasingTextureIndex(), 1))) + .addElement('h', lazy(t -> ofHatchAdderOptional(GT_MetaTileEntity_LargeTurbine::addToMachineList, t.getCasingTextureIndex(), 2, t.getCasingBlock(), t.getCasingMeta()))) + .addElement('x', (IStructureElementCheckOnly<GT_MetaTileEntity_LargeTurbine>) (aContext, aWorld, aX, aY, aZ) -> { + TileEntity tTile = aWorld.getTileEntity(aX, aY, aZ); + return !(tTile instanceof IGregTechTileEntity) || !(((IGregTechTileEntity) tTile).getMetaTileEntity() instanceof GT_MetaTileEntity_LargeTurbine); + }) + .build(); + } + }; protected int baseEff = 0; protected int optFlow = 0; @@ -74,7 +79,7 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends GT_MetaTileEntity_E @Override public IStructureDefinition<GT_MetaTileEntity_LargeTurbine> getStructureDefinition() { - return STRUCTURE_DEFINITION; + return STRUCTURE_DEFINITION.get(getClass()); } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java index 27e4bf7084..20f795572e 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java @@ -46,10 +46,10 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT .beginStructureBlock(3, 3, 4, true) .addController("Front center") .addCasingInfo("Stainless Steel Turbine Casing", 24) - .addDynamoHatch("Back center") - .addMaintenanceHatch("Side centered") - .addMufflerHatch("Side centered") - .addInputHatch("Gas Fuel, Side centered") + .addDynamoHatch("Back center", 1) + .addMaintenanceHatch("Side centered", 2) + .addMufflerHatch("Side centered", 2) + .addInputHatch("Gas Fuel, Side centered", 2) .toolTipFinisher("Gregtech"); return tt; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java index 0d22271a34..2c803712f1 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java @@ -54,10 +54,10 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La .beginStructureBlock(3, 3, 4, true) .addController("Front center") .addCasingInfo("Titanium Turbine Casing", 24) - .addDynamoHatch("Back center") - .addMaintenanceHatch("Side centered") - .addInputHatch("Superheated Steam, Side centered") - .addOutputHatch("Steam, Side centered") + .addDynamoHatch("Back center", 1) + .addMaintenanceHatch("Side centered", 2) + .addInputHatch("Superheated Steam, Side centered", 2) + .addOutputHatch("Steam, Side centered", 2) .toolTipFinisher("Gregtech"); return tt; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java index d1bf1e7c0b..c34f190242 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java @@ -53,10 +53,10 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar .beginStructureBlock(3, 3, 4, true) .addController("Front center") .addCasingInfo("Tungstensteel Turbine Casing", 24) - .addDynamoHatch("Back center") - .addMaintenanceHatch("Side centered") - .addInputHatch("Plasma Fluid, Side centered") - .addOutputHatch("Molten Fluid, optional, Side centered") + .addDynamoHatch("Back center", 1) + .addMaintenanceHatch("Side centered", 2) + .addInputHatch("Plasma Fluid, Side centered", 2) + .addOutputHatch("Molten Fluid, optional, Side centered", 2) .toolTipFinisher("Gregtech"); return tt; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java index 8990ad3324..356dda9183 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java @@ -57,10 +57,10 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg .beginStructureBlock(3, 3, 4, true) .addController("Front center") .addCasingInfo("Turbine Casing", 24) - .addDynamoHatch("Back center") - .addMaintenanceHatch("Side centered") - .addInputHatch("Steam, Side centered") - .addOutputHatch("Distilled Water, Side centered") + .addDynamoHatch("Back center", 1) + .addMaintenanceHatch("Side centered", 2) + .addInputHatch("Steam, Side centered", 2) + .addOutputHatch("Distilled Water, Side centered", 2) .toolTipFinisher("Gregtech"); return tt; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java index edfce02aad..907de38f6b 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java @@ -51,7 +51,7 @@ public class GT_MetaTileEntity_MultiFurnace extends GT_MetaTileEntity_AbstractMu .addElement('c', ofBlock(GregTech_API.sBlockCasings1, CASING_INDEX)) .addElement('m', ofHatchAdder(GT_MetaTileEntity_MultiFurnace::addMufflerToMachineList, CASING_INDEX, 2)) .addElement('C', GT_StructureUtility.ofCoil(GT_MetaTileEntity_MultiFurnace::setCoilLevel, GT_MetaTileEntity_MultiFurnace::getCoilLevel)) - .addElement('b', ofHatchAdderOptional(GT_MetaTileEntity_MultiFurnace::addBottomHatch, CASING_INDEX, 3, GregTech_API.sBlockCasings1, CASING_INDEX)) + .addElement('b', ofHatchAdderOptional(GT_MetaTileEntity_MultiFurnace::addBottomHatch, CASING_INDEX, 1, GregTech_API.sBlockCasings1, CASING_INDEX)) .build(); public GT_MetaTileEntity_MultiFurnace(int aID, String aName, String aNameRegional) { @@ -80,11 +80,11 @@ public class GT_MetaTileEntity_MultiFurnace extends GT_MetaTileEntity_AbstractMu .addController("Front bottom") .addCasingInfo("Heat Proof Machine Casing", 8) .addOtherStructurePart("Heating Coils", "Middle layer") - .addEnergyHatch("Any bottom casing") - .addMaintenanceHatch("Any bottom casing") - .addMufflerHatch("Top Middle") - .addInputBus("Any bottom casing") - .addOutputBus("Any bottom casing") + .addEnergyHatch("Any bottom casing", 1) + .addMaintenanceHatch("Any bottom casing", 1) + .addMufflerHatch("Top Middle", 2) + .addInputBus("Any bottom casing", 1) + .addOutputBus("Any bottom casing", 1) .toolTipFinisher("Gregtech"); return tt; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java index 8a257db8ee..c8dbe2321a 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java @@ -52,7 +52,7 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_EnhancedMult onElementPass(GT_MetaTileEntity_OilCracker::onCasingAdded, ofBlock(GregTech_API.sBlockCasings4, 1)) )) .addElement('r', ofChain( - ofHatchAdder(GT_MetaTileEntity_OilCracker::addRightHatchToMachineList, CASING_INDEX, 2), + ofHatchAdder(GT_MetaTileEntity_OilCracker::addRightHatchToMachineList, CASING_INDEX, 3), onElementPass(GT_MetaTileEntity_OilCracker::onCasingAdded, ofBlock(GregTech_API.sBlockCasings4, 1)) )) .addElement('m', ofChain( @@ -91,12 +91,13 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_EnhancedMult .addCasingInfo("Clean Stainless Steel Machine Casing", 18) .addOtherStructurePart("2 Rings of 8 Coils", "Each side of the controller") .addInfo("Gets 5% EU/t reduction per coil tier") - .addEnergyHatch("Any casing") - .addMaintenanceHatch("Any casing") - .addInputHatch("Steam/Hydrogen ONLY, Any middle ring casing") - .addInputHatch("Any left/right side casing") - .addOutputHatch("Any left/right side casing") + .addEnergyHatch("Any casing", 1) + .addMaintenanceHatch("Any casing", 1) + .addInputHatch("Steam/Hydrogen ONLY, Any middle ring casing", 1) + .addInputHatch("Any left/right side casing",2, 3) + .addOutputHatch("Any right/left side casing", 2, 3) .addStructureInfo("Input/Output Hatches must be on opposite sides!") + .addStructureHint("GT5U.cracker.io_side") .toolTipFinisher("Gregtech"); return tt; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillBase.java index 554e5dfd63..76231980ec 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillBase.java @@ -92,10 +92,10 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D .addStructureInfo(casings + " form the 3x1x3 Base") .addOtherStructurePart(casings, " 1x3x1 pillar above the center of the base (2 minimum total)") .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top") - .addEnergyHatch(VN[getMinTier()] + "+, Any base casing") - .addMaintenanceHatch("Any base casing") - .addInputBus("Mining Pipes or Circuits, optional, any base casing") - .addOutputHatch("Any base casing") + .addEnergyHatch(VN[getMinTier()] + "+, Any base casing", 1) + .addMaintenanceHatch("Any base casing", 1) + .addInputBus("Mining Pipes or Circuits, optional, any base casing", 1) + .addOutputHatch("Any base casing", 1) .toolTipFinisher("Gregtech"); return tt; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java index 5b4444cec3..b168e44c41 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java @@ -350,11 +350,11 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile .addStructureInfo(casings + " form the 3x1x3 Base") .addOtherStructurePart(casings, " 1x3x1 pillar above the center of the base (2 minimum total)") .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top") - .addEnergyHatch(VN[getMinTier()] + "+, Any base casing") - .addMaintenanceHatch("Any base casing") - .addInputBus("Mining Pipes, optional, any base casing") - .addInputHatch("Drilling Fluid, any base casing") - .addOutputBus("Any base casing") + .addEnergyHatch(VN[getMinTier()] + "+, Any base casing", 1) + .addMaintenanceHatch("Any base casing", 1) + .addInputBus("Mining Pipes, optional, any base casing", 1) + .addInputHatch("Drilling Fluid, any base casing", 1) + .addOutputBus("Any base casing", 1) .toolTipFinisher("Gregtech"); return tt; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java index 0a46c47f7c..ea56266b41 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java @@ -76,12 +76,12 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_CubicMu .beginStructureBlock(3, 3, 3, true) .addController("Front center") .addCasingInfo("Robust Tungstensteel Machine Casing", 14) - .addEnergyHatch("Any casing") - .addMaintenanceHatch("Any casing") - .addInputBus("Any casing") - .addInputHatch("Any casing") - .addOutputBus("Any casing") - .addOutputHatch("Any casing") + .addEnergyHatch("Any casing", 1) + .addMaintenanceHatch("Any casing", 1) + .addInputBus("Any casing", 1) + .addInputHatch("Any casing", 1) + .addOutputBus("Any casing", 1) + .addOutputHatch("Any casing", 1) .toolTipFinisher("Gregtech"); return tt; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java index 7312e0d992..48da2c5dce 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java @@ -63,8 +63,8 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_EnhancedMu onElementPass(GT_MetaTileEntity_PyrolyseOven::onCasingAdded, tCasingElement) )) .addElement('t', ofChain( - ofHatchAdder(GT_MetaTileEntity_PyrolyseOven::addInputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_MetaTileEntity_PyrolyseOven::addMufflerToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_MetaTileEntity_PyrolyseOven::addInputToMachineList, CASING_INDEX, 2), + ofHatchAdder(GT_MetaTileEntity_PyrolyseOven::addMufflerToMachineList, CASING_INDEX, 2), onElementPass(GT_MetaTileEntity_PyrolyseOven::onCasingAdded, tCasingElement) )) .build(); @@ -95,13 +95,13 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_EnhancedMu .addController("Front center") .addCasingInfo("Pyrolyse Oven Casing", 60) .addOtherStructurePart("Heating Coils", "Center 3x1x3 of the bottom layer") - .addEnergyHatch("Any bottom layer casing") - .addMaintenanceHatch("Any bottom layer casing") - .addMufflerHatch("Center 3x1x3 area in top layer") - .addInputBus("Center 3x1x3 area in top layer") - .addInputHatch("Center 3x1x3 area in top layer") - .addOutputBus("Any bottom layer casing") - .addOutputHatch("Any bottom layer casing") + .addEnergyHatch("Any bottom layer casing", 1) + .addMaintenanceHatch("Any bottom layer casing", 1) + .addMufflerHatch("Center 3x1x3 area in top layer", 2) + .addInputBus("Center 3x1x3 area in top layer", 2) + .addInputHatch("Center 3x1x3 area in top layer", 2) + .addOutputBus("Any bottom layer casing", 1) + .addOutputHatch("Any bottom layer casing", 1) .toolTipFinisher("Gregtech"); return tt; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java index bef433e626..b7f24f7e7a 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java @@ -47,10 +47,10 @@ public class GT_MetaTileEntity_VacuumFreezer extends GT_MetaTileEntity_CubicMult .beginStructureBlock(3, 3, 3, true) .addController("Front center") .addCasingInfo("Frost Proof Machine Casing", 16) - .addEnergyHatch("Any casing") - .addMaintenanceHatch("Any casing") - .addInputBus("Any casing") - .addOutputBus("Any casing") + .addEnergyHatch("Any casing", 1) + .addMaintenanceHatch("Any casing", 1) + .addInputBus("Any casing", 1) + .addOutputBus("Any casing", 1) .toolTipFinisher("Gregtech"); return tt; } |