diff options
author | TonytheMacaroni <[email protected]> | 2023-11-04 18:00:51 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2023-11-04 15:00:51 -0700 |
commit | 23860da6c2f306fdc598fb0d09132636c7141dfd (patch) | |
tree | 612c364ffabbefde18c9ed2680583c240075ba94 /patches/server/0009-MC-Utils.patch | |
parent | 8a3980c60bd09eb1d0d21bfc846181a49c0d74df (diff) | |
download | Paper-23860da6c2f306fdc598fb0d09132636c7141dfd.tar.gz Paper-23860da6c2f306fdc598fb0d09132636c7141dfd.zip |
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
Diffstat (limited to 'patches/server/0009-MC-Utils.patch')
-rw-r--r-- | patches/server/0009-MC-Utils.patch | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/patches/server/0009-MC-Utils.patch b/patches/server/0009-MC-Utils.patch index c25d9309cd..0850a593eb 100644 --- a/patches/server/0009-MC-Utils.patch +++ b/patches/server/0009-MC-Utils.patch @@ -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; |