Adds support for vanilla negative explosions (#12705)

Fixes #10460
This commit is contained in:
Owen
2025-06-21 00:54:53 -04:00
committed by GitHub
parent e4eb69b8a1
commit 71b0c76861
3 changed files with 15 additions and 29 deletions

View File

@@ -30,7 +30,7 @@
- builder.withParameter(LootContextParams.EXPLOSION_RADIUS, explosion.radius());
+ // CraftBukkit start - add yield
+ if (explosion instanceof net.minecraft.world.level.ServerExplosion serverExplosion && serverExplosion.yield < 1.0F) {
+ builder.withParameter(LootContextParams.EXPLOSION_RADIUS, 1.0F / serverExplosion.yield);
+ builder.withParameter(LootContextParams.EXPLOSION_RADIUS, serverExplosion.yield == 0 ? 0 : 1.0F / serverExplosion.yield);
+ // CraftBukkit end
}