From 1991142d486220f3a9ab450a82f788def1b89899 Mon Sep 17 00:00:00 2001 From: Jordan Date: Tue, 26 Dec 2023 16:26:31 +0100 Subject: [PATCH] refactor: move leave event dispact to after logic (#4260) - closes #4171 --- .../main/java/com/plotsquared/core/listener/PlotListener.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Core/src/main/java/com/plotsquared/core/listener/PlotListener.java b/Core/src/main/java/com/plotsquared/core/listener/PlotListener.java index 1ac4887a3..759421f5e 100644 --- a/Core/src/main/java/com/plotsquared/core/listener/PlotListener.java +++ b/Core/src/main/java/com/plotsquared/core/listener/PlotListener.java @@ -364,7 +364,6 @@ public class PlotListener { public boolean plotExit(final PlotPlayer player, Plot plot) { try (final MetaDataAccess lastPlot = player.accessTemporaryMetaData(PlayerMetaDataKeys.TEMPORARY_LAST_PLOT)) { final Plot previous = lastPlot.remove(); - this.eventDispatcher.callLeave(player, plot); List effects = playerEffects.remove(player.getUUID()); if (effects != null) { @@ -467,6 +466,8 @@ public class PlotListener { feedRunnable.remove(player.getUUID()); healRunnable.remove(player.getUUID()); } + } finally { + this.eventDispatcher.callLeave(player, plot); } return true; }