mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-07-01 20:46:41 +00:00
Myadmin tags and misc improvements
This commit is contained in:
@ -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();
|
||||
|
Reference in New Issue
Block a user