Added generic reload command for addons to use

This command just runs the onReload method so that individual addons can
reload their stuff.
This commit is contained in:
tastybento 2019-01-02 15:40:49 -08:00
parent a7f99e2a65
commit 96bf67eb19
4 changed files with 36 additions and 3 deletions

View File

@ -0,0 +1,33 @@
package world.bentobox.bentobox.api.commands.admin;
import java.util.List;
import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.api.user.User;
/**
* Generic reload command for addons to use that will just call the onReload() method
* after checking permissions
* @author tastybento
*
*/
public class AdminReloadCommand extends CompositeCommand {
public AdminReloadCommand(CompositeCommand adminCommand) {
super(adminCommand, "reload");
}
@Override
public void setup() {
// Permission
setPermission("admin.reload");
setDescription("commands.admin.reload.description");
}
@Override
public boolean execute(User user, String label, List<String> args) {
getAddon().onReload();
return true;
}
}

View File

@ -140,7 +140,7 @@ commands:
description: "set the range of player's island"
range-updated: "Island range updated to [number]"
reload:
description: "reload the plugin"
description: "reload"
tp:
parameters: "<player>"
description: "teleport to a player's island"

View File

@ -135,7 +135,7 @@ commands:
description: "プレイヤーの島の範囲を設定する"
range-updated: "&2島の範囲は、[number]に更新"
reload:
description: "プラグインをリロードする"
description: "リロードする"
tp:
parameters: "<プレーヤー>"
description: "プレイヤーの島にテレポート"

View File

@ -108,7 +108,7 @@ commands:
description: "ustaw zasięg wyspy gracza"
range-updated: "Zaktualizowano zasięg wyspy do [number]"
reload:
description: "ponownie załaduj plugin"
description: "ponownie załaduj"
tp:
parameters: "<gracz>"
description: "teleportuj się na wyspę gracza"