Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Coagulation Tank formation glitch #322

Merged
merged 4 commits into from
Oct 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
import gregtech.api.gui.widgets.*;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.interfaces.IGregTechTileEntity;
import gregtech.api.metatileentity.multiblock.*;
import gregtech.api.metatileentity.multiblock.IMultiblockPart;
import gregtech.api.metatileentity.multiblock.MultiblockAbility;
import gregtech.api.metatileentity.multiblock.ParallelLogicType;
import gregtech.api.metatileentity.multiblock.RecipeMapPrimitiveMultiblockController;
import gregtech.api.pattern.BlockPattern;
import gregtech.api.pattern.FactoryBlockPattern;
import gregtech.api.pattern.PatternMatchContext;
Expand Down Expand Up @@ -66,21 +69,19 @@ public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) {
return new MetaTileEntityCoagulationTank(this.metaTileEntityId);
}

@NotNull
@Override
protected BlockPattern createStructurePattern() {
return FactoryBlockPattern.start()
.aisle(new String[]{"XXX", "XXX", "XXX"})
.aisle(new String[]{"XXX", "XIX", "X#X"}).setRepeatable(1, 4)
.aisle(new String[]{"XXX", "XSX", "XXX"})
.where('X',
states(new IBlockState[]{SuSyBlocks.COAGULATION_TANK_WALL
.getState(BlockCoagulationTankWall.CoagulationTankWallType.WOODEN_COAGULATION_TANK_WALL)})
.or(abilities(MultiblockAbility.EXPORT_ITEMS)
.setMaxGlobalLimited(1))
.or(abilities(MultiblockAbility.IMPORT_FLUIDS)
.setMaxGlobalLimited(1)))
.aisle("XXX", "XXX", "XXX")
.aisle("XXX", "XIX", "X#X").setRepeatable(1, 4)
.aisle("XXX", "XSX", "XXX")
.where('X', states(getCasingState())
.or(abilities(MultiblockAbility.EXPORT_ITEMS, MultiblockAbility.IMPORT_FLUIDS)))
.where('#', air())
.where('I', isIndicatorPredicate())
.where('S', this.selfPredicate()).build();
.where('S', selfPredicate())
.build();
}

public static TraceabilityPredicate isIndicatorPredicate() {
Expand All @@ -93,6 +94,11 @@ public static TraceabilityPredicate isIndicatorPredicate() {
});
}

protected static IBlockState getCasingState() {
return SuSyBlocks.COAGULATION_TANK_WALL
.getState(BlockCoagulationTankWall.CoagulationTankWallType.WOODEN_COAGULATION_TANK_WALL);
}

@Override
public void addInformation(ItemStack stack, @Nullable World world, @NotNull List<String> tooltip, boolean advanced) {
super.addInformation(stack, world, tooltip, advanced);
Expand Down