Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-26 16:12:42 +01:00
Merge pull request #309 from HugoDaBosss/master
Implement subcommand to reload the config
Dieser Commit ist enthalten in:
Commit
5c84b3d8cc
@ -135,6 +135,7 @@ public class ViaCommandHandler implements ViaVersionCommand, CommandExecutor, Ta
|
|||||||
registerSubCommand(new DontBugMeSubCmd());
|
registerSubCommand(new DontBugMeSubCmd());
|
||||||
registerSubCommand(new AutoTeamSubCmd());
|
registerSubCommand(new AutoTeamSubCmd());
|
||||||
registerSubCommand(new HelpSubCmd());
|
registerSubCommand(new HelpSubCmd());
|
||||||
|
registerSubCommand(new ReloadSubCmd());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String color(String string) {
|
public static String color(String string) {
|
||||||
|
@ -0,0 +1,27 @@
|
|||||||
|
package us.myles.ViaVersion.commands.defaultsubs;
|
||||||
|
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import us.myles.ViaVersion.ViaVersionPlugin;
|
||||||
|
import us.myles.ViaVersion.api.ViaVersion;
|
||||||
|
import us.myles.ViaVersion.api.command.ViaSubCommand;
|
||||||
|
|
||||||
|
public class ReloadSubCmd extends ViaSubCommand {
|
||||||
|
@Override
|
||||||
|
public String name() {
|
||||||
|
return "reload";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String description() {
|
||||||
|
return "Reload the config from the disk";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean execute(CommandSender sender, String[] args) {
|
||||||
|
ViaVersionPlugin plugin = (ViaVersionPlugin) ViaVersion.getInstance();
|
||||||
|
|
||||||
|
plugin.generateConfig();
|
||||||
|
sender.sendMessage(color("&6Configuration successfully reloaded! Some features may need a restart."));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren