From b3ba8c935e74bbc3fb7757eda4519762da356245 Mon Sep 17 00:00:00 2001 From: tastybento Date: Sun, 16 Sep 2018 15:44:48 -0700 Subject: [PATCH] Makes the BSkyBlock and AcidIsland commands configurable. https://github.com/BentoBoxWorld/addon-acidisland/pull/4 --- pom.xml | 2 +- src/main/java/bentobox/addon/level/Level.java | 8 ++++---- src/main/resources/config.yml | 12 ++++++++++++ 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 316ab8d..358224b 100644 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,7 @@ world.bentobox bentobox - 0.9.0-SNAPSHOT + 0.10.0-SNAPSHOT provided diff --git a/src/main/java/bentobox/addon/level/Level.java b/src/main/java/bentobox/addon/level/Level.java index b88fd46..4d0a4b6 100644 --- a/src/main/java/bentobox/addon/level/Level.java +++ b/src/main/java/bentobox/addon/level/Level.java @@ -117,22 +117,22 @@ public class Level extends Addon { // Register commands // AcidIsland hook in this.getPlugin().getAddonsManager().getAddonByName("AcidIsland").ifPresent(a -> { - CompositeCommand acidIslandCmd = getPlugin().getCommandsManager().getCommand("ai"); + CompositeCommand acidIslandCmd = getPlugin().getCommandsManager().getCommand(getConfig().getString("acidisland.user-command","ai")); if (acidIslandCmd != null) { new IslandLevel(this, acidIslandCmd); new IslandTop(this, acidIslandCmd); - CompositeCommand acidCmd = getPlugin().getCommandsManager().getCommand("acid"); + CompositeCommand acidCmd = getPlugin().getCommandsManager().getCommand(getConfig().getString("acidisland.admin-command","acid")); new AdminLevel(this, acidCmd); new AdminTop(this, acidCmd); } }); // BSkyBlock hook in this.getPlugin().getAddonsManager().getAddonByName("BSkyBlock").ifPresent(a -> { - CompositeCommand bsbIslandCmd = getPlugin().getCommandsManager().getCommand("island"); + CompositeCommand bsbIslandCmd = getPlugin().getCommandsManager().getCommand(getConfig().getString("bskyblock.user-command","island")); if (bsbIslandCmd != null) { new IslandLevel(this, bsbIslandCmd); new IslandTop(this, bsbIslandCmd); - CompositeCommand bsbAdminCmd = getPlugin().getCommandsManager().getCommand("bsbadmin"); + CompositeCommand bsbAdminCmd = getPlugin().getCommandsManager().getCommand(getConfig().getString("bskyblock.admin-command","bsbadmin")); new AdminLevel(this, bsbAdminCmd); new AdminTop(this, bsbAdminCmd); } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index e67a361..fe24fca 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -1,3 +1,15 @@ +# Config file for Level add-on for BSkyBlock or AcidIsland + +# Command hook-in configuration. +# Level will try to hook into these commands when it starts +# If you have changed the default AcidIsland or BSkyBlock commands, change them here +acidisland: + admin-command: acid + user-command: ai +bskyblock: + admin-command: bsbadmin + user-command: island + # This file lists the values for various blocks that are used to calculate the # island level. Level = total of all blocks in island boundary / 100. # Players with the permission askyblock.island.multiplier.# will have their blocks