2016-03-02 19:28:01 +00:00
|
|
|
package me.totalfreedom.totalfreedommod.command;
|
2013-07-27 21:49:25 +00:00
|
|
|
|
2016-05-12 19:40:39 +00:00
|
|
|
import me.totalfreedom.totalfreedommod.LogViewer.LogsRegistrationMode;
|
2016-03-06 15:56:15 +00:00
|
|
|
import me.totalfreedom.totalfreedommod.rank.Rank;
|
2013-07-27 21:49:25 +00:00
|
|
|
import org.bukkit.command.Command;
|
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
2016-03-06 15:56:15 +00:00
|
|
|
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.ONLY_IN_GAME)
|
2013-07-29 17:20:08 +00:00
|
|
|
@CommandParameters(description = "Register your connection with the TFM logviewer.", usage = "/<command> [off]")
|
2015-10-19 17:43:46 +00:00
|
|
|
public class Command_logs extends FreedomCommand
|
2013-07-27 21:49:25 +00:00
|
|
|
{
|
2015-11-22 18:26:47 +00:00
|
|
|
|
2013-07-27 21:49:25 +00:00
|
|
|
@Override
|
2015-11-22 18:26:47 +00:00
|
|
|
public boolean run(final CommandSender sender, final Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
2013-07-27 21:49:25 +00:00
|
|
|
{
|
2017-08-01 19:59:24 +00:00
|
|
|
LogsRegistrationMode mode = LogsRegistrationMode.ADD;
|
|
|
|
if (args.length == 1 && "off".equalsIgnoreCase(args[0]))
|
2013-07-27 21:49:25 +00:00
|
|
|
{
|
2017-08-01 19:59:24 +00:00
|
|
|
mode = LogsRegistrationMode.DELETE;
|
2013-07-27 21:49:25 +00:00
|
|
|
}
|
2016-05-12 19:40:39 +00:00
|
|
|
plugin.lv.updateLogsRegistration(sender, playerSender, mode);
|
2013-07-27 21:49:25 +00:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|