mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-23 07:51:52 +01:00
SPIGOT-7220: TNT drop rate isn't 100%
By: md_5 <git@md-5.net>
This commit is contained in:
parent
b6f6246c5d
commit
7bf6f20cec
@ -109,13 +109,13 @@
|
||||
+ float yield;
|
||||
+
|
||||
+ if (explode != null) {
|
||||
+ EntityExplodeEvent event = new EntityExplodeEvent(explode, location, blockList, this.blockInteraction == Explosion.Effect.DESTROY ? 1.0F / this.radius : 1.0F);
|
||||
+ EntityExplodeEvent event = new EntityExplodeEvent(explode, location, blockList, this.blockInteraction == Explosion.Effect.DESTROY_WITH_DECAY ? 1.0F / this.radius : 1.0F);
|
||||
+ this.level.getCraftServer().getPluginManager().callEvent(event);
|
||||
+ cancelled = event.isCancelled();
|
||||
+ bukkitBlocks = event.blockList();
|
||||
+ yield = event.getYield();
|
||||
+ } else {
|
||||
+ BlockExplodeEvent event = new BlockExplodeEvent(location.getBlock(), blockList, this.blockInteraction == Explosion.Effect.DESTROY ? 1.0F / this.radius : 1.0F);
|
||||
+ BlockExplodeEvent event = new BlockExplodeEvent(location.getBlock(), blockList, this.blockInteraction == Explosion.Effect.DESTROY_WITH_DECAY ? 1.0F / this.radius : 1.0F);
|
||||
+ this.level.getCraftServer().getPluginManager().callEvent(event);
|
||||
+ cancelled = event.isCancelled();
|
||||
+ bukkitBlocks = event.blockList();
|
||||
@ -144,7 +144,7 @@
|
||||
|
||||
- if (this.blockInteraction == Explosion.Effect.DESTROY_WITH_DECAY) {
|
||||
- loottableinfo_builder.withParameter(LootContextParameters.EXPLOSION_RADIUS, this.radius);
|
||||
+ if (this.blockInteraction == Explosion.Effect.DESTROY_WITH_DECAY || yield < 1.0F) { // CraftBukkit - add yield
|
||||
+ if (yield < 1.0F) { // CraftBukkit - add yield
|
||||
+ loottableinfo_builder.withParameter(LootContextParameters.EXPLOSION_RADIUS, 1.0F / yield); // CraftBukkit - add yield
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user