Makes the BSkyBlock and AcidIsland commands configurable.

https://github.com/BentoBoxWorld/addon-acidisland/pull/4
This commit is contained in:
tastybento 2018-09-16 15:44:48 -07:00
parent 3d8c7dafea
commit b3ba8c935e
3 changed files with 17 additions and 5 deletions

View File

@ -70,7 +70,7 @@
<dependency> <dependency>
<groupId>world.bentobox</groupId> <groupId>world.bentobox</groupId>
<artifactId>bentobox</artifactId> <artifactId>bentobox</artifactId>
<version>0.9.0-SNAPSHOT</version> <version>0.10.0-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -117,22 +117,22 @@ public class Level extends Addon {
// Register commands // Register commands
// AcidIsland hook in // AcidIsland hook in
this.getPlugin().getAddonsManager().getAddonByName("AcidIsland").ifPresent(a -> { 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) { if (acidIslandCmd != null) {
new IslandLevel(this, acidIslandCmd); new IslandLevel(this, acidIslandCmd);
new IslandTop(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 AdminLevel(this, acidCmd);
new AdminTop(this, acidCmd); new AdminTop(this, acidCmd);
} }
}); });
// BSkyBlock hook in // BSkyBlock hook in
this.getPlugin().getAddonsManager().getAddonByName("BSkyBlock").ifPresent(a -> { 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) { if (bsbIslandCmd != null) {
new IslandLevel(this, bsbIslandCmd); new IslandLevel(this, bsbIslandCmd);
new IslandTop(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 AdminLevel(this, bsbAdminCmd);
new AdminTop(this, bsbAdminCmd); new AdminTop(this, bsbAdminCmd);
} }

View File

@ -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 # 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. # island level. Level = total of all blocks in island boundary / 100.
# Players with the permission askyblock.island.multiplier.# will have their blocks # Players with the permission askyblock.island.multiplier.# will have their blocks