2023-12-06 03:40:00 +11:00

16 lines
1.2 KiB
Diff

--- a/net/minecraft/world/level/block/state/BlockBase.java
+++ b/net/minecraft/world/level/block/state/BlockBase.java
@@ -188,8 +188,10 @@
TileEntity tileentity = iblockdata.hasBlockEntity() ? world.getBlockEntity(blockposition) : null;
LootParams.a lootparams_a = (new LootParams.a(worldserver)).withParameter(LootContextParameters.ORIGIN, Vec3D.atCenterOf(blockposition)).withParameter(LootContextParameters.TOOL, ItemStack.EMPTY).withOptionalParameter(LootContextParameters.BLOCK_ENTITY, tileentity).withOptionalParameter(LootContextParameters.THIS_ENTITY, explosion.getDirectSourceEntity());
- if (explosion.getBlockInteraction() == Explosion.Effect.DESTROY_WITH_DECAY) {
- lootparams_a.withParameter(LootContextParameters.EXPLOSION_RADIUS, explosion.radius());
+ // CraftBukkit start - add yield
+ if (explosion.yield < 1.0F) {
+ lootparams_a.withParameter(LootContextParameters.EXPLOSION_RADIUS, 1.0F / explosion.yield);
+ // CraftBukkit end
}
iblockdata.spawnAfterBreak(worldserver, blockposition, ItemStack.EMPTY, flag);