mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-06-11 13:33:54 +00:00
Implement #22 and fix pom.xml.
Signed-off-by: Lemon <minecraftoxlemonxo@gmail.com>
This commit is contained in:
@ -0,0 +1,35 @@
|
||||
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 = "/<command>")
|
||||
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;
|
||||
}
|
||||
}
|
@ -27,7 +27,14 @@ public class Command_wipeflatlands extends FreedomCommand
|
||||
|
||||
if (!plugin.cpb.isEnabled())
|
||||
{
|
||||
server.shutdown();
|
||||
if(!plugin.amp.enabled)
|
||||
{
|
||||
server.shutdown();
|
||||
}
|
||||
else
|
||||
{
|
||||
plugin.amp.restartServer();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user