Skip to content

Commit 22ead11

Browse files
dordsor21PierreSchwang
authored andcommitted
refactor: move leave event dispact to after logic
- closes #4171
1 parent 63ae11b commit 22ead11

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Core/src/main/java/com/plotsquared/core/listener/PlotListener.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,6 @@ public boolean plotEntry(final PlotPlayer<?> player, final Plot plot) {
364364
public boolean plotExit(final PlotPlayer<?> player, Plot plot) {
365365
try (final MetaDataAccess<Plot> lastPlot = player.accessTemporaryMetaData(PlayerMetaDataKeys.TEMPORARY_LAST_PLOT)) {
366366
final Plot previous = lastPlot.remove();
367-
this.eventDispatcher.callLeave(player, plot);
368367

369368
List<StatusEffect> effects = playerEffects.remove(player.getUUID());
370369
if (effects != null) {
@@ -467,6 +466,8 @@ public boolean plotExit(final PlotPlayer<?> player, Plot plot) {
467466
feedRunnable.remove(player.getUUID());
468467
healRunnable.remove(player.getUUID());
469468
}
469+
} finally {
470+
this.eventDispatcher.callLeave(player, plot);
470471
}
471472
return true;
472473
}

0 commit comments

Comments
 (0)