2015-10-19 17:43:46 +00:00
|
|
|
package me.totalfreedom.totalfreedommod.commands;
|
2013-07-13 20:11:13 +00:00
|
|
|
|
2015-10-19 17:43:46 +00:00
|
|
|
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
|
|
|
import me.totalfreedom.totalfreedommod.config.MainConfig;
|
|
|
|
import me.totalfreedom.totalfreedommod.permission.PlayerRank;
|
|
|
|
import me.totalfreedom.totalfreedommod.util.FLog;
|
|
|
|
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
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.
|
|
|
|
*/
|
2015-10-19 17:43:46 +00:00
|
|
|
@CommandPermissions(level = PlayerRank.NON_OP, source = SourceType.BOTH)
|
2014-04-23 14:23:50 +00:00
|
|
|
@CommandParameters(description = "Shows information about TotalFreedomMod or reloads it", usage = "/<command> [reload]")
|
2015-10-19 17:43:46 +00:00
|
|
|
public class Command_tfm extends FreedomCommand
|
2013-07-14 12:10:29 +00:00
|
|
|
{
|
2013-07-13 20:11:13 +00:00
|
|
|
@Override
|
|
|
|
public boolean run(CommandSender sender, Player sender_p, 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)
|
|
|
|
{
|
|
|
|
if (!args[0].equals("reload"))
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-10-19 17:43:46 +00:00
|
|
|
if (!plugin.al.isAdmin(sender))
|
2014-04-23 14:23:50 +00:00
|
|
|
{
|
2015-10-19 17:43:46 +00:00
|
|
|
playerMsg(FreedomCommand.MSG_NO_PERMS);
|
2014-06-30 15:30:16 +00:00
|
|
|
return true;
|
2014-04-23 14:23:50 +00:00
|
|
|
}
|
|
|
|
|
2015-10-19 17:43:46 +00:00
|
|
|
MainConfig.load();
|
|
|
|
plugin.services.stop();
|
|
|
|
plugin.services.start();
|
2014-04-23 14:23:50 +00:00
|
|
|
|
2015-09-06 21:02:10 +00:00
|
|
|
final String message = String.format("%s v%s reloaded.",
|
2014-04-23 14:23:50 +00:00
|
|
|
TotalFreedomMod.pluginName,
|
2015-09-06 21:02:10 +00:00
|
|
|
TotalFreedomMod.pluginVersion);
|
2014-04-23 14:23:50 +00:00
|
|
|
|
|
|
|
playerMsg(message);
|
2015-10-19 17:43:46 +00:00
|
|
|
FLog.info(message);
|
2014-04-23 14:23:50 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-09-06 21:02:10 +00:00
|
|
|
TotalFreedomMod.BuildProperties build = TotalFreedomMod.build;
|
2014-04-21 17:00:39 +00:00
|
|
|
playerMsg("TotalFreedomMod for 'Total Freedom', the original all-op server.", ChatColor.GOLD);
|
2015-10-19 17:43:46 +00:00
|
|
|
playerMsg("Running on " + ConfigEntry.SERVER_NAME.getString() + ".", ChatColor.GOLD);
|
2015-01-19 21:51:02 +00:00
|
|
|
playerMsg("Created by Madgeek1450 and Prozza.", ChatColor.GOLD);
|
2015-09-06 21:02:10 +00:00
|
|
|
playerMsg(String.format("Version "
|
|
|
|
+ ChatColor.BLUE + "%s.%s " + ChatColor.GOLD + "("
|
|
|
|
+ ChatColor.BLUE + "%s" + ChatColor.GOLD + ")",
|
|
|
|
TotalFreedomMod.pluginVersion,
|
|
|
|
build.number,
|
|
|
|
build.head), ChatColor.GOLD);
|
|
|
|
playerMsg(String.format("Compiled "
|
|
|
|
+ ChatColor.BLUE + "%s" + ChatColor.GOLD + " by "
|
|
|
|
+ ChatColor.BLUE + "%s",
|
|
|
|
build.date,
|
|
|
|
build.builder), ChatColor.GOLD);
|
|
|
|
playerMsg("Visit " + ChatColor.AQUA + "http://github.com/TotalFreedom/TotalFreedomMod"
|
|
|
|
+ ChatColor.GREEN + " for more information.", ChatColor.GREEN);
|
2013-07-13 20:11:13 +00:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|