Add version command

This commit is contained in:
GeorgH93 2019-04-30 18:24:07 +02:00
parent 7e4f023a2c
commit 1cdc17eb6a
No known key found for this signature in database
GPG Key ID: D1630D37F9E4B3C8
4 changed files with 58 additions and 0 deletions

View File

@ -58,6 +58,7 @@ Language:
Backup: "Erstellt eine Sicherungskopie eines Rucksackes."
Restore: "Stellt eine Sicherungskopie eines Rucksackes wieder her."
RestoreList: "Listet alle verfügbaren Sicherungskopien von Rucksäcken auf."
Version: "Gibt die Versionsdetails über das Plugin und seine Abhängigkeiten aus."
Help: "Zeigt die verfügbaren Befehle an."
Command:
@ -85,6 +86,8 @@ Command:
- restore
ListBackups:
- listbackups
Version:
- version
Help:
- help
- hilfe

View File

@ -56,6 +56,7 @@ Language:
OpenOthers: "Shows the backpack of another player."
Reload: "Reloads the config of the plugin."
Update: "Checks for new plugin updates."
Version: "Prints the version details about the plugin and it's dependencies."
Backup: "Creates a backup of a players backpack."
Restore: "Restores a backup."
RestoreList: "Lists all available backups."
@ -82,6 +83,8 @@ Command:
- restore
ListBackups:
- listbackups
Version:
- version
Help:
- help

View File

@ -76,6 +76,7 @@ public CommandManager(Minepacks plugin)
registerSubCommand(new BackupCommand(plugin));
registerSubCommand(new RestoreCommand(plugin));
registerSubCommand(new MigrateCommand(plugin));
registerSubCommand(new VersionCommand(plugin));
registerSubCommand(new HelpCommand(plugin, commands));
}

View File

@ -0,0 +1,51 @@
/*
* Copyright (C) 2019 GeorgH93
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package at.pcgamingfreaks.Minepacks.Bukkit.Command;
import at.pcgamingfreaks.Minepacks.Bukkit.API.MinepacksCommand;
import at.pcgamingfreaks.Minepacks.Bukkit.Minepacks;
import at.pcgamingfreaks.PluginLib.Bukkit.PluginLib;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
import java.util.List;
public class VersionCommand extends MinepacksCommand
{
public VersionCommand(Minepacks plugin)
{
super(plugin, "version", plugin.getLanguage().getTranslated("Commands.Description.Version"), "backpack.version", plugin.getLanguage().getCommandAliases("Version"));
}
@Override
public void execute(@NotNull CommandSender sender, @NotNull String mainCommandAlias, @NotNull String alias, @NotNull String[] args)
{
sender.sendMessage("##### Start Minepacks version info #####");
sender.sendMessage("Marriage Master: " + plugin.getDescription().getVersion());
sender.sendMessage("PCGF PluginLib: " + PluginLib.getInstance().getVersion());
sender.sendMessage("Server: " + plugin.getServer().getVersion());
sender.sendMessage("##### End Minepacks version info #####");
}
@Override
public List<String> tabComplete(@NotNull CommandSender sender, @NotNull String mainCommandAlias, @NotNull String alias, @NotNull String[] args)
{
return null;
}
}