Force a clear of transient nodes when a User quits, don't just rely on their instance being unloaded

This commit is contained in:
Luck
2018-01-21 20:25:00 +00:00
Unverified
parent 72d4e5cf7a
commit f18d230ff6
3 changed files with 31 additions and 2 deletions
@@ -202,6 +202,14 @@ public class BukkitConnectionListener extends AbstractLoginListener implements L
// 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.getScheduler().doAsync(() -> {
User user = this.plugin.getUserManager().getIfLoaded(player.getUniqueId());
if (user != null) {
user.clearTransientNodes();
}
});
}
}