Updated Upstream (Paper)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@dd11ef8 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#11102)
This commit is contained in:
granny
2024-07-18 03:57:34 -07:00
parent 2e39567fa1
commit eadfff73ea
35 changed files with 123 additions and 121 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 d7cd063240a2799996cf7efa3f766ee748702db1..5248e32e2109494904bc16839b2f202dab3d96c9 100644
index 8dd513e3aa12bb5086d4eebe9a93c1f2ffb0b9eb..97e79b770f0d7273611db0e60ea14005b65fb7d2 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -407,6 +407,25 @@ public class Explosion {
@@ -16,7 +16,7 @@ index d7cd063240a2799996cf7efa3f766ee748702db1..5248e32e2109494904bc16839b2f202d
+ // Purpur start - add PreExplodeEvents
+ if(this.source != null){
+ Location location = new Location(this.level.getWorld(), this.x, this.y, this.z);
+ if(!new org.purpurmc.purpur.event.entity.PreEntityExplodeEvent(this.source.getBukkitEntity(), location, this.blockInteraction == Explosion.BlockInteraction.DESTROY_WITH_DECAY ? 1.0F / this.radius : 1.0F).callEvent()) {
+ if(!new org.purpurmc.purpur.event.entity.PreEntityExplodeEvent(this.source.getBukkitEntity(), location, this.blockInteraction == Explosion.BlockInteraction.DESTROY_WITH_DECAY ? 1.0F / this.radius : 1.0F, org.bukkit.craftbukkit.CraftExplosionResult.toBukkit(getBlockInteraction())).callEvent()) {
+ this.wasCanceled = true;
+ return;
+ }
@@ -24,7 +24,7 @@ index d7cd063240a2799996cf7efa3f766ee748702db1..5248e32e2109494904bc16839b2f202d
+ Location location = new Location(this.level.getWorld(), this.x, this.y, this.z);
+ org.bukkit.block.Block block = location.getBlock();
+ org.bukkit.block.BlockState blockState = (this.damageSource.getDirectBlockState() != null) ? this.damageSource.getDirectBlockState() : 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()) {
+ if(!new org.purpurmc.purpur.event.PreBlockExplodeEvent(location.getBlock(), this.blockInteraction == Explosion.BlockInteraction.DESTROY_WITH_DECAY ? 1.0F / this.radius : 1.0F, blockState, org.bukkit.craftbukkit.CraftExplosionResult.toBukkit(getBlockInteraction())).callEvent()) {
+ this.wasCanceled = true;
+ return;
+ }