From 5748ba1e3e532cd451ee7ce6cfb3af32dca11e0e Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Sun, 18 Sep 2022 16:39:48 +0800 Subject: migrate to new survival autoplace api (#1382) * migrate to new survival autoplace api * reduce type of blocks autoplace will use this does not prevent those blocks from not being accepted into the structures though * implement getBlocksToPlace * fix survivalConstruct code for assline and DT i hate variable size multi :( * fix AIOBE * allow disabling machine block updates on a per-thread basis * make a sensible guess at what texture to use on server side * spotless * implement hologram support for bbf * spotless --- src/main/java/gregtech/api/interfaces/IHatchElement.java | 12 ++++++++++++ 1 file changed, 12 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 e1f68963e0..276a7a1a9c 100644 --- a/src/main/java/gregtech/api/interfaces/IHatchElement.java +++ b/src/main/java/gregtech/api/interfaces/IHatchElement.java @@ -11,6 +11,7 @@ import java.util.Collections; import java.util.List; import java.util.function.BiPredicate; import java.util.function.ToLongFunction; +import net.minecraftforge.common.util.ForgeDirection; public interface IHatchElement { List> mteClasses(); @@ -62,6 +63,17 @@ public interface IHatchElement { .build(); } + default IStructureElement newAny(int aCasingIndex, int aDot, ForgeDirection... allowedFacings) { + if (aCasingIndex < 0 || aDot < 0) throw new IllegalArgumentException(); + return GT_StructureUtility.buildHatchAdder() + .anyOf(this) + .casingIndex(aCasingIndex) + .dot(aDot) + .continueIfSuccess() + .allowOnly(allowedFacings) + .build(); + } + default IStructureElement newAny( int aCasingIndex, int aDot, BiPredicate aShouldSkip) { if (aCasingIndex < 0 || aDot < 0 || aShouldSkip == null) throw new IllegalArgumentException(); -- cgit