private FakeTeam reset(String player, FakeTeam fakeTeam) { if (fakeTeam != null && fakeTeam.getMembers().remove(player)) { boolean delete; Player removing = Bukkit.getPlayerExact(player); if (removing != null) { delete = removePlayerFromTeamPackets(fakeTeam, removing.getName()); } else { OfflinePlayer toRemoveOffline = Bukkit.getOfflinePlayer(player); delete = removePlayerFromTeamPackets(fakeTeam, toRemoveOffline.getName()); } plugin.debug(player + " was removed from " + fakeTeam.getName()); if (delete) { removeTeamPackets(fakeTeam); TEAMS.remove(fakeTeam.getName()); plugin.debug("FakeTeam " + fakeTeam.getName() + " has been deleted. Size: " + TEAMS.size()); } } return fakeTeam; }
public void applyTags() { if (!Bukkit.isPrimaryThread()) { new BukkitRunnable() { @Override public void run() { applyTags(); } }.runTask(plugin); return; } for (Player online : Utils.getOnline()) { if (online != null) { applyTagToPlayer(online, false); } } plugin.debug("Applied tags to all online players."); }
/** * Replaces placeholders when a player tag is created. * Maxim and Clip's plugins are searched for, and input * is replaced. We use direct imports to avoid any problems! * (So don't change that) */ public String formatWithPlaceholders(Player player, String input, boolean limitChars) { if (input == null) return ""; if (player == null) return input; if (Bukkit.getPluginManager().isPluginEnabled("MVdWPlaceholderAPI")) { plugin.debug("Trying to use MVdWPlaceholderAPI for placeholders"); if (be.maximvdw.placeholderapi.PlaceholderAPI.getLoadedPlaceholderCount() != 0) { input = be.maximvdw.placeholderapi.PlaceholderAPI.replacePlaceholders(player, input); } else { Bukkit.getConsoleSender().sendMessage(ChatColor.RED + "[NametagEdit] As the error above suggests, you " + "do NOT have any placeholder plugins installed. The placeholder API is merely an interface, it " + "requires other plugins to function. This is NOT an issue with NametagEdit."); } } // The string can become null again at this point. Add another check. if (input != null && Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) { plugin.debug("Trying to use PlaceholderAPI for placeholders"); input = me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(player, input); } return Utils.format(input, limitChars); }
plugin.debug(player + " already belongs to a similar team (" + previous.getName() + ")"); return; if (joining != null) { joining.addMember(player); plugin.debug("Using existing team for " + player); } else { joining = new FakeTeam(prefix, suffix, sortPriority, playerTag); TEAMS.put(joining.getName(), joining); addTeamPackets(joining); plugin.debug("Created FakeTeam " + joining.getName() + ". Size: " + TEAMS.size()); plugin.debug(player + " has been added to team " + joining.getName());
plugin.debug("Applying " + (tempNametag.isPlayerTag() ? "PlayerTag" : "GroupTag") + " to " + player.getName());