#1209: Clean up various patches

By: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
This commit is contained in:
CraftBukkit/Spigot
2023-06-24 17:15:05 +10:00
parent 0f9e7a497e
commit b97cc9b99f
71 changed files with 662 additions and 719 deletions

View File

@@ -25,7 +25,7 @@
}
}
@@ -95,11 +104,24 @@
@@ -95,11 +104,23 @@
return false;
} else {
if (!this.isRemoved() && !this.level().isClientSide) {
@@ -40,8 +40,7 @@
- this.level().explode(this, damagesource1, (ExplosionDamageCalculator) null, this.getX(), this.getY(), this.getZ(), 6.0F, false, World.a.BLOCK);
+ // CraftBukkit start
+ ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), 6.0F, false);
+ this.level().getCraftServer().getPluginManager().callEvent(event);
+ ExplosionPrimeEvent event = CraftEventFactory.callExplosionPrimeEvent(this, 6.0F, false);
+ if (event.isCancelled()) {
+ this.unsetRemoved();
+ return false;

View File

@@ -75,7 +75,7 @@
if (canDestroy(iblockdata)) {
+ // CraftBukkit start
+ if (CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, Blocks.AIR.defaultBlockState()).isCancelled()) {
+ if (!CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, Blocks.AIR.defaultBlockState())) {
+ continue;
+ }
+ // CraftBukkit end