aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/interfaces
diff options
context:
space:
mode:
authorGlease <4586901+Glease@users.noreply.github.com>2024-08-16 09:14:09 +0800
committerGitHub <noreply@github.com>2024-08-16 01:14:09 +0000
commit54f98cd732f1ce1dc5a8a6ed69490a25d676c8b1 (patch)
treead7048b0a0e4acf5eacb3a37b75b9b0b43f60618 /src/main/java/gregtech/api/interfaces
parent5decfda1dd1b3bbfdb1098f409aa50162ea32dc2 (diff)
downloadGT5-Unofficial-54f98cd732f1ce1dc5a8a6ed69490a25d676c8b1.tar.gz
GT5-Unofficial-54f98cd732f1ce1dc5a8a6ed69490a25d676c8b1.tar.bz2
GT5-Unofficial-54f98cd732f1ce1dc5a8a6ed69490a25d676c8b1.zip
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 <dream-master@gmx.net>
Diffstat (limited to 'src/main/java/gregtech/api/interfaces')
-rw-r--r--src/main/java/gregtech/api/interfaces/IHatchElement.java15
1 files changed, 15 insertions, 0 deletions
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<T> {
.casingIndex(aCasingIndex)
.dot(aDot)
.continueIfSuccess()
+ .exclusive()
.build();
}
+ default <T2 extends T> IStructureElement<T2> newAnyOrCasing(int aCasingIndex, int aDot, Block casingBlock,
+ int casingMeta) {
+ if (aCasingIndex < 0 || aDot < 0) throw new IllegalArgumentException();
+ return GT_StructureUtility.<T2>buildHatchAdder()
+ .anyOf(this)
+ .casingIndex(aCasingIndex)
+ .dot(aDot)
+ .continueIfSuccess()
+ .buildAndChain(StructureUtility.ofBlock(casingBlock, casingMeta));
+ }
+
default <T2 extends T> IStructureElement<T2> newAny(int aCasingIndex, int aDot, ForgeDirection... allowedFacings) {
if (aCasingIndex < 0 || aDot < 0) throw new IllegalArgumentException();
return GT_StructureUtility.<T2>buildHatchAdder()
@@ -75,6 +89,7 @@ public interface IHatchElement<T> {
.dot(aDot)
.continueIfSuccess()
.allowOnly(allowedFacings)
+ .exclusive()
.build();
}