diff --git a/nms-patches/Explosion.patch b/nms-patches/Explosion.patch index b166c928cb..c15369bfaf 100644 --- a/nms-patches/Explosion.patch +++ b/nms-patches/Explosion.patch @@ -90,13 +90,13 @@ + float yield; + + if (explode != null) { -+ EntityExplodeEvent event = new EntityExplodeEvent(explode, location, blockList, 1.0F / this.size); ++ EntityExplodeEvent event = new EntityExplodeEvent(explode, location, blockList, this.b == Explosion.Effect.DESTROY ? 1.0F / this.size : 1.0F); + this.world.getServer().getPluginManager().callEvent(event); + cancelled = event.isCancelled(); + bukkitBlocks = event.blockList(); + yield = event.getYield(); + } else { -+ BlockExplodeEvent event = new BlockExplodeEvent(location.getBlock(), blockList, 1.0F / this.size); ++ BlockExplodeEvent event = new BlockExplodeEvent(location.getBlock(), blockList, this.b == Explosion.Effect.DESTROY ? 1.0F / this.size : 1.0F); + this.world.getServer().getPluginManager().callEvent(event); + cancelled = event.isCancelled(); + bukkitBlocks = event.blockList(); @@ -118,11 +118,13 @@ iterator = this.blocks.iterator(); while (iterator.hasNext()) { -@@ -226,7 +292,7 @@ +@@ -225,8 +291,8 @@ + TileEntity tileentity = block.isTileEntity() ? this.world.getTileEntity(blockposition) : null; LootTableInfo.Builder loottableinfo_builder = (new LootTableInfo.Builder((WorldServer) this.world)).a(this.world.random).set(LootContextParameters.POSITION, blockposition).set(LootContextParameters.TOOL, ItemStack.a).setOptional(LootContextParameters.BLOCK_ENTITY, tileentity); - if (this.b == Explosion.Effect.DESTROY) { +- if (this.b == Explosion.Effect.DESTROY) { - loottableinfo_builder.set(LootContextParameters.EXPLOSION_RADIUS, this.size); ++ if (this.b == Explosion.Effect.DESTROY || yield < 1.0F) { // CraftBukkit - add yield + loottableinfo_builder.set(LootContextParameters.EXPLOSION_RADIUS, 1.0F / yield); // CraftBukkit - add yield }