/** * @see Server#getPlayer(java.util.UUID) */ public static Player getPlayer(UUID id) { return server.getPlayer(id); }
private Player getPlayer(QueuedPlayer player) { if (player.getUuid() != null && (plugin.getServer().getOnlineMode() || plugin.getConfiguration().isBungeeCord())) { return plugin.getServer().getPlayer(UuidUtil.mojangUuidToJavaUuid(player.getUuid())); } return plugin.getServer().getPlayerExact(player.getName()); }
/** * @see Server#getPlayer(String name) */ @Deprecated public static Player getPlayer(String name) { return server.getPlayer(name); }
@Override protected boolean isInputValid(ConversationContext context, String input) { return plugin.getServer().getPlayer(input) != null; }
@Override public boolean isActive() { // This is a thread safe call on CraftBukkit because it uses a // CopyOnWrite list for the list of players, but the Bukkit // specification doesn't require thread safety (though the // spec is extremely incomplete) return Bukkit.getServer().getPlayer(uuid) != null; }
@Override protected Prompt acceptValidatedInput(ConversationContext context, String input) { return acceptValidatedInput(context, plugin.getServer().getPlayer(input)); }
final Player player = sender.getServer().getPlayer(args[0]);
/** * @see Server#getPlayer(java.util.UUID) */ public static Player getPlayer(UUID id) { return server.getPlayer(id); }
/** * Gets a player by uuid. * * @param uuid the uuid * @return a player, or null */ @Nullable public static Player getNullable(UUID uuid) { return Helper.server().getPlayer(uuid); }
public Optional<Commander<?>> getCommanderFor(String identifier) { return Optional.ofNullable(plugin.getServer().getPlayer(UUID.fromString(identifier))).map(ply -> new BukkitCommander(plugin, ply)); } }
@Override public String getPlayerPrefix(String world, String player) { Player p = Bukkit.getServer().getPlayer(player); if (p ==null) { throw new UnsupportedOperationException("mChat does not support offline player prefixes"); } return mChat.getPrefix(p); }
@Override public String getPlayerInfoString(String world, String player, String node, String defaultValue) { Player p = Bukkit.getServer().getPlayer(player); if (p ==null) { throw new UnsupportedOperationException("mChat does not support offline player prefixes"); } String s = mChat.getInfo(p, node); return s == null ? defaultValue : s; }
@Override public boolean playerHas(String world, String player, String permission) { Player p = plugin.getServer().getPlayer(player); return p != null ? p.hasPermission(permission) : false; }
@Override public void respawnPlayer(UUID playerUuid) { Validate.notNull(playerUuid, "Player uuid cannot be null"); Player p = plugin.getServer().getPlayer(playerUuid); Validate.isTrue(p != null, String.format("Player (uuid: %s) not online", playerUuid)); this.respawnPlayer(p); }
@Override public void run() { SkyStatic.debug("Finished delay. Re-attempting apply for %s. [InventorySaveListener.restoreInventory]", uuid); Player player = plugin.getServer().getPlayer(uuid); if (player != null) { restoreInventory(player, false, true); } else { plugin.getLogger().log(Level.WARNING, "Player {0} no longer logged in, not restoring saved inventory! Note: 4 tick delay due to workaround for teleportation failure.", uuid); } } }, 4);
@Override public String getPlayerPrefix(String world, String player) { Player p = plugin.getServer().getPlayer(player); if (p == null) { throw new UnsupportedOperationException("iChat does not support offline player info nodes!"); } if (!p.getWorld().getName().equals(world)) { return null; } return iChat.getPrefix(p); }
@Override public String getPlayerSuffix(String world, String player) { Player p = plugin.getServer().getPlayer(player); if (p == null) { throw new UnsupportedOperationException("iChat does not support offline player info nodes!"); } if (!p.getWorld().getName().equals(world)) { return null; } return iChat.getSuffix(p); }
@Override public String getPlayerInfoString(String world, String player, String node, String defaultValue) { Player p = plugin.getServer().getPlayer(player); if (p == null) { throw new UnsupportedOperationException("iChat does not support offline player info nodes!"); } if (!p.getWorld().getName().equals(world)) { return null; } String val = iChat.getInfo(p, node); return val != null ? val : defaultValue; }
public PlayerStatistic(UUID uuid) { this.uuid = uuid; Player player = BedwarsRel.getInstance().getServer().getPlayer(uuid); if (player != null && !this.name.equals(player.getName())) { this.name = player.getName(); } }
@Override public String getPlayerWorld(UUID uuid) { Player p = ((BukkitLoader) getCaller().getLoader()).getServer().getPlayer(uuid); return (p != null) ? p.getWorld().getName() : ""; }