Myadmin tags and misc improvements

This commit is contained in:
ZeroEpoch1969
2018-02-21 18:22:13 -07:00
parent c8683ea489
commit 2bffcef9a9
8 changed files with 78 additions and 11 deletions

View File

@ -2,13 +2,14 @@ package me.totalfreedom.totalfreedommod.command;
import me.totalfreedom.totalfreedommod.rank.Rank;
import me.totalfreedom.totalfreedommod.util.FUtil;
import org.apache.commons.lang3.StringUtils;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
@CommandParameters(description = "Kicks everyone and stops the server.", usage = "/<command>")
@CommandParameters(description = "Kicks everyone and stops the server.", usage = "/<command> [reason]")
public class Command_stop extends FreedomCommand
{
@ -17,9 +18,16 @@ public class Command_stop extends FreedomCommand
{
FUtil.bcastMsg("Server is going offline!", ChatColor.LIGHT_PURPLE);
String reason = "Server is going offline, come back in about 20 seconds.";
if (args.length > 0)
{
reason = StringUtils.join(args, " ", 0, args.length);
}
for (Player player : server.getOnlinePlayers())
{
player.kickPlayer("Server is going offline, come back in about 20 seconds.");
player.kickPlayer(reason);
}
server.shutdown();