@@ -52,7 +52,7 @@ public LaserParticle(ClientLevel world, double d, double d1, double d2, double x
52
52
// of the asset instead of it applying to the entire texture
53
53
BlockColors blockColors = Minecraft .getInstance ().getBlockColors ();
54
54
55
- int color = blockColors .getColor (this .blockState , this .level , new BlockPos (d , d1 , d2 ), 0 );
55
+ int color = blockColors .getColor (this .blockState , this .level , new BlockPos (( int ) d , ( int ) d1 , ( int ) d2 ), 0 );
56
56
float f = (float ) (color >> 16 & 255 ) / 255.0F ;
57
57
float f1 = (float ) (color >> 8 & 255 ) / 255.0F ;
58
58
float f2 = (float ) (color & 255 ) / 255.0F ;
@@ -80,8 +80,7 @@ public LaserParticle(ClientLevel world, double d, double d1, double d2, double x
80
80
xo = x ;
81
81
yo = y ;
82
82
zo = z ;
83
- RenderBlockTileEntity te = (RenderBlockTileEntity ) world .getBlockEntity (new BlockPos (this .x , this .y , this .z ));
84
- if (te != null ) {
83
+ if (world .getBlockEntity (new BlockPos ((int )Math .floor (this .x ), (int )Math .floor (this .y ), (int )Math .floor (this .z ))) instanceof RenderBlockTileEntity te ) {
85
84
playerUUID = te .getPlayerUUID ();
86
85
voiding = !te .getBlockAllowed ();
87
86
}
@@ -99,7 +98,7 @@ public void render(VertexConsumer builder, Camera activeRenderInfo, float partia
99
98
public boolean particleToPlayer (Player player ) {
100
99
boolean partToPlayer = false ;
101
100
//if (player.isHandActive()) partToPlayer = true;
102
- BlockPos sourcePos = new BlockPos (sourceX , sourceY , sourceZ );
101
+ BlockPos sourcePos = new BlockPos (( int ) Math . floor ( sourceX ), ( int ) Math . floor ( sourceY ), ( int ) Math . floor ( sourceZ ) );
103
102
if (!(level .getBlockState (sourcePos ) == this .blockState )) partToPlayer = true ;
104
103
BlockEntity te = level .getBlockEntity (sourcePos );
105
104
if (te != null && te instanceof RenderBlockTileEntity ) {
0 commit comments