package me.totalfreedom.totalfreedommod.command; import me.totalfreedom.totalfreedommod.rank.Rank; import me.totalfreedom.totalfreedommod.util.FUtil; 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 restarts the server.", usage = "/") public class Command_restart extends FreedomCommand { @Override public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { if(!plugin.amp.enabled) { msg(ChatColor.RED + "AMP integration is not enabled. Please use /stop instead."); return true; } FUtil.bcastMsg("Server is going offline!", ChatColor.LIGHT_PURPLE); for (Player player : server.getOnlinePlayers()) { player.kickPlayer("Server is going offline, come back in about 20 seconds."); } plugin.amp.restartServer(); return true; } }