Skip to content

Commit

Permalink
Fix for #2402 player record was deleted on quit (#2403)
Browse files Browse the repository at this point in the history
This was due to the changes to the Player cache. On quit the cache was
cleared, but this was also deleting the player from the database.
  • Loading branch information
tastybento committed Jun 10, 2024
1 parent 156c3da commit 86e5a02
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/main/java/world/bentobox/bentobox/api/user/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ public static User getInstance(@NonNull OfflinePlayer offlinePlayer) {
public static void removePlayer(Player player) {
if (player != null) {
users.remove(player.getUniqueId());
BentoBox.getInstance().getPlayers().removePlayer(player);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ public void testRemovePlayer() {
// If the player has been removed from the cache, then code will ask server for player
// Return null and check if instance is null will show that the player is not in the cache
when(Bukkit.getPlayer(any(UUID.class))).thenReturn(null);
verify(pm).removePlayer(player);
}

@Test
Expand Down

0 comments on commit 86e5a02

Please sign in to comment.