mirror of
https://github.com/lucko/LuckPerms.git
synced 2025-09-09 22:00:40 +02:00
Detach from permissible objects with a 1 tick delay after player quit to allow plugins listening on monitor to still access data (#1220)
This commit is contained in:
@@ -151,19 +151,7 @@ public class VelocityConnectionListener extends AbstractConnectionListener {
|
||||
// Wait until the last priority to unload, so plugins can still perform permission checks on this event
|
||||
@Subscribe(order = PostOrder.LAST)
|
||||
public void onPlayerQuit(DisconnectEvent e) {
|
||||
Player player = e.getPlayer();
|
||||
|
||||
// Register with the housekeeper, so the User's instance will stick
|
||||
// around for a bit after they disconnect
|
||||
this.plugin.getUserManager().getHouseKeeper().registerUsage(player.getUniqueId());
|
||||
|
||||
// force a clear of transient nodes
|
||||
this.plugin.getBootstrap().getScheduler().executeAsync(() -> {
|
||||
User user = this.plugin.getUserManager().getIfLoaded(player.getUniqueId());
|
||||
if (user != null) {
|
||||
user.clearTransientNodes();
|
||||
}
|
||||
});
|
||||
handleDisconnect(e.getPlayer().getUniqueId());
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user