2015-10-19 17:43:46 +00:00
|
|
|
package me.totalfreedom.totalfreedommod.commands;
|
2011-11-28 22:44:51 +00:00
|
|
|
|
2015-10-19 17:43:46 +00:00
|
|
|
import me.totalfreedom.totalfreedommod.permission.PlayerRank;
|
|
|
|
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
2011-11-28 22:44:51 +00:00
|
|
|
import org.bukkit.command.Command;
|
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
2015-10-19 17:43:46 +00:00
|
|
|
@CommandPermissions(level = PlayerRank.SENIOR_ADMIN, source = SourceType.ONLY_IN_GAME)
|
2013-04-10 02:05:24 +00:00
|
|
|
@CommandParameters(description = "You'll never even see it coming.", usage = "/<command>")
|
2015-10-19 17:43:46 +00:00
|
|
|
public class Command_fuckoff extends FreedomCommand
|
2011-11-28 22:44:51 +00:00
|
|
|
{
|
2015-10-19 17:43:46 +00:00
|
|
|
|
2011-11-28 22:44:51 +00:00
|
|
|
@Override
|
|
|
|
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
|
|
|
{
|
|
|
|
if (args.length < 1)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
boolean fuckoff_enabled = false;
|
|
|
|
double fuckoff_range = 25.0;
|
|
|
|
|
|
|
|
if (args[0].equalsIgnoreCase("on"))
|
|
|
|
{
|
|
|
|
fuckoff_enabled = true;
|
|
|
|
|
|
|
|
if (args.length >= 2)
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
fuckoff_range = Math.max(5.0, Math.min(100.0, Double.parseDouble(args[1])));
|
|
|
|
}
|
2013-08-14 13:28:19 +00:00
|
|
|
catch (NumberFormatException ex)
|
2011-11-28 22:44:51 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (TotalFreedomMod.fuckoffEnabledFor.containsKey(sender_p))
|
|
|
|
{
|
|
|
|
TotalFreedomMod.fuckoffEnabledFor.remove(sender_p);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (fuckoff_enabled)
|
|
|
|
{
|
|
|
|
TotalFreedomMod.fuckoffEnabledFor.put(sender_p, new Double(fuckoff_range));
|
|
|
|
}
|
|
|
|
|
2013-01-07 14:56:53 +00:00
|
|
|
playerMsg("Fuckoff " + (fuckoff_enabled ? ("enabled. Range: " + fuckoff_range + ".") : "disabled."));
|
2011-11-28 22:44:51 +00:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|