2011-10-19 00:37:00 +00:00
|
|
|
package me.StevenLawson.TotalFreedomMod.Commands;
|
|
|
|
|
|
|
|
import me.StevenLawson.TotalFreedomMod.TFM_Util;
|
|
|
|
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
|
|
|
|
import org.bukkit.ChatColor;
|
|
|
|
import org.bukkit.command.Command;
|
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
|
|
|
public class Command_nonuke extends TFM_Command
|
|
|
|
{
|
|
|
|
@Override
|
|
|
|
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
|
|
|
{
|
|
|
|
if (senderIsConsole || TFM_Util.isUserSuperadmin(sender, plugin))
|
|
|
|
{
|
|
|
|
if (args.length < 1)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (args.length >= 2)
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2011-11-08 00:29:33 +00:00
|
|
|
TotalFreedomMod.nukeMonitorRange = Math.max(1.0, Math.min(500.0, Double.parseDouble(args[1])));
|
2011-10-19 00:37:00 +00:00
|
|
|
}
|
|
|
|
catch (NumberFormatException nfex)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (args.length >= 3)
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2011-11-08 00:29:33 +00:00
|
|
|
TotalFreedomMod.nukeMonitorCountBreak = Math.max(1, Math.min(500, Integer.parseInt(args[2])));
|
2011-10-19 00:37:00 +00:00
|
|
|
}
|
|
|
|
catch (NumberFormatException nfex)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (args[0].equalsIgnoreCase("on"))
|
|
|
|
{
|
2011-11-08 00:29:33 +00:00
|
|
|
TotalFreedomMod.nukeMonitor = true;
|
2011-10-19 00:37:00 +00:00
|
|
|
sender.sendMessage(ChatColor.GRAY + "Nuke monitor is enabled.");
|
2011-11-08 00:29:33 +00:00
|
|
|
sender.sendMessage(ChatColor.GRAY + "Anti-freecam range is set to " + TotalFreedomMod.nukeMonitorRange + " blocks.");
|
|
|
|
sender.sendMessage(ChatColor.GRAY + "Block throttle rate is set to " + TotalFreedomMod.nukeMonitorCountBreak + " blocks destroyed per 5 seconds.");
|
2011-10-19 00:37:00 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-11-08 00:29:33 +00:00
|
|
|
TotalFreedomMod.nukeMonitor = false;
|
2011-10-19 00:37:00 +00:00
|
|
|
sender.sendMessage("Nuke monitor is disabled.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS);
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|