TotalFreedomMod/src/main/java/me/totalfreedom/totalfreedommod/command/Command_status.java

45 lines
1.7 KiB
Java
Raw Normal View History

package me.totalfreedom.totalfreedommod.command;
2011-10-19 00:37:00 +00:00
import java.util.HashMap;
import java.util.Map;
import me.totalfreedom.totalfreedommod.rank.Rank;
2011-10-19 00:37:00 +00:00
import org.bukkit.ChatColor;
import org.bukkit.World;
2011-10-19 00:37:00 +00:00
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@CommandPermissions(level = Rank.NON_OP, source = SourceType.BOTH)
@CommandParameters(description = "Show misc. server info.", usage = "/<command>")
public class Command_status extends FreedomCommand
2011-10-19 00:37:00 +00:00
{
public static final Map<String, String> SERVICE_MAP = new HashMap<>();
static
{
SERVICE_MAP.put("minecraft.net", "Minecraft.net");
SERVICE_MAP.put("login.minecraft.net", "Minecraft Logins");
SERVICE_MAP.put("session.minecraft.net", "Minecraft Multiplayer Sessions");
SERVICE_MAP.put("account.mojang.com", "Mojang Accounts Website");
SERVICE_MAP.put("auth.mojang.com", "Mojang Accounts Login");
SERVICE_MAP.put("skins.minecraft.net", "Minecraft Skins");
}
2011-10-19 00:37:00 +00:00
@Override
public boolean run(final CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
2011-10-19 00:37:00 +00:00
{
msg("For information about TotalFreedomMod, try /tfm", ChatColor.GREEN); // Temporary
msg("Server is currently running with 'online-mode=" + (server.getOnlineMode() ? "true" : "false") + "'.", ChatColor.YELLOW);
msg("Loaded worlds:", ChatColor.BLUE);
int i = 0;
for (World world : server.getWorlds())
{
msg(String.format("World %d: %s - %d players.", i++, world.getName(), world.getPlayers().size()), ChatColor.BLUE);
}
2011-10-19 00:37:00 +00:00
return true;
}
}