Fix explosion line of sight crash
All checks were successful
Build / build (push) Successful in 14m13s

This commit is contained in:
MrSphay
2026-05-09 14:54:47 +02:00
parent fc9a4e00a1
commit 0c57ad000a

View File

@@ -16,6 +16,7 @@ import net.minecraft.world.level.ClipContext;
import net.minecraft.world.level.Explosion;
import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.Vec3;
import net.minecraft.world.phys.shapes.CollisionContext;
public class ServerExplosionHandler {
private static final double SOUND_SPEED_BLOCKS_PER_TICK = 343.0 / 20.0;
@@ -205,7 +206,7 @@ public class ServerExplosionHandler {
}
private static boolean hasLineOfSight(ServerLevel level, Vec3 from, Vec3 to) {
return level.clip(new ClipContext(from, to, ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, (Entity)null)).getType() == HitResult.Type.MISS;
return level.clip(new ClipContext(from, to, ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, CollisionContext.empty())).getType() == HitResult.Type.MISS;
}
private static boolean isInCave(ServerLevel level, BlockPos pos) {