mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-09-07 04:18:26 +02:00
Removed afk permission from map on leave (Memory leak)
This commit is contained in:
parent
f9389c0ef8
commit
9613c1d7b8
@ -25,10 +25,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
import org.bukkit.event.player.PlayerEvent;
|
||||
import org.bukkit.event.player.PlayerMoveEvent;
|
||||
import org.bukkit.event.player.*;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.util.HashMap;
|
||||
@ -109,4 +106,9 @@ public class AFKListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onLeave(PlayerQuitEvent event) {
|
||||
ignorePermissionInfo.remove(event.getPlayer().getUniqueId());
|
||||
}
|
||||
|
||||
}
|
@ -30,6 +30,7 @@ import org.spongepowered.api.event.entity.living.humanoid.player.PlayerChangeCli
|
||||
import org.spongepowered.api.event.entity.living.humanoid.player.TargetPlayerEvent;
|
||||
import org.spongepowered.api.event.filter.cause.First;
|
||||
import org.spongepowered.api.event.message.MessageChannelEvent;
|
||||
import org.spongepowered.api.event.network.ClientConnectionEvent;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.util.HashMap;
|
||||
@ -118,4 +119,8 @@ public class SpongeAFKListener {
|
||||
event(event);
|
||||
}
|
||||
|
||||
@Listener(order = Order.POST)
|
||||
public void onLeave(ClientConnectionEvent.Disconnect event) {
|
||||
ignorePermissionInfo.remove(event.getTargetEntity().getUniqueId());
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user