make it compile

This commit is contained in:
granny
2024-04-29 19:21:50 -07:00
parent 7a08bb73c9
commit 69403e54d0
2 changed files with 9 additions and 8 deletions

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Add PreExplodeEvents
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
index ed31528ddfec06e723827a505daeca5938dba865..58aa5059c484c9e8acf429a3ae4f07d83594f991 100644
index 69d8ff6a97335b6fe4b20a8229a77f2591b0f050..f5e84bf8817e2d53557e0909d8c9e0e0e8206a16 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -430,6 +430,23 @@ public class Explosion {
@@ -430,6 +430,25 @@ public class Explosion {
return;
}
// CraftBukkit end
@@ -22,7 +22,9 @@ index ed31528ddfec06e723827a505daeca5938dba865..58aa5059c484c9e8acf429a3ae4f07d8
+ }
+ }else {
+ Location location = new Location(this.level.getWorld(), this.x, this.y, this.z);
+ if(!new org.purpurmc.purpur.event.PreBlockExplodeEvent(location.getBlock(), this.blockInteraction == Explosion.BlockInteraction.DESTROY_WITH_DECAY ? 1.0F / this.radius : 1.0F, this.damageSource.explodedBlockState).callEvent()) {
+ org.bukkit.block.Block block = location.getBlock();
+ org.bukkit.block.BlockState blockState = (this.damageSource.blockState != null) ? this.damageSource.blockState : block.getState();
+ if(!new org.purpurmc.purpur.event.PreBlockExplodeEvent(location.getBlock(), this.blockInteraction == Explosion.BlockInteraction.DESTROY_WITH_DECAY ? 1.0F / this.radius : 1.0F, blockState).callEvent()) {
+ this.wasCanceled = true;
+ return;
+ }