2020-03-10 01:58:45 +00:00
|
|
|
package me.totalfreedom.totalfreedommod.command;
|
|
|
|
|
|
|
|
import me.totalfreedom.totalfreedommod.rank.Rank;
|
|
|
|
import org.bukkit.command.Command;
|
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
2020-09-28 03:17:01 +00:00
|
|
|
@CommandPermissions(level = Rank.ADMIN, source = SourceType.BOTH)
|
2020-03-10 01:58:45 +00:00
|
|
|
@CommandParameters(description = "Toggle whether or not a player is automatically teleported when they join", usage = "/<command> <player>")
|
|
|
|
public class Command_autotp extends FreedomCommand
|
|
|
|
{
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
|
|
|
{
|
|
|
|
if (args.length == 0)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
boolean enabled = plugin.lp.TELEPORT_ON_JOIN.contains(args[0]);
|
|
|
|
|
|
|
|
if (enabled)
|
|
|
|
{
|
|
|
|
plugin.lp.TELEPORT_ON_JOIN.remove(args[0]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
plugin.lp.TELEPORT_ON_JOIN.add(args[0]);
|
|
|
|
}
|
|
|
|
|
2020-03-30 23:43:57 +00:00
|
|
|
msg(args[0] + " will " + (enabled ? "no longer" : "now") + " be automatically teleported when they join.");
|
2020-03-10 01:58:45 +00:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|