mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2025-02-18 05:21:57 +01:00
Added online player count / max players to /mv who header
This commit is contained in:
parent
0829df01aa
commit
19fb9df5cf
@ -15,6 +15,7 @@ import org.bukkit.command.CommandSender;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.permissions.PermissionDefault;
|
import org.bukkit.permissions.PermissionDefault;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -73,8 +74,17 @@ public class WhoCommand extends MultiverseCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final Player[] onlinePlayers = plugin.getServer().getOnlinePlayers();
|
||||||
|
final List<Player> visiblePlayers = new ArrayList<Player>();
|
||||||
|
for (final Player player : onlinePlayers) {
|
||||||
|
if (p == null || p.canSee(player)) {
|
||||||
|
visiblePlayers.add(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// multiworld mode
|
// multiworld mode
|
||||||
sender.sendMessage(ChatColor.AQUA + "--- Worlds and their players ---");
|
sender.sendMessage(ChatColor.AQUA + "--- Worlds and their players --- "
|
||||||
|
+ visiblePlayers.size() + "/" + plugin.getServer().getMaxPlayers());
|
||||||
boolean shownOne = false;
|
boolean shownOne = false;
|
||||||
for (MultiverseWorld world : this.worldManager.getMVWorlds()) {
|
for (MultiverseWorld world : this.worldManager.getMVWorlds()) {
|
||||||
if (this.plugin.getMVPerms().canEnterWorld(p, world)) { // only show world if the player can access it
|
if (this.plugin.getMVPerms().canEnterWorld(p, world)) { // only show world if the player can access it
|
||||||
|
Loading…
Reference in New Issue
Block a user