From 7984552938edb8be6841a70679b5b9708e8b04d1 Mon Sep 17 00:00:00 2001 From: Alexander Brandes Date: Wed, 11 Jan 2023 22:15:59 +0100 Subject: [PATCH] Address review feedback --- .../com/plotsquared/bukkit/player/BukkitPlayer.java | 10 ++++++++++ .../plotsquared/bukkit/player/BukkitPlayerManager.java | 2 ++ 2 files changed, 12 insertions(+) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitPlayer.java b/Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitPlayer.java index fc32e155d..268258ead 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitPlayer.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitPlayer.java @@ -83,6 +83,16 @@ public class BukkitPlayer extends PlotPlayer { this(plotAreaManager, eventDispatcher, player, false, permissionHandler); } + /** + * @param plotAreaManager PlotAreaManager instance + * @param eventDispatcher EventDispatcher instance + * @param player Bukkit player instance + * @param permissionHandler PermissionHandler instance + * + * @deprecated Please do not use this method. Instead use {@link BukkitUtil#adapt(Player)}, as it caches player objects. + * This method will be made private in a future release. + */ + @Deprecated(forRemoval = true, since = "TODO") public BukkitPlayer( final @NonNull PlotAreaManager plotAreaManager, final @NonNull EventDispatcher eventDispatcher, final @NonNull Player player, 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 35b550d2f..a1a675598 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitPlayerManager.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitPlayerManager.java @@ -54,6 +54,7 @@ public class BukkitPlayerManager extends PlayerManager { @NonNull @Override + @SuppressWarnings("deprecation") 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); @@ -65,6 +66,7 @@ public class BukkitPlayerManager extends PlayerManager { } @Override + @SuppressWarnings("deprecation") public @NonNull BukkitPlayer createPlayer(final @NonNull UUID uuid) { final Player player = Bukkit.getPlayer(uuid); if (player == null || !player.isOnline()) {