Skip to content

Commit

Permalink
refactor: move leave event dispact to after logic
Browse files Browse the repository at this point in the history
 - closes #4171
  • Loading branch information
dordsor21 authored and PierreSchwang committed Dec 26, 2023
1 parent 63ae11b commit 22ead11
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,6 @@ public boolean plotEntry(final PlotPlayer<?> player, final Plot plot) {
public boolean plotExit(final PlotPlayer<?> player, Plot plot) {
try (final MetaDataAccess<Plot> lastPlot = player.accessTemporaryMetaData(PlayerMetaDataKeys.TEMPORARY_LAST_PLOT)) {
final Plot previous = lastPlot.remove();
this.eventDispatcher.callLeave(player, plot);

List<StatusEffect> effects = playerEffects.remove(player.getUUID());
if (effects != null) {
Expand Down Expand Up @@ -467,6 +466,8 @@ public boolean plotExit(final PlotPlayer<?> player, Plot plot) {
feedRunnable.remove(player.getUUID());
healRunnable.remove(player.getUUID());
}
} finally {
this.eventDispatcher.callLeave(player, plot);
}
return true;
}
Expand Down

0 comments on commit 22ead11

Please sign in to comment.