2016-03-02 19:28:01 +00:00
|
|
|
package me.totalfreedom.totalfreedommod.command;
|
2013-07-13 20:11:13 +00:00
|
|
|
|
2016-03-06 15:56:15 +00:00
|
|
|
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
2015-10-19 17:43:46 +00:00
|
|
|
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
2016-03-06 15:56:15 +00:00
|
|
|
import me.totalfreedom.totalfreedommod.rank.Rank;
|
2015-10-19 17:43:46 +00:00
|
|
|
import me.totalfreedom.totalfreedommod.util.FLog;
|
2013-07-13 20:11:13 +00:00
|
|
|
import org.bukkit.ChatColor;
|
|
|
|
import org.bukkit.command.Command;
|
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
2014-08-02 15:10:54 +00:00
|
|
|
/*
|
|
|
|
* See https://github.com/TotalFreedom/License - This file may not be edited or removed.
|
|
|
|
*/
|
2016-03-06 15:56:15 +00:00
|
|
|
@CommandPermissions(level = Rank.NON_OP, source = SourceType.BOTH)
|
2018-05-21 19:44:18 +00:00
|
|
|
@CommandParameters(description = "Shows information about TotalFreedomMod or reloads it", usage = "/<command> [reload]", aliases = "tfm")
|
2016-05-12 19:40:39 +00:00
|
|
|
public class Command_totalfreedommod extends FreedomCommand
|
2013-07-14 12:10:29 +00:00
|
|
|
{
|
2015-11-22 18:26:47 +00:00
|
|
|
|
2013-07-13 20:11:13 +00:00
|
|
|
@Override
|
2015-11-22 18:26:47 +00:00
|
|
|
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
2013-08-10 00:11:17 +00:00
|
|
|
{
|
2014-04-23 14:23:50 +00:00
|
|
|
if (args.length == 1)
|
|
|
|
{
|
2018-05-22 02:32:28 +00:00
|
|
|
if (!args[0].equals("reload"))
|
2014-04-23 14:23:50 +00:00
|
|
|
{
|
2018-05-22 02:32:28 +00:00
|
|
|
return false;
|
|
|
|
}
|
2018-03-25 23:29:30 +00:00
|
|
|
|
2018-05-22 02:32:28 +00:00
|
|
|
if (!plugin.al.isAdmin(sender))
|
|
|
|
{
|
|
|
|
noPerms();
|
2018-03-25 23:29:30 +00:00
|
|
|
return true;
|
|
|
|
}
|
2014-04-23 14:23:50 +00:00
|
|
|
|
2018-05-22 02:32:28 +00:00
|
|
|
plugin.config.load();
|
|
|
|
plugin.services.stop();
|
|
|
|
plugin.services.start();
|
|
|
|
|
|
|
|
final String message = String.format("%s v%s reloaded.",
|
|
|
|
TotalFreedomMod.pluginName,
|
|
|
|
TotalFreedomMod.pluginVersion);
|
|
|
|
|
|
|
|
msg(message);
|
|
|
|
FLog.info(message);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-09-06 21:02:10 +00:00
|
|
|
TotalFreedomMod.BuildProperties build = TotalFreedomMod.build;
|
2016-03-02 19:28:01 +00:00
|
|
|
msg("TotalFreedomMod for 'Total Freedom', the original all-op server.", ChatColor.GOLD);
|
|
|
|
msg("Running on " + ConfigEntry.SERVER_NAME.getString() + ".", ChatColor.GOLD);
|
|
|
|
msg("Created by Madgeek1450 and Prozza.", ChatColor.GOLD);
|
|
|
|
msg(String.format("Version "
|
2018-06-02 08:18:28 +00:00
|
|
|
+ ChatColor.BLUE + "%s - %s Build %s " + ChatColor.GOLD + "("
|
2018-05-22 02:32:28 +00:00
|
|
|
+ ChatColor.BLUE + "%s" + ChatColor.GOLD + ")",
|
2016-05-12 19:40:39 +00:00
|
|
|
build.codename,
|
2015-11-22 18:26:47 +00:00
|
|
|
build.version,
|
2015-09-06 21:02:10 +00:00
|
|
|
build.number,
|
|
|
|
build.head), ChatColor.GOLD);
|
2016-03-02 19:28:01 +00:00
|
|
|
msg(String.format("Compiled "
|
2018-05-22 02:32:28 +00:00
|
|
|
+ ChatColor.BLUE + "%s" + ChatColor.GOLD + " by "
|
|
|
|
+ ChatColor.BLUE + "%s",
|
2015-09-06 21:02:10 +00:00
|
|
|
build.date,
|
2015-11-22 18:26:47 +00:00
|
|
|
build.author), ChatColor.GOLD);
|
2016-03-02 19:28:01 +00:00
|
|
|
msg("Visit " + ChatColor.AQUA + "http://github.com/TotalFreedom/TotalFreedomMod"
|
2015-09-06 21:02:10 +00:00
|
|
|
+ ChatColor.GREEN + " for more information.", ChatColor.GREEN);
|
2013-07-13 20:11:13 +00:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|