From 0e84cf085bbbdfcb69af49fe7da4ffadb49f4a08 Mon Sep 17 00:00:00 2001 From: SirYwell Date: Tue, 22 Jun 2021 10:18:48 +0200 Subject: [PATCH] Fix compatibility issues with Citizens (fixes #3105) --- .../plotsquared/bukkit/player/BukkitPlayerManager.java | 9 ++++----- .../java/com/plotsquared/core/util/PlayerManager.java | 5 ----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitPlayerManager.java b/Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitPlayerManager.java index 226ea0f8c..fbb8b8edf 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitPlayerManager.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitPlayerManager.java @@ -62,14 +62,13 @@ public class BukkitPlayerManager extends PlayerManager { @NonNull @Override public BukkitPlayer getPlayer(final @NonNull Player object) { + if (object.getUniqueId().version() == 2) { // not a real player + return new BukkitPlayer(this.plotAreaManager, this.eventDispatcher, object, false, this.permissionHandler); + } if (!object.isOnline()) { throw new NoSuchPlayerException(object.getUniqueId()); } - try { - return getPlayer(object.getUniqueId()); - } catch (final NoSuchPlayerException exception) { - return new BukkitPlayer(this.plotAreaManager, this.eventDispatcher, object, false, this.permissionHandler); - } + return getPlayer(object.getUniqueId()); } @Override diff --git a/Core/src/main/java/com/plotsquared/core/util/PlayerManager.java b/Core/src/main/java/com/plotsquared/core/util/PlayerManager.java index 1c20da6fd..0c9758fbc 100644 --- a/Core/src/main/java/com/plotsquared/core/util/PlayerManager.java +++ b/Core/src/main/java/com/plotsquared/core/util/PlayerManager.java @@ -314,11 +314,6 @@ public abstract class PlayerManager

, T> { super(String.format("There is no online player with UUID '%s'", uuid.toString())); } - @Override - public synchronized Throwable fillInStackTrace() { - return this; - } - } }