fix bad method call in PreBlockExplodeEvent event

This commit is contained in:
BillyGalbreath
2023-07-28 23:20:01 -07:00
committed by granny
parent f12aa53d9a
commit 556e83c2ec
2 changed files with 8 additions and 6 deletions

View File

@@ -5,7 +5,7 @@ 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 dcc3b333f3647631e2fb695d0854036d3bc009be..6772c4584f1d243df76b42a730376247c8f04e3b 100644
index dcc3b333f3647631e2fb695d0854036d3bc009be..4932374ab9a3d8582fb0ef024d817ad896dd23c4 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -141,6 +141,23 @@ public class Explosion {
@@ -22,7 +22,7 @@ index dcc3b333f3647631e2fb695d0854036d3bc009be..6772c4584f1d243df76b42a730376247
+ }
+ }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).callEvent()) {
+ 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()) {
+ this.wasCanceled = true;
+ return;
+ }