mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 11:55:38 +01:00
Call plot leave on quit
This commit is contained in:
parent
afef79ea66
commit
574ca7a180
@ -1617,11 +1617,15 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen
|
||||
@EventHandler(priority= EventPriority.MONITOR)
|
||||
public void onLeave(final PlayerQuitEvent event) {
|
||||
PlotPlayer pp = BukkitUtil.getPlayer(event.getPlayer());
|
||||
Plot plot = pp.getCurrentPlot();
|
||||
if (plot != null) {
|
||||
plotExit(pp, plot);
|
||||
}
|
||||
ExpireManager.dates.put(pp.getUUID(), System.currentTimeMillis());
|
||||
EventUtil.unregisterPlayer(pp);
|
||||
if (Settings.DELETE_PLOTS_ON_BAN && event.getPlayer().isBanned()) {
|
||||
for (final Plot plot : PS.get().getPlotsInWorld(pp.getName())) {
|
||||
plot.deletePlot(null);
|
||||
for (final Plot owned : PS.get().getPlotsInWorld(pp.getName())) {
|
||||
owned.deletePlot(null);
|
||||
PS.debug(String.format("&cPlot &6%s &cwas deleted + cleared due to &6%s&c getting banned", plot.getId(), event.getPlayer().getName()));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user