diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTENetworkSwitch.java b/src/main/java/tectech/thing/metaTileEntity/multi/MTENetworkSwitch.java index b9b80912d05..ffe04650955 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTENetworkSwitch.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/MTENetworkSwitch.java @@ -3,7 +3,9 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.enums.GTValues.V; -import static gregtech.api.util.GTStructureUtility.ofHatchAdderOptional; +import static gregtech.api.enums.HatchElement.Energy; +import static gregtech.api.enums.HatchElement.Maintenance; +import static gregtech.api.util.GTStructureUtility.buildHatchAdder; import static net.minecraft.util.StatCollector.translateToLocal; import net.minecraft.item.ItemStack; @@ -44,23 +46,35 @@ public class MTENetworkSwitch extends TTMultiblockBase implements IConstructable // region structure private static final String[] description = new String[] { EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", - "1 - Classic/Data Hatches or Computer casing", // 1 - Classic/Data Hatches or Computer casing + translateToLocal("gt.blockmachines.multimachine.em.switch.hint.0"), // 1 - Data Input/Output Hatches or Advanced + // computer casing + translateToLocal("gt.blockmachines.multimachine.em.switch.hint.1"), // 2 - Data Output Hatches or Computer + // casing }; private static final IStructureDefinition STRUCTURE_DEFINITION = IStructureDefinition .builder() .addShape( "main", - transpose(new String[][] { { "BBB", "BBB", "BBB" }, { "B~B", "BAB", "BBB" }, { "BBB", "BBB", "BBB" } })) - .addElement('A', ofBlock(TTCasingsContainer.sBlockCasingsTT, 3)) + transpose(new String[][] { { "BBB", "BAB", "BBB" }, { "B~B", "AAA", "BAB" }, { "BBB", "BAB", "BBB" } })) + .addElement( + 'A', + buildHatchAdder(MTENetworkSwitch.class) + .atLeast( + Energy.or(HatchElement.EnergyMulti), + Maintenance, + HatchElement.InputData, + HatchElement.OutputData) + .casingIndex(BlockGTCasingsTT.textureOffset + 3) + .dot(1) + .buildAndChain(ofBlock(TTCasingsContainer.sBlockCasingsTT, 3))) .addElement( 'B', - ofHatchAdderOptional( - MTENetworkSwitch::addClassicToMachineList, - BlockGTCasingsTT.textureOffset + 1, - 1, - TTCasingsContainer.sBlockCasingsTT, - 1)) + buildHatchAdder(MTENetworkSwitch.class) + .atLeast(Energy.or(HatchElement.EnergyMulti), Maintenance, HatchElement.OutputData) // No Input Data + .casingIndex(BlockGTCasingsTT.textureOffset + 1) + .dot(2) + .buildAndChain(ofBlock(TTCasingsContainer.sBlockCasingsTT, 1))) .build(); // endregion @@ -209,24 +223,20 @@ public MultiblockTooltipBuilder createTooltip() { .addInfo(translateToLocal("gt.blockmachines.multimachine.em.switch.desc.2")) // Needs a Parametrizer to // be configured .addTecTechHatchInfo() + .beginStructureBlock(3, 3, 3, false) .addController(translateToLocal("tt.keyword.Structure.FrontCenter")) // Controller: Front center - .addCasingInfoMin(translateToLocal("gt.blockcasingsTT.1.name"), 0, false) // 0x Computer Casing - // (minimum) .addOtherStructurePart( - translateToLocal("gt.blockcasingsTT.3.name"), - translateToLocal("tt.keyword.Structure.Center")) // Advanced Computer Casing: Center - .addOtherStructurePart( - translateToLocal("tt.keyword.Structure.DataConnector"), - translateToLocal("tt.keyword.Structure.AnyComputerCasing"), - 2) // Data Connector: Any Computer Casing + translateToLocal("tt.keyword.Structure.DataInput"), // Data Input Hatch: Any Advanced Computer Casing + translateToLocal("tt.keyword.Structure.AnyAdvComputerCasing"), + 1) .addOtherStructurePart( - translateToLocal("gt.blockmachines.hatch.param.tier.05.name"), + translateToLocal("tt.keyword.Structure.DataOutput"), // Data Output Hatch: Any Computer Casing translateToLocal("tt.keyword.Structure.AnyComputerCasing"), - 2) // Parametrizer: Any Computer Casing - .addEnergyHatch(translateToLocal("tt.keyword.Structure.AnyComputerCasing"), 1) // Energy Hatch: Any + 2) + .addEnergyHatch(translateToLocal("tt.keyword.Structure.AnyComputerCasing"), 2) // Energy Hatch: Any // Computer Casing - .addMaintenanceHatch(translateToLocal("tt.keyword.Structure.AnyComputerCasing"), 1) // Maintenance + .addMaintenanceHatch(translateToLocal("tt.keyword.Structure.AnyComputerCasing"), 2) // Maintenance // Hatch: Any // Computer Casing .toolTipFinisher(); diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTEQuantumComputer.java b/src/main/java/tectech/thing/metaTileEntity/multi/MTEQuantumComputer.java index cbe9fc8332c..f3c3d6ab16d 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTEQuantumComputer.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/MTEQuantumComputer.java @@ -103,6 +103,7 @@ public class MTEQuantumComputer extends TTMultiblockBase implements ISurvivalCon Energy.or(HatchElement.EnergyMulti), Maintenance, HatchElement.Uncertainty, + HatchElement.InputData, HatchElement.OutputData, WirelessComputationHatchElement.INSTANCE) .casingIndex(BlockGTCasingsTT.textureOffset + 1) @@ -368,11 +369,6 @@ public MultiblockTooltipBuilder createTooltip() { translateToLocal("gt.blockmachines.hatch.rack.tier.08.name"), translateToLocal("tt.keyword.Structure.AnyAdvComputerCasingExceptOuter"), 2) // Computer Rack: Any Advanced Computer Casing, except the outer ones - .addOtherStructurePart( - translateToLocal("gt.blockmachines.hatch.param.tier.05.name"), - translateToLocal("tt.keyword.Structure.Optional") + " " - + translateToLocal("tt.keyword.Structure.AnyComputerCasingFirstOrLastSlice"), - 2) // Parametrizer: (optional) Any Computer Casing on first or last slice .addEnergyHatch(translateToLocal("tt.keyword.Structure.AnyComputerCasingFirstOrLastSlice"), 1) // Energy // Hatch: // Any diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/base/TTMultiblockBase.java b/src/main/java/tectech/thing/metaTileEntity/multi/base/TTMultiblockBase.java index 5a4bc939103..28790f4492a 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/base/TTMultiblockBase.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/base/TTMultiblockBase.java @@ -2085,7 +2085,7 @@ public final boolean addClassicMaintenanceToMachineList(IGregTechTileEntity aTil } // NEW METHOD - public final boolean addDataConnectorToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + public final boolean addDataInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (aTileEntity == null) { return false; } @@ -2097,6 +2097,18 @@ public final boolean addDataConnectorToMachineList(IGregTechTileEntity aTileEnti ((MTEHatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); return eInputData.add((MTEHatchDataInput) aMetaTileEntity); } + return false; + } + + // NEW METHOD + public final boolean addDataOutputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } if (aMetaTileEntity instanceof MTEHatchDataOutput) { ((MTEHatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); return eOutputData.add((MTEHatchDataOutput) aMetaTileEntity); @@ -2175,14 +2187,14 @@ public long count(TTMultiblockBase t) { return t.eDynamoMulti.size(); } }, - InputData(TTMultiblockBase::addDataConnectorToMachineList, MTEHatchDataInput.class) { + InputData(TTMultiblockBase::addDataInputToMachineList, MTEHatchDataInput.class) { @Override public long count(TTMultiblockBase t) { return t.eInputData.size(); } }, - OutputData(TTMultiblockBase::addDataConnectorToMachineList, MTEHatchDataOutput.class) { + OutputData(TTMultiblockBase::addDataOutputToMachineList, MTEHatchDataOutput.class) { @Override public long count(TTMultiblockBase t) { diff --git a/src/main/resources/assets/tectech/lang/en_US.lang b/src/main/resources/assets/tectech/lang/en_US.lang index 0fc1e2c0175..3117cf6a0c5 100644 --- a/src/main/resources/assets/tectech/lang/en_US.lang +++ b/src/main/resources/assets/tectech/lang/en_US.lang @@ -693,11 +693,10 @@ gt.blockmachines.multimachine.tm.teslaCoil.cfgo.8=Scan time display gt.blockmachines.multimachine.tm.teslaCoil.cfgo.9=Output max display gt.blockmachines.multimachine.em.switch.name=Network Switch With QoS -gt.blockmachines.multimachine.em.switch.hint=1 - Classic/Data Hatches or Computer casing +gt.blockmachines.multimachine.em.switch.hint.0=1 - Data Input/Output Hatches or Advanced computer casing +gt.blockmachines.multimachine.em.switch.hint.1=2 - Data Output Hatches or Computer casing gt.blockmachines.multimachine.em.switch.desc.0=Controller block of the Network Switch With QoS -gt.blockmachines.multimachine.em.switch.desc.1=Used to route and distribute computation -gt.blockmachines.multimachine.em.switch.desc.2=Needs a Parametrizer to be configured - +gt.blockmachines.multimachine.em.switch.desc.1=Routes and distributes computation gt.blockmachines.multimachine.em.computer.name=Quantum Computer gt.blockmachines.multimachine.em.computer.hint.0=1 - Classic/Data Hatches or Computer casing @@ -1342,6 +1341,7 @@ tt.keyword.Structure.AnyHighPowerCasingFront=Any High Power Casing on the front tt.keyword.Structure.AnyTeslaBaseCasingOuter=Any outer Tesla Base Casing tt.keyword.Structure.AnyComputerCasingFirstOrLastSlice=Any Computer Casing on the first or last slice tt.keyword.Structure.AnyComputerCasingBackMain=Any Computer Casing on the backside of the main body +tt.keyword.Structure.AnyAdvComputerCasing=Any Advanced Computer Casing tt.keyword.Structure.AnyAdvComputerCasingExceptOuter=Any Advanced Computer Casing, except the outer ones tt.keyword.Structure.AnyMolecularCasing=Any Molecular Casing tt.keyword.Structure.AnyMolecularCasing2D=Any Molecular Casing with 2 dots @@ -1368,6 +1368,8 @@ tt.keyword.Structure.ElementalOverflow=Elemental Overflow Hatch tt.keyword.Structure.ElementalInput=Elemental Input Hatch tt.keyword.Structure.EssentiaStorage=Essentia Storage tt.keyword.Structure.DataConnector=Data Connector +tt.keyword.Structure.DataInput=Data Input Hatch +tt.keyword.Structure.DataOutput=Data Output Hatch tt.keyword.Structure.SuperconductingCoilBlock=Superconducting Coil Block tt.keyword.Structure.StainlessSteelCasing=Stainless Steel Casing tt.wirelessInputData.config.text=Configure how much computation to pull from wireless network