Fix issue where old player objects were not cleaned up properly.

This is caused by an issue with the event order in Spigot (and Spigot derivatives), so the fix is rather hacky.
This commit is contained in:
Alexander Söderberg
2020-06-23 18:36:53 +02:00
parent f4724a3c87
commit 55cf34508a
5 changed files with 46 additions and 18 deletions

View File

@ -116,9 +116,11 @@ public class BukkitUtil extends WorldUtil {
private static Player lastPlayer = null;
private static BukkitPlayer lastPlotPlayer = null;
public static void removePlayer(String player) {
public static void removePlayer(UUID uuid) {
lastPlayer = null;
lastPlotPlayer = null;
// Make sure that it's removed internally
PlotSquared.imp().getPlayerManager().removePlayer(uuid);
}
public static PlotPlayer<Player> getPlayer(@NonNull final OfflinePlayer op) {