Skip to content

Commit

Permalink
fix: change where player is removed from cache
Browse files Browse the repository at this point in the history
Fixes a permission error
  • Loading branch information
WiIIiam278 committed Nov 8, 2024
1 parent 6f96c0a commit b7d2391
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,10 @@ protected final void handlePlayerJoin(@NotNull OnlineUser onlineUser) {
*/
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
Expand All @@ -125,9 +127,6 @@ protected final void handlePlayerLeave(@NotNull OnlineUser online) {
.findAny()
.ifPresent(player -> this.updateUserList(player, users));
}

// Remove from user map
plugin.getOnlineUserMap().remove(online.getUuid());
});
}

Expand Down

0 comments on commit b7d2391

Please sign in to comment.