diff --git a/gradle.properties b/gradle.properties index 4ed382c5..b8f6f14c 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 58273c43..a9d9f802 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/api/multi/GCYLRecipeMapMultiblockController.java b/src/main/java/com/fulltrix/gcyl/api/multi/GCYLRecipeMapMultiblockController.java index a8e7d35c..5744ebbb 100644 --- a/src/main/java/com/fulltrix/gcyl/api/multi/GCYLRecipeMapMultiblockController.java +++ b/src/main/java/com/fulltrix/gcyl/api/multi/GCYLRecipeMapMultiblockController.java @@ -1,11 +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 { @@ -23,6 +32,53 @@ public GCYLRecipeMapMultiblockController(ResourceLocation metaTileEntityId, Reci this.isParallel = isParallel; } + @Override + protected void configureDisplayText(MultiblockUIBuilder builder) { + super.configureDisplayText(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; + } @Override public boolean isTiered() { return true; } 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 fc273d19..9d6eabfc 100644 --- a/src/main/java/com/fulltrix/gcyl/api/pattern/TraceabilityPredicates.java +++ b/src/main/java/com/fulltrix/gcyl/api/pattern/TraceabilityPredicates.java @@ -6,21 +6,22 @@ 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.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; -import gregtech.common.blocks.BlockCleanroomCasing; -import gregtech.common.blocks.MetaBlocks; +import groovyjarjarantlr4.runtime.misc.IntArray; 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 { @@ -59,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; } @@ -131,6 +135,56 @@ 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; + }, () -> 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 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/GCYLTileEntities.java b/src/main/java/com/fulltrix/gcyl/machines/GCYLTileEntities.java index d0f394fb..699d996a 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/MetaTileEntityBioReactor.java b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityBioReactor.java index 5d326e2c..6772e489 100644 --- a/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityBioReactor.java +++ b/src/main/java/com/fulltrix/gcyl/machines/multi/MetaTileEntityBioReactor.java @@ -1,28 +1,64 @@ 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; 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; +import net.minecraftforge.fml.relauncher.SideOnly; +import org.jetbrains.annotations.Nullable; 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 { + private long maxVoltage; + public MetaTileEntityBioReactor(ResourceLocation metaTileEntityId) { super(metaTileEntityId, GCYLRecipeMaps.BIO_REACTOR_RECIPES, false); + this.recipeMapWorkable = new GCYLMultiblockRecipeLogic(this, false) { + @Override + public long getMaxVoltage() { + return GCYMConfigHolder.globalMultiblocks.enableTieredCasings ? maxVoltage : super.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 @@ -30,10 +66,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 +79,41 @@ 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 + 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); + int tier = context.getOrDefault("tiered_hatches", new ArrayList()).get(0).getTier() - 1; + this.maxVoltage = 32L << tier * 2; + } + @Override public void invalidateStructure() { super.invalidateStructure(); 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 65dccf14..db788702 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,14 @@ 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.GCYMMetaTileEntities; +import gregicality.multiblocks.common.metatileentities.multiblockpart.MetaTileEntityTieredHatch; import gregtech.api.capability.*; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; @@ -15,21 +19,22 @@ 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; -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; @@ -37,18 +42,30 @@ import org.jetbrains.annotations.NotNull; 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 { + 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() { @@ -68,9 +85,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##", "###############") @@ -82,16 +99,52 @@ 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(); } + @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.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()) + .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); + 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); @@ -102,9 +155,17 @@ protected void formStructure(PatternMatchContext context) { } } + @Override + public void invalidateStructure() { + super.invalidateStructure(); + this.maxVoltage = 0; + } + @Override protected void configureDisplayText(MultiblockUIBuilder builder) { - builder.structureFormed(isStructureFormed()) + super.configureDisplayText(builder); + CosmicRayRecipeLogic recipeLogic = (CosmicRayRecipeLogic)this.recipeMapWorkable; + builder.addComputationUsageLine(recipeLogic.getRecipeCWUt()) .addCustom((keyManager, uiSyncer) -> { if (!uiSyncer.syncBoolean(canSeeSky())) { keyManager.add(KeyUtil.lang(TextFormatting.RED, "gcyl.multiblock.cosmic_ray_detector.tooltip.1")); @@ -116,6 +177,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")); @@ -154,7 +216,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); } 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 9c017d39..8fcfd25d 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 b10e5bf6..a0c46910 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,68 @@ 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.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.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.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.util.text.ITextComponent; -import net.minecraft.util.text.TextComponentTranslation; +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.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 { -public class MetaTileEntityStellarForge extends RecipeMapMultiblockController { //TODO implement tiering private long maxVoltage; public MetaTileEntityStellarForge(ResourceLocation metaTileEntityId) { - super(metaTileEntityId, GCYLRecipeMaps.STELLAR_FORGE_RECIPES); + super(metaTileEntityId, GCYLRecipeMaps.STELLAR_FORGE_RECIPES, false); + this.recipeMapWorkable = new GCYLMultiblockRecipeLogic(this, false) { + @Override + public long getMaxVoltage() { + return GCYMConfigHolder.globalMultiblocks.enableTieredCasings ? maxVoltage : super.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 @@ -52,7 +83,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 +93,49 @@ protected BlockPattern createStructurePattern() { } @Override - public void invalidateStructure() { - super.invalidateStructure(); - this.maxVoltage = 0; + 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 configureDisplayText(MultiblockUIBuilder builder) { - builder.addCustom((keyManager, uiSyncer) -> { - keyManager.add(KeyUtil.lang("gregtech.multiblock.universal.framework", this.maxVoltage)); - }); + 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; } @Override 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 ca64a3a3..34da42ad 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); 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 583c1938..430dbfa4 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; - } - } 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 60e85305..5f10a0ac 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; @@ -54,15 +50,14 @@ import static gregtech.api.unification.material.Materials.TungstenSteel; 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 +105,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 +163,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 +196,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 +223,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 +245,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 +263,6 @@ public ComponentALRecipeLogic(MetaTileEntityComponentAL metaTileEntity) { public boolean checkRecipe(@NotNull Recipe recipe) { if (!super.checkRecipe(recipe)) return false; - return recipe.getProperty(ComponentALProperty.getInstance(), 0) <= tier; } 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 1bad95dc..26c2c67d 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,51 +1,65 @@ 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.GCYLConfig; +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.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.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; 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; import net.minecraftforge.fml.relauncher.SideOnly; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.List; - -import static gregtech.api.GTValues.ZPM; +import java.util.function.UnaryOperator; //TODO: limit reflect in ui. update tooltip. improve performance -public class MetaTileEntityCryogenicFreezer extends GCYMRecipeMapMultiblockController { +public class MetaTileEntityCryogenicFreezer extends GCYLRecipeMapMultiblockController implements ProgressBarMultiblock { + + private static final FluidStack CRYOTHEUM = GCYLMaterials.Cryotheum.getFluid(Integer.MAX_VALUE); - protected final MetaTileEntity metaTileEntity; + private FluidStack cryotheum = 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])); + if (GCYLConfig.Misc.cryogenicFreezerMaxVoltage > 0) + this.recipeMapWorkable.setMaximumOverclockVoltage(Math.min(this.energyContainer.getInputVoltage(), GTValues.VOC[GCYLConfig.Misc.cryogenicFreezerMaxVoltage])); } @Override @@ -53,6 +67,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() @@ -86,62 +118,67 @@ protected OrientedOverlayRenderer getFrontOverlay() { return ClientHandler.FREEZER_OVERLAY; } - - @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("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 + 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]); + 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 82a708e5..e6d61796 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,34 +1,32 @@ 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.GCYLConfig; +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.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; +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; import gregtech.api.recipes.RecipeMaps; 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; @@ -36,13 +34,12 @@ 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.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; @@ -51,22 +48,32 @@ 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.GregTechAPI.HEATING_COILS; import static gregtech.api.recipes.logic.OverclockingLogic.heatingCoilOC; +import static gregtech.api.util.RelativeDirection.*; //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 = PYROTHEUM; public MetaTileEntityVolcanus(ResourceLocation metaTileEntityId) { - super(metaTileEntityId, RecipeMaps.BLAST_RECIPES); + super(metaTileEntityId, RecipeMaps.BLAST_RECIPES, false); this.recipeMapWorkable = new MetaTileEntityVolcanus.VolcanusRecipeLogic(this); + if (GCYLConfig.Misc.volcanusMaxVoltage > 0) + this.recipeMapWorkable.setMaximumOverclockVoltage(Math.min(this.energyContainer.getInputVoltage(), GTValues.VOC[GCYLConfig.Misc.volcanusMaxVoltage])); } @Override @@ -76,34 +83,29 @@ 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))); + keyManager.add(KeyUtil.lang(TextFormatting.GRAY, "gcyl.machine.fluid.tick.consuming", this.pyrotheum.getLocalizedName(), uiSyncer.syncInt(this.pyrotheum.amount))); + }); } @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 public void invalidateStructure() { super.invalidateStructure(); this.blastFurnaceTemperature = 0; + this.pyrotheum = PYROTHEUM; } - @Override public boolean checkRecipe(@NotNull Recipe recipe, boolean consumeIfSuccess) { return this.blastFurnaceTemperature >= recipe.getProperty(TemperatureProperty.getInstance(), 0); @@ -113,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")); @@ -125,6 +128,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 +142,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 @@ -162,67 +166,64 @@ 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); } - @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 @@ -235,29 +236,23 @@ public int getParallelLimit() { return 8; } - @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))); - } - @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)); + } + + @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/java/com/fulltrix/gcyl/machines/multi/miner/MetaTileEntityDeepMiner.java b/src/main/java/com/fulltrix/gcyl/machines/multi/miner/MetaTileEntityDeepMiner.java index a3b350d0..53a77d40 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,17 @@ 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.GCYMMetaTileEntities; +import gregicality.multiblocks.common.metatileentities.multiblockpart.MetaTileEntityTieredHatch; import gregtech.api.block.IHeatingCoilBlockStats; import gregtech.api.capability.IHeatingCoil; import gregtech.api.capability.IMultipleTankHandler; @@ -14,16 +20,18 @@ 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.pattern.BlockPattern; -import gregtech.api.pattern.FactoryBlockPattern; -import gregtech.api.pattern.PatternMatchContext; -import gregtech.api.pattern.TraceabilityPredicate; +import gregtech.api.metatileentity.multiblock.ui.TemplateBarBuilder; +import gregtech.api.mui.GTGuiTextures; +import gregtech.api.mui.sync.FixedIntArraySyncValue; +import gregtech.api.pattern.*; import gregtech.api.recipes.Recipe; import gregtech.api.recipes.RecipeMap; 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 +39,54 @@ 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; 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.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) -//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,10 +112,39 @@ 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(); } + @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); @@ -109,23 +163,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 +199,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 +323,8 @@ else if(fluidType == 2) { public void invalidateStructure() { super.invalidateStructure(); this.currentTemperature = 0; + this.maxVoltage = 0; + this.offsetPos = null; } @Override @@ -337,14 +394,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 +439,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 +511,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/java/com/fulltrix/gcyl/machines/multi/miner/MetaTileEntityVoidMiner.java b/src/main/java/com/fulltrix/gcyl/machines/multi/miner/MetaTileEntityVoidMiner.java index 22c4ae86..73ad938f 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/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityChemicalPlant.java b/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityChemicalPlant.java index e16a9ecb..536cf6e0 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,82 @@ 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.GCYMMetaTileEntities; +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.MultiblockShapeInfo; +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 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; 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.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 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 +84,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 +106,73 @@ 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 + 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); + 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 +190,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/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityDecayChamber.java b/src/main/java/com/fulltrix/gcyl/machines/multi/simple/MetaTileEntityDecayChamber.java index aa0ad8c4..11dad4d2 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,33 +1,56 @@ 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.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 //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 +63,44 @@ public MetaTileEntityDecayChamber(ResourceLocation metaTileEntityId, boolean isP .where('S', selfPredicate()) .where('G', states(getGlassState())) .where('#', air()) - .where('T', tieredCasing()) + .where('T', TraceabilityPredicates.tieredHatchPredicate()) .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); + 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); } 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 3b7da161..60fe2af4 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]; } 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 617f38a3..bb658ee8 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,39 +1,71 @@ 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.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.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; import net.minecraftforge.fml.relauncher.SideOnly; +import org.jetbrains.annotations.Nullable; 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; -//TODO add tooltips and information +import static gregtech.api.util.RelativeDirection.*; + public class MetaTileEntityPlasmaCondenser extends GCYLRecipeMapMultiblockController { - public MetaTileEntityPlasmaCondenser(ResourceLocation metaTileEntityId, boolean isParallel) { - super(metaTileEntityId, GCYLRecipeMaps.PLASMA_CONDENSER_RECIPES, isParallel); - this.recipeMapWorkable = new GCYMMultiblockRecipeLogic(this); + private long maxVoltage; + + public MetaTileEntityPlasmaCondenser(ResourceLocation metaTileEntityId) { + super(metaTileEntityId, GCYLRecipeMaps.PLASMA_CONDENSER_RECIPES, false); + this.recipeMapWorkable = new GCYLMultiblockRecipeLogic(this, false) { + @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 + @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 @@ -50,10 +82,46 @@ 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 + 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); + 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); } diff --git a/src/main/resources/assets/gcyl/lang/en_us.lang b/src/main/resources/assets/gcyl/lang/en_us.lang index f7afb805..a9201480 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. @@ -3146,7 +3149,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! @@ -3233,6 +3236,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 @@ -4730,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 @@ -4870,7 +4874,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. @@ -4880,9 +4884,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) @@ -5308,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