generated from MrSphay/codex-agent-repository-kit
Fix explosion line of sight crash
All checks were successful
Build / build (push) Successful in 14m13s
All checks were successful
Build / build (push) Successful in 14m13s
This commit is contained in:
@@ -16,6 +16,7 @@ import net.minecraft.world.level.ClipContext;
|
|||||||
import net.minecraft.world.level.Explosion;
|
import net.minecraft.world.level.Explosion;
|
||||||
import net.minecraft.world.phys.HitResult;
|
import net.minecraft.world.phys.HitResult;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
|
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||||
|
|
||||||
public class ServerExplosionHandler {
|
public class ServerExplosionHandler {
|
||||||
private static final double SOUND_SPEED_BLOCKS_PER_TICK = 343.0 / 20.0;
|
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) {
|
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) {
|
private static boolean isInCave(ServerLevel level, BlockPos pos) {
|
||||||
|
|||||||
Reference in New Issue
Block a user