mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
refactor: move leave event dispact to after logic (#4260)
- closes #4171
This commit is contained in:
parent
63ae11b3d3
commit
1991142d48
@ -364,7 +364,6 @@ public class PlotListener {
|
|||||||
public boolean plotExit(final PlotPlayer<?> player, Plot plot) {
|
public boolean plotExit(final PlotPlayer<?> player, Plot plot) {
|
||||||
try (final MetaDataAccess<Plot> lastPlot = player.accessTemporaryMetaData(PlayerMetaDataKeys.TEMPORARY_LAST_PLOT)) {
|
try (final MetaDataAccess<Plot> lastPlot = player.accessTemporaryMetaData(PlayerMetaDataKeys.TEMPORARY_LAST_PLOT)) {
|
||||||
final Plot previous = lastPlot.remove();
|
final Plot previous = lastPlot.remove();
|
||||||
this.eventDispatcher.callLeave(player, plot);
|
|
||||||
|
|
||||||
List<StatusEffect> effects = playerEffects.remove(player.getUUID());
|
List<StatusEffect> effects = playerEffects.remove(player.getUUID());
|
||||||
if (effects != null) {
|
if (effects != null) {
|
||||||
@ -467,6 +466,8 @@ public class PlotListener {
|
|||||||
feedRunnable.remove(player.getUUID());
|
feedRunnable.remove(player.getUUID());
|
||||||
healRunnable.remove(player.getUUID());
|
healRunnable.remove(player.getUUID());
|
||||||
}
|
}
|
||||||
|
} finally {
|
||||||
|
this.eventDispatcher.callLeave(player, plot);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user