From 54f98cd732f1ce1dc5a8a6ed69490a25d676c8b1 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Fri, 16 Aug 2024 09:14:09 +0800 Subject: makeshift solution of skipping gt hatches (#2881) * makeshift solution of telling structurelib to not place gt hatches * Spotless apply for branch feature/gt-no-hatch for #2881 (#2882) spotlessApply Co-authored-by: GitHub GTNH Actions <> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Martin Robertz --- src/main/java/gregtech/api/interfaces/IHatchElement.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/main/java/gregtech/api/interfaces') diff --git a/src/main/java/gregtech/api/interfaces/IHatchElement.java b/src/main/java/gregtech/api/interfaces/IHatchElement.java index 09f3385729..482b7899ab 100644 --- a/src/main/java/gregtech/api/interfaces/IHatchElement.java +++ b/src/main/java/gregtech/api/interfaces/IHatchElement.java @@ -6,10 +6,12 @@ import java.util.List; import java.util.function.BiPredicate; import java.util.function.ToLongFunction; +import net.minecraft.block.Block; import net.minecraftforge.common.util.ForgeDirection; import com.google.common.collect.ImmutableList; import com.gtnewhorizon.structurelib.structure.IStructureElement; +import com.gtnewhorizon.structurelib.structure.StructureUtility; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -64,9 +66,21 @@ public interface IHatchElement { .casingIndex(aCasingIndex) .dot(aDot) .continueIfSuccess() + .exclusive() .build(); } + default IStructureElement newAnyOrCasing(int aCasingIndex, int aDot, Block casingBlock, + int casingMeta) { + if (aCasingIndex < 0 || aDot < 0) throw new IllegalArgumentException(); + return GT_StructureUtility.buildHatchAdder() + .anyOf(this) + .casingIndex(aCasingIndex) + .dot(aDot) + .continueIfSuccess() + .buildAndChain(StructureUtility.ofBlock(casingBlock, casingMeta)); + } + default IStructureElement newAny(int aCasingIndex, int aDot, ForgeDirection... allowedFacings) { if (aCasingIndex < 0 || aDot < 0) throw new IllegalArgumentException(); return GT_StructureUtility.buildHatchAdder() @@ -75,6 +89,7 @@ public interface IHatchElement { .dot(aDot) .continueIfSuccess() .allowOnly(allowedFacings) + .exclusive() .build(); } -- cgit