aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLex <50260829+4gname@users.noreply.github.com>2020-08-25 01:02:12 +0700
committerGitHub <noreply@github.com>2020-08-24 20:02:12 +0200
commit47ab2b7b988c95518b862059ef0c0d8b4c71c5d7 (patch)
treecd6e3576dc093a9fe11babca5c639c5ef227bba3
parent8e81f24ce5f168e7f4269c8c006d0b85f2472550 (diff)
downloadGT5-Unofficial-47ab2b7b988c95518b862059ef0c0d8b4c71c5d7.tar.gz
GT5-Unofficial-47ab2b7b988c95518b862059ef0c0d8b4c71c5d7.tar.bz2
GT5-Unofficial-47ab2b7b988c95518b862059ef0c0d8b4c71c5d7.zip
add check only block without meta (#37)
Meta 0 will be used to build and display the hologram. For example, you can make 16 kinds of glass blocks, and check only the block, without meta.
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java
index a9b88af2f3..1b89b80036 100644
--- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java
+++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java
@@ -391,6 +391,7 @@ public class StructureUtility {
@Override
public boolean check(T t, World world, int x, int y, int z) {
Block worldBlock = world.getBlock(x, y, z);
+ if (meta == -1) return block == worldBlock;
return block == worldBlock && meta == worldBlock.getDamageValue(world, x, y, z);
}
@@ -411,6 +412,7 @@ public class StructureUtility {
@Override
public boolean check(T t, World world, int x, int y, int z) {
Block worldBlock = world.getBlock(x, y, z);
+ if (meta == -1) return block == worldBlock;
return block == worldBlock && meta == worldBlock.getDamageValue(world, x, y, z);
}
@@ -432,6 +434,10 @@ public class StructureUtility {
public static <T> IStructureElement<T> ofBlock(Block block, int meta) {
return ofBlock(block, meta, block, meta);
}
+
+ public static <T> IStructureElement<T> ofBlock(Block block) {
+ return ofBlock(block, -1, block, 0);
+ }
//endregion