From 8673af30e331a1d0977b07721f65f04e951d256f Mon Sep 17 00:00:00 2001 From: Johny709 <86203059+Johny709@users.noreply.github.com> Date: Tue, 23 Dec 2025 09:48:19 -0500 Subject: [PATCH 01/22] Fix Cosmic Ray Detector --- .../multi/MetaTileEntityCosmicRayDetector.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityCosmicRayDetector.java b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityCosmicRayDetector.java index 65dccf1..ac6dabd 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityCosmicRayDetector.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityCosmicRayDetector.java @@ -27,9 +27,6 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3i; -import net.minecraft.util.text.ITextComponent; -import net.minecraft.util.text.Style; -import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; @@ -104,7 +101,10 @@ protected void formStructure(PatternMatchContext context) { @Override protected void configureDisplayText(MultiblockUIBuilder builder) { - builder.structureFormed(isStructureFormed()) + super.configureDisplayText(builder); + CosmicRayRecipeLogic recipeLogic = (CosmicRayRecipeLogic)this.recipeMapWorkable; + builder.addComputationUsageLine(recipeLogic.getRecipeCWUt()) + .addRecipeOutputLine(recipeLogic) .addCustom((keyManager, uiSyncer) -> { if (!uiSyncer.syncBoolean(canSeeSky())) { keyManager.add(KeyUtil.lang(TextFormatting.RED, "gcyl.multiblock.cosmic_ray_detector.tooltip.1")); @@ -154,7 +154,7 @@ public IOpticalComputationProvider getComputationProvider() { return computationProvider; } - private class CosmicRayRecipeLogic extends GCYLComputationRecipeLogic { + private static class CosmicRayRecipeLogic extends GCYLComputationRecipeLogic { public CosmicRayRecipeLogic(RecipeMapMultiblockController metaTileEntity) { super(metaTileEntity, ComputationType.STEADY); } From 6d713d3f3b0fee866636c6c1ef6c48f4c1392069 Mon Sep 17 00:00:00 2001 From: Johny709 <86203059+Johny709@users.noreply.github.com> Date: Tue, 23 Dec 2025 16:41:51 -0500 Subject: [PATCH 02/22] Fix Stellar Forge and add voltage casings to it --- .../api/pattern/TraceabilityPredicates.java | 25 +++++++++---- .../multi/MetaTileEntityStellarForge.java | 36 +++++++++++-------- 2 files changed, 40 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/fulltrix/gcyl/api/pattern/TraceabilityPredicates.java b/src/main/java/com/fulltrix/gcyl/api/pattern/TraceabilityPredicates.java index fc273d1..248a022 100644 --- a/src/main/java/com/fulltrix/gcyl/api/pattern/TraceabilityPredicates.java +++ b/src/main/java/com/fulltrix/gcyl/api/pattern/TraceabilityPredicates.java @@ -4,23 +4,20 @@ import com.fulltrix.gcyl.api.block.IComponentALTier; import com.fulltrix.gcyl.api.block.IElevatorMotorTier; import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; -import com.fulltrix.gcyl.blocks.component_al.GCYLComponentALCasing; import com.fulltrix.gcyl.blocks.fusion.GCYLFusionCoils; -import com.fulltrix.gcyl.blocks.metal.GCYLCleanroomCasing; +import gregicality.multiblocks.common.metatileentities.multiblockpart.MetaTileEntityTieredHatch; import gregtech.api.GregTechAPI; import gregtech.api.block.ICleanroomFilter; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.MetaTileEntityHolder; import gregtech.api.pattern.PatternStringError; import gregtech.api.pattern.TraceabilityPredicate; import gregtech.api.util.BlockInfo; -import gregtech.common.blocks.BlockCleanroomCasing; -import gregtech.common.blocks.MetaBlocks; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import org.apache.commons.lang3.ArrayUtils; -import java.util.Arrays; -import java.util.Comparator; -import java.util.LinkedList; +import java.util.*; import java.util.function.Supplier; public class TraceabilityPredicates { @@ -131,6 +128,20 @@ public class TraceabilityPredicates { .toArray(BlockInfo[]::new)) .addTooltips("gcyl.multiblock.pattern.error.elevator_motor_tier"); + public static TraceabilityPredicate tieredHatchPredicate() { + return new TraceabilityPredicate(blockWorldState -> { + if (blockWorldState.getTileEntity() instanceof MetaTileEntityHolder holder) { + MetaTileEntity tileEntity = holder.getMetaTileEntity(); + if (tileEntity instanceof MetaTileEntityTieredHatch tieredHatch) { + List tieredHatches = blockWorldState.getMatchContext().getOrCreate("tiered_hatches", ArrayList::new); + tieredHatches.add(tieredHatch); + return tieredHatches.get(0).getTier() == tieredHatch.getTier(); + } + } + return false; + }); + } + public static TraceabilityPredicate advFusionCoils() { return ADV_FUSION_COIL_PRED.get(); } diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityStellarForge.java b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityStellarForge.java index b10e5bf..c1e47f0 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityStellarForge.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityStellarForge.java @@ -1,37 +1,45 @@ package com.fulltrix.gcyl.machines.multi; +import com.fulltrix.gcyl.api.pattern.TraceabilityPredicates; import com.fulltrix.gcyl.client.ClientHandler; import com.fulltrix.gcyl.blocks.GCYLMultiblockCasing2; import com.fulltrix.gcyl.blocks.metal.MetalCasing2; import com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps; +import gregicality.multiblocks.common.GCYMConfigHolder; +import gregicality.multiblocks.common.metatileentities.multiblockpart.MetaTileEntityTieredHatch; +import gregtech.api.capability.impl.MultiblockRecipeLogic; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.IMultiblockPart; import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController; -import gregtech.api.metatileentity.multiblock.ui.MultiblockUIBuilder; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; -import gregtech.api.util.KeyUtil; +import gregtech.api.pattern.PatternMatchContext; import gregtech.client.renderer.ICubeRenderer; import gregtech.client.renderer.texture.cube.OrientedOverlayRenderer; import net.minecraft.block.state.IBlockState; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.text.ITextComponent; -import net.minecraft.util.text.TextComponentTranslation; import javax.annotation.Nonnull; -import java.util.List; +import java.util.ArrayList; import static com.fulltrix.gcyl.api.pattern.TraceabilityPredicates.advFusionCoils; import static com.fulltrix.gcyl.client.ClientHandler.ENRICHED_NAQUADAH_ALLOY_CASING; import static com.fulltrix.gcyl.blocks.GCYLMetaBlocks.METAL_CASING_2; import static com.fulltrix.gcyl.blocks.GCYLMetaBlocks.MULTIBLOCK_CASING2; -public class MetaTileEntityStellarForge extends RecipeMapMultiblockController { //TODO implement tiering +public class MetaTileEntityStellarForge extends RecipeMapMultiblockController { + private long maxVoltage; public MetaTileEntityStellarForge(ResourceLocation metaTileEntityId) { super(metaTileEntityId, GCYLRecipeMaps.STELLAR_FORGE_RECIPES); + this.recipeMapWorkable = new MultiblockRecipeLogic(this) { + @Override + public long getMaxVoltage() { + return GCYMConfigHolder.globalMultiblocks.enableTieredCasings ? maxVoltage : super.getMaxVoltage(); + } + }; } @Override @@ -52,7 +60,7 @@ protected BlockPattern createStructurePattern() { .aisle("######C#C######", "###FF#####FF###", "###############", "###############", "###############", "###############", "###############", "###FF#####FF###", "######C#C######") .aisle("######C#C######", "#####FFFFF#####", "###############", "###############", "###############", "###############", "###############", "#####FFFFF#####", "######C#C######") .aisle("###############", "######CSC######", "######C#C######", "######C#C######", "######C#C######", "######C#C######", "######C#C######", "######CCC######", "###############") - .where('M', air()) + .where('M', TraceabilityPredicates.tieredHatchPredicate()) .where('C', states(getCasingState()).setMinGlobalLimited(130).or(autoAbilities(true, true, true, true, true, true, false))) .where('X', states(MULTIBLOCK_CASING2.getState(GCYLMultiblockCasing2.CasingType.STELLAR_CONTAINMENT))) .where('F', advFusionCoils()) @@ -62,16 +70,16 @@ protected BlockPattern createStructurePattern() { } @Override - public void invalidateStructure() { - super.invalidateStructure(); - this.maxVoltage = 0; + protected void formStructure(PatternMatchContext context) { + super.formStructure(context); + int tier = context.getOrDefault("tiered_hatches", new ArrayList()).get(0).getTier() - 1; + this.maxVoltage = 32L << tier * 2; } @Override - protected void configureDisplayText(MultiblockUIBuilder builder) { - builder.addCustom((keyManager, uiSyncer) -> { - keyManager.add(KeyUtil.lang("gregtech.multiblock.universal.framework", this.maxVoltage)); - }); + public void invalidateStructure() { + super.invalidateStructure(); + this.maxVoltage = 0; } @Override From b13e13e6eefe806cbe723ab832d204d6f1d74f0e Mon Sep 17 00:00:00 2001 From: Johny709 <86203059+Johny709@users.noreply.github.com> Date: Tue, 23 Dec 2025 17:18:20 -0500 Subject: [PATCH 03/22] Fix Bio Reactor voltage casings --- .../multi/MetaTileEntityBioReactor.java | 33 +++++++++++++++---- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityBioReactor.java b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityBioReactor.java index 5d326e2..3375df9 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityBioReactor.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityBioReactor.java @@ -1,15 +1,20 @@ package com.fulltrix.gcyl.machines.multi; -import com.fulltrix.gcyl.api.multi.GCYLRecipeMapMultiblockController; +import com.fulltrix.gcyl.api.pattern.TraceabilityPredicates; import com.fulltrix.gcyl.client.ClientHandler; import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; import com.fulltrix.gcyl.blocks.GCYLMultiblockCasing2; import com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps; +import gregicality.multiblocks.common.GCYMConfigHolder; +import gregicality.multiblocks.common.metatileentities.multiblockpart.MetaTileEntityTieredHatch; +import gregtech.api.capability.impl.MultiblockRecipeLogic; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.IMultiblockPart; +import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; +import gregtech.api.pattern.PatternMatchContext; import gregtech.client.renderer.ICubeRenderer; import gregtech.client.renderer.texture.cube.OrientedOverlayRenderer; import gregtech.common.blocks.BlockGlassCasing; @@ -18,11 +23,20 @@ import net.minecraft.util.ResourceLocation; import javax.annotation.Nonnull; +import java.util.ArrayList; -public class MetaTileEntityBioReactor extends GCYLRecipeMapMultiblockController { +public class MetaTileEntityBioReactor extends RecipeMapMultiblockController { + + private long maxVoltage; public MetaTileEntityBioReactor(ResourceLocation metaTileEntityId) { - super(metaTileEntityId, GCYLRecipeMaps.BIO_REACTOR_RECIPES, false); + super(metaTileEntityId, GCYLRecipeMaps.BIO_REACTOR_RECIPES); + this.recipeMapWorkable = new MultiblockRecipeLogic(this) { + @Override + public long getMaxVoltage() { + return GCYMConfigHolder.globalMultiblocks.enableTieredCasings ? maxVoltage : super.getMaxVoltage(); + } + }; } @Override @@ -30,10 +44,8 @@ public MetaTileEntity createMetaTileEntity(IGregTechTileEntity iGregTechTileEnti return new MetaTileEntityBioReactor(metaTileEntityId); } - public long maxVoltage = 0; - @Override - protected BlockPattern createStructurePattern() { //TODO: add tiered casings + protected BlockPattern createStructurePattern() { return FactoryBlockPattern.start() .aisle("XXXXX", "XGGGX", "XGGGX", "XGGGX", "XXXXX") .aisle("XXXXX", "G###G", "G#T#G", "G###G", "XXXXX") @@ -45,10 +57,17 @@ protected BlockPattern createStructurePattern() { //TODO: add tiered casings .where('L', states(getCasingState())) .where('#', air()) .where('G', states(MetaBlocks.TRANSPARENT_CASING.getState(BlockGlassCasing.CasingType.LAMINATED_GLASS))) - .where('T', tieredCasing()) + .where('T', TraceabilityPredicates.tieredHatchPredicate()) .build(); } + @Override + protected void formStructure(PatternMatchContext context) { + super.formStructure(context); + int tier = context.getOrDefault("tiered_hatches", new ArrayList()).get(0).getTier() - 1; + this.maxVoltage = 32L << tier * 2; + } + @Override public void invalidateStructure() { super.invalidateStructure(); From 9dd3f09ac736681590cd18da1a075cbe4102a253 Mon Sep 17 00:00:00 2001 From: Johny709 <86203059+Johny709@users.noreply.github.com> Date: Tue, 23 Dec 2025 17:34:29 -0500 Subject: [PATCH 04/22] Fix Plasma Condenser voltage casings --- .../gcyl/machines/GCYLTileEntities.java | 2 +- .../simple/MetaTileEntityPlasmaCondenser.java | 42 +++++++++++++++---- 2 files changed, 35 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/fulltrix/gcyl/machines/GCYLTileEntities.java b/src/main/java/com/fulltrix/gcyl/machines/GCYLTileEntities.java index d0f394f..699d996 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/GCYLTileEntities.java +++ b/src/main/java/com/fulltrix/gcyl/machines/GCYLTileEntities.java @@ -129,7 +129,7 @@ public static void init() { HYPER_REACTOR[1] = registerMetaTileEntity(++id, new MetaTileEntityHyperReactor(gcylId("hyper_reactor.ii"), GTUtility.getTierByVoltage(GCYLConfig.multis.hyperReactors.euGeneration[1]))); HYPER_REACTOR[2] = registerMetaTileEntity(++id, new MetaTileEntityHyperReactor(gcylId("hyper_reactor.iii"), GTUtility.getTierByVoltage(GCYLConfig.multis.hyperReactors.euGeneration[2]))); - PLASMA_CONDENSER = registerMetaTileEntity(++id, new MetaTileEntityPlasmaCondenser(gcylId("plasma_condenser"), false)); + PLASMA_CONDENSER = registerMetaTileEntity(++id, new MetaTileEntityPlasmaCondenser(gcylId("plasma_condenser"))); ADVANCED_MIXER = registerMetaTileEntity(++id, new MetaTileEntityAdvMixer(gcylId("large_mixer"))); diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityPlasmaCondenser.java b/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityPlasmaCondenser.java index 617f38a..b002e27 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityPlasmaCondenser.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityPlasmaCondenser.java @@ -1,14 +1,18 @@ package com.fulltrix.gcyl.machines.multi.simple; -import com.fulltrix.gcyl.api.multi.GCYLRecipeMapMultiblockController; +import com.fulltrix.gcyl.api.pattern.TraceabilityPredicates; import com.fulltrix.gcyl.blocks.metal.MetalCasing1; import com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps; -import gregicality.multiblocks.api.capability.impl.GCYMMultiblockRecipeLogic; +import gregicality.multiblocks.common.GCYMConfigHolder; +import gregicality.multiblocks.common.metatileentities.multiblockpart.MetaTileEntityTieredHatch; +import gregtech.api.capability.impl.MultiblockRecipeLogic; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.IMultiblockPart; +import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; +import gregtech.api.pattern.PatternMatchContext; import gregtech.client.renderer.ICubeRenderer; import gregtech.client.renderer.texture.Textures; import gregtech.common.blocks.BlockBoilerCasing; @@ -21,19 +25,28 @@ import javax.annotation.Nonnull; +import java.util.ArrayList; + import static com.fulltrix.gcyl.client.ClientHandler.HASTELLOY_N_CASING; import static com.fulltrix.gcyl.blocks.GCYLMetaBlocks.METAL_CASING_1; //TODO add tooltips and information -public class MetaTileEntityPlasmaCondenser extends GCYLRecipeMapMultiblockController { +public class MetaTileEntityPlasmaCondenser extends RecipeMapMultiblockController { + + private long maxVoltage; - public MetaTileEntityPlasmaCondenser(ResourceLocation metaTileEntityId, boolean isParallel) { - super(metaTileEntityId, GCYLRecipeMaps.PLASMA_CONDENSER_RECIPES, isParallel); - this.recipeMapWorkable = new GCYMMultiblockRecipeLogic(this); + public MetaTileEntityPlasmaCondenser(ResourceLocation metaTileEntityId) { + super(metaTileEntityId, GCYLRecipeMaps.PLASMA_CONDENSER_RECIPES); + this.recipeMapWorkable = new MultiblockRecipeLogic(this) { + @Override + public long getMaxVoltage() { + return GCYMConfigHolder.globalMultiblocks.enableTieredCasings ? maxVoltage : super.getMaxVoltage(); + } + }; } @Override public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) { - return new MetaTileEntityPlasmaCondenser(metaTileEntityId, this.isParallel()); + return new MetaTileEntityPlasmaCondenser(metaTileEntityId); } @Override @@ -50,10 +63,23 @@ protected BlockPattern createStructurePattern() { .where('P', states(MetaBlocks.BOILER_CASING.getState(BlockBoilerCasing.BoilerCasingType.TUNGSTENSTEEL_PIPE))) .where('A', air()) .where('#', any()) - .where('p', tieredCasing()) + .where('p', TraceabilityPredicates.tieredHatchPredicate()) .build(); } + @Override + protected void formStructure(PatternMatchContext context) { + super.formStructure(context); + int tier = context.getOrDefault("tiered_hatches", new ArrayList()).get(0).getTier() - 1; + this.maxVoltage = 32L << tier * 2; + } + + @Override + public void invalidateStructure() { + super.invalidateStructure(); + this.maxVoltage = 0; + } + private IBlockState getCasingState() { return METAL_CASING_1.getState(MetalCasing1.CasingType.HASTELLOY_N); } From f4953f7af61ea2bc13b6689127bacfd3b7fce41b Mon Sep 17 00:00:00 2001 From: Johny709 <86203059+Johny709@users.noreply.github.com> Date: Tue, 23 Dec 2025 18:25:26 -0500 Subject: [PATCH 05/22] Fix Cosmic Ray Detector voltage casings --- .../GCYLRecipeMapMultiblockController.java | 6 ++++ .../multi/MetaTileEntityBioReactor.java | 10 +++--- .../MetaTileEntityCosmicRayDetector.java | 32 +++++++++++++++---- .../multi/MetaTileEntityStellarForge.java | 10 +++--- .../simple/MetaTileEntityPlasmaCondenser.java | 10 +++--- 5 files changed, 46 insertions(+), 22 deletions(-) diff --git a/src/main/java/com/fulltrix/gcyl/api/multi/GCYLRecipeMapMultiblockController.java b/src/main/java/com/fulltrix/gcyl/api/multi/GCYLRecipeMapMultiblockController.java index a8e7d35..8e8263a 100644 --- a/src/main/java/com/fulltrix/gcyl/api/multi/GCYLRecipeMapMultiblockController.java +++ b/src/main/java/com/fulltrix/gcyl/api/multi/GCYLRecipeMapMultiblockController.java @@ -3,6 +3,7 @@ import gregicality.multiblocks.api.capability.impl.GCYMMultiblockRecipeLogic; import gregicality.multiblocks.api.metatileentity.GCYMMultiblockAbility; import gregicality.multiblocks.api.metatileentity.GCYMRecipeMapMultiblockController; +import gregtech.api.metatileentity.multiblock.ui.MultiblockUIBuilder; import gregtech.api.pattern.TraceabilityPredicate; import gregtech.api.recipes.RecipeMap; import net.minecraft.util.ResourceLocation; @@ -23,6 +24,11 @@ public GCYLRecipeMapMultiblockController(ResourceLocation metaTileEntityId, Reci this.isParallel = isParallel; } + @Override + protected void configureDisplayText(MultiblockUIBuilder builder) { + super.configureDisplayText(builder); + builder.addRecipeOutputLine(this.recipeMapWorkable).addEmptyLine(); + } @Override public boolean isTiered() { return true; } diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityBioReactor.java b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityBioReactor.java index 3375df9..1249433 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityBioReactor.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityBioReactor.java @@ -1,5 +1,7 @@ package com.fulltrix.gcyl.machines.multi; +import com.fulltrix.gcyl.api.multi.GCYLMultiblockRecipeLogic; +import com.fulltrix.gcyl.api.multi.GCYLRecipeMapMultiblockController; import com.fulltrix.gcyl.api.pattern.TraceabilityPredicates; import com.fulltrix.gcyl.client.ClientHandler; import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; @@ -7,11 +9,9 @@ import com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps; import gregicality.multiblocks.common.GCYMConfigHolder; import gregicality.multiblocks.common.metatileentities.multiblockpart.MetaTileEntityTieredHatch; -import gregtech.api.capability.impl.MultiblockRecipeLogic; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.IMultiblockPart; -import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; import gregtech.api.pattern.PatternMatchContext; @@ -25,13 +25,13 @@ import javax.annotation.Nonnull; import java.util.ArrayList; -public class MetaTileEntityBioReactor extends RecipeMapMultiblockController { +public class MetaTileEntityBioReactor extends GCYLRecipeMapMultiblockController { private long maxVoltage; public MetaTileEntityBioReactor(ResourceLocation metaTileEntityId) { - super(metaTileEntityId, GCYLRecipeMaps.BIO_REACTOR_RECIPES); - this.recipeMapWorkable = new MultiblockRecipeLogic(this) { + super(metaTileEntityId, GCYLRecipeMaps.BIO_REACTOR_RECIPES, false); + this.recipeMapWorkable = new GCYLMultiblockRecipeLogic(this, false) { @Override public long getMaxVoltage() { return GCYMConfigHolder.globalMultiblocks.enableTieredCasings ? maxVoltage : super.getMaxVoltage(); diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityCosmicRayDetector.java b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityCosmicRayDetector.java index ac6dabd..6186c34 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityCosmicRayDetector.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityCosmicRayDetector.java @@ -2,10 +2,13 @@ import com.fulltrix.gcyl.api.multi.GCYLComputationRecipeLogic; import com.fulltrix.gcyl.api.multi.GCYLRecipeMapMultiblockController; +import com.fulltrix.gcyl.api.pattern.TraceabilityPredicates; import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; import com.fulltrix.gcyl.blocks.fusion.GCYLFusionCoils; import com.fulltrix.gcyl.client.ClientHandler; import com.fulltrix.gcyl.blocks.metal.MetalCasing2; +import gregicality.multiblocks.common.GCYMConfigHolder; +import gregicality.multiblocks.common.metatileentities.multiblockpart.MetaTileEntityTieredHatch; import gregtech.api.capability.*; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; @@ -34,6 +37,7 @@ import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; +import java.util.ArrayList; import java.util.List; import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.COSMIC_RAY_DETECTOR_RECIPES; @@ -42,10 +46,18 @@ import static com.fulltrix.gcyl.blocks.GCYLMetaBlocks.METAL_CASING_2; public class MetaTileEntityCosmicRayDetector extends GCYLRecipeMapMultiblockController implements IOpticalComputationReceiver { + private IOpticalComputationProvider computationProvider; + private long maxVoltage; + public MetaTileEntityCosmicRayDetector(ResourceLocation metaTileEntityId) { super(metaTileEntityId, COSMIC_RAY_DETECTOR_RECIPES, false); - this.recipeMapWorkable = new CosmicRayRecipeLogic(this); + this.recipeMapWorkable = new CosmicRayRecipeLogic(this) { + @Override + public long getMaxVoltage() { + return GCYMConfigHolder.globalMultiblocks.enableTieredCasings ? maxVoltage : super.getMaxVoltage(); + } + }; } private boolean canSeeSky() { @@ -65,9 +77,9 @@ protected BlockPattern createStructurePattern() { .aisle("######XXX######", "######XXX######", "######XXX######", "###############", "###############", "#######X#######", "#####xxxxx#####", "###xx#####xx###", "##x#########x##", "###############") .aisle("#####XXXXX#####", "#####X###X#####", "#####X###X#####", "######XXX######", "######XXX######", "#####XXXXX#####", "####xxxxxxx####", "##xx#######xx##", "#x###########x#", "###############") .aisle("####XXXXXXX####", "####X#####X####", "####X#####X####", "#####X###X#####", "#####X###X#####", "####XXxxxXX####", "###xxx###xxx###", "##x#########x##", "#x###########x#", "###############") - .aisle("###XXXXXXXXX###", "###X###E###X###", "###X#######X###", "####X#####X####", "####X##F##X####", "####XxxxxxX####", "###xx#####xx###", "#xx#########xx#", "x#############x", "###############") - .aisle("###XXXXXXXXX###", "###X##EcE##X###", "###X###c###X###", "####X##c##X####", "####X#FcF#X####", "###XXxxExxXX###", "##xxx##C##xxx##", "#x#####C#####x#", "x######C######x", "#######s#######") - .aisle("###XXXXXXXXX###", "###X###E###X###", "###X#######X###", "####X#####X####", "####X##F##X####", "####XxxxxxX####", "###xx#####xx###", "#xx#########xx#", "x#############x", "###############") + .aisle("###XXXXXXXXX###", "###X###E###X###", "###X#######X###", "####X#####X####", "####X##E##X####", "####XxxxxxX####", "###xx#####xx###", "#xx#########xx#", "x#############x", "###############") + .aisle("###XXXXXXXXX###", "###X##EcE##X###", "###X###c###X###", "####X##c##X####", "####X#EcE#X####", "###XXxxExxXX###", "##xxx##C##xxx##", "#x#####C#####x#", "x######C######x", "#######s#######") + .aisle("###XXXXXXXXX###", "###X###E###X###", "###X#######X###", "####X#####X####", "####X##E##X####", "####XxxxxxX####", "###xx#####xx###", "#xx#########xx#", "x#############x", "###############") .aisle("####XXXXXXX####", "####X#####X####", "####X#####X####", "#####X###X#####", "#####X###X#####", "####XXxxxXX####", "###xxx###xxx###", "##x#########x##", "#x###########x#", "###############") .aisle("#####XXXXX#####", "#####X###X#####", "#####X###X#####", "######XXX######", "######XXX######", "#####XXXXX#####", "####xxxxxxx####", "##xx#######xx##", "#x###########x#", "###############") .aisle("######XXX######", "######XSX######", "######XXX######", "###############", "###############", "#######X#######", "#####xxxxx#####", "###xx#####xx###", "##x#########x##", "###############") @@ -79,8 +91,7 @@ protected BlockPattern createStructurePattern() { .where('x', states(getSecondaryCasingState())) .where('C', frames(BlackTitanium)) .where('c', states(GCYLMetaBlocks.FUSION_COILS.getState(GCYLFusionCoils.CasingType.ADV_FUSION_COIL_3))) - .where('F', tieredCasing()) - .where('E', tieredCasing()) + .where('E', TraceabilityPredicates.tieredHatchPredicate()) .where('s', states(GCYLMetaBlocks.FUSION_COILS.getState(GCYLFusionCoils.CasingType.ADV_FUSION_COIL_3))) .where('#', any()) .build(); @@ -89,6 +100,8 @@ protected BlockPattern createStructurePattern() { @Override protected void formStructure(PatternMatchContext context) { super.formStructure(context); + int tier = context.getOrDefault("tiered_hatches", new ArrayList()).get(0).getTier() - 1; + this.maxVoltage = 32L << tier * 2; List providers = getAbilities(MultiblockAbility.COMPUTATION_DATA_RECEPTION); if (providers != null && providers.size() >= 1) { computationProvider = providers.get(0); @@ -99,12 +112,17 @@ protected void formStructure(PatternMatchContext context) { } } + @Override + public void invalidateStructure() { + super.invalidateStructure(); + this.maxVoltage = 0; + } + @Override protected void configureDisplayText(MultiblockUIBuilder builder) { super.configureDisplayText(builder); CosmicRayRecipeLogic recipeLogic = (CosmicRayRecipeLogic)this.recipeMapWorkable; builder.addComputationUsageLine(recipeLogic.getRecipeCWUt()) - .addRecipeOutputLine(recipeLogic) .addCustom((keyManager, uiSyncer) -> { if (!uiSyncer.syncBoolean(canSeeSky())) { keyManager.add(KeyUtil.lang(TextFormatting.RED, "gcyl.multiblock.cosmic_ray_detector.tooltip.1")); diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityStellarForge.java b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityStellarForge.java index c1e47f0..97c3814 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityStellarForge.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityStellarForge.java @@ -1,5 +1,7 @@ package com.fulltrix.gcyl.machines.multi; +import com.fulltrix.gcyl.api.multi.GCYLMultiblockRecipeLogic; +import com.fulltrix.gcyl.api.multi.GCYLRecipeMapMultiblockController; import com.fulltrix.gcyl.api.pattern.TraceabilityPredicates; import com.fulltrix.gcyl.client.ClientHandler; import com.fulltrix.gcyl.blocks.GCYLMultiblockCasing2; @@ -7,11 +9,9 @@ import com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps; import gregicality.multiblocks.common.GCYMConfigHolder; import gregicality.multiblocks.common.metatileentities.multiblockpart.MetaTileEntityTieredHatch; -import gregtech.api.capability.impl.MultiblockRecipeLogic; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.IMultiblockPart; -import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; import gregtech.api.pattern.PatternMatchContext; @@ -28,13 +28,13 @@ import static com.fulltrix.gcyl.blocks.GCYLMetaBlocks.METAL_CASING_2; import static com.fulltrix.gcyl.blocks.GCYLMetaBlocks.MULTIBLOCK_CASING2; -public class MetaTileEntityStellarForge extends RecipeMapMultiblockController { +public class MetaTileEntityStellarForge extends GCYLRecipeMapMultiblockController { private long maxVoltage; public MetaTileEntityStellarForge(ResourceLocation metaTileEntityId) { - super(metaTileEntityId, GCYLRecipeMaps.STELLAR_FORGE_RECIPES); - this.recipeMapWorkable = new MultiblockRecipeLogic(this) { + super(metaTileEntityId, GCYLRecipeMaps.STELLAR_FORGE_RECIPES, false); + this.recipeMapWorkable = new GCYLMultiblockRecipeLogic(this, false) { @Override public long getMaxVoltage() { return GCYMConfigHolder.globalMultiblocks.enableTieredCasings ? maxVoltage : super.getMaxVoltage(); diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityPlasmaCondenser.java b/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityPlasmaCondenser.java index b002e27..b684dc4 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityPlasmaCondenser.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityPlasmaCondenser.java @@ -1,15 +1,15 @@ package com.fulltrix.gcyl.machines.multi.simple; +import com.fulltrix.gcyl.api.multi.GCYLMultiblockRecipeLogic; +import com.fulltrix.gcyl.api.multi.GCYLRecipeMapMultiblockController; import com.fulltrix.gcyl.api.pattern.TraceabilityPredicates; import com.fulltrix.gcyl.blocks.metal.MetalCasing1; import com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps; import gregicality.multiblocks.common.GCYMConfigHolder; import gregicality.multiblocks.common.metatileentities.multiblockpart.MetaTileEntityTieredHatch; -import gregtech.api.capability.impl.MultiblockRecipeLogic; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.IMultiblockPart; -import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; import gregtech.api.pattern.PatternMatchContext; @@ -30,13 +30,13 @@ import static com.fulltrix.gcyl.client.ClientHandler.HASTELLOY_N_CASING; import static com.fulltrix.gcyl.blocks.GCYLMetaBlocks.METAL_CASING_1; //TODO add tooltips and information -public class MetaTileEntityPlasmaCondenser extends RecipeMapMultiblockController { +public class MetaTileEntityPlasmaCondenser extends GCYLRecipeMapMultiblockController { private long maxVoltage; public MetaTileEntityPlasmaCondenser(ResourceLocation metaTileEntityId) { - super(metaTileEntityId, GCYLRecipeMaps.PLASMA_CONDENSER_RECIPES); - this.recipeMapWorkable = new MultiblockRecipeLogic(this) { + super(metaTileEntityId, GCYLRecipeMaps.PLASMA_CONDENSER_RECIPES, false); + this.recipeMapWorkable = new GCYLMultiblockRecipeLogic(this, false) { @Override public long getMaxVoltage() { return GCYMConfigHolder.globalMultiblocks.enableTieredCasings ? maxVoltage : super.getMaxVoltage(); From b482b7c3ffc8bfaf93efd8587274d9894cee4537 Mon Sep 17 00:00:00 2001 From: Johny709 <86203059+Johny709@users.noreply.github.com> Date: Tue, 23 Dec 2025 20:23:57 -0500 Subject: [PATCH 06/22] Fix Chemical Plant and add coil bonus --- .../simple/MetaTileEntityChemicalPlant.java | 100 +++++++++++++++++- .../resources/assets/gcyl/lang/en_us.lang | 1 + 2 files changed, 97 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityChemicalPlant.java b/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityChemicalPlant.java index e16a9ec..bfca7b8 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityChemicalPlant.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityChemicalPlant.java @@ -1,37 +1,72 @@ package com.fulltrix.gcyl.machines.multi.simple; +import com.cleanroommc.modularui.api.drawable.IKey; import com.fulltrix.gcyl.api.multi.GCYLMultiblockRecipeLogic; import com.fulltrix.gcyl.api.multi.GCYLRecipeMapMultiblockController; +import com.fulltrix.gcyl.api.pattern.TraceabilityPredicates; import com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps; +import gregicality.multiblocks.common.GCYMConfigHolder; +import gregicality.multiblocks.common.metatileentities.multiblockpart.MetaTileEntityTieredHatch; +import gregtech.api.block.IHeatingCoilBlockStats; import gregtech.api.capability.IHeatingCoil; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.IMultiblockPart; +import gregtech.api.metatileentity.multiblock.ui.MultiblockUIBuilder; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; +import gregtech.api.pattern.PatternMatchContext; import gregtech.api.recipes.RecipeMap; import gregtech.api.recipes.RecipeMaps; +import gregtech.api.recipes.logic.OCResult; +import gregtech.api.recipes.properties.RecipePropertyStorage; +import gregtech.api.util.KeyUtil; import gregtech.client.renderer.ICubeRenderer; import gregtech.client.renderer.texture.Textures; import gregtech.common.blocks.BlockBoilerCasing; import gregtech.common.blocks.BlockMetalCasing; +import gregtech.common.blocks.BlockWireCoil; import gregtech.common.blocks.MetaBlocks; import net.minecraft.block.state.IBlockState; +import net.minecraft.client.resources.I18n; +import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.List; -//TODO implement coil bonus //TODO make a separate mega chemical reactor so this one isnt so broken -//TODO add tooltips and information public class MetaTileEntityChemicalPlant extends GCYLRecipeMapMultiblockController implements IHeatingCoil { + private long maxVoltage; private int temperature; + private int tier; public MetaTileEntityChemicalPlant(ResourceLocation metaTileEntityId, boolean isParallel) { super(metaTileEntityId, new RecipeMap[] { GCYLRecipeMaps.CHEMICAL_PLANT_RECIPES, RecipeMaps.LARGE_CHEMICAL_RECIPES }, isParallel); - this.recipeMapWorkable = new GCYLMultiblockRecipeLogic(this, true); + this.recipeMapWorkable = new GCYLMultiblockRecipeLogic(this, true) { + @Override + public long getMaxVoltage() { + return GCYMConfigHolder.globalMultiblocks.enableTieredCasings ? maxVoltage : super.getMaxVoltage(); + } + + @Override + protected void modifyOverclockPost(@NotNull OCResult ocResult, @NotNull RecipePropertyStorage storage) { + super.modifyOverclockPost(ocResult, storage); + int coilTier = ((MetaTileEntityChemicalPlant) metaTileEntity).getCoilTier(); + if (coilTier <= 0) + return; + + // each coil above cupronickel (coilTier = 0) uses 5% less energy + ocResult.setEut(Math.max(1, (long) (ocResult.eut() * (1.0 - coilTier * 0.05)))); + } + }; } @Override @@ -39,6 +74,15 @@ public MetaTileEntity createMetaTileEntity(IGregTechTileEntity iGregTechTileEnti return new MetaTileEntityChemicalPlant(metaTileEntityId, this.isParallel()); } + @Override + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, @Nullable World player, List tooltip, boolean advanced) { + super.addInformation(stack, player, tooltip, advanced); + tooltip.add(I18n.format("gcyl.multiblock.chemical_plant.description")); + tooltip.add(I18n.format("gcyl.multiblock.chemical_plant.tooltip.1")); + tooltip.add(I18n.format("gcyl.multiblock.chemical_plant.tooltip.2")); + } + @Override protected @NotNull BlockPattern createStructurePattern() { return FactoryBlockPattern.start() @@ -52,10 +96,49 @@ public MetaTileEntity createMetaTileEntity(IGregTechTileEntity iGregTechTileEnti .where('C', heatingCoils()) .where('P', states(MetaBlocks.BOILER_CASING.getState(BlockBoilerCasing.BoilerCasingType.POLYTETRAFLUOROETHYLENE_PIPE))) .where('#', air()) - .where('M', tieredCasing()) + .where('M', TraceabilityPredicates.tieredHatchPredicate()) .build(); } + @Override + protected void formStructure(PatternMatchContext context) { + super.formStructure(context); + IHeatingCoilBlockStats coilType = context.getOrDefault("CoilType", BlockWireCoil.CoilType.CUPRONICKEL); + int tier = context.getOrDefault("tiered_hatches", new ArrayList()).get(0).getTier() - 1; + this.maxVoltage = 32L << tier * 2; + this.temperature = coilType.getCoilTemperature(); + this.tier = coilType.getTier(); + } + + @Override + public void invalidateStructure() { + super.invalidateStructure(); + this.maxVoltage = 0; + this.temperature = 0; + this.tier = 0; + } + + @Override + protected void configureDisplayText(MultiblockUIBuilder builder) { + super.configureDisplayText(builder); + builder.addCustom((textList, syncer) -> { + if (!isStructureFormed()) return; + + // Coil energy discount line + IKey energyDiscount = KeyUtil.number(TextFormatting.AQUA, + syncer.syncLong(100 - 5L * getCoilTier()), "%"); + + IKey base = KeyUtil.lang(TextFormatting.GRAY, + "gregtech.multiblock.cracking_unit.energy", + energyDiscount); + + IKey hover = KeyUtil.lang(TextFormatting.GRAY, + "gregtech.multiblock.cracking_unit.energy_hover"); + + textList.add(KeyUtil.setHover(base, hover)); + }); + } + public int getCurrentTemperature() {return this.temperature;} @Override @@ -73,4 +156,13 @@ public IBlockState getCasingState() { protected ICubeRenderer getFrontOverlay() { return Textures.LARGE_CHEMICAL_REACTOR_OVERLAY; } + + public int getCoilTier() { + return this.tier; + } + + @Override + public int getMaxParallel() { + return this.getCurrentRecipeMap() == GCYLRecipeMaps.CHEMICAL_PLANT_RECIPES ? 1 : super.getMaxParallel(); + } } diff --git a/src/main/resources/assets/gcyl/lang/en_us.lang b/src/main/resources/assets/gcyl/lang/en_us.lang index f7afb80..436a53e 100644 --- a/src/main/resources/assets/gcyl/lang/en_us.lang +++ b/src/main/resources/assets/gcyl/lang/en_us.lang @@ -3233,6 +3233,7 @@ gcyl.multiblock.mega_blast_logic.tooltip.1=EU/t Usage: §eParallel Amount * Reci gcyl.multiblock.mega_blast_logic.tooltip.2=Prioritizes Parallel Recipes over Heating Coil Bonuses. gcyl.multiblock.chemical_plant.tooltip.1=Does not run in parallel when running chemical plant recipes. +gcyl.multiblock.chemical_plant.tooltip.2=Every coil after §6Cupronickel reduces energy usage by §f5%%§7. gcyl.multiblock.preview.left_or_right=Can only be placed in the second layer, on the left or right sides, excluding the front and back faces gcyl.multiblock.preview.rear_output=Can only be placed in the second layer in the center of the back face From 79be57f9e4feb8a4a5460ddfb1f2ebe390311bd5 Mon Sep 17 00:00:00 2001 From: Johny709 <86203059+Johny709@users.noreply.github.com> Date: Tue, 23 Dec 2025 20:39:45 -0500 Subject: [PATCH 07/22] Turn on distinct mode --- .../gcyl/api/multi/GCYLRecipeMapMultiblockController.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/fulltrix/gcyl/api/multi/GCYLRecipeMapMultiblockController.java b/src/main/java/com/fulltrix/gcyl/api/multi/GCYLRecipeMapMultiblockController.java index 8e8263a..f4aea2f 100644 --- a/src/main/java/com/fulltrix/gcyl/api/multi/GCYLRecipeMapMultiblockController.java +++ b/src/main/java/com/fulltrix/gcyl/api/multi/GCYLRecipeMapMultiblockController.java @@ -30,6 +30,11 @@ protected void configureDisplayText(MultiblockUIBuilder builder) { builder.addRecipeOutputLine(this.recipeMapWorkable).addEmptyLine(); } + @Override + public boolean canBeDistinct() { + return true; + } + @Override public boolean isTiered() { return true; } From 9ca36d01850ac4e37600569ba9461618138492d4 Mon Sep 17 00:00:00 2001 From: Johny709 <86203059+Johny709@users.noreply.github.com> Date: Tue, 23 Dec 2025 21:10:07 -0500 Subject: [PATCH 08/22] Add tooltips --- .../machines/multi/MetaTileEntityBioReactor.java | 14 ++++++++++++++ .../multi/MetaTileEntityCosmicRayDetector.java | 1 + .../multi/MetaTileEntityElectricImplosion.java | 15 +++++++++++++++ .../multi/MetaTileEntityStellarForge.java | 14 ++++++++++++++ .../simple/MetaTileEntityPlasmaCondenser.java | 14 +++++++++++++- 5 files changed, 57 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityBioReactor.java b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityBioReactor.java index 1249433..90f9347 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityBioReactor.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityBioReactor.java @@ -20,10 +20,17 @@ import gregtech.common.blocks.BlockGlassCasing; import gregtech.common.blocks.MetaBlocks; import net.minecraft.block.state.IBlockState; +import net.minecraft.client.resources.I18n; +import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import org.jetbrains.annotations.Nullable; import javax.annotation.Nonnull; import java.util.ArrayList; +import java.util.List; public class MetaTileEntityBioReactor extends GCYLRecipeMapMultiblockController { @@ -39,6 +46,13 @@ public long getMaxVoltage() { }; } + @Override + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, @Nullable World player, List tooltip, boolean advanced) { + super.addInformation(stack, player, tooltip, advanced); + tooltip.add(I18n.format("gcyl.multiblock.bio_reactor.description")); + } + @Override public MetaTileEntity createMetaTileEntity(IGregTechTileEntity iGregTechTileEntity) { return new MetaTileEntityBioReactor(metaTileEntityId); diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityCosmicRayDetector.java b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityCosmicRayDetector.java index 6186c34..6cc4218 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityCosmicRayDetector.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityCosmicRayDetector.java @@ -134,6 +134,7 @@ protected void configureDisplayText(MultiblockUIBuilder builder) { @Override public void addInformation(ItemStack stack, @Nullable World player, List tooltip, boolean advanced) { super.addInformation(stack, player, tooltip, advanced); + tooltip.add(I18n.format("gcyl.multiblock.cosmic_ray_detector.description")); tooltip.add(I18n.format("gcyl.multiblock.cosmic_ray_detector.tooltip.2")); tooltip.add(I18n.format("gcyl.multiblock.cosmic_ray_detector.tooltip.3")); tooltip.add(I18n.format("gcyl.multiblock.cosmic_ray_detector.tooltip.4")); diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityElectricImplosion.java b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityElectricImplosion.java index 9c017d3..8fcfd25 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityElectricImplosion.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityElectricImplosion.java @@ -15,10 +15,18 @@ import gregtech.common.blocks.BlockMultiblockCasing; import gregtech.common.blocks.MetaBlocks; import net.minecraft.block.state.IBlockState; +import net.minecraft.client.resources.I18n; +import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import org.jetbrains.annotations.Nullable; import javax.annotation.Nonnull; +import java.util.List; + import static gregtech.api.metatileentity.multiblock.MultiblockAbility.MUFFLER_HATCH; public class MetaTileEntityElectricImplosion extends GCYLRecipeMapMultiblockController { @@ -32,6 +40,13 @@ public MetaTileEntity createMetaTileEntity(IGregTechTileEntity metaTileEntityHol return new MetaTileEntityElectricImplosion(metaTileEntityId); } + @Override + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, @Nullable World player, List tooltip, boolean advanced) { + super.addInformation(stack, player, tooltip, advanced); + tooltip.add(I18n.format("gcyl.multiblock.electric_implosion.description")); + } + @Override protected BlockPattern createStructurePattern() { return FactoryBlockPattern.start() diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityStellarForge.java b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityStellarForge.java index 97c3814..b4cc3e3 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityStellarForge.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityStellarForge.java @@ -18,10 +18,17 @@ import gregtech.client.renderer.ICubeRenderer; import gregtech.client.renderer.texture.cube.OrientedOverlayRenderer; import net.minecraft.block.state.IBlockState; +import net.minecraft.client.resources.I18n; +import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import org.jetbrains.annotations.Nullable; import javax.annotation.Nonnull; import java.util.ArrayList; +import java.util.List; import static com.fulltrix.gcyl.api.pattern.TraceabilityPredicates.advFusionCoils; import static com.fulltrix.gcyl.client.ClientHandler.ENRICHED_NAQUADAH_ALLOY_CASING; @@ -42,6 +49,13 @@ public long getMaxVoltage() { }; } + @Override + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, @Nullable World player, List tooltip, boolean advanced) { + super.addInformation(stack, player, tooltip, advanced); + tooltip.add(I18n.format("gcyl.multiblock.stellar_forge.description")); + } + @Override protected BlockPattern createStructurePattern() { return FactoryBlockPattern.start() diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityPlasmaCondenser.java b/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityPlasmaCondenser.java index b684dc4..dc357a4 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityPlasmaCondenser.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityPlasmaCondenser.java @@ -19,17 +19,22 @@ import gregtech.common.blocks.BlockTurbineCasing; import gregtech.common.blocks.MetaBlocks; import net.minecraft.block.state.IBlockState; +import net.minecraft.client.resources.I18n; +import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import org.jetbrains.annotations.Nullable; import javax.annotation.Nonnull; import java.util.ArrayList; +import java.util.List; import static com.fulltrix.gcyl.client.ClientHandler.HASTELLOY_N_CASING; import static com.fulltrix.gcyl.blocks.GCYLMetaBlocks.METAL_CASING_1; -//TODO add tooltips and information + public class MetaTileEntityPlasmaCondenser extends GCYLRecipeMapMultiblockController { private long maxVoltage; @@ -49,6 +54,13 @@ public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) { return new MetaTileEntityPlasmaCondenser(metaTileEntityId); } + @Override + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, @Nullable World player, List tooltip, boolean advanced) { + super.addInformation(stack, player, tooltip, advanced); + tooltip.add(I18n.format("gcyl.multiblock.plasma_condenser.description")); + } + @Override protected BlockPattern createStructurePattern() { return FactoryBlockPattern.start() From a2820fa2384ad322f27f81d0bb3a3ee3e3be5ea4 Mon Sep 17 00:00:00 2001 From: Johny709 <86203059+Johny709@users.noreply.github.com> Date: Wed, 24 Dec 2025 07:26:39 -0500 Subject: [PATCH 09/22] Fix Deep Miner and implement voltage casings, and breaking blocks to bedrock. --- .../GCYLRecipeMapMultiblockController.java | 45 +++++ .../multi/miner/MetaTileEntityDeepMiner.java | 174 ++++++++++++++---- .../resources/assets/gcyl/lang/en_us.lang | 11 +- 3 files changed, 191 insertions(+), 39 deletions(-) diff --git a/src/main/java/com/fulltrix/gcyl/api/multi/GCYLRecipeMapMultiblockController.java b/src/main/java/com/fulltrix/gcyl/api/multi/GCYLRecipeMapMultiblockController.java index f4aea2f..5744ebb 100644 --- a/src/main/java/com/fulltrix/gcyl/api/multi/GCYLRecipeMapMultiblockController.java +++ b/src/main/java/com/fulltrix/gcyl/api/multi/GCYLRecipeMapMultiblockController.java @@ -1,12 +1,20 @@ package com.fulltrix.gcyl.api.multi; +import com.cleanroommc.modularui.api.drawable.IKey; +import com.cleanroommc.modularui.screen.RichTooltip; +import com.cleanroommc.modularui.value.sync.StringSyncValue; import gregicality.multiblocks.api.capability.impl.GCYMMultiblockRecipeLogic; import gregicality.multiblocks.api.metatileentity.GCYMMultiblockAbility; import gregicality.multiblocks.api.metatileentity.GCYMRecipeMapMultiblockController; +import gregtech.api.capability.IMultipleTankHandler; import gregtech.api.metatileentity.multiblock.ui.MultiblockUIBuilder; +import gregtech.api.mui.sync.FixedIntArraySyncValue; import gregtech.api.pattern.TraceabilityPredicate; import gregtech.api.recipes.RecipeMap; import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; import org.jetbrains.annotations.NotNull; public abstract class GCYLRecipeMapMultiblockController extends GCYMRecipeMapMultiblockController { @@ -30,6 +38,43 @@ protected void configureDisplayText(MultiblockUIBuilder builder) { builder.addRecipeOutputLine(this.recipeMapWorkable).addEmptyLine(); } + protected int[] getTotalFluidAmount(FluidStack testStack, IMultipleTankHandler multiTank) { + int fluidAmount = 0; + int fluidCapacity = 0; + for (var tank : multiTank) { + if (tank != null) { + FluidStack drainStack = tank.drain(testStack, false); + if (drainStack != null && drainStack.amount > 0) { + fluidAmount += drainStack.amount; + fluidCapacity += tank.getCapacity(); + } + } + } + return new int[] { fluidAmount, fluidCapacity }; + } + + /** + * @param tooltip the tooltip to populate + * @param amounts the sync value containing an array of [fuel stored, fuel capacity] + * @param fuelNameValue the name of the fuel + */ + protected void createFuelTooltip(@NotNull RichTooltip tooltip, @NotNull FixedIntArraySyncValue amounts, + @NotNull StringSyncValue fuelNameValue) { + if (isStructureFormed()) { + Fluid fluid = fuelNameValue.getStringValue() == null ? null : + FluidRegistry.getFluid(fuelNameValue.getStringValue()); + if (fluid == null) { + tooltip.addLine(IKey.lang("gregtech.multiblock.large_combustion_engine.fuel_none")); + } else { + tooltip.addLine( + IKey.lang("gregtech.multiblock.large_combustion_engine.fuel_amount", amounts.getValue(0), + amounts.getValue(1), fluid.getLocalizedName(new FluidStack(fluid, 1)))); + } + } else { + tooltip.addLine(IKey.lang("gregtech.multiblock.invalid_structure")); + } + } + @Override public boolean canBeDistinct() { return true; diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/miner/MetaTileEntityDeepMiner.java b/src/main/java/com/fulltrix/gcyl/machines/multi/miner/MetaTileEntityDeepMiner.java index a3b350d..c7aa157 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/miner/MetaTileEntityDeepMiner.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/miner/MetaTileEntityDeepMiner.java @@ -1,11 +1,16 @@ package com.fulltrix.gcyl.machines.multi.miner; import codechicken.lib.raytracer.CuboidRayTraceResult; +import com.cleanroommc.modularui.value.sync.PanelSyncManager; +import com.cleanroommc.modularui.value.sync.StringSyncValue; +import com.fulltrix.gcyl.api.pattern.TraceabilityPredicates; import com.fulltrix.gcyl.client.ClientHandler; import com.fulltrix.gcyl.materials.GCYLMaterials; import com.fulltrix.gcyl.api.multi.GCYLRecipeMapMultiblockController; import com.fulltrix.gcyl.api.recipes.properties.GCYLTemperatureProperty; import gregicality.multiblocks.api.capability.impl.GCYMMultiblockRecipeLogic; +import gregicality.multiblocks.common.GCYMConfigHolder; +import gregicality.multiblocks.common.metatileentities.multiblockpart.MetaTileEntityTieredHatch; import gregtech.api.block.IHeatingCoilBlockStats; import gregtech.api.capability.IHeatingCoil; import gregtech.api.capability.IMultipleTankHandler; @@ -14,7 +19,11 @@ import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.IMultiblockPart; import gregtech.api.metatileentity.multiblock.MultiblockAbility; +import gregtech.api.metatileentity.multiblock.ProgressBarMultiblock; import gregtech.api.metatileentity.multiblock.ui.MultiblockUIBuilder; +import gregtech.api.metatileentity.multiblock.ui.TemplateBarBuilder; +import gregtech.api.mui.GTGuiTextures; +import gregtech.api.mui.sync.FixedIntArraySyncValue; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; import gregtech.api.pattern.PatternMatchContext; @@ -24,6 +33,7 @@ import gregtech.api.recipes.logic.OCParams; import gregtech.api.recipes.properties.RecipePropertyStorage; import gregtech.api.unification.material.Materials; +import gregtech.api.util.GTTransferUtils; import gregtech.api.util.GTUtility; import gregtech.api.util.KeyUtil; import gregtech.client.renderer.ICubeRenderer; @@ -31,37 +41,48 @@ import gregtech.common.blocks.BlockMetalCasing; import gregtech.common.blocks.BlockWireCoil; import gregtech.common.blocks.MetaBlocks; +import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagInt; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; +import net.minecraft.util.NonNullList; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.TextComponentTranslation; +import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidBlock; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; +import java.util.ArrayList; import java.util.List; +import java.util.function.UnaryOperator; //TODO add fram and casing requirements to use helium and neutron plasma (traceability predicate stuff) -//TODO implement breaking a blocks to bedrock -public class MetaTileEntityDeepMiner extends GCYLRecipeMapMultiblockController implements IHeatingCoil { +public class MetaTileEntityDeepMiner extends GCYLRecipeMapMultiblockController implements IHeatingCoil, ProgressBarMultiblock { protected final MetaTileEntity metaTileEntity; private final float TEMPERATURE_DURATION_MULTIPLIER = 1.11F; private final float TEMPERATURE_DURATION_MULTIPLIER_INVERSE = 0.90F; + private final BlockPos.MutableBlockPos minerPos = new BlockPos.MutableBlockPos(); + private BlockPos offsetPos; + private boolean runRecipe; + private long maxVoltage; private int currentTemperature; private int maxTemperature; private int fluidType = 0; + public MetaTileEntityDeepMiner(ResourceLocation metaTileEntityId, RecipeMap recipeMap, boolean isParallel) { super(metaTileEntityId, recipeMap, isParallel); this.recipeMapWorkable = new MetaTileEntityDeepMiner.DeepMinerRecipeLogic(this); @@ -87,7 +108,7 @@ public MetaTileEntityDeepMiner(ResourceLocation metaTileEntityId, RecipeMap r .where('C', states(getCasingState()).setMinGlobalLimited(50).or(autoAbilities(true,true,true,true,true,true,false))) .where('S', selfPredicate()) .where('M', abilities(MultiblockAbility.MUFFLER_HATCH)) - .where('T', tieredCasing()) + .where('T', TraceabilityPredicates.tieredHatchPredicate()) .build(); } @@ -109,23 +130,30 @@ public void addInformation(ItemStack stack, @Nullable World player, List @Override protected void configureDisplayText(MultiblockUIBuilder builder) { - builder.structureFormed(this.isStructureFormed()) - .addMaintenanceProblemLines(this.maintenance_problems, this.hasMaintenanceProblems()) - .addCustom((keyManager, uiSyncer) -> { - int currentTemp = uiSyncer.syncInt(getCurrentTemperature()); - int maxTemp = uiSyncer.syncInt(getMaxTemperature()); - keyManager.add(KeyUtil.lang("gregtech.multiblock.universal.vom.temperature", currentTemp)); - keyManager.add(KeyUtil.lang("gregtech.multiblock.deep_miner.max.temperature", maxTemp)); - keyManager.add(KeyUtil.lang("gregtech.multiblock.deep_miner.max.fluid consumption", uiSyncer.syncBoolean(this.recipeMapWorkable.isActive()) && currentTemp == maxTemp ? getHeatingFluidActiveMax(getFluidType()).amount : getHeatingFluid(getFluidType()).amount)); + super.configureDisplayText(builder); + builder.addCustom((keyManager, uiSyncer) -> { + int currentTemp = uiSyncer.syncInt(getCurrentTemperature()); + int maxTemp = uiSyncer.syncInt(getMaxTemperature()); + int x = uiSyncer.syncInt(this.minerPos.getX()); + int y = uiSyncer.syncInt(this.minerPos.getY()); + int z = uiSyncer.syncInt(this.minerPos.getZ()); + boolean runRecipe = uiSyncer.syncBoolean(this.runRecipe); + keyManager.add(KeyUtil.lang(TextFormatting.GRAY, "gregtech.multiblock.universal.vom.temperature", currentTemp)); + keyManager.add(KeyUtil.lang(TextFormatting.GRAY, "gregtech.multiblock.deep_miner.max.temperature", maxTemp)); + keyManager.add(KeyUtil.lang(TextFormatting.GRAY, "gregtech.multiblock.deep_miner.max.fluid consumption", uiSyncer.syncBoolean(this.recipeMapWorkable.isActive()) && currentTemp == maxTemp ? getHeatingFluidActiveMax(getFluidType()).amount : getHeatingFluid(getFluidType()).amount)); + if (uiSyncer.syncBoolean(this.recipeMapWorkable.isActive())) + keyManager.add(runRecipe ? KeyUtil.lang(TextFormatting.GREEN, "gcyl.multiblock.deep_miner.clear") + : KeyUtil.lang("gregtech.multiblock.deep_miner_error", x, y, z)); }); - if(this.getPos().getY() > 8 && !this.getWorld().isRemote) - builder.addCustom((keyManager, uiSyncer) -> keyManager.add(KeyUtil.lang("gregtech.multiblock.deep_miner_error"))); } @Override protected void formStructure(PatternMatchContext context) { super.formStructure(context); + int tier = context.getOrDefault("tiered_hatches", new ArrayList()).get(0).getTier() - 1; + this.maxVoltage = 32L << tier * 2; + this.offsetPos = this.getPos().offset(this.getFrontFacing().getOpposite(), 2); Object type = context.get("CoilType"); if (type instanceof IHeatingCoilBlockStats) { this.maxTemperature = (int) (((IHeatingCoilBlockStats) type).getCoilTemperature() * getTemperatureModifierFromFluidType(getFluidType())); @@ -138,25 +166,19 @@ protected void formStructure(PatternMatchContext context) { protected void updateFormedValid() { super.updateFormedValid(); - if(this.recipeMapWorkable.isWorkingEnabled() && checkHeatingFluid() && getCurrentTemperature() <= getMaxTemperature()) { - if(getOffsetTimer() % 20 == 0) { - if(getCurrentTemperature() < getMaxTemperature()) { + if (this.recipeMapWorkable.isWorkingEnabled() && checkHeatingFluid() && getCurrentTemperature() <= getMaxTemperature()) { + if (getOffsetTimer() % 20 == 0) { + if (getCurrentTemperature() < getMaxTemperature()) { drainHeatingFluid(); increaseTemperature(); - } - else if(getCurrentTemperature() == getMaxTemperature() && this.recipeMapWorkable.isActive()) { + } else if (getCurrentTemperature() == getMaxTemperature() && this.recipeMapWorkable.isActive()) { drainHeatingFluidActiveMax(); + } else if (!this.isActive()) { + decreaseTemperature(); } - else { - if(!this.isActive()) - decreaseTemperature(); - } - } - } - else { - if (getOffsetTimer() % 20 == 0 && getCurrentTemperature() != 0 && !this.recipeMapWorkable.isActive()) { - decreaseTemperature(); } + } else if (getOffsetTimer() % 20 == 0 && getCurrentTemperature() != 0 && !this.recipeMapWorkable.isActive()) { + decreaseTemperature(); } } @@ -268,6 +290,8 @@ else if(fluidType == 2) { public void invalidateStructure() { super.invalidateStructure(); this.currentTemperature = 0; + this.maxVoltage = 0; + this.offsetPos = null; } @Override @@ -337,14 +361,39 @@ public NBTTagCompound writeToNBT(NBTTagCompound data) { super.writeToNBT(data); data.setTag("temperature", new NBTTagInt(getCurrentTemperature())); data.setTag("fluidtype", new NBTTagInt(getFluidType())); + data.setBoolean("runRecipe", this.runRecipe); return data; } @Override public void readFromNBT(NBTTagCompound data) { super.readFromNBT(data); - currentTemperature = data.getInteger("temperature"); - fluidType = data.getInteger("fluidtype"); + this.currentTemperature = data.getInteger("temperature"); + this.fluidType = data.getInteger("fluidtype"); + this.runRecipe = data.getBoolean("runRecipe"); + } + + @Override + public int getProgressBarCount() { + return 1; + } + + @Override + public void registerBars(List> bars, PanelSyncManager syncManager) { + StringSyncValue boosterNameValue = new StringSyncValue(() -> this.getHeatingFluid(this.getFluidType()).getFluid().getName()); + syncManager.syncValue("booster_name", boosterNameValue); + FixedIntArraySyncValue boosterValue = new FixedIntArraySyncValue(this::getBoosterAmount, null); + syncManager.syncValue("booster_value", boosterValue); + + bars.add(bar -> bar.progress(() -> boosterValue.getValue(1) == 0 ? 0 : 1.0 * boosterValue.getValue(0) / boosterValue.getValue(1)) + .texture(GTGuiTextures.PROGRESS_BAR_LCE_FUEL) + .tooltipBuilder(tooltip -> this.createFuelTooltip(tooltip, boosterValue, boosterNameValue))); + } + + private int[] getBoosterAmount() { + FluidStack booster = this.getHeatingFluid(this.getFluidType()).copy(); + booster.amount = Integer.MAX_VALUE; + return this.getInputFluidInventory() != null ? this.getTotalFluidAmount(booster, this.getInputFluidInventory()) : new int[2]; } @@ -357,14 +406,66 @@ public DeepMinerRecipeLogic(GCYLRecipeMapMultiblockController metaTileEntity) { this.deepMiner = (MetaTileEntityDeepMiner) metaTileEntity; } + @Override + protected void updateRecipeProgress() { + if (offsetPos != null && this.metaTileEntity.getOffsetTimer() % 20 == 0) + this.mineBlocks(); + super.updateRecipeProgress(); + } + + @Override + protected boolean canProgressRecipe() { + return runRecipe && super.canProgressRecipe(); + } + + private void mineBlocks() { + runRecipe = false; + for (int y = offsetPos.getY(); y > -1; y--) { + minerPos.setPos(offsetPos.getX(), y, offsetPos.getZ()); + World world = this.metaTileEntity.getWorld(); + IBlockState state = world.getBlockState(minerPos); + Block block = state.getBlock(); + if (block == Blocks.BEDROCK || y < 1) { + runRecipe = true; + break; + } else if (state.getMaterial().isLiquid() || block instanceof IFluidBlock) { + this.replaceWithCobble(world, minerPos, state); + break; + } else if (block != Blocks.AIR) { + this.breakBlock(world, minerPos, state); + break; + } + } + } + + /** + * Replace 3x3 area with cobblestone if a fluid is hit + */ + private void replaceWithCobble(World world, BlockPos pos, IBlockState state) { + BlockPos.MutableBlockPos newPos = new BlockPos.MutableBlockPos(pos); + for (int x = -1; x < 2; x++) { + for (int z = -1; z < 2; z++) { + newPos.setPos(pos.getX() + x, pos.getY(), pos.getZ() + z); + this.breakBlock(world, newPos, state); + world.setBlockState(newPos, Blocks.COBBLESTONE.getDefaultState()); + } + } + } + + /** + * Break block and send its drops to item output. Doesn't check if the drops fit + */ + private void breakBlock(World world, BlockPos pos, IBlockState state) { + NonNullList itemDrops = NonNullList.create(); + state.getBlock().getDrops(itemDrops, world, pos, state, 0); + world.destroyBlock(pos, false); + GTTransferUtils.addItemsToItemHandler(this.getOutputInventory(), false, itemDrops); + } + @Override public boolean checkRecipe(Recipe recipe) { if (!super.checkRecipe(recipe)) return false; - - if(deepMiner.getPos().getY() > 8) - return false; - return recipe.getProperty(GCYLTemperatureProperty.getInstance(), 0) <= deepMiner.getCurrentTemperature(); } @@ -377,5 +478,10 @@ protected void modifyOverclockPre(@NotNull OCParams ocParams, @NotNull RecipePro double durationModifier = temperatureDiff / 1000 < 1 ? 1 : TEMPERATURE_DURATION_MULTIPLIER * (temperatureDiff / 1000); ocParams.setDuration((int) (ocParams.duration() / durationModifier)); } + + @Override + public long getMaxVoltage() { + return GCYMConfigHolder.globalMultiblocks.enableTieredCasings ? maxVoltage : super.getMaxVoltage(); + } } } diff --git a/src/main/resources/assets/gcyl/lang/en_us.lang b/src/main/resources/assets/gcyl/lang/en_us.lang index 436a53e..fb52db1 100644 --- a/src/main/resources/assets/gcyl/lang/en_us.lang +++ b/src/main/resources/assets/gcyl/lang/en_us.lang @@ -3146,7 +3146,7 @@ gregtech.multiblock.recipe=Screw to change recipe. Currently using: %s gregtech.universal.tooltip.efficiency=Efficiency: %s %% gregtech.multiblock.universal.energy_used=Energy Use: %d EU -gregtech.multiblock.universal.vom.temperature=Temperature: %sK +gregtech.multiblock.universal.vom.temperature=Temperature: §c%sK gregtech.multiblock.universal.vom.max_temperature=Max Temperature: %sK gregtech.multiblock.universal.drilling_fluid_amount=Fluids Consumption: %.2fmB gregtech.multiblock.universal.overheat=Overheated! @@ -4871,7 +4871,7 @@ gcyl.machine.deep_miner.config.1=Fluid type set to Pyrotheum gcyl.machine.deep_miner.config.2=Fluid type set to Helium Plasma gcyl.machine.deep_miner.config.3=Fluid type set to Neutron Plasma gcyl.multiblock.deep_miner.tooltip.1=For obtaining resources deep in §6Bedrock§r§7. §aRecipes require scanned Data§r§7. -gcyl.multiblock.deep_miner.tooltip.2=Controller must be placed at §eY=8§r§7 or lower. +gcyl.multiblock.deep_miner.tooltip.2=Mines all the way to §6Bedrock§r§7. Make sure things below the miner are clear. gcyl.multiblock.deep_miner.tooltip.3=Use a §bScrewdriver§r§7 to change between §bFluid§r§7 inputs. gcyl.multiblock.deep_miner.tooltip.4=Accepts §cLava§r§7 (.75), §6Pyrotheum§r§7 (1), §eHelium Plasma§r§7 (4), or §8Neutron Plasma§r§7 (16) with §bBonuses§r§7 increasing from left to right. gcyl.multiblock.deep_miner.tooltip.5=Maximum §bTemperature§r§7 depends on §bFluid§r§7 input and §bCoil§r§7 tier. @@ -4881,9 +4881,10 @@ gcyl.multiblock.deep_miner.tooltip.7=Loses §cHeat§r§7 when not running §lOR gcyl.multiblock.deep_miner.tooltip.8=For every §b1000K§r§7 above recipe temperature, the recipe duration is multiplied by §e%s§r§7. (Additive) gcyl.multiblock.deep_miner.tooltip.9=To use §eHelium Plasma§r§7, the casings and frames need to be §2Incoloy 813§r§7. gcyl.multiblock.deep_miner.tooltip.10=To use §8Neutron Plasma§r§7, the casings and frames need to be §aHastelloy K243§r§7. -gregtech.multiblock.deep_miner.max.temperature=Max Temperature: %sK -gregtech.multiblock.deep_miner.max.fluid consumption=Fluid Consumption: %smB -gregtech.multiblock.deep_miner_error=§cY LEVEL TOO HIGH! RECIPES WILL NOT RUN! +gcyl.multiblock.deep_miner.clear=Miner is clear to run! +gregtech.multiblock.deep_miner.max.temperature=Max Temperature: §c%sK +gregtech.multiblock.deep_miner.max.fluid consumption=Fluid Consumption: §e%smB +gregtech.multiblock.deep_miner_error=§eMiner obstructed, Mining block at §7(§fX:%,d§7) (§fY:%,d§7) (§fZ:%,d§7) recipemap.deep_miner.name=Deep Miner gcyl.machine.decay_chamber.name=Decay Chamber (DC) From 8e0f0e1d4cc8871ae587d002c5f95b48a15f6e04 Mon Sep 17 00:00:00 2001 From: Johny709 <86203059+Johny709@users.noreply.github.com> Date: Wed, 24 Dec 2025 12:07:25 -0500 Subject: [PATCH 10/22] Add fluid bars to Void Miner UI --- .../multi/miner/MetaTileEntityVoidMiner.java | 75 ++++++++++++++++++- .../resources/assets/gcyl/lang/en_us.lang | 3 + 2 files changed, 76 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/miner/MetaTileEntityVoidMiner.java b/src/main/java/com/fulltrix/gcyl/machines/multi/miner/MetaTileEntityVoidMiner.java index 22c4ae8..73ad938 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/miner/MetaTileEntityVoidMiner.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/miner/MetaTileEntityVoidMiner.java @@ -3,6 +3,8 @@ import codechicken.lib.render.CCRenderState; import codechicken.lib.render.pipeline.IVertexOperation; import codechicken.lib.vec.Matrix4; +import com.cleanroommc.modularui.api.drawable.IKey; +import com.cleanroommc.modularui.value.sync.PanelSyncManager; import com.fulltrix.gcyl.api.multi.IVoidMinerProvider; import com.fulltrix.gcyl.api.multi.VoidMinerLogic; import com.fulltrix.gcyl.blocks.metal.MetalCasing1; @@ -18,12 +20,17 @@ import gregtech.api.metatileentity.multiblock.IMultiblockPart; import gregtech.api.metatileentity.multiblock.MultiblockAbility; import gregtech.api.metatileentity.multiblock.MultiblockWithDisplayBase; +import gregtech.api.metatileentity.multiblock.ProgressBarMultiblock; import gregtech.api.metatileentity.multiblock.ui.KeyManager; import gregtech.api.metatileentity.multiblock.ui.MultiblockUIBuilder; +import gregtech.api.metatileentity.multiblock.ui.TemplateBarBuilder; +import gregtech.api.mui.GTGuiTextures; +import gregtech.api.mui.sync.FixedIntArraySyncValue; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; import gregtech.api.pattern.PatternMatchContext; import gregtech.api.pattern.TraceabilityPredicate; +import gregtech.api.unification.material.Materials; import gregtech.api.util.KeyUtil; import gregtech.api.util.TextComponentUtil; import gregtech.client.renderer.ICubeRenderer; @@ -41,6 +48,7 @@ import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.items.IItemHandlerModifiable; @@ -49,14 +57,19 @@ import javax.annotation.Nullable; import java.util.List; +import java.util.function.UnaryOperator; import static com.fulltrix.gcyl.client.ClientHandler.*; import static com.fulltrix.gcyl.blocks.GCYLMetaBlocks.METAL_CASING_1; import static com.fulltrix.gcyl.blocks.GCYLMetaBlocks.METAL_CASING_2; +import static com.fulltrix.gcyl.materials.GCYLMaterials.*; import static gregtech.api.unification.material.Materials.*; -public class MetaTileEntityVoidMiner extends MultiblockWithDisplayBase implements IWorkable, IVoidMinerProvider { //TODO: OpenComputers implementation +public class MetaTileEntityVoidMiner extends MultiblockWithDisplayBase implements IWorkable, IVoidMinerProvider, ProgressBarMultiblock { //TODO: OpenComputers implementation private static final int CONSUME_START = 100; + private static final FluidStack DRILLING_MUD = DrillingMud.getFluid(Integer.MAX_VALUE); + private static final FluidStack PYROTHEUM = Pyrotheum.getFluid(Integer.MAX_VALUE); + private static final FluidStack CRYOTHEUM = Cryotheum.getFluid(Integer.MAX_VALUE); private boolean isWorkingEnabled = false; private final int maxTemperature; @@ -239,7 +252,7 @@ public void addInformation(ItemStack stack, @Nullable World player, List protected void configureDisplayText(MultiblockUIBuilder builder) { builder.setWorkingStatus(voidMinerLogic.isWorkingEnabled(), voidMinerLogic.isActive()) .addCustom((keyManager, uiSyncer) -> { - if(isStructureFormed()) { + if (uiSyncer.syncBoolean(this.isStructureFormed())) { keyManager.add(KeyUtil.lang(TextFormatting.YELLOW,"gregtech.multiblock.universal.energy_used", energyDrain)); keyManager.add(KeyUtil.lang(TextFormatting.GOLD,"gregtech.multiblock.universal.vom.temperature", this.voidMinerLogic.getTemperature())); keyManager.add(KeyUtil.lang(TextFormatting.RED,"gregtech.multiblock.universal.vom.max_temperature", this.voidMinerLogic.getMaxTemperature())); @@ -400,4 +413,62 @@ public int getMaxProgress() { public boolean isActive() { return super.isActive() && this.voidMinerLogic.isActive(); } + + @Override + public int getProgressBarCount() { + return 3; + } + + @Override + public void registerBars(List> bars, PanelSyncManager syncManager) { + FixedIntArraySyncValue drillingMudAmount = new FixedIntArraySyncValue(this::getDrillingMudAmount, null); + FixedIntArraySyncValue pyrotheumAmount = new FixedIntArraySyncValue(this::getPyrotheumAmount, null); + FixedIntArraySyncValue cryotheumAmount = new FixedIntArraySyncValue(this::getCryotheumAmount, null); + syncManager.syncValue("drilling_mud_amount", drillingMudAmount); + syncManager.syncValue("pyrotheum_amount", pyrotheumAmount); + syncManager.syncValue("cryotheum_amount", cryotheumAmount); + + bars.add(bar -> bar.progress(() -> drillingMudAmount.getValue(1) == 0 ? 0 : 1.0 * drillingMudAmount.getValue(0) / drillingMudAmount.getValue(1)) + .texture(GTGuiTextures.PROGRESS_BAR_LCE_FUEL) + .tooltipBuilder(tooltip -> tooltip.addLine(!this.isStructureFormed() ? IKey.lang("gregtech.multiblock.invalid_structure") + : drillingMudAmount.getValue(0) == 0 ? IKey.lang("gregtech.multiblock.large_combustion_engine.fuel_none") + : IKey.lang("gcyl.multiblock.void_miner.drilling_mud", drillingMudAmount.getValue(0), drillingMudAmount.getValue(1))))); + bars.add(bar -> bar.progress(() -> pyrotheumAmount.getValue(1) == 0 ? 0 : 1.0 * pyrotheumAmount.getValue(0) / pyrotheumAmount.getValue(1)) + .texture(GTGuiTextures.PROGRESS_BAR_LCE_LUBRICANT) + .tooltipBuilder(tooltip -> tooltip.addLine(!this.isStructureFormed() ? IKey.lang("gregtech.multiblock.invalid_structure") + : pyrotheumAmount.getValue(0) == 0 ? IKey.lang("gregtech.multiblock.large_combustion_engine.fuel_none") + : IKey.lang("gcyl.multiblock.void_miner.pyrotheum", pyrotheumAmount.getValue(0), pyrotheumAmount.getValue(1))))); + bars.add(bar -> bar.progress(() -> cryotheumAmount.getValue(1) == 0 ? 0 : 1.0 * cryotheumAmount.getValue(0) / cryotheumAmount.getValue(1)) + .texture(GTGuiTextures.PROGRESS_BAR_LCE_OXYGEN) + .tooltipBuilder(tooltip -> tooltip.addLine(!this.isStructureFormed() ? IKey.lang("gregtech.multiblock.invalid_structure") + : cryotheumAmount.getValue(0) == 0 ? IKey.lang("gregtech.multiblock.large_combustion_engine.fuel_none") + : IKey.lang("gcyl.multiblock.void_miner.cryotheum", cryotheumAmount.getValue(0), cryotheumAmount.getValue(1))))); + } + + private int[] getDrillingMudAmount() { + return this.getImportFluidHandler() != null ? this.getTotalFluidAmount(DRILLING_MUD, this.getImportFluidHandler()) : new int[2]; + } + + private int[] getPyrotheumAmount() { + return this.getImportFluidHandler() != null ? this.getTotalFluidAmount(PYROTHEUM, this.getImportFluidHandler()) : new int[2]; + } + + private int[] getCryotheumAmount() { + return this.getImportFluidHandler() != null ? this.getTotalFluidAmount(CRYOTHEUM, this.getImportFluidHandler()) : new int[2]; + } + + protected int[] getTotalFluidAmount(FluidStack testStack, IMultipleTankHandler multiTank) { + int fluidAmount = 0; + int fluidCapacity = 0; + for (var tank : multiTank) { + if (tank != null) { + FluidStack drainStack = tank.drain(testStack, false); + if (drainStack != null && drainStack.amount > 0) { + fluidAmount += drainStack.amount; + fluidCapacity += tank.getCapacity(); + } + } + } + return new int[] { fluidAmount, fluidCapacity }; + } } diff --git a/src/main/resources/assets/gcyl/lang/en_us.lang b/src/main/resources/assets/gcyl/lang/en_us.lang index fb52db1..8b13934 100644 --- a/src/main/resources/assets/gcyl/lang/en_us.lang +++ b/src/main/resources/assets/gcyl/lang/en_us.lang @@ -3103,6 +3103,9 @@ gcyl.multiblock.void_miner.description.8=Fluid use does not reset unless overhea gcyl.multiblock.void_miner.description.9=Temperature will decrease slowly if work is paused. gcyl.multiblock.void_miner.description.5=If temperature is above the max temperature the Void Ore Miner will stop working and slowly cool down. gcyl.multiblock.void_miner.description.6=Used Drilling Mud, and 10 random ores with each having a stack size of (Temperature/1000)^2 every 10 seconds. +gcyl.multiblock.void_miner.drilling_mud=§7(§4Drilling Mud§7) §4%,d / %,d L +gcyl.multiblock.void_miner.pyrotheum=§7(§6Pyrotheum§7) §6%,d / %,d L +gcyl.multiblock.void_miner.cryotheum=§7(§bCryotheum§7) §b%,d / %,d L gcyl.multiblock.large_transformer.description=Large Transformer can convert any GTEU/AMPS by any GTEU/AMPS. gcyl.multiblock.industrial_primitive_blast_furnace.description=The Industrial Primitive Blast Furnace is a large multiblock structure consisting of 1 to 64 "slices". gregtech.machine.primitive_blast_furnace.industrial.tooltip.1=It's an upgraded version of The Primitive Blast Furnace. From f5b339bbe0d575125a4a4011910f26f5f809b5ae Mon Sep 17 00:00:00 2001 From: Johny709 <86203059+Johny709@users.noreply.github.com> Date: Wed, 24 Dec 2025 15:20:58 -0500 Subject: [PATCH 11/22] Volcanus progress --- .../multi/advance/MetaTileEntityVolcanus.java | 142 +++++++----------- 1 file changed, 54 insertions(+), 88 deletions(-) diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityVolcanus.java b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityVolcanus.java index 82a708e..a812fde 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityVolcanus.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityVolcanus.java @@ -1,24 +1,25 @@ package com.fulltrix.gcyl.machines.multi.advance; +import com.cleanroommc.modularui.api.drawable.IKey; +import com.cleanroommc.modularui.value.sync.PanelSyncManager; +import com.fulltrix.gcyl.api.multi.GCYLRecipeMapMultiblockController; import com.fulltrix.gcyl.materials.GCYLMaterials; import com.fulltrix.gcyl.blocks.metal.MetalCasing1; -import gregicality.multiblocks.api.capability.impl.GCYMMultiblockRecipeLogic; -import gregicality.multiblocks.api.metatileentity.GCYMRecipeMapMultiblockController; import gregicality.multiblocks.api.render.GCYMTextures; import gregtech.api.GTValues; import gregtech.api.block.IHeatingCoilBlockStats; -import gregtech.api.capability.IEnergyContainer; import gregtech.api.capability.IHeatingCoil; -import gregtech.api.capability.IMultipleTankHandler; -import gregtech.api.capability.impl.EnergyContainerList; import gregtech.api.capability.impl.MultiblockRecipeLogic; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.IMultiblockPart; import gregtech.api.metatileentity.multiblock.MultiblockAbility; -import gregtech.api.metatileentity.multiblock.ParallelLogicType; +import gregtech.api.metatileentity.multiblock.ProgressBarMultiblock; import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController; import gregtech.api.metatileentity.multiblock.ui.MultiblockUIBuilder; +import gregtech.api.metatileentity.multiblock.ui.TemplateBarBuilder; +import gregtech.api.mui.GTGuiTextures; +import gregtech.api.mui.sync.FixedIntArraySyncValue; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; import gregtech.api.pattern.PatternMatchContext; @@ -28,7 +29,6 @@ import gregtech.api.recipes.logic.OCParams; import gregtech.api.recipes.logic.OCResult; import gregtech.api.recipes.logic.OverclockingLogic; -import gregtech.api.recipes.machines.RecipeMapFurnace; import gregtech.api.recipes.properties.RecipePropertyStorage; import gregtech.api.recipes.properties.impl.TemperatureProperty; import gregtech.api.util.GTUtility; @@ -40,9 +40,6 @@ import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.text.ITextComponent; -import net.minecraft.util.text.Style; -import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; @@ -52,21 +49,27 @@ import org.jetbrains.annotations.Nullable; import java.util.List; +import java.util.function.UnaryOperator; import static com.fulltrix.gcyl.client.ClientHandler.HASTELLOY_N_CASING; import static com.fulltrix.gcyl.blocks.GCYLMetaBlocks.METAL_CASING_1; +import static gregtech.api.GTValues.ZPM; import static gregtech.api.recipes.logic.OverclockingLogic.heatingCoilOC; //TODO: update ui & tooltip. improve performance -public class MetaTileEntityVolcanus extends RecipeMapMultiblockController implements IHeatingCoil { +public class MetaTileEntityVolcanus extends GCYLRecipeMapMultiblockController implements IHeatingCoil, ProgressBarMultiblock { + + private static final FluidStack PYROTHEUM = GCYLMaterials.Pyrotheum.getFluid(Integer.MAX_VALUE); private int blastFurnaceTemperature; + private FluidStack pyrotheum; public MetaTileEntityVolcanus(ResourceLocation metaTileEntityId) { - super(metaTileEntityId, RecipeMaps.BLAST_RECIPES); + super(metaTileEntityId, RecipeMaps.BLAST_RECIPES, false); this.recipeMapWorkable = new MetaTileEntityVolcanus.VolcanusRecipeLogic(this); + this.recipeMapWorkable.setMaximumOverclockVoltage(Math.min(this.energyContainer.getInputVoltage() , GTValues.V[ZPM])); } @Override @@ -76,25 +79,17 @@ public MetaTileEntity createMetaTileEntity(IGregTechTileEntity metaTileEntityHol @Override protected void configureDisplayText(MultiblockUIBuilder builder) { - builder.structureFormed(isStructureFormed()) - .addCustom((keyManager, uiSyncer) -> keyManager.add(KeyUtil.lang(TextFormatting.RED, "gregtech.multiblock.blast_furnace.max_temperature", - blastFurnaceTemperature))); + super.configureDisplayText(builder); + builder.addCustom((keyManager, uiSyncer) -> keyManager.add(KeyUtil.lang(TextFormatting.RED, "gregtech.multiblock.blast_furnace.max_temperature", uiSyncer.syncInt(this.blastFurnaceTemperature)))); } @Override protected void formStructure(PatternMatchContext context) { super.formStructure(context); - Object type = context.get("CoilType"); - if (type instanceof IHeatingCoilBlockStats) { - this.blastFurnaceTemperature = ((IHeatingCoilBlockStats) type).getCoilTemperature(); - } else { - this.blastFurnaceTemperature = BlockWireCoil.CoilType.CUPRONICKEL.getCoilTemperature(); - } - - this.blastFurnaceTemperature += 100 * - Math.max(0, GTUtility.getTierByVoltage(getEnergyContainer().getInputVoltage()) - GTValues.MV); - - + IHeatingCoilBlockStats coilType = context.getOrDefault("CoilType", BlockWireCoil.CoilType.CUPRONICKEL); + this.blastFurnaceTemperature = coilType.getCoilTemperature(); + this.blastFurnaceTemperature += 100 * Math.max(0, GTUtility.getTierByVoltage(getEnergyContainer().getInputVoltage()) - GTValues.MV); + this.pyrotheum = GCYLMaterials.Pyrotheum.getFluid((int) Math.pow(2,GTUtility.getTierByVoltage(this.energyContainer.getInputVoltage()))); } @Override @@ -103,7 +98,6 @@ public void invalidateStructure() { this.blastFurnaceTemperature = 0; } - @Override public boolean checkRecipe(@NotNull Recipe recipe, boolean consumeIfSuccess) { return this.blastFurnaceTemperature >= recipe.getProperty(TemperatureProperty.getInstance(), 0); @@ -125,6 +119,7 @@ public void addInformation(ItemStack stack, @Nullable World player, List public ICubeRenderer getBaseTexture(IMultiblockPart iMultiblockPart) { return HASTELLOY_N_CASING; } + @SideOnly(Side.CLIENT) @NotNull @Override @@ -138,13 +133,13 @@ public boolean hasMufflerMechanics() { } @Override - public boolean canBeDistinct() { - return true; + public int getCurrentTemperature() { + return this.blastFurnaceTemperature; } @Override - public int getCurrentTemperature() { - return this.blastFurnaceTemperature; + public boolean isTiered() { + return false; } @Override @@ -166,63 +161,39 @@ protected IBlockState getCasingState() { return METAL_CASING_1.getState(MetalCasing1.CasingType.HASTELLOY_N); } - @SuppressWarnings("InnerClassMayBeStatic") - private class VolcanusRecipeLogic extends MultiblockRecipeLogic { - - private final MetaTileEntityVolcanus volcanus; - - public VolcanusRecipeLogic(RecipeMapMultiblockController metaTileEntity) { - super(metaTileEntity); - this.volcanus = (MetaTileEntityVolcanus) metaTileEntity; - } - - protected FluidStack getPyrotheum() { - return GCYLMaterials.Pyrotheum.getFluid((int) Math.pow(2,GTUtility.getTierByVoltage(this.volcanus.energyContainer.getInputVoltage()))); - } - - protected boolean checkPyrotheum() { - IMultipleTankHandler inputTank = volcanus.getInputFluidInventory(); - if(getPyrotheum().isFluidStackIdentical(inputTank.drain(getPyrotheum(), false))) { - return true; - } - else { - invalidate(); - return false; - } - } + @Override + public int getProgressBarCount() { + return 1; + } - protected void drainPyrotheum() { - volcanus.getInputFluidInventory().drain(getPyrotheum(), true); - } + @Override + public void registerBars(List> bars, PanelSyncManager syncManager) { + FixedIntArraySyncValue pyrotheumAmount = new FixedIntArraySyncValue(this::getPyrotheumAmount, null); + syncManager.syncValue("pyrotheum_amount", pyrotheumAmount); + + bars.add(bar -> bar.progress(() -> pyrotheumAmount.getValue(1) == 0 ? 0 : 1.0 * pyrotheumAmount.getValue(0) / pyrotheumAmount.getValue(1)) + .texture(GTGuiTextures.PROGRESS_BAR_LCE_LUBRICANT) + .tooltipBuilder(tooltip -> tooltip.addLine(!this.isStructureFormed() ? IKey.lang("gregtech.multiblock.invalid_structure") + : pyrotheumAmount.getValue(0) == 0 ? IKey.lang("gregtech.multiblock.large_combustion_engine.fuel_none") + : IKey.lang("gcyl.multiblock.void_miner.pyrotheum", pyrotheumAmount.getValue(0), pyrotheumAmount.getValue(1))))); + } - @Override - protected boolean shouldSearchForRecipes() { - return super.shouldSearchForRecipes() && checkPyrotheum(); - } + private int[] getPyrotheumAmount() { + return this.getInputFluidInventory() != null ? this.getTotalFluidAmount(PYROTHEUM, this.getInputFluidInventory()) : new int[2]; + } - @Override - protected boolean canProgressRecipe() { - if(checkPyrotheum() && volcanus.isActive()) { - drainPyrotheum(); - } + private class VolcanusRecipeLogic extends MultiblockRecipeLogic { - return super.canProgressRecipe() && checkPyrotheum(); + public VolcanusRecipeLogic(RecipeMapMultiblockController metaTileEntity) { + super(metaTileEntity); } @Override - public long getMaximumOverclockVoltage() { - IEnergyContainer energyContainer = volcanus.getEnergyContainer(); - if (energyContainer instanceof EnergyContainerList) { - long voltage; - long amperage; - - voltage = energyContainer.getInputVoltage(); - amperage = energyContainer.getInputAmperage(); - - return amperage == 1L ? Math.min(GTValues.V[GTUtility.getFloorTierByVoltage(voltage)], GTValues.V[GTValues.ZPM]) : Math.min(voltage, GTValues.V[GTValues.ZPM]); - } else { - return Math.max(energyContainer.getInputVoltage(), energyContainer.getOutputVoltage()); - } + protected void updateRecipeProgress() { + if (pyrotheum.isFluidStackIdentical(this.getInputTank().drain(pyrotheum, false))) { + this.getInputTank().drain(pyrotheum, true); + super.updateRecipeProgress(); + } else this.decreaseProgress(); } @Override @@ -246,18 +217,13 @@ public void applyParallelBonus(@NotNull RecipeBuilder builder) { @Override protected void modifyOverclockPre(@NotNull OCParams ocParams, @NotNull RecipePropertyStorage storage) { super.modifyOverclockPre(ocParams, storage); - - ocParams.setEut(OverclockingLogic.applyCoilEUtDiscount(ocParams.eut(), - ((IHeatingCoil) volcanus).getCurrentTemperature(), - storage.get(TemperatureProperty.getInstance(), 0))); - + ocParams.setEut(OverclockingLogic.applyCoilEUtDiscount(ocParams.eut(), getCurrentTemperature(), storage.get(TemperatureProperty.getInstance(), 0))); } @Override protected void runOverclockingLogic(@NotNull OCParams ocParams, @NotNull OCResult ocResult, @NotNull RecipePropertyStorage propertyStorage, long maxVoltage) { - heatingCoilOC(ocParams, ocResult, maxVoltage, ((IHeatingCoil) volcanus).getCurrentTemperature(), - propertyStorage.get(TemperatureProperty.getInstance(), 0)); + heatingCoilOC(ocParams, ocResult, maxVoltage, getCurrentTemperature(), propertyStorage.get(TemperatureProperty.getInstance(), 0)); } } } From 86e7229311af48bcf0429b07a7bc0a5e2ee1c672 Mon Sep 17 00:00:00 2001 From: Johny709 <86203059+Johny709@users.noreply.github.com> Date: Wed, 24 Dec 2025 16:50:22 -0500 Subject: [PATCH 12/22] Cryogenic Freezer progress --- .../MetaTileEntityCryogenicFreezer.java | 95 +++++++++++-------- 1 file changed, 57 insertions(+), 38 deletions(-) diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityCryogenicFreezer.java b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityCryogenicFreezer.java index 1bad95d..271d6c8 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityCryogenicFreezer.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityCryogenicFreezer.java @@ -1,20 +1,27 @@ package com.fulltrix.gcyl.machines.multi.advance; +import com.cleanroommc.modularui.api.drawable.IKey; +import com.cleanroommc.modularui.value.sync.PanelSyncManager; +import com.fulltrix.gcyl.api.multi.GCYLRecipeMapMultiblockController; import com.fulltrix.gcyl.materials.GCYLMaterials; import com.fulltrix.gcyl.client.ClientHandler; import gregicality.multiblocks.api.capability.impl.GCYMMultiblockRecipeLogic; -import gregicality.multiblocks.api.metatileentity.GCYMRecipeMapMultiblockController; import gregicality.multiblocks.api.render.GCYMTextures; import gregicality.multiblocks.common.block.GCYMMetaBlocks; import gregicality.multiblocks.common.block.blocks.BlockLargeMultiblockCasing; import gregtech.api.GTValues; -import gregtech.api.capability.IMultipleTankHandler; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.IMultiblockPart; +import gregtech.api.metatileentity.multiblock.ProgressBarMultiblock; import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController; +import gregtech.api.metatileentity.multiblock.ui.TemplateBarBuilder; +import gregtech.api.mui.GTGuiTextures; +import gregtech.api.mui.sync.FixedIntArraySyncValue; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; +import gregtech.api.pattern.PatternMatchContext; +import gregtech.api.recipes.RecipeBuilder; import gregtech.api.recipes.RecipeMaps; import gregtech.api.util.GTUtility; import gregtech.client.renderer.ICubeRenderer; @@ -27,24 +34,27 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.List; +import java.util.function.UnaryOperator; import static gregtech.api.GTValues.ZPM; //TODO: limit reflect in ui. update tooltip. improve performance -public class MetaTileEntityCryogenicFreezer extends GCYMRecipeMapMultiblockController { +public class MetaTileEntityCryogenicFreezer extends GCYLRecipeMapMultiblockController implements ProgressBarMultiblock { - protected final MetaTileEntity metaTileEntity; + private static final FluidStack CRYOTHEUM = GCYLMaterials.Cryotheum.getFluid(Integer.MAX_VALUE); + + private FluidStack cryotheum; public MetaTileEntityCryogenicFreezer(ResourceLocation metaTileEntityId) { - super(metaTileEntityId, RecipeMaps.VACUUM_RECIPES); + super(metaTileEntityId, RecipeMaps.VACUUM_RECIPES, false); this.recipeMapWorkable = new MetaTileEntityCryogenicFreezer.CryogenicRecipeLogic(this); - this.metaTileEntity = this; this.recipeMapWorkable.setMaximumOverclockVoltage(Math.min(this.energyContainer.getInputVoltage() , GTValues.V[ZPM])); } @@ -53,6 +63,12 @@ public MetaTileEntity createMetaTileEntity(IGregTechTileEntity metaTileEntityHol return new MetaTileEntityCryogenicFreezer(this.metaTileEntityId); } + @Override + protected void formStructure(PatternMatchContext context) { + super.formStructure(context); + this.cryotheum = GCYLMaterials.Cryotheum.getFluid((int) Math.pow(2, GTUtility.getTierByVoltage(this.energyContainer.getInputVoltage()))); + } + @Override protected BlockPattern createStructurePattern() { return FactoryBlockPattern.start() @@ -86,8 +102,6 @@ protected OrientedOverlayRenderer getFrontOverlay() { return ClientHandler.FREEZER_OVERLAY; } - - @Override @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, @Nullable World player, List tooltip, boolean advanced) { @@ -96,52 +110,57 @@ public void addInformation(ItemStack stack, @Nullable World player, List tooltip.add(I18n.format("gregtech.multiblock.vol_cryo.description")); } + @Override + public int getProgressBarCount() { + return 1; + } - private class CryogenicRecipeLogic extends GCYMMultiblockRecipeLogic { + @Override + public void registerBars(List> bars, PanelSyncManager syncManager) { + FixedIntArraySyncValue cryotheumAmount = new FixedIntArraySyncValue(this::getCryotheumAmount, null); + syncManager.syncValue("cryotheum_amount", cryotheumAmount); + + bars.add(bar -> bar.progress(() -> cryotheumAmount.getValue(1) == 0 ? 0 : 1.0 * cryotheumAmount.getValue(0) / cryotheumAmount.getValue(1)) + .texture(GTGuiTextures.PROGRESS_BAR_LCE_OXYGEN) + .tooltipBuilder(tooltip -> tooltip.addLine(!this.isStructureFormed() ? IKey.lang("gregtech.multiblock.invalid_structure") + : cryotheumAmount.getValue(0) == 0 ? IKey.lang("gregtech.multiblock.large_combustion_engine.fuel_none") + : IKey.lang("gcyl.multiblock.void_miner.cryotheum", cryotheumAmount.getValue(0), cryotheumAmount.getValue(1))))); + } - private final MetaTileEntityCryogenicFreezer freezer; + private int[] getCryotheumAmount() { + return this.getInputFluidInventory() != null ? this.getTotalFluidAmount(CRYOTHEUM, this.getInputFluidInventory()) : new int[2]; + } + + private class CryogenicRecipeLogic extends GCYMMultiblockRecipeLogic { public CryogenicRecipeLogic(RecipeMapMultiblockController metaTileEntity) { super(metaTileEntity); - this.freezer = (MetaTileEntityCryogenicFreezer) metaTileEntity; - } - - protected FluidStack getCryotheum() { - return GCYLMaterials.Cryotheum.getFluid((int) Math.pow(2, GTUtility.getTierByVoltage(this.freezer.energyContainer.getInputVoltage()))); } - protected boolean checkCryotheum() { - IMultipleTankHandler inputTank = freezer.getInputFluidInventory(); - if(getCryotheum().isFluidStackIdentical(inputTank.drain(getCryotheum(), false))) { - return true; - } - else { - invalidate(); - return false; - } - } - - protected void drainCryotheum() { - freezer.getInputFluidInventory().drain(getCryotheum(), true); + @Override + protected void updateRecipeProgress() { + if (cryotheum.isFluidStackIdentical(this.getInputTank().drain(cryotheum, false))) { + this.getInputTank().drain(cryotheum, true); + super.updateRecipeProgress(); + } else this.decreaseProgress(); } @Override - protected boolean shouldSearchForRecipes() { - return super.shouldSearchForRecipes() && checkCryotheum(); + public long getMaxParallelVoltage() { + return Long.MAX_VALUE; } @Override - protected boolean canProgressRecipe() { - if(checkCryotheum() && freezer.isActive()) { - drainCryotheum(); - } - - return super.canProgressRecipe() && checkCryotheum(); + public int getParallelLimit() { + return 8; } @Override - public long getMaximumOverclockVoltage() { - return Math.min(freezer.getEnergyContainer().getInputVoltage(), GTValues.V[ZPM]); + public void applyParallelBonus(@NotNull RecipeBuilder builder) { + long EUt = (long) (builder.getEUt() * 0.9); + + builder.EUt(EUt / builder.getParallel()) + .duration((int) (builder.getDuration() * (1.0F / 2.2F))); } } } From 5a440680ae5809d4e3b5adb64994af68e1cb6044 Mon Sep 17 00:00:00 2001 From: Johny709 <86203059+Johny709@users.noreply.github.com> Date: Wed, 24 Dec 2025 17:42:40 -0500 Subject: [PATCH 13/22] Add Tiered Hatch (voltage casings) predicates to JEI multi preview --- .../gcyl/api/pattern/TraceabilityPredicates.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/fulltrix/gcyl/api/pattern/TraceabilityPredicates.java b/src/main/java/com/fulltrix/gcyl/api/pattern/TraceabilityPredicates.java index 248a022..1861b4d 100644 --- a/src/main/java/com/fulltrix/gcyl/api/pattern/TraceabilityPredicates.java +++ b/src/main/java/com/fulltrix/gcyl/api/pattern/TraceabilityPredicates.java @@ -5,11 +5,13 @@ import com.fulltrix.gcyl.api.block.IElevatorMotorTier; import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; import com.fulltrix.gcyl.blocks.fusion.GCYLFusionCoils; +import gregicality.multiblocks.api.metatileentity.GCYMMultiblockAbility; import gregicality.multiblocks.common.metatileentities.multiblockpart.MetaTileEntityTieredHatch; import gregtech.api.GregTechAPI; import gregtech.api.block.ICleanroomFilter; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.MetaTileEntityHolder; +import gregtech.api.metatileentity.multiblock.MultiblockAbility; import gregtech.api.pattern.PatternStringError; import gregtech.api.pattern.TraceabilityPredicate; import gregtech.api.util.BlockInfo; @@ -139,7 +141,13 @@ public static TraceabilityPredicate tieredHatchPredicate() { } } return false; - }); + }, () -> MultiblockAbility.REGISTRY.get(GCYMMultiblockAbility.TIERED_HATCH).stream() + .map(tileEntity -> { + MetaTileEntityHolder holder = new MetaTileEntityHolder(); + holder.setMetaTileEntity(tileEntity); + holder.getMetaTileEntity().onPlacement(); + return new BlockInfo(tileEntity.getBlock().getDefaultState(), holder); + }).toArray(BlockInfo[]::new)); } public static TraceabilityPredicate advFusionCoils() { From 29ab9e9175b713cedacc6ba4b4309bfb06bc90fa Mon Sep 17 00:00:00 2001 From: Johny709 Date: Wed, 24 Dec 2025 22:46:14 -0500 Subject: [PATCH 14/22] Fix Decay Chamber voltage casings --- .../simple/MetaTileEntityDecayChamber.java | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityDecayChamber.java b/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityDecayChamber.java index aa0ad8c..1f7f82a 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityDecayChamber.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityDecayChamber.java @@ -1,14 +1,19 @@ package com.fulltrix.gcyl.machines.multi.simple; +import com.fulltrix.gcyl.api.multi.GCYLMultiblockRecipeLogic; import com.fulltrix.gcyl.api.multi.GCYLRecipeMapMultiblockController; +import com.fulltrix.gcyl.api.pattern.TraceabilityPredicates; import com.fulltrix.gcyl.client.ClientHandler; import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; import com.fulltrix.gcyl.blocks.GCYLReactorCasing; +import gregicality.multiblocks.common.GCYMConfigHolder; +import gregicality.multiblocks.common.metatileentities.multiblockpart.MetaTileEntityTieredHatch; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.IMultiblockPart; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; +import gregtech.api.pattern.PatternMatchContext; import gregtech.client.renderer.ICubeRenderer; import gregtech.client.renderer.texture.Textures; import gregtech.common.blocks.BlockGlassCasing; @@ -19,6 +24,8 @@ import net.minecraftforge.fml.relauncher.SideOnly; import org.jetbrains.annotations.NotNull; +import java.util.ArrayList; + import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.DECAY_CHAMBERS_RECIPES; @@ -26,8 +33,16 @@ //TODO: add tooltips and information public class MetaTileEntityDecayChamber extends GCYLRecipeMapMultiblockController { + private long maxVoltage; + public MetaTileEntityDecayChamber(ResourceLocation metaTileEntityId, boolean isParallel) { super(metaTileEntityId, DECAY_CHAMBERS_RECIPES, isParallel); + this.recipeMapWorkable = new GCYLMultiblockRecipeLogic(this, false) { + @Override + public long getMaxVoltage() { + return GCYMConfigHolder.globalMultiblocks.enableTieredCasings ? maxVoltage : super.getMaxVoltage(); + } + }; } @Override @@ -40,10 +55,23 @@ public MetaTileEntityDecayChamber(ResourceLocation metaTileEntityId, boolean isP .where('S', selfPredicate()) .where('G', states(getGlassState())) .where('#', air()) - .where('T', tieredCasing()) + .where('T', TraceabilityPredicates.tieredHatchPredicate()) .build(); } + @Override + protected void formStructure(PatternMatchContext context) { + super.formStructure(context); + int tier = context.getOrDefault("tiered_hatches", new ArrayList()).get(0).getTier() - 1; + this.maxVoltage = 32L << tier * 2; + } + + @Override + public void invalidateStructure() { + super.invalidateStructure(); + this.maxVoltage = 0; + } + public IBlockState getCasingState() { return GCYLMetaBlocks.REACTOR_CASING.getState(GCYLReactorCasing.CasingType.CLADDED_REACTOR_CASING); } From b9343a5f63bcef8a153a37d57657ed4cc90033c4 Mon Sep 17 00:00:00 2001 From: Johny709 Date: Wed, 24 Dec 2025 23:56:09 -0500 Subject: [PATCH 15/22] Match Greenhouse texture and casings --- .../machines/multi/simple/MetaTileEntityGreenhouse.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityGreenhouse.java b/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityGreenhouse.java index 3b7da16..60fe2af 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityGreenhouse.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityGreenhouse.java @@ -8,6 +8,7 @@ import gregtech.api.pattern.FactoryBlockPattern; import gregtech.client.renderer.ICubeRenderer; import gregtech.client.renderer.texture.Textures; +import gregtech.common.ConfigHolder; import gregtech.common.blocks.BlockGlassCasing; import gregtech.common.blocks.BlockMachineCasing; import gregtech.common.blocks.MetaBlocks; @@ -20,7 +21,6 @@ import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.GREENHOUSE_RECIPES; -//TODO: GET A MATCHING TEXTURE FOR THE CASINGS AND BASE TEXTURE //TODO: add tooltips and information public class MetaTileEntityGreenhouse extends GCYMRecipeMapMultiblockController { @@ -56,9 +56,16 @@ public boolean isTiered() { return false; } + @Override + public int getDefaultPaintingColor() { + return ConfigHolder.client.defaultPaintingColor; + } + @SideOnly(Side.CLIENT) @Override public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) { + if (sourcePart instanceof MetaTileEntity tileEntity) + tileEntity.setPaintingColor(ConfigHolder.client.defaultPaintingColor); return tier > 2 ? Textures.VOLTAGE_CASINGS[8] : Textures.VOLTAGE_CASINGS[0]; } From 1cb057654982b2af10639a3f33b2febe43419be8 Mon Sep 17 00:00:00 2001 From: Johny709 Date: Thu, 25 Dec 2025 00:16:33 -0500 Subject: [PATCH 16/22] Add extra pages to JEI multiblock previews with multis with different block variants --- .../multi/MetaTileEntityBioReactor.java | 32 ++++++++++++++ .../MetaTileEntityCosmicRayDetector.java | 43 +++++++++++++++++++ .../multi/MetaTileEntityStellarForge.java | 42 ++++++++++++++++++ .../multi/advance/MetaTileEntityVolcanus.java | 28 ++++++++++++ .../multi/miner/MetaTileEntityDeepMiner.java | 41 ++++++++++++++++-- .../simple/MetaTileEntityChemicalPlant.java | 34 +++++++++++++++ .../simple/MetaTileEntityDecayChamber.java | 29 +++++++++++++ .../simple/MetaTileEntityPlasmaCondenser.java | 30 +++++++++++++ 8 files changed, 275 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityBioReactor.java b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityBioReactor.java index 90f9347..6772e48 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityBioReactor.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityBioReactor.java @@ -8,20 +8,24 @@ import com.fulltrix.gcyl.blocks.GCYLMultiblockCasing2; import com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps; import gregicality.multiblocks.common.GCYMConfigHolder; +import gregicality.multiblocks.common.metatileentities.GCYMMetaTileEntities; import gregicality.multiblocks.common.metatileentities.multiblockpart.MetaTileEntityTieredHatch; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.IMultiblockPart; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; +import gregtech.api.pattern.MultiblockShapeInfo; import gregtech.api.pattern.PatternMatchContext; import gregtech.client.renderer.ICubeRenderer; import gregtech.client.renderer.texture.cube.OrientedOverlayRenderer; import gregtech.common.blocks.BlockGlassCasing; import gregtech.common.blocks.MetaBlocks; +import gregtech.common.metatileentities.MetaTileEntities; import net.minecraft.block.state.IBlockState; import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; @@ -30,7 +34,11 @@ import javax.annotation.Nonnull; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; +import java.util.stream.Collectors; + +import static gregtech.api.util.RelativeDirection.*; public class MetaTileEntityBioReactor extends GCYLRecipeMapMultiblockController { @@ -75,6 +83,30 @@ protected BlockPattern createStructurePattern() { .build(); } + @Override + public List getMatchingShapes() { + MultiblockShapeInfo.Builder builder = MultiblockShapeInfo.builder(RIGHT, DOWN, FRONT) + .aisle("XXEMX", "XGGGX", "XGGGX", "XGGGX", "XXXXX") + .aisle("XXXXX", "G###G", "G#T#G", "G###G", "XXXXX") + .aisle("XXXXX", "G#T#G", "GTTTG", "G#T#G", "XXXXX") + .aisle("XXXXX", "G###G", "G#T#G", "G###G", "XXXXX") + .aisle("iISOo", "XGGGX", "XGGGX", "XGGGX", "XXXXX") + .where('S', this, EnumFacing.SOUTH) + .where('I', MetaTileEntities.ITEM_IMPORT_BUS[3], EnumFacing.SOUTH) + .where('O', MetaTileEntities.ITEM_EXPORT_BUS[3], EnumFacing.SOUTH) + .where('i', MetaTileEntities.FLUID_IMPORT_HATCH[3], EnumFacing.SOUTH) + .where('o', MetaTileEntities.FLUID_EXPORT_HATCH[3], EnumFacing.SOUTH) + .where('M', MetaTileEntities.MAINTENANCE_HATCH, EnumFacing.NORTH) + .where('X', this.getCasingState()) + .where('L', this.getCasingState()) + .where('G', MetaBlocks.TRANSPARENT_CASING.getState(BlockGlassCasing.CasingType.LAMINATED_GLASS)); + return Arrays.stream(GCYMMetaTileEntities.TIERED_HATCH) + .map(hatch -> builder.where('T', hatch, EnumFacing.DOWN) + .where('E', MetaTileEntities.ENERGY_INPUT_HATCH[hatch.getTier()], EnumFacing.NORTH) + .build()) + .collect(Collectors.toList()); + } + @Override protected void formStructure(PatternMatchContext context) { super.formStructure(context); diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityCosmicRayDetector.java b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityCosmicRayDetector.java index 6cc4218..f42d4d1 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityCosmicRayDetector.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityCosmicRayDetector.java @@ -8,6 +8,7 @@ import com.fulltrix.gcyl.client.ClientHandler; import com.fulltrix.gcyl.blocks.metal.MetalCasing2; import gregicality.multiblocks.common.GCYMConfigHolder; +import gregicality.multiblocks.common.metatileentities.GCYMMetaTileEntities; import gregicality.multiblocks.common.metatileentities.multiblockpart.MetaTileEntityTieredHatch; import gregtech.api.capability.*; import gregtech.api.metatileentity.MetaTileEntity; @@ -18,15 +19,19 @@ import gregtech.api.metatileentity.multiblock.ui.MultiblockUIBuilder; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; +import gregtech.api.pattern.MultiblockShapeInfo; import gregtech.api.pattern.PatternMatchContext; import gregtech.api.recipes.Recipe; import gregtech.api.recipes.logic.OCParams; import gregtech.api.recipes.properties.RecipePropertyStorage; import gregtech.api.util.KeyUtil; import gregtech.client.renderer.ICubeRenderer; +import gregtech.common.blocks.MetaBlocks; +import gregtech.common.metatileentities.MetaTileEntities; import net.minecraft.block.state.IBlockState; import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3i; @@ -38,12 +43,15 @@ import javax.annotation.Nullable; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; +import java.util.stream.Collectors; import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.COSMIC_RAY_DETECTOR_RECIPES; import static com.fulltrix.gcyl.materials.GCYLMaterials.BlackTitanium; import static com.fulltrix.gcyl.client.ClientHandler.QUANTUM_CASING; import static com.fulltrix.gcyl.blocks.GCYLMetaBlocks.METAL_CASING_2; +import static gregtech.api.util.RelativeDirection.*; public class MetaTileEntityCosmicRayDetector extends GCYLRecipeMapMultiblockController implements IOpticalComputationReceiver { @@ -97,6 +105,41 @@ protected BlockPattern createStructurePattern() { .build(); } + @Override + public List getMatchingShapes() { + MultiblockShapeInfo.Builder builder = MultiblockShapeInfo.builder(RIGHT, DOWN, FRONT) + .aisle("###############", "###############", "###############", "###############", "###############", "###############", "###############", "###############", "######xxx######", "###############") + .aisle("###############", "###############", "###############", "###############", "###############", "###############", "###############", "######xxx######", "####xx###xx####", "###############") + .aisle("###############", "###############", "###############", "###############", "###############", "###############", "#######x#######", "####xxx#xxx####", "###x#######x###", "###############") + .aisle("######ReM######", "######XXX######", "######XXX######", "###############", "###############", "#######X#######", "#####xxxxx#####", "###xx#####xx###", "##x#########x##", "###############") + .aisle("#####XXXXX#####", "#####X###X#####", "#####X###X#####", "######XXX######", "######XXX######", "#####XXXXX#####", "####xxxxxxx####", "##xx#######xx##", "#x###########x#", "###############") + .aisle("####XXXXXXX####", "####X#####X####", "####X#####X####", "#####X###X#####", "#####X###X#####", "####XXxxxXX####", "###xxx###xxx###", "##x#########x##", "#x###########x#", "###############") + .aisle("###XXXXXXXXX###", "###X###E###X###", "###X#######X###", "####X#####X####", "####X##E##X####", "####XxxxxxX####", "###xx#####xx###", "#xx#########xx#", "x#############x", "###############") + .aisle("###XXXXXXXXX###", "###X##EcE##X###", "###X###c###X###", "####X##c##X####", "####X#EcE#X####", "###XXxxExxXX###", "##xxx##C##xxx##", "#x#####C#####x#", "x######C######x", "#######s#######") + .aisle("###XXXXXXXXX###", "###X###E###X###", "###X#######X###", "####X#####X####", "####X##E##X####", "####XxxxxxX####", "###xx#####xx###", "#xx#########xx#", "x#############x", "###############") + .aisle("####XXXXXXX####", "####X#####X####", "####X#####X####", "#####X###X#####", "#####X###X#####", "####XXxxxXX####", "###xxx###xxx###", "##x#########x##", "#x###########x#", "###############") + .aisle("#####XXXXX#####", "#####X###X#####", "#####X###X#####", "######XXX######", "######XXX######", "#####XXXXX#####", "####xxxxxxx####", "##xx#######xx##", "#x###########x#", "###############") + .aisle("######XXX######", "######ISO######", "######XXo######", "###############", "###############", "#######X#######", "#####xxxxx#####", "###xx#####xx###", "##x#########x##", "###############") + .aisle("###############", "###############", "###############", "###############", "###############", "###############", "#######x#######", "####xxx#xxx####", "###x#######x###", "###############") + .aisle("###############", "###############", "###############", "###############", "###############", "###############", "###############", "######xxx######", "####xx###xx####", "###############") + .aisle("###############", "###############", "###############", "###############", "###############", "###############", "###############", "###############", "######xxx######", "###############") + .where('S', this, EnumFacing.SOUTH) + .where('I', MetaTileEntities.ITEM_IMPORT_BUS[3], EnumFacing.SOUTH) + .where('O', MetaTileEntities.ITEM_EXPORT_BUS[3], EnumFacing.SOUTH) + .where('o', MetaTileEntities.FLUID_EXPORT_HATCH[3], EnumFacing.SOUTH) + .where('M', MetaTileEntities.MAINTENANCE_HATCH, EnumFacing.NORTH) + .where('R', MetaTileEntities.OPTICAL_DATA_HATCH_RECEIVER, EnumFacing.NORTH) + .where('C', MetaBlocks.FRAMES.get(BlackTitanium).getStateFromMeta(14)) + .where('c', GCYLMetaBlocks.FUSION_COILS.getState(GCYLFusionCoils.CasingType.ADV_FUSION_COIL_3)) + .where('X', this.getCasingState()) + .where('x', this.getSecondaryCasingState()) + .where('s', GCYLMetaBlocks.FUSION_COILS.getState(GCYLFusionCoils.CasingType.ADV_FUSION_COIL_3)); + return Arrays.stream(GCYMMetaTileEntities.TIERED_HATCH) + .map(hatch -> builder.where('E', hatch, EnumFacing.DOWN) + .where('e', MetaTileEntities.ENERGY_INPUT_HATCH[hatch.getTier()], EnumFacing.NORTH).build()) + .collect(Collectors.toList()); + } + @Override protected void formStructure(PatternMatchContext context) { super.formStructure(context); diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityStellarForge.java b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityStellarForge.java index b4cc3e3..a0c4691 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityStellarForge.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityStellarForge.java @@ -3,23 +3,29 @@ import com.fulltrix.gcyl.api.multi.GCYLMultiblockRecipeLogic; import com.fulltrix.gcyl.api.multi.GCYLRecipeMapMultiblockController; import com.fulltrix.gcyl.api.pattern.TraceabilityPredicates; +import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; +import com.fulltrix.gcyl.blocks.fusion.GCYLFusionCoils; import com.fulltrix.gcyl.client.ClientHandler; import com.fulltrix.gcyl.blocks.GCYLMultiblockCasing2; import com.fulltrix.gcyl.blocks.metal.MetalCasing2; import com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps; import gregicality.multiblocks.common.GCYMConfigHolder; +import gregicality.multiblocks.common.metatileentities.GCYMMetaTileEntities; import gregicality.multiblocks.common.metatileentities.multiblockpart.MetaTileEntityTieredHatch; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.IMultiblockPart; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; +import gregtech.api.pattern.MultiblockShapeInfo; import gregtech.api.pattern.PatternMatchContext; import gregtech.client.renderer.ICubeRenderer; import gregtech.client.renderer.texture.cube.OrientedOverlayRenderer; +import gregtech.common.metatileentities.MetaTileEntities; import net.minecraft.block.state.IBlockState; import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; @@ -28,12 +34,15 @@ import javax.annotation.Nonnull; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; +import java.util.stream.Collectors; import static com.fulltrix.gcyl.api.pattern.TraceabilityPredicates.advFusionCoils; import static com.fulltrix.gcyl.client.ClientHandler.ENRICHED_NAQUADAH_ALLOY_CASING; import static com.fulltrix.gcyl.blocks.GCYLMetaBlocks.METAL_CASING_2; import static com.fulltrix.gcyl.blocks.GCYLMetaBlocks.MULTIBLOCK_CASING2; +import static gregtech.api.util.RelativeDirection.*; public class MetaTileEntityStellarForge extends GCYLRecipeMapMultiblockController { @@ -83,6 +92,39 @@ protected BlockPattern createStructurePattern() { .build(); } + @Override + public List getMatchingShapes() { + MultiblockShapeInfo.Builder builder = MultiblockShapeInfo.builder(RIGHT, DOWN, FRONT) + .aisle("###############", "######mEC######", "######C#C######", "######C#C######", "######C#C######", "######C#C######", "######C#C######", "######CCC######", "###############") + .aisle("######C#C######", "#####FFFFF#####", "###############", "###############", "###############", "###############", "###############", "#####FFFFF#####", "######C#C######") + .aisle("######C#C######", "###FF#####FF###", "###############", "###############", "###############", "###############", "###############", "###FF#####FF###", "######C#C######") + .aisle("######C#C######", "##F#########F##", "#####FFFFF#####", "###############", "###############", "###############", "#####FFFFF#####", "##F#########F##", "######C#C######") + .aisle("######C#C######", "##F#########F##", "####F#XXX#F####", "######XXX######", "######XXX######", "######XXX######", "####F#XXX#F####", "##F#########F##", "######C#C######") + .aisle("######C#C######", "#F###########F#", "###F#X###X#F###", "#####X###X#####", "#####X###X#####", "#####X###X#####", "###F#X###X#F###", "#F###########F#", "######C#C######") + .aisle("#CCCCCCMCCCCCC#", "CF####XXX####FC", "C##FX#####XF##C", "C###X#####X###C", "C###X#####X###C", "C###X#####X###C", "C##FX#####XF##C", "CF####XXX####FC", "#CCCCCCMCCCCCC#") + .aisle("######MMM######", "CF####XXX####FC", "###FX#####XF###", "####X#####X####", "####X#####X####", "####X#####X####", "###FX#####XF###", "CF####XXX####FC", "######MMM######") + .aisle("#CCCCCCMCCCCCC#", "CF####XXX####FC", "C##FX#####XF##C", "C###X#####X###C", "C###X#####X###C", "C###X#####X###C", "C##FX#####XF##C", "CF####XXX####FC", "#CCCCCCMCCCCCC#") + .aisle("######C#C######", "#F###########F#", "###F#X###X#F###", "#####X###X#####", "#####X###X#####", "#####X###X#####", "###F#X###X#F###", "#F###########F#", "######C#C######") + .aisle("######C#C######", "##F#########F##", "####F#XXX#F####", "######XXX######", "######XXX######", "######XXX######", "####F#XXX#F####", "##F#########F##", "######C#C######") + .aisle("######C#C######", "##F#########F##", "#####FFFFF#####", "###############", "###############", "###############", "#####FFFFF#####", "##F#########F##", "######C#C######") + .aisle("######C#C######", "###FF#####FF###", "###############", "###############", "###############", "###############", "###############", "###FF#####FF###", "######C#C######") + .aisle("######C#C######", "#####FFFFF#####", "###############", "###############", "###############", "###############", "###############", "#####FFFFF#####", "######C#C######") + .aisle("###############", "######ISO######", "######i#o######", "######C#C######", "######C#C######", "######C#C######", "######C#C######", "######CCC######", "###############") + .where('S', this, EnumFacing.SOUTH) + .where('I', MetaTileEntities.ITEM_IMPORT_BUS[3], EnumFacing.SOUTH) + .where('O', MetaTileEntities.ITEM_EXPORT_BUS[3], EnumFacing.SOUTH) + .where('i', MetaTileEntities.FLUID_IMPORT_HATCH[3], EnumFacing.SOUTH) + .where('o', MetaTileEntities.FLUID_EXPORT_HATCH[3], EnumFacing.SOUTH) + .where('m', MetaTileEntities.MAINTENANCE_HATCH, EnumFacing.NORTH) + .where('C', this.getCasingState()) + .where('X', MULTIBLOCK_CASING2.getState(GCYLMultiblockCasing2.CasingType.STELLAR_CONTAINMENT)) + .where('F', GCYLMetaBlocks.FUSION_COILS.getState(GCYLFusionCoils.CasingType.ADV_FUSION_COIL_1)); + return Arrays.stream(GCYMMetaTileEntities.TIERED_HATCH) + .map(hatch -> builder.where('M', hatch, EnumFacing.DOWN) + .where('E', MetaTileEntities.ENERGY_INPUT_HATCH[hatch.getTier()], EnumFacing.NORTH).build()) + .collect(Collectors.toList()); + } + @Override protected void formStructure(PatternMatchContext context) { super.formStructure(context); diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityVolcanus.java b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityVolcanus.java index a812fde..868555f 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityVolcanus.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityVolcanus.java @@ -22,6 +22,7 @@ import gregtech.api.mui.sync.FixedIntArraySyncValue; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; +import gregtech.api.pattern.MultiblockShapeInfo; import gregtech.api.pattern.PatternMatchContext; import gregtech.api.recipes.Recipe; import gregtech.api.recipes.RecipeBuilder; @@ -36,9 +37,11 @@ import gregtech.client.renderer.ICubeRenderer; import gregtech.client.renderer.texture.cube.OrientedOverlayRenderer; import gregtech.common.blocks.BlockWireCoil; +import gregtech.common.metatileentities.MetaTileEntities; import net.minecraft.block.state.IBlockState; import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; @@ -48,14 +51,18 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import java.util.Comparator; import java.util.List; import java.util.function.UnaryOperator; +import java.util.stream.Collectors; import static com.fulltrix.gcyl.client.ClientHandler.HASTELLOY_N_CASING; import static com.fulltrix.gcyl.blocks.GCYLMetaBlocks.METAL_CASING_1; import static gregtech.api.GTValues.ZPM; +import static gregtech.api.GregTechAPI.HEATING_COILS; import static gregtech.api.recipes.logic.OverclockingLogic.heatingCoilOC; +import static gregtech.api.util.RelativeDirection.*; //TODO: update ui & tooltip. improve performance @@ -157,6 +164,27 @@ protected BlockPattern createStructurePattern() { .build(); } + @Override + public List getMatchingShapes() { + MultiblockShapeInfo.Builder builder = MultiblockShapeInfo.builder(RIGHT, DOWN, FRONT) + .aisle("mEX", "CCC", "CCC", "XXX") + .aisle("XXX", "C#C", "C#C", "XMX") + .aisle("ISO", "CCC", "CCC", "iXo") + .where('S', this, EnumFacing.SOUTH) + .where('X', this.getCasingState()) + .where('I', MetaTileEntities.ITEM_IMPORT_BUS[3], EnumFacing.SOUTH) + .where('O', MetaTileEntities.ITEM_EXPORT_BUS[3], EnumFacing.SOUTH) + .where('i', MetaTileEntities.FLUID_IMPORT_HATCH[3], EnumFacing.SOUTH) + .where('o', MetaTileEntities.FLUID_EXPORT_HATCH[3], EnumFacing.SOUTH) + .where('M', MetaTileEntities.MUFFLER_HATCH[3], EnumFacing.UP) + .where('m', MetaTileEntities.MAINTENANCE_HATCH, EnumFacing.NORTH); + return HEATING_COILS.entrySet().stream() + .sorted(Comparator.comparingInt(entry -> entry.getValue().getTier())) + .map(entry -> builder.where('C', entry.getKey()) + .where('E', MetaTileEntities.ENERGY_INPUT_HATCH[entry.getValue().getTier() + 1], EnumFacing.NORTH).build()) + .collect(Collectors.toList()); + } + protected IBlockState getCasingState() { return METAL_CASING_1.getState(MetalCasing1.CasingType.HASTELLOY_N); } diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/miner/MetaTileEntityDeepMiner.java b/src/main/java/com/fulltrix/gcyl/machines/multi/miner/MetaTileEntityDeepMiner.java index c7aa157..53a77d4 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/miner/MetaTileEntityDeepMiner.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/miner/MetaTileEntityDeepMiner.java @@ -10,6 +10,7 @@ import com.fulltrix.gcyl.api.recipes.properties.GCYLTemperatureProperty; import gregicality.multiblocks.api.capability.impl.GCYMMultiblockRecipeLogic; import gregicality.multiblocks.common.GCYMConfigHolder; +import gregicality.multiblocks.common.metatileentities.GCYMMetaTileEntities; import gregicality.multiblocks.common.metatileentities.multiblockpart.MetaTileEntityTieredHatch; import gregtech.api.block.IHeatingCoilBlockStats; import gregtech.api.capability.IHeatingCoil; @@ -24,10 +25,7 @@ import gregtech.api.metatileentity.multiblock.ui.TemplateBarBuilder; import gregtech.api.mui.GTGuiTextures; import gregtech.api.mui.sync.FixedIntArraySyncValue; -import gregtech.api.pattern.BlockPattern; -import gregtech.api.pattern.FactoryBlockPattern; -import gregtech.api.pattern.PatternMatchContext; -import gregtech.api.pattern.TraceabilityPredicate; +import gregtech.api.pattern.*; import gregtech.api.recipes.Recipe; import gregtech.api.recipes.RecipeMap; import gregtech.api.recipes.logic.OCParams; @@ -41,6 +39,7 @@ import gregtech.common.blocks.BlockMetalCasing; import gregtech.common.blocks.BlockWireCoil; import gregtech.common.blocks.MetaBlocks; +import gregtech.common.metatileentities.MetaTileEntities; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.client.resources.I18n; @@ -65,8 +64,13 @@ import javax.annotation.Nullable; import java.util.ArrayList; +import java.util.Comparator; import java.util.List; import java.util.function.UnaryOperator; +import java.util.stream.Collectors; + +import static gregtech.api.GregTechAPI.HEATING_COILS; +import static gregtech.api.util.RelativeDirection.*; //TODO add fram and casing requirements to use helium and neutron plasma (traceability predicate stuff) public class MetaTileEntityDeepMiner extends GCYLRecipeMapMultiblockController implements IHeatingCoil, ProgressBarMultiblock { @@ -112,6 +116,35 @@ public MetaTileEntityDeepMiner(ResourceLocation metaTileEntityId, RecipeMap r .build(); } + @Override + public List getMatchingShapes() { + MultiblockShapeInfo.Builder builder = MultiblockShapeInfo.builder(RIGHT, DOWN, FRONT) + .aisle("##C###C##","#########","#########","#########","#########","#########","#########","#########","#########","#########","#########","#########","#########") + .aisle("#CC###CC#","##C###C##","#########","#########","#########","#########","#########","#########","#########","#########","#########","#########","#########") + .aisle("CCCFFFCCC","#CCFFFCC#","##CmMEC##","##F###F##","##F###F##","##F###F##","##CFFFC##","#########","#########","#########","#########","#########","#########") + .aisle("##FTTTF##","##FHHHF##","##CHHHC##","###HHH###","###HHH###","###HHH###","##FCCCF##","####F####","####F####","####F####","#########","#########","#########") + .aisle("##FTATF##","##FHAHF##","##CHAHC##","###HAH###","###HAH###","###HAH###","##FCACF##","###FCF###","###FCF###","###FCF###","####F####","####F####","####F####") + .aisle("##FTTTF##","##FHHHF##","##CHHHC##","###HHH###","###HHH###","###HHH###","##FCCCF##","####F####","####F####","####F####","#########","#########","#########") + .aisle("CCCFFFCCC","#CCFFFCC#","##iISOo##","##F###F##","##F###F##","##F###F##","##CFFFC##","#########","#########","#########","#########","#########","#########") + .aisle("#CC###CC#","##C###C##","#########","#########","#########","#########","#########","#########","#########","#########","#########","#########","#########") + .aisle("##C###C##","#########","#########","#########","#########","#########","#########","#########","#########","#########","#########","#########","#########") + .where('S', this, EnumFacing.SOUTH) + .where('M', MetaTileEntities.MUFFLER_HATCH[1], EnumFacing.NORTH) + .where('m', MetaTileEntities.MAINTENANCE_HATCH, EnumFacing.NORTH) + .where('I', MetaTileEntities.ITEM_IMPORT_BUS[3], EnumFacing.SOUTH) + .where('O', MetaTileEntities.ITEM_EXPORT_BUS[3], EnumFacing.SOUTH) + .where('i', MetaTileEntities.FLUID_IMPORT_HATCH[3], EnumFacing.SOUTH) + .where('o', MetaTileEntities.FLUID_EXPORT_HATCH[3], EnumFacing.SOUTH) + .where('C', this.getCasingState()) + .where('F', MetaBlocks.FRAMES.get(Materials.Steel).getStateFromMeta(4)); + return HEATING_COILS.entrySet().stream() + .sorted(Comparator.comparingInt(entry -> entry.getValue().getTier())) + .map(entry -> builder.where('H', entry.getKey()) + .where('T', GCYMMetaTileEntities.TIERED_HATCH[entry.getValue().getTier() + 1], EnumFacing.DOWN) + .where('E', MetaTileEntities.ENERGY_INPUT_HATCH[entry.getValue().getTier() + 1], EnumFacing.NORTH).build()) + .collect(Collectors.toList()); + } + @Override public void addInformation(ItemStack stack, @Nullable World player, List tooltip, boolean advanced) { super.addInformation(stack,player,tooltip,advanced); diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityChemicalPlant.java b/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityChemicalPlant.java index bfca7b8..536cf6e 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityChemicalPlant.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityChemicalPlant.java @@ -6,6 +6,7 @@ import com.fulltrix.gcyl.api.pattern.TraceabilityPredicates; import com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps; import gregicality.multiblocks.common.GCYMConfigHolder; +import gregicality.multiblocks.common.metatileentities.GCYMMetaTileEntities; import gregicality.multiblocks.common.metatileentities.multiblockpart.MetaTileEntityTieredHatch; import gregtech.api.block.IHeatingCoilBlockStats; import gregtech.api.capability.IHeatingCoil; @@ -15,6 +16,7 @@ import gregtech.api.metatileentity.multiblock.ui.MultiblockUIBuilder; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; +import gregtech.api.pattern.MultiblockShapeInfo; import gregtech.api.pattern.PatternMatchContext; import gregtech.api.recipes.RecipeMap; import gregtech.api.recipes.RecipeMaps; @@ -27,9 +29,11 @@ import gregtech.common.blocks.BlockMetalCasing; import gregtech.common.blocks.BlockWireCoil; import gregtech.common.blocks.MetaBlocks; +import gregtech.common.metatileentities.MetaTileEntities; import net.minecraft.block.state.IBlockState; import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; @@ -39,7 +43,13 @@ import org.jetbrains.annotations.Nullable; import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; import java.util.List; +import java.util.stream.Collectors; + +import static gregtech.api.GregTechAPI.HEATING_COILS; +import static gregtech.api.util.RelativeDirection.*; //TODO make a separate mega chemical reactor so this one isnt so broken public class MetaTileEntityChemicalPlant extends GCYLRecipeMapMultiblockController implements IHeatingCoil { @@ -100,6 +110,30 @@ public void addInformation(ItemStack stack, @Nullable World player, List .build(); } + @Override + public List getMatchingShapes() { + MultiblockShapeInfo.Builder builder = MultiblockShapeInfo.builder(RIGHT, DOWN, FRONT) + .aisle("E###m", "XXXXX", "X###X", "XXXXX", "X###X") + .aisle("XXXXX", "XCCCX", "XPPPX", "XCCCX", "XXXXX") + .aisle("X###X", "XPPPX", "XMMMX", "XPPPX", "X###X") + .aisle("XXXXX", "XCCCX", "XPPPX", "XCCCX", "XXXXX") + .aisle("X###X", "oIOiS", "X###X", "XXXXX", "X###X") + .where('S', this, EnumFacing.SOUTH) + .where('I', MetaTileEntities.ITEM_IMPORT_BUS[3], EnumFacing.SOUTH) + .where('O', MetaTileEntities.ITEM_EXPORT_BUS[3], EnumFacing.SOUTH) + .where('i', MetaTileEntities.FLUID_IMPORT_HATCH[3], EnumFacing.SOUTH) + .where('o', MetaTileEntities.FLUID_EXPORT_HATCH[3], EnumFacing.SOUTH) + .where('m', MetaTileEntities.MAINTENANCE_HATCH, EnumFacing.NORTH) + .where('X', this.getCasingState()) + .where('P', MetaBlocks.BOILER_CASING.getState(BlockBoilerCasing.BoilerCasingType.POLYTETRAFLUOROETHYLENE_PIPE)); + return HEATING_COILS.entrySet().stream() + .sorted(Comparator.comparingInt(entry -> entry.getValue().getTier())) + .map(entry -> builder.where('C', entry.getKey()) + .where('M', GCYMMetaTileEntities.TIERED_HATCH[entry.getValue().getTier() + 1], EnumFacing.DOWN) + .where('E', MetaTileEntities.ENERGY_INPUT_HATCH[entry.getValue().getTier() + 1], EnumFacing.NORTH).build()) + .collect(Collectors.toList()); + } + @Override protected void formStructure(PatternMatchContext context) { super.formStructure(context); diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityDecayChamber.java b/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityDecayChamber.java index 1f7f82a..11dad4d 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityDecayChamber.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityDecayChamber.java @@ -7,26 +7,34 @@ import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; import com.fulltrix.gcyl.blocks.GCYLReactorCasing; import gregicality.multiblocks.common.GCYMConfigHolder; +import gregicality.multiblocks.common.metatileentities.GCYMMetaTileEntities; import gregicality.multiblocks.common.metatileentities.multiblockpart.MetaTileEntityTieredHatch; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.IMultiblockPart; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; +import gregtech.api.pattern.MultiblockShapeInfo; import gregtech.api.pattern.PatternMatchContext; import gregtech.client.renderer.ICubeRenderer; import gregtech.client.renderer.texture.Textures; import gregtech.common.blocks.BlockGlassCasing; import gregtech.common.blocks.MetaBlocks; +import gregtech.common.metatileentities.MetaTileEntities; import net.minecraft.block.state.IBlockState; +import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; import static com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps.DECAY_CHAMBERS_RECIPES; +import static gregtech.api.util.RelativeDirection.*; //TODO: add neutron mechanics @@ -59,6 +67,27 @@ public long getMaxVoltage() { .build(); } + @Override + public List getMatchingShapes() { + MultiblockShapeInfo.Builder builder = MultiblockShapeInfo.builder(RIGHT, DOWN, FRONT) + .aisle("PEM","CGC","CGC","CGC","CCC") + .aisle("CCC","GTG","G#G","GTG","CCC") + .aisle("ISO","iGo","CGC","CGC","CCC") + .where('S', this, EnumFacing.SOUTH) + .where('I', MetaTileEntities.ITEM_IMPORT_BUS[3], EnumFacing.SOUTH) + .where('O', MetaTileEntities.ITEM_EXPORT_BUS[3], EnumFacing.SOUTH) + .where('i', MetaTileEntities.FLUID_IMPORT_HATCH[3], EnumFacing.SOUTH) + .where('o', MetaTileEntities.FLUID_EXPORT_HATCH[3], EnumFacing.SOUTH) + .where('P', GCYMMetaTileEntities.PARALLEL_HATCH[0], EnumFacing.NORTH) + .where('M', MetaTileEntities.MAINTENANCE_HATCH, EnumFacing.NORTH) + .where('C', this.getCasingState()) + .where('G', this.getGlassState()); + return Arrays.stream(GCYMMetaTileEntities.TIERED_HATCH) + .map(hatch -> builder.where('T', hatch, EnumFacing.DOWN) + .where('E', MetaTileEntities.ENERGY_INPUT_HATCH[hatch.getTier()], EnumFacing.NORTH).build()) + .collect(Collectors.toList()); + } + @Override protected void formStructure(PatternMatchContext context) { super.formStructure(context); diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityPlasmaCondenser.java b/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityPlasmaCondenser.java index dc357a4..bb658ee 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityPlasmaCondenser.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityPlasmaCondenser.java @@ -6,21 +6,25 @@ import com.fulltrix.gcyl.blocks.metal.MetalCasing1; import com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps; import gregicality.multiblocks.common.GCYMConfigHolder; +import gregicality.multiblocks.common.metatileentities.GCYMMetaTileEntities; import gregicality.multiblocks.common.metatileentities.multiblockpart.MetaTileEntityTieredHatch; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.IMultiblockPart; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; +import gregtech.api.pattern.MultiblockShapeInfo; import gregtech.api.pattern.PatternMatchContext; import gregtech.client.renderer.ICubeRenderer; import gregtech.client.renderer.texture.Textures; import gregtech.common.blocks.BlockBoilerCasing; import gregtech.common.blocks.BlockTurbineCasing; import gregtech.common.blocks.MetaBlocks; +import gregtech.common.metatileentities.MetaTileEntities; import net.minecraft.block.state.IBlockState; import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; @@ -30,10 +34,13 @@ import javax.annotation.Nonnull; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; +import java.util.stream.Collectors; import static com.fulltrix.gcyl.client.ClientHandler.HASTELLOY_N_CASING; import static com.fulltrix.gcyl.blocks.GCYLMetaBlocks.METAL_CASING_1; +import static gregtech.api.util.RelativeDirection.*; public class MetaTileEntityPlasmaCondenser extends GCYLRecipeMapMultiblockController { @@ -79,6 +86,29 @@ protected BlockPattern createStructurePattern() { .build(); } + @Override + public List getMatchingShapes() { + MultiblockShapeInfo.Builder builder = MultiblockShapeInfo.builder(RIGHT, DOWN, FRONT) + .aisle("#####", "#XMX#", "#XEX#", "#XXX#", "#####") + .aisle("#XXX#", "XGAGX", "XAPAX", "XGpGX", "#XXX#") + .aisle("#XXX#", "XAPAX", "XPPPX", "XpPpX", "#XXX#") + .aisle("#XXX#", "XGAGX", "XAPAX", "XGpGX", "#XXX#") + .aisle("#####", "#XXX#", "#ISO#", "#iXo#", "#####") + .where('S', this, EnumFacing.SOUTH) + .where('X', this.getCasingState()) + .where('I', MetaTileEntities.ITEM_IMPORT_BUS[3], EnumFacing.SOUTH) + .where('O', MetaTileEntities.ITEM_EXPORT_BUS[3], EnumFacing.SOUTH) + .where('i', MetaTileEntities.FLUID_IMPORT_HATCH[3], EnumFacing.SOUTH) + .where('o', MetaTileEntities.FLUID_EXPORT_HATCH[3], EnumFacing.SOUTH) + .where('M', MetaTileEntities.MAINTENANCE_HATCH, EnumFacing.NORTH) + .where('G', MetaBlocks.TURBINE_CASING.getState(BlockTurbineCasing.TurbineCasingType.STEEL_GEARBOX)) + .where('P', MetaBlocks.BOILER_CASING.getState(BlockBoilerCasing.BoilerCasingType.TUNGSTENSTEEL_PIPE)); + return Arrays.stream(GCYMMetaTileEntities.TIERED_HATCH) + .map(hatch -> builder.where('p', hatch, EnumFacing.DOWN) + .where('E', MetaTileEntities.ENERGY_INPUT_HATCH[hatch.getTier()], EnumFacing.NORTH).build()) + .collect(Collectors.toList()); + } + @Override protected void formStructure(PatternMatchContext context) { super.formStructure(context); From 5ae38e0f3237e286bc43c885d84aef94a3940701 Mon Sep 17 00:00:00 2001 From: Johny709 <86203059+Johny709@users.noreply.github.com> Date: Thu, 25 Dec 2025 14:21:41 -0500 Subject: [PATCH 17/22] Fix Cosmic Ray Detector not forming --- .../gcyl/machines/multi/MetaTileEntityCosmicRayDetector.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityCosmicRayDetector.java b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityCosmicRayDetector.java index f42d4d1..db78870 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityCosmicRayDetector.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityCosmicRayDetector.java @@ -128,7 +128,7 @@ public List getMatchingShapes() { .where('O', MetaTileEntities.ITEM_EXPORT_BUS[3], EnumFacing.SOUTH) .where('o', MetaTileEntities.FLUID_EXPORT_HATCH[3], EnumFacing.SOUTH) .where('M', MetaTileEntities.MAINTENANCE_HATCH, EnumFacing.NORTH) - .where('R', MetaTileEntities.OPTICAL_DATA_HATCH_RECEIVER, EnumFacing.NORTH) + .where('R', MetaTileEntities.COMPUTATION_HATCH_RECEIVER, EnumFacing.NORTH) .where('C', MetaBlocks.FRAMES.get(BlackTitanium).getStateFromMeta(14)) .where('c', GCYLMetaBlocks.FUSION_COILS.getState(GCYLFusionCoils.CasingType.ADV_FUSION_COIL_3)) .where('X', this.getCasingState()) From 81479ba250c98fc3b4b2d051be090e77f1c166a8 Mon Sep 17 00:00:00 2001 From: Johny709 <86203059+Johny709@users.noreply.github.com> Date: Thu, 25 Dec 2025 15:56:24 -0500 Subject: [PATCH 18/22] Fix Adv Centrifuge voltage casings --- .../advance/MetaTileEntityAdvCentrifuge.java | 66 +++++++++++++++++-- 1 file changed, 60 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityAdvCentrifuge.java b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityAdvCentrifuge.java index ca64a3a..34da42a 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityAdvCentrifuge.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityAdvCentrifuge.java @@ -1,34 +1,54 @@ package com.fulltrix.gcyl.machines.multi.advance; +import com.fulltrix.gcyl.api.multi.GCYLMultiblockRecipeLogic; +import com.fulltrix.gcyl.api.multi.GCYLRecipeMapMultiblockController; +import com.fulltrix.gcyl.api.pattern.TraceabilityPredicates; import com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps; -import gregicality.multiblocks.api.metatileentity.GCYMRecipeMapMultiblockController; import gregicality.multiblocks.api.render.GCYMTextures; +import gregicality.multiblocks.common.GCYMConfigHolder; import gregicality.multiblocks.common.block.GCYMMetaBlocks; import gregicality.multiblocks.common.block.blocks.BlockLargeMultiblockCasing; -import gregicality.multiblocks.common.metatileentities.multiblock.standard.MetaTileEntityLargeCentrifuge; +import gregicality.multiblocks.common.metatileentities.GCYMMetaTileEntities; +import gregicality.multiblocks.common.metatileentities.multiblockpart.MetaTileEntityTieredHatch; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.IMultiblockPart; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; +import gregtech.api.pattern.MultiblockShapeInfo; +import gregtech.api.pattern.PatternMatchContext; import gregtech.api.recipes.RecipeMap; import gregtech.api.recipes.RecipeMaps; import gregtech.client.renderer.ICubeRenderer; import gregtech.client.renderer.texture.cube.OrientedOverlayRenderer; import gregtech.common.blocks.BlockBoilerCasing; import gregtech.common.blocks.MetaBlocks; +import gregtech.common.metatileentities.MetaTileEntities; import net.minecraft.block.state.IBlockState; +import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; import org.jetbrains.annotations.NotNull; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + import static gregtech.api.util.RelativeDirection.*; //TODO: remove centrifuge map when small recipe maps work -public class MetaTileEntityAdvCentrifuge extends GCYMRecipeMapMultiblockController { +public class MetaTileEntityAdvCentrifuge extends GCYLRecipeMapMultiblockController { + + private long maxVoltage; public MetaTileEntityAdvCentrifuge(ResourceLocation metaTileEntityId) { - super(metaTileEntityId, - new RecipeMap[] { RecipeMaps.THERMAL_CENTRIFUGE_RECIPES, GCYLRecipeMaps.ADVANCED_CENTRIFUGE_RECIPES, RecipeMaps.CENTRIFUGE_RECIPES }); + super(metaTileEntityId, new RecipeMap[] { RecipeMaps.THERMAL_CENTRIFUGE_RECIPES, GCYLRecipeMaps.ADVANCED_CENTRIFUGE_RECIPES, RecipeMaps.CENTRIFUGE_RECIPES }, true); + this.recipeMapWorkable = new GCYLMultiblockRecipeLogic(this, false) { + @Override + public long getMaxVoltage() { + return GCYMConfigHolder.globalMultiblocks.enableTieredCasings ? maxVoltage : super.getMaxVoltage(); + } + }; } @Override @@ -45,12 +65,46 @@ public MetaTileEntity createMetaTileEntity(IGregTechTileEntity metaTileEntityHol .where('S', selfPredicate()) .where('X', states(getCasingState()).setMinGlobalLimited(40).or(autoAbilities())) .where('C', states(getCasingState2())) - .where('T', tieredCasing().or(air())) + .where('T', TraceabilityPredicates.tieredHatchPredicate()) .where('A', air()) .where('#', any()) .build(); } + @Override + public List getMatchingShapes() { + MultiblockShapeInfo.Builder builder = MultiblockShapeInfo.builder(RIGHT, BACK, DOWN) + .aisle("#XXX#", "XXXXX", "XXXXX", "XXXXX", "#XXX#") + .aisle("iISOo", "XACAX", "XCTCX", "XACAX", "XPEMX") + .aisle("#XXX#", "XXXXX", "XXXXX", "XXXXX", "#XXX#") + .where('S', this, EnumFacing.SOUTH) + .where('I', MetaTileEntities.ITEM_IMPORT_BUS[3], EnumFacing.SOUTH) + .where('O', MetaTileEntities.ITEM_EXPORT_BUS[3], EnumFacing.SOUTH) + .where('i', MetaTileEntities.FLUID_IMPORT_HATCH[3], EnumFacing.SOUTH) + .where('o', MetaTileEntities.ITEM_EXPORT_BUS[3], EnumFacing.SOUTH) + .where('P', GCYMMetaTileEntities.PARALLEL_HATCH[0], EnumFacing.NORTH) + .where('M', MetaTileEntities.MAINTENANCE_HATCH, EnumFacing.NORTH) + .where('X', this.getCasingState()) + .where('C', this.getCasingState2()); + return Arrays.stream(GCYMMetaTileEntities.TIERED_HATCH) + .map(hatch -> builder.where('T', hatch, EnumFacing.DOWN) + .where('E', MetaTileEntities.ENERGY_INPUT_HATCH[hatch.getTier()], EnumFacing.NORTH).build()) + .collect(Collectors.toList()); + } + + @Override + protected void formStructure(PatternMatchContext context) { + super.formStructure(context); + int tier = context.getOrDefault("tiered_hatches", new ArrayList()).get(0).getTier() - 1; + this.maxVoltage = 32L << tier * 2; + } + + @Override + public void invalidateStructure() { + super.invalidateStructure(); + this.maxVoltage = 0; + } + private IBlockState getCasingState() { return GCYMMetaBlocks.LARGE_MULTIBLOCK_CASING .getState(BlockLargeMultiblockCasing.CasingType.VIBRATION_SAFE_CASING); From 4480bb8e684b10daadf0819465e2089c4555b0d1 Mon Sep 17 00:00:00 2001 From: Johny709 <86203059+Johny709@users.noreply.github.com> Date: Thu, 25 Dec 2025 16:35:35 -0500 Subject: [PATCH 19/22] Fix Adv Mixer voltage casings --- .../multi/advance/MetaTileEntityAdvMixer.java | 77 ++++++++++++++++--- 1 file changed, 66 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityAdvMixer.java b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityAdvMixer.java index 583c193..430dbfa 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityAdvMixer.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityAdvMixer.java @@ -1,17 +1,23 @@ package com.fulltrix.gcyl.machines.multi.advance; +import com.fulltrix.gcyl.api.multi.GCYLMultiblockRecipeLogic; +import com.fulltrix.gcyl.api.multi.GCYLRecipeMapMultiblockController; +import com.fulltrix.gcyl.api.pattern.TraceabilityPredicates; import com.fulltrix.gcyl.api.recipes.GCYLRecipeMaps; -import gregicality.multiblocks.api.metatileentity.GCYMRecipeMapMultiblockController; import gregicality.multiblocks.api.render.GCYMTextures; import gregicality.multiblocks.api.unification.GCYMMaterials; +import gregicality.multiblocks.common.GCYMConfigHolder; import gregicality.multiblocks.common.block.GCYMMetaBlocks; import gregicality.multiblocks.common.block.blocks.BlockLargeMultiblockCasing; -import gregicality.multiblocks.common.metatileentities.multiblock.standard.MetaTileEntityLargeMixer; +import gregicality.multiblocks.common.metatileentities.GCYMMetaTileEntities; +import gregicality.multiblocks.common.metatileentities.multiblockpart.MetaTileEntityTieredHatch; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.IMultiblockPart; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; +import gregtech.api.pattern.MultiblockShapeInfo; +import gregtech.api.pattern.PatternMatchContext; import gregtech.api.recipes.RecipeMap; import gregtech.api.recipes.RecipeMaps; import gregtech.client.renderer.ICubeRenderer; @@ -20,19 +26,35 @@ import gregtech.common.blocks.BlockMetalCasing; import gregtech.common.blocks.BlockTurbineCasing; import gregtech.common.blocks.MetaBlocks; +import gregtech.common.metatileentities.MetaTileEntities; import net.minecraft.block.state.IBlockState; +import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; import org.jetbrains.annotations.NotNull; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +import static gregtech.api.util.RelativeDirection.*; + //TODO: remove regular mixer recipes once small map is implemented -public class MetaTileEntityAdvMixer extends GCYMRecipeMapMultiblockController { +public class MetaTileEntityAdvMixer extends GCYLRecipeMapMultiblockController { + + private long maxVoltage; public MetaTileEntityAdvMixer(ResourceLocation metaTileEnttityID) { - super(metaTileEnttityID, new RecipeMap[] {RecipeMaps.MIXER_RECIPES, GCYLRecipeMaps.ADVANCED_MIXER_RECIPES}); + super(metaTileEnttityID, new RecipeMap[] {RecipeMaps.MIXER_RECIPES, GCYLRecipeMaps.ADVANCED_MIXER_RECIPES}, true); + this.recipeMapWorkable = new GCYLMultiblockRecipeLogic(this, false) { + @Override + public long getMaxVoltage() { + return GCYMConfigHolder.globalMultiblocks.enableTieredCasings ? maxVoltage : super.getMaxVoltage(); + } + }; } - @Override public MetaTileEntity createMetaTileEntity(IGregTechTileEntity metaTileEntityHolder) { return new MetaTileEntityAdvMixer(this.metaTileEntityId); @@ -50,13 +72,51 @@ public MetaTileEntity createMetaTileEntity(IGregTechTileEntity metaTileEntityHol .where('X', states(getCasingState()).setMinGlobalLimited(50).or(autoAbilities())) .where('P', states(getCasingState2())) .where('C', states(getCasingState3())) - .where('T', tieredCasing().or(states(getCasingState4()))) + .where('T', TraceabilityPredicates.tieredHatchPredicate()) .where('F', frames(GCYMMaterials.HastelloyX)) .where('A', air()) .where('#', any()) .build(); } + @Override + public List getMatchingShapes() { + MultiblockShapeInfo.Builder builder = MultiblockShapeInfo.builder(RIGHT, DOWN, FRONT) + .aisle("#pEM#", "#XXX#", "#XXX#", "#XXX#", "#XXX#", "##F##") + .aisle("XXXXX", "XACAX", "XAAAX", "XACAX", "XAAAX", "##F##") + .aisle("XXXXX", "XCPCX", "XAPAX", "XCPCX", "XAPAX", "FFTFF") + .aisle("XXXXX", "iACAo", "XAAAX", "XACAX", "XAAAX", "##F##") + .aisle("#XXX#", "#ISO#", "#XXX#", "#XXX#", "#XXX#", "##F##") + .where('S', this, EnumFacing.SOUTH) + .where('I', MetaTileEntities.ITEM_IMPORT_BUS[3], EnumFacing.SOUTH) + .where('O', MetaTileEntities.ITEM_EXPORT_BUS[3], EnumFacing.SOUTH) + .where('i', MetaTileEntities.FLUID_IMPORT_HATCH[3], EnumFacing.SOUTH) + .where('o', MetaTileEntities.FLUID_EXPORT_HATCH[3], EnumFacing.SOUTH) + .where('p', GCYMMetaTileEntities.PARALLEL_HATCH[0], EnumFacing.NORTH) + .where('M', MetaTileEntities.MAINTENANCE_HATCH, EnumFacing.NORTH) + .where('X', this.getCasingState()) + .where('P', this.getCasingState2()) + .where('C', this.getCasingState3()) + .where('F', MetaBlocks.FRAMES.get(GCYMMaterials.HastelloyX).getStateFromMeta(12)); + return Arrays.stream(GCYMMetaTileEntities.TIERED_HATCH) + .map(hatch -> builder.where('T', hatch, EnumFacing.DOWN) + .where('E', MetaTileEntities.ENERGY_INPUT_HATCH[hatch.getTier()], EnumFacing.NORTH).build()) + .collect(Collectors.toList()); + } + + @Override + protected void formStructure(PatternMatchContext context) { + super.formStructure(context); + int tier = context.getOrDefault("tiered_hatches", new ArrayList()).get(0).getTier() - 1; + this.maxVoltage = 32L << tier * 2; + } + + @Override + public void invalidateStructure() { + super.invalidateStructure(); + this.maxVoltage = 0; + } + private IBlockState getCasingState() { return GCYMMetaBlocks.LARGE_MULTIBLOCK_CASING.getState(BlockLargeMultiblockCasing.CasingType.MIXER_CASING); } @@ -83,9 +143,4 @@ public ICubeRenderer getBaseTexture(IMultiblockPart iMultiblockPart) { return GCYMTextures.LARGE_MIXER_OVERLAY; } - @Override - public boolean canBeDistinct() { - return true; - } - } From 8f8c3a0ffe1170247b68d67514fd4651522c2f72 Mon Sep 17 00:00:00 2001 From: Johny709 <86203059+Johny709@users.noreply.github.com> Date: Fri, 26 Dec 2025 09:20:31 -0500 Subject: [PATCH 20/22] Add lasers to Component Assembly Line --- .../api/pattern/TraceabilityPredicates.java | 35 ++++++++++++ .../advance/MetaTileEntityComponentAL.java | 56 +++++++++---------- 2 files changed, 60 insertions(+), 31 deletions(-) diff --git a/src/main/java/com/fulltrix/gcyl/api/pattern/TraceabilityPredicates.java b/src/main/java/com/fulltrix/gcyl/api/pattern/TraceabilityPredicates.java index 1861b4d..9d6eabf 100644 --- a/src/main/java/com/fulltrix/gcyl/api/pattern/TraceabilityPredicates.java +++ b/src/main/java/com/fulltrix/gcyl/api/pattern/TraceabilityPredicates.java @@ -4,6 +4,7 @@ import com.fulltrix.gcyl.api.block.IComponentALTier; import com.fulltrix.gcyl.api.block.IElevatorMotorTier; import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; +import com.fulltrix.gcyl.blocks.component_al.GCYLComponentALCasing; import com.fulltrix.gcyl.blocks.fusion.GCYLFusionCoils; import gregicality.multiblocks.api.metatileentity.GCYMMultiblockAbility; import gregicality.multiblocks.common.metatileentities.multiblockpart.MetaTileEntityTieredHatch; @@ -15,6 +16,7 @@ import gregtech.api.pattern.PatternStringError; import gregtech.api.pattern.TraceabilityPredicate; import gregtech.api.util.BlockInfo; +import groovyjarjarantlr4.runtime.misc.IntArray; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import org.apache.commons.lang3.ArrayUtils; @@ -58,6 +60,9 @@ public class TraceabilityPredicates { return false; } blockWorldState.getMatchContext().getOrPut("VABlock", new LinkedList<>()).add(blockWorldState.getPos()); + + IntArray bonus = blockWorldState.getMatchContext().getOrCreate("filtered_casings_speed", IntArray::new); + bonus.add(currentFilter.getTier() * 5); return true; } @@ -150,6 +155,36 @@ public static TraceabilityPredicate tieredHatchPredicate() { }).toArray(BlockInfo[]::new)); } + public static TraceabilityPredicate componentAssemblyLineCasingPredicate() { + return new TraceabilityPredicate(blockWorldState -> { + if (blockWorldState.getBlockState().getBlock() instanceof GCYLComponentALCasing componentALCasing) { + GCYLComponentALCasing.CasingType casingType = componentALCasing.getState(blockWorldState.getBlockState()); + List casingTypes = blockWorldState.getMatchContext().getOrCreate("componentAssemblyLineCasings", ArrayList::new); + casingTypes.add(casingType); + return casingTypes.get(0).getTier() == casingType.getTier(); + } + return false; + }, () -> Arrays.stream(GCYLComponentALCasing.CasingType.values()) + .sorted(Comparator.comparingInt(GCYLComponentALCasing.CasingType::getTier)) + .map(entry -> new BlockInfo(GCYLMetaBlocks.GCYL_COMPONENT_AL_CASING.getState(entry))) + .toArray(BlockInfo[]::new)); + } + + public static TraceabilityPredicate filterCasingPredicate() { + return new TraceabilityPredicate(blockWorldState -> { + ICleanroomFilter filter; + if ((filter = GCYLAPI.GCYL_FILTER_CASINGS.get(blockWorldState.getBlockState())) != null) { + List filters = blockWorldState.getMatchContext().getOrCreate("filterCasings", ArrayList::new); + filters.add(filter); + return filters.get(0).getCleanroomType() == filter.getCleanroomType(); + } + return false; + }, () -> GCYLAPI.GCYL_FILTER_CASINGS.entrySet().stream() + .sorted(Comparator.comparingInt(entry -> entry.getValue().getTier())) + .map(entry -> new BlockInfo(entry.getKey())) + .toArray(BlockInfo[]::new)); + } + public static TraceabilityPredicate advFusionCoils() { return ADV_FUSION_COIL_PRED.get(); } diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityComponentAL.java b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityComponentAL.java index 60e8530..3f060fb 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityComponentAL.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityComponentAL.java @@ -1,6 +1,7 @@ package com.fulltrix.gcyl.machines.multi.advance; -import com.fulltrix.gcyl.api.block.IComponentALTier; +import com.fulltrix.gcyl.api.multi.GCYLComputationRecipeLogic; +import com.fulltrix.gcyl.api.multi.GCYLRecipeMapMultiblockController; import com.fulltrix.gcyl.api.recipes.ITier; import com.fulltrix.gcyl.api.recipes.properties.ComponentALProperty; import com.fulltrix.gcyl.blocks.GCYLMetaBlocks; @@ -14,12 +15,10 @@ import gregtech.api.capability.IOpticalComputationProvider; import gregtech.api.capability.IOpticalComputationReceiver; import gregtech.api.capability.impl.ComputationRecipeLogic; -import gregtech.api.capability.impl.MultiblockRecipeLogic; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.IMultiblockPart; import gregtech.api.metatileentity.multiblock.MultiblockAbility; -import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController; import gregtech.api.metatileentity.multiblock.ui.MultiblockUIBuilder; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; @@ -30,14 +29,11 @@ import gregtech.client.renderer.ICubeRenderer; import gregtech.common.blocks.*; import gregtech.common.metatileentities.MetaTileEntities; -import net.minecraft.block.state.IBlockState; import net.minecraft.client.resources.I18n; -import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.text.ITextComponent; -import net.minecraft.util.text.TextComponentTranslation; +import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -55,14 +51,14 @@ import static gregtech.api.util.RelativeDirection.*; //TODO implement filter bonus, laser hatches -public class MetaTileEntityComponentAL extends RecipeMapMultiblockController implements ITier, IOpticalComputationReceiver { +public class MetaTileEntityComponentAL extends GCYLRecipeMapMultiblockController implements ITier, IOpticalComputationReceiver { private IOpticalComputationProvider computationProvider; private int tier; private int filterTier; public MetaTileEntityComponentAL(ResourceLocation metaTileEntityId) { - super(metaTileEntityId, COMPONENT_AL_RECIPES); + super(metaTileEntityId, COMPONENT_AL_RECIPES, false); this.recipeMapWorkable = new ComponentALRecipeLogic(this); } @@ -110,15 +106,16 @@ protected BlockPattern createStructurePattern() { .where('S', selfPredicate()) .where('F', frames(TungstenSteel)) .where('G', states(MetaBlocks.TRANSPARENT_CASING.getState(BlockGlassCasing.CasingType.LAMINATED_GLASS))) - .where('T', filterCasings()) - .where('I', componentALCasings()) + .where('T', filterCasingPredicate()) + .where('I', componentAssemblyLineCasingPredicate()) .where('A', states(MetaBlocks.MULTIBLOCK_CASING.getState(BlockMultiblockCasing.MultiblockCasingType.ASSEMBLY_CONTROL))) .where('B', states(MetaBlocks.MULTIBLOCK_CASING.getState(BlockMultiblockCasing.MultiblockCasingType.ASSEMBLY_LINE_CASING))) .where('P', states(MetaBlocks.BOILER_CASING.getState(BlockBoilerCasing.BoilerCasingType.POLYTETRAFLUOROETHYLENE_PIPE))) .where('C', states(GCYLMetaBlocks.METAL_CASING_2.getState(MetalCasing2.CasingType.IRIDIUM)) .setMinGlobalLimited(630) .or(autoAbilities(true,true,true,true,true,false,false)) - .or(abilities(MultiblockAbility.COMPUTATION_DATA_RECEPTION).setExactLimit(1))) + .or(abilities(MultiblockAbility.COMPUTATION_DATA_RECEPTION).setExactLimit(1)) + .or(abilities(MultiblockAbility.INPUT_LASER).setMaxGlobalLimited(1))) .where('#', air()) .build(); } @@ -167,7 +164,6 @@ public List getMatchingShapes() { .where('B', MetaBlocks.MULTIBLOCK_CASING.getState(BlockMultiblockCasing.MultiblockCasingType.ASSEMBLY_LINE_CASING)) .where('P', MetaBlocks.BOILER_CASING.getState(BlockBoilerCasing.BoilerCasingType.POLYTETRAFLUOROETHYLENE_PIPE)) .where('C', GCYLMetaBlocks.METAL_CASING_2.getState(MetalCasing2.CasingType.IRIDIUM)) - .where('#', Blocks.AIR.getDefaultState()) .where('M', MetaTileEntities.MAINTENANCE_HATCH, EnumFacing.NORTH) .where('E', MetaTileEntities.ENERGY_INPUT_HATCH[9], EnumFacing.NORTH) .where('Z', MetaTileEntities.ITEM_IMPORT_BUS[5], EnumFacing.NORTH) @@ -201,33 +197,23 @@ public ICubeRenderer getBaseTexture(IMultiblockPart iMultiblockPart) { @Override protected void formStructure(PatternMatchContext context) { super.formStructure(context); - Object type = context.get("ComponentALTier"); - if(type instanceof IComponentALTier) { - this.tier = ((IComponentALTier) type).getTier() + 1; - } - else - this.tier = 0; + this.tier = context.getOrPut("componentAssemblyLineCasings", new ArrayList()).get(0).getTier() + 1; + this.filterTier = context.getOrPut("filterCasings", new ArrayList()).get(0).getTier(); List providers = getAbilities(MultiblockAbility.COMPUTATION_DATA_RECEPTION); - if (providers != null && providers.size() >= 1) { + if (providers != null && !providers.isEmpty()) { computationProvider = providers.get(0); } if (computationProvider == null) { invalidateStructure(); } - - this.filterTier = ((ICleanroomFilter) context.get("FilterType")).getTier(); - } - - @Override - public boolean canBeDistinct() { - return true; } @Override public void invalidateStructure() { super.invalidateStructure(); + this.filterTier = 0; this.tier = 0; } @@ -238,8 +224,13 @@ public int getTier() { @Override protected void configureDisplayText(MultiblockUIBuilder builder) { - builder.addCustom((keyManager, uiSyncer) -> { - keyManager.add(KeyUtil.lang("gcyl.multiblock.coal.max_recipe_tier", GTValues.VN[this.tier])); + super.configureDisplayText(builder); + ComponentALRecipeLogic recipeLogic = (ComponentALRecipeLogic)this.recipeMapWorkable; + builder.addComputationUsageLine(recipeLogic.getRecipeCWUt()) + .addCustom((keyManager, uiSyncer) -> { + String tier = uiSyncer.syncString(GTValues.VOCNF[this.tier]); + if (uiSyncer.syncBoolean(this.isStructureFormed())) + keyManager.add(KeyUtil.lang(TextFormatting.GRAY, "gcyl.multiblock.coal.max_recipe_tier", tier)); }); } @@ -255,8 +246,12 @@ public IOpticalComputationProvider getComputationProvider() { return computationProvider; } + @Override + public boolean isTiered() { + return false; + } - private class ComponentALRecipeLogic extends ComputationRecipeLogic { + private class ComponentALRecipeLogic extends GCYLComputationRecipeLogic { MetaTileEntityComponentAL componentAL; @@ -269,7 +264,6 @@ public ComponentALRecipeLogic(MetaTileEntityComponentAL metaTileEntity) { public boolean checkRecipe(@NotNull Recipe recipe) { if (!super.checkRecipe(recipe)) return false; - return recipe.getProperty(ComponentALProperty.getInstance(), 0) <= tier; } From f5ec1eec4daa25c4415809da547b609b3ba1dac1 Mon Sep 17 00:00:00 2001 From: Johny709 Date: Thu, 15 Jan 2026 19:06:30 -0500 Subject: [PATCH 21/22] finish volcanus and cryo freezer logic. --- .../advance/MetaTileEntityComponentAL.java | 1 - .../MetaTileEntityCryogenicFreezer.java | 25 +++++++++++++++---- .../multi/advance/MetaTileEntityVolcanus.java | 16 +++++++----- .../resources/assets/gcyl/lang/en_us.lang | 4 ++- 4 files changed, 33 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityComponentAL.java b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityComponentAL.java index 3f060fb..5f10a0a 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityComponentAL.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityComponentAL.java @@ -50,7 +50,6 @@ import static gregtech.api.unification.material.Materials.TungstenSteel; import static gregtech.api.util.RelativeDirection.*; -//TODO implement filter bonus, laser hatches public class MetaTileEntityComponentAL extends GCYLRecipeMapMultiblockController implements ITier, IOpticalComputationReceiver { private IOpticalComputationProvider computationProvider; diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityCryogenicFreezer.java b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityCryogenicFreezer.java index 271d6c8..a859bb7 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityCryogenicFreezer.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityCryogenicFreezer.java @@ -15,6 +15,7 @@ import gregtech.api.metatileentity.multiblock.IMultiblockPart; import gregtech.api.metatileentity.multiblock.ProgressBarMultiblock; import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController; +import gregtech.api.metatileentity.multiblock.ui.MultiblockUIBuilder; import gregtech.api.metatileentity.multiblock.ui.TemplateBarBuilder; import gregtech.api.mui.GTGuiTextures; import gregtech.api.mui.sync.FixedIntArraySyncValue; @@ -24,12 +25,14 @@ import gregtech.api.recipes.RecipeBuilder; import gregtech.api.recipes.RecipeMaps; import gregtech.api.util.GTUtility; +import gregtech.api.util.KeyUtil; import gregtech.client.renderer.ICubeRenderer; import gregtech.client.renderer.texture.cube.OrientedOverlayRenderer; import net.minecraft.block.state.IBlockState; import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fml.relauncher.Side; @@ -50,7 +53,7 @@ public class MetaTileEntityCryogenicFreezer extends GCYLRecipeMapMultiblockContr private static final FluidStack CRYOTHEUM = GCYLMaterials.Cryotheum.getFluid(Integer.MAX_VALUE); - private FluidStack cryotheum; + private FluidStack cryotheum = CRYOTHEUM; public MetaTileEntityCryogenicFreezer(ResourceLocation metaTileEntityId) { super(metaTileEntityId, RecipeMaps.VACUUM_RECIPES, false); @@ -63,12 +66,24 @@ public MetaTileEntity createMetaTileEntity(IGregTechTileEntity metaTileEntityHol return new MetaTileEntityCryogenicFreezer(this.metaTileEntityId); } + @Override + protected void configureDisplayText(MultiblockUIBuilder builder) { + super.configureDisplayText(builder); + builder.addCustom((key, syncer) -> key.add(KeyUtil.lang(TextFormatting.GRAY, "gcyl.machine.fluid.tick.consuming", this.cryotheum.getLocalizedName(), syncer.syncInt(this.cryotheum.amount)))); + } + @Override protected void formStructure(PatternMatchContext context) { super.formStructure(context); this.cryotheum = GCYLMaterials.Cryotheum.getFluid((int) Math.pow(2, GTUtility.getTierByVoltage(this.energyContainer.getInputVoltage()))); } + @Override + public void invalidateStructure() { + super.invalidateStructure(); + this.cryotheum = CRYOTHEUM; + } + @Override protected BlockPattern createStructurePattern() { return FactoryBlockPattern.start() @@ -157,10 +172,10 @@ public int getParallelLimit() { @Override public void applyParallelBonus(@NotNull RecipeBuilder builder) { - long EUt = (long) (builder.getEUt() * 0.9); - - builder.EUt(EUt / builder.getParallel()) - .duration((int) (builder.getDuration() * (1.0F / 2.2F))); + int currentParallel = builder.getParallel(); + long currentRecipeEU = builder.getEUt() / currentParallel; + int currentRecipeDuration = builder.getDuration() / this.getParallelLimit(); + builder.EUt(currentRecipeEU * 2).duration(currentRecipeDuration * currentParallel); } } } diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityVolcanus.java b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityVolcanus.java index 868555f..dccf4d9 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityVolcanus.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityVolcanus.java @@ -71,7 +71,7 @@ public class MetaTileEntityVolcanus extends GCYLRecipeMapMultiblockController im private static final FluidStack PYROTHEUM = GCYLMaterials.Pyrotheum.getFluid(Integer.MAX_VALUE); private int blastFurnaceTemperature; - private FluidStack pyrotheum; + private FluidStack pyrotheum = PYROTHEUM; public MetaTileEntityVolcanus(ResourceLocation metaTileEntityId) { super(metaTileEntityId, RecipeMaps.BLAST_RECIPES, false); @@ -87,7 +87,10 @@ public MetaTileEntity createMetaTileEntity(IGregTechTileEntity metaTileEntityHol @Override protected void configureDisplayText(MultiblockUIBuilder builder) { super.configureDisplayText(builder); - builder.addCustom((keyManager, uiSyncer) -> keyManager.add(KeyUtil.lang(TextFormatting.RED, "gregtech.multiblock.blast_furnace.max_temperature", uiSyncer.syncInt(this.blastFurnaceTemperature)))); + builder.addCustom((keyManager, uiSyncer) -> { + keyManager.add(KeyUtil.lang(TextFormatting.RED, "gregtech.multiblock.blast_furnace.max_temperature", uiSyncer.syncInt(this.blastFurnaceTemperature))); + keyManager.add(KeyUtil.lang(TextFormatting.GRAY, "gcyl.machine.fluid.tick.consuming", this.pyrotheum.getLocalizedName(), uiSyncer.syncInt(this.pyrotheum.amount))); + }); } @Override @@ -103,6 +106,7 @@ protected void formStructure(PatternMatchContext context) { public void invalidateStructure() { super.invalidateStructure(); this.blastFurnaceTemperature = 0; + this.pyrotheum = PYROTHEUM; } @Override @@ -236,10 +240,10 @@ public int getParallelLimit() { @Override public void applyParallelBonus(@NotNull RecipeBuilder builder) { - long EUt = (long) (builder.getEUt() * 0.9); - - builder.EUt(EUt / builder.getParallel()) - .duration((int) (builder.getDuration() * (1.0F / 2.2F))); + int currentParallel = builder.getParallel(); + long currentRecipeEU = builder.getEUt() / currentParallel; + int currentRecipeDuration = builder.getDuration() / this.getParallelLimit(); + builder.EUt(currentRecipeEU * 2).duration(currentRecipeDuration * currentParallel); } @Override diff --git a/src/main/resources/assets/gcyl/lang/en_us.lang b/src/main/resources/assets/gcyl/lang/en_us.lang index 8b13934..8f374fd 100644 --- a/src/main/resources/assets/gcyl/lang/en_us.lang +++ b/src/main/resources/assets/gcyl/lang/en_us.lang @@ -5313,4 +5313,6 @@ gcyl.machine.diode.high.uev.name=Ultra Excessive Voltage Hi-Amp Diode gcyl.machine.diode.high.uiv.name=Ultra Immense Voltage Hi-Amp Diode gcyl.machine.diode.high.uxv.name=Ultra Extreme Voltage Hi-Amp Diode gcyl.machine.diode.high.opv.name=Overpowered Voltage Hi-Amp Diode -gcyl.machine.diode.high.max.name=Maximum Voltage Hi-Amp Diode \ No newline at end of file +gcyl.machine.diode.high.max.name=Maximum Voltage Hi-Amp Diode + +gcyl.machine.fluid.tick.consuming=Consuming: (§b%s§7) §b%,d L/t \ No newline at end of file From b42857d99900b916b1e7820c5aab6f74553ab370 Mon Sep 17 00:00:00 2001 From: Johny709 Date: Fri, 16 Jan 2026 06:48:57 -0500 Subject: [PATCH 22/22] fix volcanus and cryo freezer oc not working and add config to set max overclocking voltage --- gradle.properties | 2 +- .../java/com/fulltrix/gcyl/GCYLConfig.java | 9 ++++++ .../MetaTileEntityCryogenicFreezer.java | 21 ++++++++------ .../multi/advance/MetaTileEntityVolcanus.java | 29 +++++++++---------- .../resources/assets/gcyl/lang/en_us.lang | 2 +- 5 files changed, 36 insertions(+), 27 deletions(-) diff --git a/gradle.properties b/gradle.properties index 4ed382c..b8f6f14 100644 --- a/gradle.properties +++ b/gradle.properties @@ -166,4 +166,4 @@ deploymentDebug = false org.gradle.logging.stacktrace = all # Sets default memory used for gradle commands. Can be overridden by user or command line properties. # This is required to provide enough memory for the Minecraft decompilation process. -org.gradle.jvmargs = -Xmx8G \ No newline at end of file +#org.gradle.jvmargs = -Xmx8G \ No newline at end of file diff --git a/src/main/java/com/fulltrix/gcyl/GCYLConfig.java b/src/main/java/com/fulltrix/gcyl/GCYLConfig.java index 58273c4..a9d9f80 100644 --- a/src/main/java/com/fulltrix/gcyl/GCYLConfig.java +++ b/src/main/java/com/fulltrix/gcyl/GCYLConfig.java @@ -154,6 +154,15 @@ public static class Misc { @Config.Comment("Efficiency level for the LuV rocket engine") public int LuVRocketEfficiency= 25; + @Config.Comment("Set the max overclocking voltage for Volcanus. LV = 1, MV = 2, HV = 3 etc. Set to 0 for no limit.") + @Config.Name("Volcanus Max Voltage") + @Config.RequiresMcRestart + public int volcanusMaxVoltage = GTValues.ZPM; + + @Config.Comment("Set the max overclocking voltage for Cryogenic Freezer. LV = 1, MV = 2, HV = 3 etc. Set to 0 for no limit.") + @Config.Name("Cryogenic Freezer Max Voltage") + @Config.RequiresMcRestart + public int cryogenicFreezerMaxVoltage = GTValues.ZPM; } diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityCryogenicFreezer.java b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityCryogenicFreezer.java index a859bb7..26c2c67 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityCryogenicFreezer.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityCryogenicFreezer.java @@ -2,6 +2,7 @@ import com.cleanroommc.modularui.api.drawable.IKey; import com.cleanroommc.modularui.value.sync.PanelSyncManager; +import com.fulltrix.gcyl.GCYLConfig; import com.fulltrix.gcyl.api.multi.GCYLRecipeMapMultiblockController; import com.fulltrix.gcyl.materials.GCYLMaterials; import com.fulltrix.gcyl.client.ClientHandler; @@ -22,8 +23,9 @@ import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; import gregtech.api.pattern.PatternMatchContext; -import gregtech.api.recipes.RecipeBuilder; import gregtech.api.recipes.RecipeMaps; +import gregtech.api.recipes.logic.OCResult; +import gregtech.api.recipes.properties.RecipePropertyStorage; import gregtech.api.util.GTUtility; import gregtech.api.util.KeyUtil; import gregtech.client.renderer.ICubeRenderer; @@ -45,8 +47,6 @@ import java.util.List; import java.util.function.UnaryOperator; -import static gregtech.api.GTValues.ZPM; - //TODO: limit reflect in ui. update tooltip. improve performance public class MetaTileEntityCryogenicFreezer extends GCYLRecipeMapMultiblockController implements ProgressBarMultiblock { @@ -58,7 +58,8 @@ public class MetaTileEntityCryogenicFreezer extends GCYLRecipeMapMultiblockContr public MetaTileEntityCryogenicFreezer(ResourceLocation metaTileEntityId) { super(metaTileEntityId, RecipeMaps.VACUUM_RECIPES, false); this.recipeMapWorkable = new MetaTileEntityCryogenicFreezer.CryogenicRecipeLogic(this); - this.recipeMapWorkable.setMaximumOverclockVoltage(Math.min(this.energyContainer.getInputVoltage() , GTValues.V[ZPM])); + if (GCYLConfig.Misc.cryogenicFreezerMaxVoltage > 0) + this.recipeMapWorkable.setMaximumOverclockVoltage(Math.min(this.energyContainer.getInputVoltage(), GTValues.VOC[GCYLConfig.Misc.cryogenicFreezerMaxVoltage])); } @Override @@ -123,6 +124,9 @@ public void addInformation(ItemStack stack, @Nullable World player, List super.addInformation(stack, player, tooltip, advanced); tooltip.add(I18n.format("gregtech.multiblock.cryogenic_freezer.description")); tooltip.add(I18n.format("gregtech.multiblock.vol_cryo.description")); + if (GCYLConfig.Misc.cryogenicFreezerMaxVoltage > 0) + tooltip.add(I18n.format("gregtech.multiblock.volcanus.description.4", GTValues.VOCNF[GCYLConfig.Misc.cryogenicFreezerMaxVoltage])); + tooltip.add(I18n.format("gregtech.multiblock.volcanus.description.3")); } @Override @@ -171,11 +175,10 @@ public int getParallelLimit() { } @Override - public void applyParallelBonus(@NotNull RecipeBuilder builder) { - int currentParallel = builder.getParallel(); - long currentRecipeEU = builder.getEUt() / currentParallel; - int currentRecipeDuration = builder.getDuration() / this.getParallelLimit(); - builder.EUt(currentRecipeEU * 2).duration(currentRecipeDuration * currentParallel); + protected void modifyOverclockPost(@NotNull OCResult ocResult, @NotNull RecipePropertyStorage storage) { + super.modifyOverclockPost(ocResult, storage); + ocResult.setEut((long) (ocResult.duration() * 0.9)); + ocResult.setDuration((int) (ocResult.duration() / 1.2)); } } } diff --git a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityVolcanus.java b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityVolcanus.java index dccf4d9..e6d6179 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityVolcanus.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/advance/MetaTileEntityVolcanus.java @@ -2,6 +2,7 @@ import com.cleanroommc.modularui.api.drawable.IKey; import com.cleanroommc.modularui.value.sync.PanelSyncManager; +import com.fulltrix.gcyl.GCYLConfig; import com.fulltrix.gcyl.api.multi.GCYLRecipeMapMultiblockController; import com.fulltrix.gcyl.materials.GCYLMaterials; import com.fulltrix.gcyl.blocks.metal.MetalCasing1; @@ -12,10 +13,7 @@ import gregtech.api.capability.impl.MultiblockRecipeLogic; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; -import gregtech.api.metatileentity.multiblock.IMultiblockPart; -import gregtech.api.metatileentity.multiblock.MultiblockAbility; -import gregtech.api.metatileentity.multiblock.ProgressBarMultiblock; -import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController; +import gregtech.api.metatileentity.multiblock.*; import gregtech.api.metatileentity.multiblock.ui.MultiblockUIBuilder; import gregtech.api.metatileentity.multiblock.ui.TemplateBarBuilder; import gregtech.api.mui.GTGuiTextures; @@ -25,7 +23,6 @@ import gregtech.api.pattern.MultiblockShapeInfo; import gregtech.api.pattern.PatternMatchContext; import gregtech.api.recipes.Recipe; -import gregtech.api.recipes.RecipeBuilder; import gregtech.api.recipes.RecipeMaps; import gregtech.api.recipes.logic.OCParams; import gregtech.api.recipes.logic.OCResult; @@ -59,7 +56,6 @@ import static com.fulltrix.gcyl.client.ClientHandler.HASTELLOY_N_CASING; import static com.fulltrix.gcyl.blocks.GCYLMetaBlocks.METAL_CASING_1; -import static gregtech.api.GTValues.ZPM; import static gregtech.api.GregTechAPI.HEATING_COILS; import static gregtech.api.recipes.logic.OverclockingLogic.heatingCoilOC; import static gregtech.api.util.RelativeDirection.*; @@ -76,7 +72,8 @@ public class MetaTileEntityVolcanus extends GCYLRecipeMapMultiblockController im public MetaTileEntityVolcanus(ResourceLocation metaTileEntityId) { super(metaTileEntityId, RecipeMaps.BLAST_RECIPES, false); this.recipeMapWorkable = new MetaTileEntityVolcanus.VolcanusRecipeLogic(this); - this.recipeMapWorkable.setMaximumOverclockVoltage(Math.min(this.energyContainer.getInputVoltage() , GTValues.V[ZPM])); + if (GCYLConfig.Misc.volcanusMaxVoltage > 0) + this.recipeMapWorkable.setMaximumOverclockVoltage(Math.min(this.energyContainer.getInputVoltage(), GTValues.VOC[GCYLConfig.Misc.volcanusMaxVoltage])); } @Override @@ -118,7 +115,8 @@ public boolean checkRecipe(@NotNull Recipe recipe, boolean consumeIfSuccess) { public void addInformation(ItemStack stack, @Nullable World player, List tooltip, boolean advanced) { super.addInformation(stack, player, tooltip, advanced); tooltip.add(I18n.format("gregtech.multiblock.volcanus.description.1")); - tooltip.add(I18n.format("gregtech.multiblock.volcanus.description.4")); + if (GCYLConfig.Misc.volcanusMaxVoltage > 0) + tooltip.add(I18n.format("gregtech.multiblock.volcanus.description.4", GTValues.VOCNF[GCYLConfig.Misc.volcanusMaxVoltage])); tooltip.add(I18n.format("gregtech.multiblock.volcanus.description.2")); tooltip.add(I18n.format("gregtech.multiblock.volcanus.description.3")); tooltip.add(I18n.format("gregtech.machine.electric_blast_furnace.tooltip.1")); @@ -238,14 +236,6 @@ public int getParallelLimit() { return 8; } - @Override - public void applyParallelBonus(@NotNull RecipeBuilder builder) { - int currentParallel = builder.getParallel(); - long currentRecipeEU = builder.getEUt() / currentParallel; - int currentRecipeDuration = builder.getDuration() / this.getParallelLimit(); - builder.EUt(currentRecipeEU * 2).duration(currentRecipeDuration * currentParallel); - } - @Override protected void modifyOverclockPre(@NotNull OCParams ocParams, @NotNull RecipePropertyStorage storage) { super.modifyOverclockPre(ocParams, storage); @@ -257,5 +247,12 @@ protected void runOverclockingLogic(@NotNull OCParams ocParams, @NotNull OCResul @NotNull RecipePropertyStorage propertyStorage, long maxVoltage) { heatingCoilOC(ocParams, ocResult, maxVoltage, getCurrentTemperature(), propertyStorage.get(TemperatureProperty.getInstance(), 0)); } + + @Override + protected void modifyOverclockPost(@NotNull OCResult ocResult, @NotNull RecipePropertyStorage storage) { + super.modifyOverclockPost(ocResult, storage); + ocResult.setEut((long) (ocResult.eut() * 0.9)); + ocResult.setDuration((int) (ocResult.duration() / 1.2)); + } } } diff --git a/src/main/resources/assets/gcyl/lang/en_us.lang b/src/main/resources/assets/gcyl/lang/en_us.lang index 8f374fd..a920148 100644 --- a/src/main/resources/assets/gcyl/lang/en_us.lang +++ b/src/main/resources/assets/gcyl/lang/en_us.lang @@ -4734,7 +4734,7 @@ gcyl.multiblock.electric_blast_furnace.tooltip.1=For every §a900K§7 above the gcyl.multiblock.electric_blast_furnace.tooltip.2=For every §a1800K§7 above the recipe temperature, one overclock becomes §a100%%§7 efficient. gcyl.multiblock.electric_blast_furnace.tooltip.3=For every voltage tier above §aMV§7, temperature is increased by §a100K§7. gregtech.multiblock.volcanus.description.1=Consumes pyrotheum 2^ max voltage tier mB of pyrotheum per tick. -gregtech.multiblock.volcanus.description.4=Max Overclock Voltage of ZPM. +gregtech.multiblock.volcanus.description.4=Max Overclock Voltage of %s. gregtech.multiblock.volcanus.description.2=Can run recipes of a higher tier given the right energy hatch, but there are no bonuses. gregtech.multiblock.volcanus.description.3=Parallels 8 times. Recipes run 120%% faster. EUt usage is 0.90 recipemap.volcanus.name=Volcanus