From c80f0375ee606a2a03dd60ce807e357fd9f0df85 Mon Sep 17 00:00:00 2001 From: Andreas Troelsen Date: Sun, 5 Dec 2021 16:18:54 +0100 Subject: [PATCH] Copy cancel state to fake EntityExplodeEvent. It's not clear if this change actually solves the underlying issue, because it has not been tested in a controlled environment. However, considering the EntityExplodeEvent constructor, which doesn't take a cancel state value, and the `HIGHEST` priority setting of MobArena's event handler, the issue is realistic, and this change very likely solves the issue. Fixes #704 --- changelog.md | 1 + .../com/garbagemule/MobArena/listeners/MAGlobalListener.java | 1 + 2 files changed, 2 insertions(+) diff --git a/changelog.md b/changelog.md index 9c3e74d..5e94739 100644 --- a/changelog.md +++ b/changelog.md @@ -32,6 +32,7 @@ These changes will (most likely) be included in the next version. - Reward groups with `nothing` in them no longer cause errors when earned/granted. - The title-based announcer and the title-based boss health bar have been fixed to work with the breaking change to the Title API in Spigot 1.17. - Arena Signs now correctly update for arenas that don't have `kebab-case` names in the config-file. +- Block explosion events cancelled by other plugins now remain cancelled unless MobArena specifically uncancels them for an arena. ## [0.106] - 2021-05-09 ### Added diff --git a/src/main/java/com/garbagemule/MobArena/listeners/MAGlobalListener.java b/src/main/java/com/garbagemule/MobArena/listeners/MAGlobalListener.java index 2d010c5..9d023f5 100644 --- a/src/main/java/com/garbagemule/MobArena/listeners/MAGlobalListener.java +++ b/src/main/java/com/garbagemule/MobArena/listeners/MAGlobalListener.java @@ -203,6 +203,7 @@ public class MAGlobalListener implements Listener // Account for Spigot's messy extra event EntityExplodeEvent fake = new EntityExplodeEvent(null, event.getBlock().getLocation(), blocks, event.getYield()); + fake.setCancelled(event.isCancelled()); entityExplode(fake); // Copy the values over