mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-02-13 19:01:28 +01:00
parent
a5c710ce3a
commit
c9298c3ae6
@ -10,6 +10,7 @@ import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||
import world.bentobox.bentobox.api.commands.ConfirmableCommand;
|
||||
import world.bentobox.bentobox.api.events.BentoBoxReadyEvent;
|
||||
import world.bentobox.bentobox.api.user.User;
|
||||
import world.bentobox.bentobox.commands.reload.BentoBoxReloadLocalesCommand;
|
||||
import world.bentobox.bentobox.listeners.PanelListenerManager;
|
||||
|
||||
/**
|
||||
@ -32,6 +33,8 @@ public class BentoBoxReloadCommand extends ConfirmableCommand {
|
||||
setPermission("bentobox.admin.reload");
|
||||
setParametersHelp("commands.bentobox.reload.parameters");
|
||||
setDescription("commands.bentobox.reload.description");
|
||||
|
||||
new BentoBoxReloadLocalesCommand(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -0,0 +1,42 @@
|
||||
package world.bentobox.bentobox.commands.reload;
|
||||
|
||||
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||
import world.bentobox.bentobox.api.user.User;
|
||||
import world.bentobox.bentobox.commands.BentoBoxReloadCommand;
|
||||
import world.bentobox.bentobox.listeners.PanelListenerManager;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Reloads locales files.
|
||||
*
|
||||
* @author Poslovitch
|
||||
* @since 1.13.0
|
||||
*/
|
||||
public class BentoBoxReloadLocalesCommand extends CompositeCommand {
|
||||
|
||||
public BentoBoxReloadLocalesCommand(BentoBoxReloadCommand parent) {
|
||||
super(parent, "locales");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setup() {
|
||||
setPermission("bentobox.admin.reload");
|
||||
setDescription("commands.bentobox.reload.locales.description");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(User user, String label, List<String> args) {
|
||||
if (args.isEmpty()) {
|
||||
// Close all open panels
|
||||
PanelListenerManager.closeAllPanels();
|
||||
|
||||
// Reload locales
|
||||
getPlugin().getLocalesManager().reloadLanguages();
|
||||
user.sendMessage("commands.bentobox.reload.locales-reloaded");
|
||||
} else {
|
||||
showHelp(this, user);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
@ -401,6 +401,8 @@ commands:
|
||||
addon-reloaded: "[prefix_bentobox]&b [name] &2 reloaded."
|
||||
warning: "[prefix_bentobox]&c Warning: Reloading may cause instability, so if you see errors afterwards, restart the server."
|
||||
unknown-addon: "[prefix_bentobox]&c Unknown addon!"
|
||||
locales:
|
||||
description: "reloads locales"
|
||||
version:
|
||||
plugin-version: "&2 BentoBox version: &3 [version]"
|
||||
description: "displays BentoBox and addons versions"
|
||||
|
Loading…
Reference in New Issue
Block a user