diff --git a/src/main/java/com/zorbatron/zbgt/api/metatileentity/LaserCapableMultiMapMultiblockController.java b/src/main/java/com/zorbatron/zbgt/api/metatileentity/LaserCapableMultiMapMultiblockController.java index 91561c88..18c51d82 100644 --- a/src/main/java/com/zorbatron/zbgt/api/metatileentity/LaserCapableMultiMapMultiblockController.java +++ b/src/main/java/com/zorbatron/zbgt/api/metatileentity/LaserCapableMultiMapMultiblockController.java @@ -4,7 +4,12 @@ import java.util.Collections; import java.util.List; +import net.minecraft.client.resources.I18n; +import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +import org.jetbrains.annotations.Nullable; import com.zorbatron.zbgt.ZBGTConfig; @@ -14,6 +19,7 @@ import gregtech.api.metatileentity.multiblock.MultiblockAbility; import gregtech.api.pattern.TraceabilityPredicate; import gregtech.api.recipes.RecipeMap; +import gregtech.client.utils.TooltipHelper; public abstract class LaserCapableMultiMapMultiblockController extends MultiMapMultiblockController { @@ -79,4 +85,12 @@ public TraceabilityPredicate autoEnergyInputs(int min, int max) { public TraceabilityPredicate autoEnergyInputs() { return autoEnergyInputs(1, 3); } + + @Override + public void addInformation(ItemStack stack, @Nullable World player, List tooltip, boolean advanced) { + super.addInformation(stack, player, tooltip, advanced); + tooltip.add(I18n.format(I18n.format("zbgt.laser_enabled.1") + + TooltipHelper.RAINBOW + I18n.format("zbgt.laser_enabled.2")) + + (allowsSubstationHatches() ? I18n.format("zbgt.substation_enabled") : "")); + } } diff --git a/src/main/java/com/zorbatron/zbgt/api/metatileentity/LaserCapableRecipeMapMultiblockController.java b/src/main/java/com/zorbatron/zbgt/api/metatileentity/LaserCapableRecipeMapMultiblockController.java index 657a4a07..e6b61f58 100644 --- a/src/main/java/com/zorbatron/zbgt/api/metatileentity/LaserCapableRecipeMapMultiblockController.java +++ b/src/main/java/com/zorbatron/zbgt/api/metatileentity/LaserCapableRecipeMapMultiblockController.java @@ -4,7 +4,12 @@ import java.util.Collections; import java.util.List; +import net.minecraft.client.resources.I18n; +import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +import org.jetbrains.annotations.Nullable; import com.zorbatron.zbgt.ZBGTConfig; @@ -14,6 +19,7 @@ import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController; import gregtech.api.pattern.TraceabilityPredicate; import gregtech.api.recipes.RecipeMap; +import gregtech.client.utils.TooltipHelper; public abstract class LaserCapableRecipeMapMultiblockController extends RecipeMapMultiblockController { @@ -80,4 +86,12 @@ public TraceabilityPredicate autoEnergyInputs(int min, int max) { public TraceabilityPredicate autoEnergyInputs() { return autoEnergyInputs(1, 3); } + + @Override + public void addInformation(ItemStack stack, @Nullable World player, List tooltip, boolean advanced) { + super.addInformation(stack, player, tooltip, advanced); + tooltip.add(I18n.format(I18n.format("zbgt.laser_enabled.1") + + TooltipHelper.RAINBOW + I18n.format("zbgt.laser_enabled.2")) + + (allowsSubstationHatches() ? I18n.format("zbgt.substation_enabled") : "")); + } } diff --git a/src/main/java/com/zorbatron/zbgt/api/pattern/TraceabilityPredicates.java b/src/main/java/com/zorbatron/zbgt/api/pattern/TraceabilityPredicates.java index bf143e62..03f4e555 100644 --- a/src/main/java/com/zorbatron/zbgt/api/pattern/TraceabilityPredicates.java +++ b/src/main/java/com/zorbatron/zbgt/api/pattern/TraceabilityPredicates.java @@ -20,7 +20,11 @@ import gregtech.api.pattern.TraceabilityPredicate; import gregtech.api.recipes.RecipeMap; import gregtech.api.util.BlockInfo; +import gregtech.common.ConfigHolder; import gregtech.common.blocks.BlockMachineCasing; +import gregtech.common.blocks.BlockMetalCasing; +import gregtech.common.blocks.MetaBlocks; +import gregtech.common.metatileentities.MetaTileEntities; public class TraceabilityPredicates { @@ -162,4 +166,22 @@ public static TraceabilityPredicate maintenanceHatch(MultiblockControllerBase co return predicate; } + + public static TraceabilityPredicate autoEnergyInputs(int min, int max, int previewCount) { + return new TraceabilityPredicate(abilities(MultiblockAbility.INPUT_ENERGY, MultiblockAbility.INPUT_LASER) + .setMinGlobalLimited(min).setMaxGlobalLimited(max).setPreviewCount(previewCount)); + } + + public static TraceabilityPredicate autoEnergyInputs(int min, int max) { + return autoEnergyInputs(min, max, 2); + } + + public static TraceabilityPredicate autoEnergyInputs() { + return autoEnergyInputs(1, 3); + } + + public static Supplier getMaintenanceHatchMTE() { + return () -> ConfigHolder.machines.enableMaintenance ? MetaTileEntities.MAINTENANCE_HATCH : + MetaBlocks.METAL_CASING.getState(BlockMetalCasing.MetalCasingType.INVAR_HEATPROOF); + } } diff --git a/src/main/java/com/zorbatron/zbgt/common/metatileentities/multi/electric/MetaTileEntityCoAL.java b/src/main/java/com/zorbatron/zbgt/common/metatileentities/multi/electric/MetaTileEntityCoAL.java index 0b3392d2..feb1410a 100644 --- a/src/main/java/com/zorbatron/zbgt/common/metatileentities/multi/electric/MetaTileEntityCoAL.java +++ b/src/main/java/com/zorbatron/zbgt/common/metatileentities/multi/electric/MetaTileEntityCoAL.java @@ -252,6 +252,8 @@ protected void addDisplayText(List textList) { @Override public void addInformation(ItemStack stack, @Nullable World player, List tooltip, boolean advanced) { + super.addInformation(stack, player, tooltip, advanced); + tooltip.add(I18n.format("zbgt.machine.coal.description.1")); tooltip.add(I18n.format("zbgt.machine.coal.description.2")); } diff --git a/src/main/java/com/zorbatron/zbgt/common/metatileentities/multi/electric/MetaTileEntityQuadEBF.java b/src/main/java/com/zorbatron/zbgt/common/metatileentities/multi/electric/MetaTileEntityQuadEBF.java index 09785c9e..ef8f867c 100644 --- a/src/main/java/com/zorbatron/zbgt/common/metatileentities/multi/electric/MetaTileEntityQuadEBF.java +++ b/src/main/java/com/zorbatron/zbgt/common/metatileentities/multi/electric/MetaTileEntityQuadEBF.java @@ -1,10 +1,14 @@ package com.zorbatron.zbgt.common.metatileentities.multi.electric; +import java.util.ArrayList; +import java.util.Comparator; import java.util.List; 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.SoundEvent; import net.minecraft.util.text.ITextComponent; @@ -18,7 +22,11 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import com.zorbatron.zbgt.api.pattern.TraceabilityPredicates; +import com.zorbatron.zbgt.common.ZBGTMetaTileEntities; + import gregtech.api.GTValues; +import gregtech.api.GregTechAPI; import gregtech.api.block.IHeatingCoilBlockStats; import gregtech.api.capability.IHeatingCoil; import gregtech.api.metatileentity.MetaTileEntity; @@ -29,6 +37,7 @@ import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController; 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.RecipeMaps; @@ -41,6 +50,7 @@ import gregtech.common.blocks.BlockMetalCasing; import gregtech.common.blocks.BlockWireCoil; import gregtech.common.blocks.MetaBlocks; +import gregtech.common.metatileentities.MetaTileEntities; import gregtech.core.sound.GTSoundEvents; public class MetaTileEntityQuadEBF extends RecipeMapMultiblockController implements IHeatingCoil { @@ -68,7 +78,8 @@ public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) { .where('S', selfPredicate()) .where('C', heatingCoils()) .where('X', states(getCasingState()) - .or(autoAbilities(true, true, true, true, true, true, false))) + .or(autoAbilities(false, true, true, true, true, true, false)) + .or(TraceabilityPredicates.autoEnergyInputs(1, 8))) .where('M', abilities(MultiblockAbility.MUFFLER_HATCH)) .where('#', air()) .build(); @@ -78,6 +89,33 @@ protected IBlockState getCasingState() { return MetaBlocks.METAL_CASING.getState(BlockMetalCasing.MetalCasingType.INVAR_HEATPROOF); } + @Override + public List getMatchingShapes() { + ArrayList shapeInfo = new ArrayList<>(); + + MultiblockShapeInfo.Builder builder = MultiblockShapeInfo.builder() + .aisle("EEXEE", "CCCCC", "CCCCC", "EEXEE") + .aisle("XXXXX", "C#C#C", "C#C#C", "XMXMX") + .aisle("XXXXX", "CCCCC", "CCCCC", "XXFXX") + .aisle("XXXXX", "C#C#C", "C#C#C", "XMXMX") + .aisle("XISOX", "CCCCC", "CCCCC", "XXZXX") + .where('S', ZBGTMetaTileEntities.QUAD_EBF, EnumFacing.SOUTH) + .where('X', getCasingState()) + .where('Z', TraceabilityPredicates.getMaintenanceHatchMTE(), EnumFacing.SOUTH) + .where('M', MetaTileEntities.MUFFLER_HATCH[GTValues.LV], EnumFacing.UP) + .where('I', MetaTileEntities.ITEM_IMPORT_BUS[1], EnumFacing.SOUTH) + .where('O', MetaTileEntities.ITEM_EXPORT_BUS[1], EnumFacing.SOUTH) + .where('E', MetaTileEntities.ENERGY_INPUT_HATCH[1], EnumFacing.NORTH) + .where('F', MetaTileEntities.FLUID_IMPORT_HATCH[1], EnumFacing.UP) + .where('#', Blocks.AIR.getDefaultState()); + + GregTechAPI.HEATING_COILS.entrySet().stream() + .sorted(Comparator.comparingInt(entry -> entry.getValue().getTier())) + .forEach(entry -> shapeInfo.add(builder.where('C', entry.getKey()).build())); + + return shapeInfo; + } + @Override public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) { return Textures.HEAT_PROOF_CASING; diff --git a/src/main/java/com/zorbatron/zbgt/common/metatileentities/multi/electric/megamultis/MetaTileEntityMegaABS.java b/src/main/java/com/zorbatron/zbgt/common/metatileentities/multi/electric/megamultis/MetaTileEntityMegaABS.java index 58fd4099..1dcac0b6 100644 --- a/src/main/java/com/zorbatron/zbgt/common/metatileentities/multi/electric/megamultis/MetaTileEntityMegaABS.java +++ b/src/main/java/com/zorbatron/zbgt/common/metatileentities/multi/electric/megamultis/MetaTileEntityMegaABS.java @@ -1,10 +1,14 @@ package com.zorbatron.zbgt.common.metatileentities.multi.electric.megamultis; +import java.util.ArrayList; +import java.util.Comparator; import java.util.List; 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.TextFormatting; @@ -19,6 +23,7 @@ import com.zorbatron.zbgt.api.metatileentity.LaserCapableGCYMRecipeMapMultiblockController; import com.zorbatron.zbgt.api.pattern.TraceabilityPredicates; import com.zorbatron.zbgt.api.render.ZBGTTextures; +import com.zorbatron.zbgt.common.ZBGTMetaTileEntities; import gregicality.multiblocks.api.metatileentity.GCYMMultiblockAbility; import gregicality.multiblocks.api.recipes.GCYMRecipeMaps; @@ -26,7 +31,9 @@ import gregicality.multiblocks.common.block.GCYMMetaBlocks; import gregicality.multiblocks.common.block.blocks.BlockLargeMultiblockCasing; import gregicality.multiblocks.common.block.blocks.BlockUniqueCasing; +import gregicality.multiblocks.common.metatileentities.GCYMMetaTileEntities; import gregtech.api.GTValues; +import gregtech.api.GregTechAPI; import gregtech.api.block.IHeatingCoilBlockStats; import gregtech.api.capability.IHeatingCoil; import gregtech.api.metatileentity.MetaTileEntity; @@ -36,6 +43,7 @@ import gregtech.api.metatileentity.multiblock.MultiblockDisplayText; 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.recipeproperties.TemperatureProperty; @@ -46,6 +54,7 @@ import gregtech.common.blocks.BlockGlassCasing; import gregtech.common.blocks.BlockWireCoil; import gregtech.common.blocks.MetaBlocks; +import gregtech.common.metatileentities.MetaTileEntities; public class MetaTileEntityMegaABS extends LaserCapableGCYMRecipeMapMultiblockController implements IHeatingCoil { @@ -138,6 +147,78 @@ protected IBlockState getGlassState() { return MetaBlocks.TRANSPARENT_CASING.getState(BlockGlassCasing.CasingType.TEMPERED_GLASS); } + @Override + public List getMatchingShapes() { + ArrayList shapeInfo = new ArrayList<>(); + + MultiblockShapeInfo.Builder builder = MultiblockShapeInfo.builder() + .aisle("###XXXXX###", "###VVVVV###", "###GGGGG###", "###GGGGG###", "###GGGGG###", "###VVVVV###", + "###XXXXX###", "###########", "###########", "###########", "###########", "###########", + "###########", "###########", "###########", "###########", "###########", "###########", + "###########", "###########") + .aisle("##XXXXXXX##", "##V#####V##", "##G#####G##", "##G#####G##", "##G#####G##", "##V#####V##", + "##X#####X##", "###XXXXX###", "###GGGGG###", "###GGGGG###", "###GGGGG###", "###GGGGG###", + "###GGGGG###", "###GGGGG###", "###GGGGG###", "###GGGGG###", "###GGGGG###", "###GGGGG###", + "###GGGGG###", "###XXXXX###") + .aisle("#XXXXXXXXX#", "#V#CCCCC#V#", "#G#CCCCC#G#", "#G#CCCCC#G#", "#G#CCCCC#G#", "#V#CCCCC#V#", + "#X#CCCCC#X#", "##XCCCCCX##", "##GCCCCCG##", "##GCCCCCG##", "##GCCCCCG##", "##GCCCCCG##", + "##GCCCCCG##", "##GCCCCCG##", "##GCCCCCG##", "##GCCCCCG##", "##GCCCCCG##", "##GCCCCCG##", + "##GCCCCCG##", "##XXXXXXX##") + .aisle("DXXXXXXXXXE", "V#C#####C#V", "G#C#####C#G", "G#C#####C#G", "G#C#####C#G", "V#C#####C#V", + "X#C#####C#X", "#XC#####CX#", "#GC#####CG#", "#GC#####CG#", "#GC#####CG#", "#GC#####CG#", + "#GC#####CG#", "#GC#####CG#", "#GC#####CG#", "#GC#####CG#", "#GC#####CG#", "#GC#####CG#", + "#GC#####CG#", "#XXXXXXXXX#") + .aisle("DXXXXXXXXXE", "V#C#####C#V", "G#C#####C#G", "G#C#####C#G", "G#C#####C#G", "V#C#####C#V", + "X#C#####C#X", "#XC#####CX#", "#GC#####CG#", "#GC#####CG#", "#GC#####CG#", "#GC#####CG#", + "#GC#####CG#", "#GC#####CG#", "#GC#####CG#", "#GC#####CG#", "#GC#####CG#", "#GC#####CG#", + "#GC#####CG#", "#XXXXXXXXX#") + .aisle("XXXXXXXXXXX", "V#C#####C#V", "G#C#####C#G", "G#C#####C#G", "G#C#####C#G", "V#C#####C#V", + "X#C#####C#X", "#XC#####CX#", "#GC#####CG#", "#GC#####CG#", "#GC#####CG#", "#GC#####CG#", + "#GC#####CG#", "#GC#####CG#", "#GC#####CG#", "#GC#####CG#", "#GC#####CG#", "#GC#####CG#", + "#GC#####CG#", "#XXXXMXXXX#") + .aisle("DXXXXXXXXXE", "V#C#####C#V", "G#C#####C#G", "G#C#####C#G", "G#C#####C#G", "V#C#####C#V", + "X#C#####C#X", "#XC#####CX#", "#GC#####CG#", "#GC#####CG#", "#GC#####CG#", "#GC#####CG#", + "#GC#####CG#", "#GC#####CG#", "#GC#####CG#", "#GC#####CG#", "#GC#####CG#", "#GC#####CG#", + "#GC#####CG#", "#XXXXXXXXX#") + .aisle("DXXXXXXXXXE", "V#C#####C#V", "G#C#####C#G", "G#C#####C#G", "G#C#####C#G", "V#C#####C#V", + "X#C#####C#X", "#XC#####CX#", "#GC#####CG#", "#GC#####CG#", "#GC#####CG#", "#GC#####CG#", + "#GC#####CG#", "#GC#####CG#", "#GC#####CG#", "#GC#####CG#", "#GC#####CG#", "#GC#####CG#", + "#GC#####CG#", "#XXXXXXXXX#") + .aisle("#XXXXXXXXX#", "#V#CCCCC#V#", "#G#CCCCC#G#", "#G#CCCCC#G#", "#G#CCCCC#G#", "#V#CCCCC#V#", + "#X#CCCCC#X#", "##XCCCCCX##", "##GCCCCCG##", "##GCCCCCG##", "##GCCCCCG##", "##GCCCCCG##", + "##GCCCCCG##", "##GCCCCCG##", "##GCCCCCG##", "##GCCCCCG##", "##GCCCCCG##", "##GCCCCCG##", + "##GCCCCCG##", "##XXXXXXX##") + .aisle("##XXXXXXX##", "##V#####V##", "##G#####G##", "##G#####G##", "##G#####G##", "##V#####V##", + "##X#####X##", "###XXXXX###", "###GGGGG###", "###GGGGG###", "###GGGGG###", "###GGGGG###", + "###GGGGG###", "###GGGGG###", "###GGGGG###", "###GGGGG###", "###GGGGG###", "###GGGGG###", + "###GGGGG###", "###XXXXX###") + .aisle("###IFXXO###", "###VVVVV###", "###GWPWG###", "###GWSWG###", "###GWZWG###", "###VVVVV###", + "###XXXXX###", "###########", "###########", "###########", "###########", "###########", + "###########", "###########", "###########", "###########", "###########", "###########", + "###########", "###########") + .where('S', ZBGTMetaTileEntities.MEGA_ABS, EnumFacing.SOUTH) + .where('Z', TraceabilityPredicates.getMaintenanceHatchMTE(), EnumFacing.SOUTH) + .where('P', GCYMMetaTileEntities.PARALLEL_HATCH[0], EnumFacing.SOUTH) + .where('X', getCasingState()) + .where('V', getVentState()) + .where('G', getGlassState()) + .where('M', MetaTileEntities.MUFFLER_HATCH[1], EnumFacing.UP) + .where('W', getCasingState()) + .where('X', getCasingState()) + .where('I', MetaTileEntities.ITEM_IMPORT_BUS[1], EnumFacing.SOUTH) + .where('F', MetaTileEntities.FLUID_IMPORT_HATCH[1], EnumFacing.SOUTH) + .where('O', MetaTileEntities.FLUID_EXPORT_HATCH[1], EnumFacing.SOUTH) + .where('E', MetaTileEntities.ENERGY_INPUT_HATCH[1], EnumFacing.EAST) + .where('D', MetaTileEntities.ENERGY_INPUT_HATCH[1], EnumFacing.WEST) + .where('#', Blocks.AIR.getDefaultState()); + + GregTechAPI.HEATING_COILS.entrySet().stream() + .sorted(Comparator.comparingInt(entry -> entry.getValue().getTier())) + .forEach(entry -> shapeInfo.add(builder.where('C', entry.getKey()).build())); + + return shapeInfo; + } + @Override protected void addDisplayText(List textList) { MultiblockDisplayText.builder(textList, isStructureFormed()) diff --git a/src/main/java/com/zorbatron/zbgt/common/metatileentities/multi/electric/megamultis/MetaTileEntityMegaEBF.java b/src/main/java/com/zorbatron/zbgt/common/metatileentities/multi/electric/megamultis/MetaTileEntityMegaEBF.java index 49fa302f..cfd5fcbf 100644 --- a/src/main/java/com/zorbatron/zbgt/common/metatileentities/multi/electric/megamultis/MetaTileEntityMegaEBF.java +++ b/src/main/java/com/zorbatron/zbgt/common/metatileentities/multi/electric/megamultis/MetaTileEntityMegaEBF.java @@ -1,10 +1,13 @@ package com.zorbatron.zbgt.common.metatileentities.multi.electric.megamultis; +import java.util.ArrayList; +import java.util.Comparator; import java.util.List; 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.SoundEvent; import net.minecraft.util.text.ITextComponent; @@ -20,9 +23,13 @@ import com.zorbatron.zbgt.api.capability.impl.HeatingCoilGCYMMultiblockRecipeLogic; import com.zorbatron.zbgt.api.metatileentity.LaserCapableGCYMRecipeMapMultiblockController; +import com.zorbatron.zbgt.api.pattern.TraceabilityPredicates; import com.zorbatron.zbgt.api.render.ZBGTTextures; +import com.zorbatron.zbgt.common.ZBGTMetaTileEntities; +import gregicality.multiblocks.common.metatileentities.GCYMMetaTileEntities; import gregtech.api.GTValues; +import gregtech.api.GregTechAPI; import gregtech.api.block.IHeatingCoilBlockStats; import gregtech.api.capability.IHeatingCoil; import gregtech.api.metatileentity.MetaTileEntity; @@ -32,6 +39,7 @@ import gregtech.api.metatileentity.multiblock.MultiblockDisplayText; 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.RecipeMaps; @@ -45,6 +53,7 @@ import gregtech.common.blocks.BlockMetalCasing; import gregtech.common.blocks.BlockWireCoil; import gregtech.common.blocks.MetaBlocks; +import gregtech.common.metatileentities.MetaTileEntities; import gregtech.core.sound.GTSoundEvents; public class MetaTileEntityMegaEBF extends LaserCapableGCYMRecipeMapMultiblockController implements IHeatingCoil { @@ -143,6 +152,88 @@ protected IBlockState getGlassState() { return MetaBlocks.TRANSPARENT_CASING.getState(BlockGlassCasing.CasingType.TEMPERED_GLASS); } + @Override + public List getMatchingShapes() { + ArrayList shapeInfo = new ArrayList<>(); + + MultiblockShapeInfo.Builder builder = MultiblockShapeInfo.builder() + .aisle("EEEEXXXXXXXEEEE", "GGGGGGGGGGGGGGG", "GGGGGGGGGGGGGGG", "GGGGGGGGGGGGGGG", "GGGGGGGGGGGGGGG", + "GGGGGGGGGGGGGGG", "GGGGGGGGGGGGGGG", "GGGGGGGGGGGGGGG", "GGGGGGGGGGGGGGG", "GGGGGGGGGGGGGGG", + "GGGGGGGGGGGGGGG", "GGGGGGGGGGGGGGG", "GGGGGGGGGGGGGGG", "GGGGGGGGGGGGGGG", "GGGGGGGGGGGGGGG", + "GGGGGGGGGGGGGGG", "GGGGGGGGGGGGGGG", "GGGGGGGGGGGGGGG", "GGGGGGGGGGGGGGG", "XXXXXXXXXXXXXXX") + .aisle("XXXXXXXXXXXXXXX", "GCCCCCCCCCCCCCG", "GCCCCCCCCCCCCCG", "GCCCCCCCCCCCCCG", "GCCCCCCCCCCCCCG", + "GCCCCCCCCCCCCCG", "GCCCCCCCCCCCCCG", "GCCCCCCCCCCCCCG", "GCCCCCCCCCCCCCG", "GCCCCCCCCCCCCCG", + "GCCCCCCCCCCCCCG", "GCCCCCCCCCCCCCG", "GCCCCCCCCCCCCCG", "GCCCCCCCCCCCCCG", "GCCCCCCCCCCCCCG", + "GCCCCCCCCCCCCCG", "GCCCCCCCCCCCCCG", "GCCCCCCCCCCCCCG", "GCCCCCCCCCCCCCG", "XXXXXXXXXXXXXXX") + .aisle("XXXXXXXXXXXXXXX", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "XXXXXXXXXXXXXXX") + .aisle("XXXXXXXXXXXXXXX", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "XXXXXXXXXXXXXXX") + .aisle("XXXXXXXXXXXXXXX", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "XXXXXXXXXXXXXXX") + .aisle("XXXXXXXXXXXXXXX", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "XXXXXXXXXXXXXXX") + .aisle("XXXXXXXXXXXXXXX", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "XXXXXXXXXXXXXXX") + .aisle("XXXXXXXXXXXXXXX", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "XXXXXXXMXXXXXXX") + .aisle("XXXXXXXXXXXXXXX", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "XXXXXXXXXXXXXXX") + .aisle("XXXXXXXXXXXXXXX", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "XXXXXXXXXXXXXXX") + .aisle("XXXXXXXXXXXXXXX", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "XXXXXXXXXXXXXXX") + .aisle("XXXXXXXXXXXXXXX", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "XXXXXXXXXXXXXXX") + .aisle("XXXXXXXXXXXXXXX", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", + "GC###########CG", "GC###########CG", "GC###########CG", "GC###########CG", "XXXXXXXXXXXXXXX") + .aisle("XXXXXXXXXXXXXXX", "GCCCCCCCCCCCCCG", "GCCCCCCCCCCCCCG", "GCCCCCCCCCCCCCG", "GCCCCCCCCCCCCCG", + "GCCCCCCCCCCCCCG", "GCCCCCCCCCCCCCG", "GCCCCCCCCCCCCCG", "GCCCCCCCCCCCCCG", "GCCCCCCCCCCCCCG", + "GCCCCCCCCCCCCCG", "GCCCCCCCCCCCCCG", "GCCCCCCCCCCCCCG", "GCCCCCCCCCCCCCG", "GCCCCCCCCCCCCCG", + "GCCCCCCCCCCCCCG", "GCCCCCCCCCCCCCG", "GCCCCCCCCCCCCCG", "GCCCCCCCCCCCCCG", "XXXXXXXXXXXXXXX") + .aisle("XXXXXXIPOXXXXXX", "GGGGGGGGGGGGGGG", "GGGGGGGSGGGGGGG", "GGGGGGGGGGGGGGG", "GGGGGGGGGGGGGGG", + "GGGGGGGGGGGGGGG", "GGGGGGGGGGGGGGG", "GGGGGGGGGGGGGGG", "GGGGGGGGGGGGGGG", "GGGGGGGGGGGGGGG", + "GGGGGGGGGGGGGGG", "GGGGGGGGGGGGGGG", "GGGGGGGGGGGGGGG", "GGGGGGGGGGGGGGG", "GGGGGGGGGGGGGGG", + "GGGGGGGGGGGGGGG", "GGGGGGGGGGGGGGG", "GGGGGGGGGGGGGGG", "GGGGGGGGGGGGGGG", "XXXXXXXZXXXXXXX") + .where('S', ZBGTMetaTileEntities.MEGA_EBF, EnumFacing.SOUTH) + .where('X', getCasingState()) + .where('G', getGlassState()) + .where('M', MetaTileEntities.MUFFLER_HATCH[1], EnumFacing.UP) + .where('Z', TraceabilityPredicates.getMaintenanceHatchMTE(), EnumFacing.SOUTH) + .where('E', MetaTileEntities.ENERGY_INPUT_HATCH[1], EnumFacing.NORTH) + .where('I', MetaTileEntities.ITEM_IMPORT_BUS[1], EnumFacing.SOUTH) + .where('O', MetaTileEntities.ITEM_EXPORT_BUS[1], EnumFacing.SOUTH) + .where('P', GCYMMetaTileEntities.PARALLEL_HATCH[0], EnumFacing.SOUTH); + + GregTechAPI.HEATING_COILS.entrySet().stream() + .sorted(Comparator.comparingInt(entry -> entry.getValue().getTier())) + .forEach(entry -> shapeInfo.add(builder.where('C', entry.getKey()).build())); + + return shapeInfo; + } + @Override protected void addDisplayText(List textList) { MultiblockDisplayText.builder(textList, isStructureFormed()) diff --git a/src/main/java/com/zorbatron/zbgt/common/metatileentities/multi/electric/megamultis/MetaTileEntityMegaOCU.java b/src/main/java/com/zorbatron/zbgt/common/metatileentities/multi/electric/megamultis/MetaTileEntityMegaOCU.java index 73f6ae7d..56039ed7 100644 --- a/src/main/java/com/zorbatron/zbgt/common/metatileentities/multi/electric/megamultis/MetaTileEntityMegaOCU.java +++ b/src/main/java/com/zorbatron/zbgt/common/metatileentities/multi/electric/megamultis/MetaTileEntityMegaOCU.java @@ -1,10 +1,13 @@ package com.zorbatron.zbgt.common.metatileentities.multi.electric.megamultis; +import java.util.ArrayList; +import java.util.Comparator; import java.util.List; 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.SoundEvent; import net.minecraft.util.text.ITextComponent; @@ -17,9 +20,13 @@ import org.jetbrains.annotations.Nullable; import com.zorbatron.zbgt.api.metatileentity.LaserCapableGCYMRecipeMapMultiblockController; +import com.zorbatron.zbgt.api.pattern.TraceabilityPredicates; import com.zorbatron.zbgt.api.render.ZBGTTextures; +import com.zorbatron.zbgt.common.ZBGTMetaTileEntities; import gregicality.multiblocks.api.capability.impl.GCYMMultiblockRecipeLogic; +import gregicality.multiblocks.common.metatileentities.GCYMMetaTileEntities; +import gregtech.api.GregTechAPI; import gregtech.api.block.IHeatingCoilBlockStats; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; @@ -29,6 +36,7 @@ import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController; import gregtech.api.pattern.BlockPattern; import gregtech.api.pattern.FactoryBlockPattern; +import gregtech.api.pattern.MultiblockShapeInfo; import gregtech.api.pattern.PatternMatchContext; import gregtech.api.recipes.RecipeMaps; import gregtech.api.recipes.recipeproperties.IRecipePropertyStorage; @@ -39,6 +47,7 @@ import gregtech.common.blocks.BlockGlassCasing; import gregtech.common.blocks.BlockMetalCasing; import gregtech.common.blocks.MetaBlocks; +import gregtech.common.metatileentities.MetaTileEntities; import gregtech.core.sound.GTSoundEvents; public class MetaTileEntityMegaOCU extends LaserCapableGCYMRecipeMapMultiblockController { @@ -98,6 +107,46 @@ protected IBlockState getGlassState() { return MetaBlocks.TRANSPARENT_CASING.getState(BlockGlassCasing.CasingType.TEMPERED_GLASS); } + @Override + public List getMatchingShapes() { + ArrayList shapeInfo = new ArrayList<>(); + + MultiblockShapeInfo.Builder builder = MultiblockShapeInfo.builder() + .aisle("XXEEEEXEEEEXX", "#X#########X#", "#X#########X#", "#X#########X#", "#X#########X#", + "#X#########X#", "#X#########X#") + .aisle("XXXXXXXXXXXXX", "XGGGGGGGGGGGX", "XGGGGGGGGGGGX", "XGGGGGGGGGGGX", "XGGGGGGGGGGGX", + "XGGGGGGGGGGGX", "XXGGGGGGGGGXX") + .aisle("XXXXXXXXXXXXX", "#G#C#C#C#C#G#", "#G#C#C#C#C#G#", "#G#C#C#C#C#G#", "#G#C#C#C#C#G#", + "#G#C#C#C#C#G#", "#XGGGGGGGGGX#") + .aisle("XXXXXXXXXXXXX", "#G#C#C#C#C#G#", "#X###C###C#X#", "#X#C#C#C#C#X#", "#X###C###C#X#", + "#G#C#C#C#C#G#", "#XGGGXXXGGGX#") + .aisle("XXXXXXXXXXXXX", "#G#C#C#C#C#G#", "#X#C#C#C#C#X#", "#I#C#C#C#C#O#", "#X#C#C#C#C#X#", + "#G#C#C#C#C#G#", "#XGGGXTXGGGX#") + .aisle("XXXXXXXXXXXXX", "#G#C#C#C#C#G#", "#X###C###C#X#", "#X#C#C#C#C#X#", "#X###C###C#X#", + "#G#C#C#C#C#G#", "#XGGGXXXGGGX#") + .aisle("XXXXXXXXXXXXX", "#G#C#C#C#C#G#", "#G#C#C#C#C#G#", "#G#C#C#C#C#G#", "#G#C#C#C#C#G#", + "#G#C#C#C#C#G#", "#XGGGGGGGGGX#") + .aisle("XXXXXXXXXXXXX", "XGGGGGGGGGGGX", "XGGGGGGGGGGGX", "XGGGGGGGGGGGX", "XGGGGGGGGGGGX", + "XGGGGGGGGGGGX", "XXGGGGGGGGGXX") + .aisle("XXXXXPSMXXXXX", "#X#########X#", "#X#########X#", "#X#########X#", "#X#########X#", + "#X#########X#", "#X#########X#") + .where('S', ZBGTMetaTileEntities.MEGA_OCU, EnumFacing.SOUTH) + .where('G', getGlassState()) + .where('X', getCasingState()) + .where('M', TraceabilityPredicates.getMaintenanceHatchMTE(), EnumFacing.SOUTH) + .where('P', GCYMMetaTileEntities.PARALLEL_HATCH[0], EnumFacing.SOUTH) + .where('E', MetaTileEntities.ENERGY_INPUT_HATCH[1], EnumFacing.NORTH) + .where('I', MetaTileEntities.FLUID_IMPORT_HATCH[1], EnumFacing.WEST) + .where('T', MetaTileEntities.FLUID_IMPORT_HATCH[1], EnumFacing.UP) + .where('O', MetaTileEntities.FLUID_EXPORT_HATCH[0], EnumFacing.EAST); + + GregTechAPI.HEATING_COILS.entrySet().stream() + .sorted(Comparator.comparingInt(entry -> entry.getValue().getTier())) + .forEach(entry -> shapeInfo.add(builder.where('C', entry.getKey()).build())); + + return shapeInfo; + } + @Override public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) { return Textures.CLEAN_STAINLESS_STEEL_CASING; diff --git a/src/main/java/com/zorbatron/zbgt/common/metatileentities/multi/electric/megamultis/MetaTileEntityPreciseAssembler.java b/src/main/java/com/zorbatron/zbgt/common/metatileentities/multi/electric/megamultis/MetaTileEntityPreciseAssembler.java index 05a0b2df..c19ced7a 100644 --- a/src/main/java/com/zorbatron/zbgt/common/metatileentities/multi/electric/megamultis/MetaTileEntityPreciseAssembler.java +++ b/src/main/java/com/zorbatron/zbgt/common/metatileentities/multi/electric/megamultis/MetaTileEntityPreciseAssembler.java @@ -101,7 +101,8 @@ public List getMatchingShapes() { .where('G', MetaBlocks.TRANSPARENT_CASING.getState(BlockGlassCasing.CasingType.TEMPERED_GLASS)) .where('F', MetaBlocks.FRAMES.get(Materials.TungstenSteel).getBlock(Materials.TungstenSteel)) .where('E', MetaTileEntities.ENERGY_INPUT_HATCH[GTValues.LV], EnumFacing.SOUTH) - .where('M', MetaTileEntities.MAINTENANCE_HATCH, EnumFacing.SOUTH) + .where('M', TraceabilityPredicates.getMaintenanceHatchMTE(), + EnumFacing.SOUTH) .where('#', Blocks.AIR.getDefaultState()); ZBGTAPI.MACHINE_CASINGS.entrySet().stream()