11package dev .hephaestus .sax .server ;
22
3- import dev .hephaestus .sax .SAX ;
43import net .minecraft .block .BlockState ;
54import net .minecraft .network .packet .s2c .play .BlockUpdateS2CPacket ;
65import net .minecraft .server .network .ServerPlayerEntity ;
1110import net .minecraft .util .math .Vec3i ;
1211import net .minecraft .util .shape .VoxelShape ;
1312import net .minecraft .world .BlockView ;
14- import net .minecraft .world .RayTraceContext ;
13+ import net .minecraft .world .RaycastContext ;
1514
1615import java .util .HashSet ;
1716import java .util .function .Consumer ;
@@ -74,10 +73,10 @@ private boolean traceForBlock(ServerPlayerEntity player, Vec3i target) {
7473 for (byte dY = 0 ; dY <= 1 ; ++dY ) {
7574 for (byte dZ = 0 ; dZ <= 1 ; ++dZ ) {
7675 Vec3d pos = new Vec3d (target .getX () + dX , target .getY () + dY , target .getZ () + dZ );
77- RayTraceContext context = new RayTraceContext (
76+ RaycastContext context = new RaycastContext (
7877 player .getCameraPosVec (1F ),
7978 pos ,
80- RayTraceContext .ShapeType .VISUAL , RayTraceContext .FluidHandling .NONE , player
79+ RaycastContext .ShapeType .VISUAL , RaycastContext .FluidHandling .NONE , player
8180 );
8281
8382 BlockHitResult hitResult = rayTrace (context );
@@ -92,14 +91,14 @@ private boolean traceForBlock(ServerPlayerEntity player, Vec3i target) {
9291 return false ;
9392 }
9493
95- private BlockHitResult rayTrace (RayTraceContext context ) {
94+ private BlockHitResult rayTrace (RaycastContext context ) {
9695 BlockView blockView = this .player .world ;
97- return BlockView .rayTrace (context , (rayTraceContext , blockPos ) -> {
96+ return BlockView .raycast (context , (rayTraceContext , blockPos ) -> {
9897 BlockState blockState = blockView .getBlockState (blockPos );
9998 Vec3d vec3d = rayTraceContext .getStart ();
10099 Vec3d vec3d2 = rayTraceContext .getEnd ();
101100 VoxelShape voxelShape = rayTraceContext .getBlockShape (blockState , blockView , blockPos );
102- return blockView .rayTraceBlock (vec3d , vec3d2 , blockPos , voxelShape , blockState );
101+ return blockView .raycastBlock (vec3d , vec3d2 , blockPos , voxelShape , blockState );
103102 }, (rayTraceContext ) -> {
104103 Vec3d vec3d = rayTraceContext .getStart ().subtract (rayTraceContext .getEnd ());
105104 return BlockHitResult .createMissed (rayTraceContext .getEnd (), Direction .getFacing (vec3d .x , vec3d .y , vec3d .z ), new BlockPos (rayTraceContext .getEnd ()));
0 commit comments