fix: change where player is removed from cache

Fixes a permission error
This commit is contained in:
William committed 2024-11-08 21:14:31 +00:00
1 parent 6f96c0a618
commit b7d2391506
1 file changed
+3 -4
@@ -105,8 +105,10 @@ public abstract class EventListener {
*/
protected final void handlePlayerLeave(@NotNull OnlineUser online) {
online.removeInvulnerabilityIfPermitted();
plugin.getOnlineUserMap().remove(online.getUuid());
plugin.runAsync(() -> {
// Set offline position
// Set offline position
plugin.getDatabase().setOfflinePosition(online, online.getPosition());
// Remove this user's home cache
@@ -125,9 +127,6 @@ public abstract class EventListener {
.findAny()
.ifPresent(player -> this.updateUserList(player, users));
}
// Remove from user map
plugin.getOnlineUserMap().remove(online.getUuid());
});
}