Address review feedback

This commit is contained in:
Alexander Brandes 2023-01-11 22:15:59 +01:00
parent 181c2ef83e
commit 7984552938
No known key found for this signature in database
GPG Key ID: 158F5701A6AAD00C
2 changed files with 12 additions and 0 deletions

View File

@ -83,6 +83,16 @@ public class BukkitPlayer extends PlotPlayer<Player> {
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,

View File

@ -54,6 +54,7 @@ public class BukkitPlayerManager extends PlayerManager<BukkitPlayer, Player> {
@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<BukkitPlayer, Player> {
}
@Override
@SuppressWarnings("deprecation")
public @NonNull BukkitPlayer createPlayer(final @NonNull UUID uuid) {
final Player player = Bukkit.getPlayer(uuid);
if (player == null || !player.isOnline()) {