Add predicate for block when raytracing (#9691)
* Add predicate for block data when raytracing blocks * Match based on block, instead of block data * Use instanceof instead of casting * Use Position instead of Location, add overload for rayTraceEntities * Implement requested changes * Invert predicate * Cleanup
This commit is contained in:
parent
8a3980c60b
commit
23860da6c2
6 changed files with 261 additions and 10 deletions
|
@ -3480,10 +3480,10 @@ index 0000000000000000000000000000000000000000..cea9c098ade00ee87b8efc8164ab72f5
|
|||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..9572294a50110f2452090da1f32e0a73edc3db05
|
||||
index 0000000000000000000000000000000000000000..19708dee02491e74fb3db6e70911e20a57b09769
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||
@@ -0,0 +1,534 @@
|
||||
@@ -0,0 +1,538 @@
|
||||
+package io.papermc.paper.util;
|
||||
+
|
||||
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||
|
@ -3972,6 +3972,10 @@ index 0000000000000000000000000000000000000000..9572294a50110f2452090da1f32e0a73
|
|||
+ return Position.block(vector.getX(), vector.getY(), vector.getZ());
|
||||
+ }
|
||||
+
|
||||
+ public static Vec3 toVec3(Position position) {
|
||||
+ return new Vec3(position.x(), position.y(), position.z());
|
||||
+ }
|
||||
+
|
||||
+ public static boolean isEdgeOfChunk(BlockPos pos) {
|
||||
+ final int modX = pos.getX() & 15;
|
||||
+ final int modZ = pos.getZ() & 15;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue