mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@681c013 Bundle spark (#11093) PaperMC/Paper@5fee9c6 Move configuration option to a system property PaperMC/Paper@aa3b356 Improve server startup logging (#11110) PaperMC/Paper@9aea240 Properly lookup plugin classes when looked up by spark PaperMC/Paper@7e91a2c Update the bundled spark version
This commit is contained in:
36
patches/server/0276-Add-PreExplodeEvents.patch
Normal file
36
patches/server/0276-Add-PreExplodeEvents.patch
Normal file
@@ -0,0 +1,36 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: SageSphinx63920 <sage@sagesphinx63920.dev>
|
||||
Date: Mon, 26 Dec 2022 23:42:37 +0100
|
||||
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 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 {
|
||||
return;
|
||||
}
|
||||
// CraftBukkit end
|
||||
+
|
||||
+ // 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, org.bukkit.craftbukkit.CraftExplosionResult.toBukkit(getBlockInteraction())).callEvent()) {
|
||||
+ this.wasCanceled = true;
|
||||
+ return;
|
||||
+ }
|
||||
+ }else {
|
||||
+ 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, org.bukkit.craftbukkit.CraftExplosionResult.toBukkit(getBlockInteraction())).callEvent()) {
|
||||
+ this.wasCanceled = true;
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+ //Purpur end
|
||||
+
|
||||
this.level.gameEvent(this.source, (Holder) GameEvent.EXPLODE, new Vec3(this.x, this.y, this.z));
|
||||
|
||||
// Paper start - collision optimisations
|
||||
Reference in New Issue
Block a user