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:
TonytheMacaroni
2023-11-04 18:00:51 -04:00
parent 6e88b4fa1e
commit e83e680321
4 changed files with 251 additions and 0 deletions

View File

@@ -3972,6 +3972,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ 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;