mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-24 06:06:45 +01:00
Officially deprecated BukkitPlayer#BukkitPlayer() (#3922)
* Officially deprecated BukkitPlayer#BukkitPlayer() * Address review feedback
This commit is contained in:
parent
d1b8f652a7
commit
e887a59158
@ -67,14 +67,15 @@ public class BukkitPlayer extends PlotPlayer<Player> {
|
|||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Please do not use this method. Instead use
|
|
||||||
* BukkitUtil.getPlayer(Player), as it caches player objects.</p>
|
|
||||||
*
|
|
||||||
* @param plotAreaManager PlotAreaManager instance
|
* @param plotAreaManager PlotAreaManager instance
|
||||||
* @param eventDispatcher EventDispatcher instance
|
* @param eventDispatcher EventDispatcher instance
|
||||||
* @param player Bukkit player instance
|
* @param player Bukkit player instance
|
||||||
* @param permissionHandler PermissionHandler 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(
|
public BukkitPlayer(
|
||||||
final @NonNull PlotAreaManager plotAreaManager, final @NonNull EventDispatcher eventDispatcher,
|
final @NonNull PlotAreaManager plotAreaManager, final @NonNull EventDispatcher eventDispatcher,
|
||||||
final @NonNull Player player, final @NonNull PermissionHandler permissionHandler
|
final @NonNull Player player, final @NonNull PermissionHandler permissionHandler
|
||||||
@ -82,6 +83,16 @@ public class BukkitPlayer extends PlotPlayer<Player> {
|
|||||||
this(plotAreaManager, eventDispatcher, player, false, permissionHandler);
|
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(
|
public BukkitPlayer(
|
||||||
final @NonNull PlotAreaManager plotAreaManager, final @NonNull
|
final @NonNull PlotAreaManager plotAreaManager, final @NonNull
|
||||||
EventDispatcher eventDispatcher, final @NonNull Player player,
|
EventDispatcher eventDispatcher, final @NonNull Player player,
|
||||||
|
@ -54,6 +54,7 @@ public class BukkitPlayerManager extends PlayerManager<BukkitPlayer, Player> {
|
|||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public BukkitPlayer getPlayer(final @NonNull Player object) {
|
public BukkitPlayer getPlayer(final @NonNull Player object) {
|
||||||
if (object.getUniqueId().version() == 2) { // not a real player
|
if (object.getUniqueId().version() == 2) { // not a real player
|
||||||
return new BukkitPlayer(this.plotAreaManager, this.eventDispatcher, object, false, this.permissionHandler);
|
return new BukkitPlayer(this.plotAreaManager, this.eventDispatcher, object, false, this.permissionHandler);
|
||||||
@ -65,6 +66,7 @@ public class BukkitPlayerManager extends PlayerManager<BukkitPlayer, Player> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public @NonNull BukkitPlayer createPlayer(final @NonNull UUID uuid) {
|
public @NonNull BukkitPlayer createPlayer(final @NonNull UUID uuid) {
|
||||||
final Player player = Bukkit.getPlayer(uuid);
|
final Player player = Bukkit.getPlayer(uuid);
|
||||||
if (player == null || !player.isOnline()) {
|
if (player == null || !player.isOnline()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user