aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/interfaces/IHatchElement.java
diff options
context:
space:
mode:
authorGlease <4586901+Glease@users.noreply.github.com>2022-09-18 16:39:48 +0800
committerGitHub <noreply@github.com>2022-09-18 10:39:48 +0200
commit5748ba1e3e532cd451ee7ce6cfb3af32dca11e0e (patch)
tree5dd371a9a3d9ca01d907eb61b4cc4a725caf550a /src/main/java/gregtech/api/interfaces/IHatchElement.java
parentb321cb7a7dfe3ee4d1999a8589a444142f933369 (diff)
downloadGT5-Unofficial-5748ba1e3e532cd451ee7ce6cfb3af32dca11e0e.tar.gz
GT5-Unofficial-5748ba1e3e532cd451ee7ce6cfb3af32dca11e0e.tar.bz2
GT5-Unofficial-5748ba1e3e532cd451ee7ce6cfb3af32dca11e0e.zip
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
Diffstat (limited to 'src/main/java/gregtech/api/interfaces/IHatchElement.java')
-rw-r--r--src/main/java/gregtech/api/interfaces/IHatchElement.java12
1 files changed, 12 insertions, 0 deletions
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<T> {
List<? extends Class<? extends IMetaTileEntity>> mteClasses();
@@ -62,6 +63,17 @@ public interface IHatchElement<T> {
.build();
}
+ 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()
+ .anyOf(this)
+ .casingIndex(aCasingIndex)
+ .dot(aDot)
+ .continueIfSuccess()
+ .allowOnly(allowedFacings)
+ .build();
+ }
+
default <T2 extends T> IStructureElement<T2> newAny(
int aCasingIndex, int aDot, BiPredicate<? super T2, ? super IGregTechTileEntity> aShouldSkip) {
if (aCasingIndex < 0 || aDot < 0 || aShouldSkip == null) throw new IllegalArgumentException();