mirror of
https://github.com/TheDeus-Group/TFM-4.3-Reloaded.git
synced 2024-12-23 03:54:56 +00:00
Reword command & add aliases
This commit is contained in:
parent
f0eb0f5d28
commit
a07d2317e4
1 changed files with 5 additions and 5 deletions
|
@ -13,12 +13,12 @@ import org.bukkit.entity.Player;
|
|||
import java.io.File;
|
||||
|
||||
@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "For developers only - update TFM.", usage = "/<command>")
|
||||
@CommandParameters(description = "For developers only - update TFM.", usage = "/<command>", aliases = ("tfmupdate,update,compiletfm,tfmcompile,build,buildtfm,tfmbuild"))
|
||||
public class Command_updatetfm extends FreedomCommand {
|
||||
@Override
|
||||
public boolean run(CommandSender sender, org.bukkit.entity.Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) {
|
||||
playerMsg("Updating TFM, please wait...", ChatColor.RED);
|
||||
Utilities.adminAction(sender.getName(), "Updating TFM", true);
|
||||
playerMsg("Compiling TFM, please wait...", ChatColor.RED);
|
||||
Utilities.adminAction(sender.getName(), "Compiling TFM", true);
|
||||
String path = MainConfig.getString(ConfigurationEntry.TFM_BUILD_SHELLSCRIPT);
|
||||
File file = new File(path);
|
||||
String directory = file.getParent();
|
||||
|
@ -28,8 +28,8 @@ public class Command_updatetfm extends FreedomCommand {
|
|||
ProcessBuilder proc = new ProcessBuilder("/bin/bash", "-c", command);
|
||||
Process process = proc.start();
|
||||
process.waitFor();
|
||||
playerMsg("Updated TFM! Reloading...");
|
||||
Utilities.adminAction(sender.getName(), "Update successful, reloading TFM...", false);
|
||||
playerMsg("Compiling TFM! Reloading...");
|
||||
Utilities.adminAction(sender.getName(), "Compilation successful, reloading TFM...", false);
|
||||
for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
|
||||
onlinePlayer.kickPlayer(ChatColor.RED + "Reloading TFM, please rejoin.");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue