TFM-4.3-Reloaded/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tfm.java
JeromSar a7a2db15d6 Track build information in a better way
build.properties replaces buildcreator.properties, buildcreator.default.properties annd buildnumber.properties, but is untracked.
'git describe --tags --always HEAD' is now used to identify the build version, and its result is stored in the build properties file, included with the build. appinfo.properties is removed in favour of build.properties in the compiled jar.
The build number is still tracked, but offline, allowing TFM commits to more easily be merged
2015-09-06 23:05:36 +02:00

77 lines
3 KiB
Java

package me.StevenLawson.TotalFreedomMod.Commands;
import me.StevenLawson.TotalFreedomMod.Config.TFM_ConfigEntry;
import me.StevenLawson.TotalFreedomMod.Config.TFM_MainConfig;
import me.StevenLawson.TotalFreedomMod.TFM_AdminList;
import me.StevenLawson.TotalFreedomMod.TFM_BanManager;
import me.StevenLawson.TotalFreedomMod.TFM_CommandBlocker;
import me.StevenLawson.TotalFreedomMod.TFM_Log;
import me.StevenLawson.TotalFreedomMod.TFM_PermbanList;
import me.StevenLawson.TotalFreedomMod.TFM_PlayerList;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
/*
* See https://github.com/TotalFreedom/License - This file may not be edited or removed.
*/
@CommandPermissions(level = AdminLevel.ALL, source = SourceType.BOTH)
@CommandParameters(description = "Shows information about TotalFreedomMod or reloads it", usage = "/<command> [reload]")
public class Command_tfm extends TFM_Command
{
@Override
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{
if (args.length == 1)
{
if (!args[0].equals("reload"))
{
return false;
}
if (!TFM_AdminList.isSuperAdmin(sender))
{
playerMsg(TFM_Command.MSG_NO_PERMS);
return true;
}
TFM_MainConfig.load();
TFM_AdminList.load();
TFM_PermbanList.load();
TFM_PlayerList.load();
TFM_BanManager.load();
TFM_CommandBlocker.load();
final String message = String.format("%s v%s reloaded.",
TotalFreedomMod.pluginName,
TotalFreedomMod.pluginVersion);
playerMsg(message);
TFM_Log.info(message);
return true;
}
TotalFreedomMod.BuildProperties build = TotalFreedomMod.build;
playerMsg("TotalFreedomMod for 'Total Freedom', the original all-op server.", ChatColor.GOLD);
playerMsg("Running on " + TFM_ConfigEntry.SERVER_NAME.getString() + ".", ChatColor.GOLD);
playerMsg("Created by Madgeek1450 and Prozza.", ChatColor.GOLD);
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);
return true;
}
}