Skip to content

Commit

Permalink
Update to BentoBox 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
BONNe committed Jan 26, 2019
1 parent 99cf49e commit 7a6a55d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 59 deletions.
16 changes: 2 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>world.bentobox</groupId>
<artifactId>biomes</artifactId>
<version>0.4.0-SNAPSHOT</version>
<version>0.4.1-SNAPSHOT</version>

<name>Biomes</name>
<description>Biomes is an add-on for BentoBox, an expandable Minecraft Spigot plugin for island-type games like SkyBlock or AcidIsland.</description>
Expand Down Expand Up @@ -94,19 +94,7 @@
<dependency>
<groupId>world.bentobox</groupId>
<artifactId>bentobox</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>world.bentobox</groupId>
<artifactId>bskyblock</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>world.bentobox</groupId>
<artifactId>acidisland</artifactId>
<version>1.0</version>
<version>1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
58 changes: 13 additions & 45 deletions src/main/java/world/bentobox/biomes/BiomesAddon.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
package world.bentobox.biomes;


import world.bentobox.acidisland.AcidIsland;
import world.bentobox.bentobox.api.addons.Addon;
import world.bentobox.bentobox.api.configuration.Config;
import world.bentobox.bentobox.managers.CommandsManager;
import world.bentobox.biomes.commands.admin.AdminCommand;
import world.bentobox.biomes.commands.user.BiomesCommand;
import world.bentobox.biomes.listeners.ChangeOwnerListener;
import world.bentobox.biomes.objects.Settings;
import world.bentobox.bskyblock.BSkyBlock;


/**
Expand All @@ -36,52 +34,22 @@ public void onEnable()
CommandsManager commandsManager = this.getPlugin().getCommandsManager();

// AcidIsland hook in
if (this.settings.getDisabledGameModes().isEmpty() ||
!this.settings.getDisabledGameModes().contains("AcidIsland"))
{
this.getPlugin().getAddonsManager().getAddonByName("AcidIsland").ifPresent(
addon -> {
AcidIsland acidIsland = (AcidIsland) addon;

new AdminCommand(this,
commandsManager.getCommand(acidIsland.getSettings().getAdminCommand()));
new BiomesCommand(this,
commandsManager.getCommand(acidIsland.getSettings().getIslandCommand()));

String currentWorld = acidIsland.getWorldSettings().getWorldName();

if (this.addonManager.getBiomes(currentWorld).isEmpty())
{
this.addonManager.importBiomes(currentWorld);
}

this.getPlugin().getAddonsManager().getGameModeAddons().forEach(gameModeAddon -> {
if (!this.settings.getDisabledGameModes().contains(gameModeAddon.getDescription().getName()))
{
if (gameModeAddon.getPlayerCommand().isPresent())
{
new BiomesCommand(this, gameModeAddon.getPlayerCommand().get());
this.hooked = true;
});
}

// BSkyBlock hook in
if (this.settings.getDisabledGameModes().isEmpty() ||
!this.settings.getDisabledGameModes().contains("BSkyBlock"))
{
this.getPlugin().getAddonsManager().getAddonByName("BSkyBlock").ifPresent(
addon -> {
BSkyBlock skyBlock = (BSkyBlock) addon;

new AdminCommand(this,
commandsManager.getCommand("bsbadmin"));
new BiomesCommand(this,
commandsManager.getCommand("island"));

String currentWorld = skyBlock.getWorldSettings().getWorldName();

if (this.addonManager.getBiomes(currentWorld).isEmpty())
{
this.addonManager.importBiomes(currentWorld);
}
}

if (gameModeAddon.getAdminCommand().isPresent())
{
new AdminCommand(this, gameModeAddon.getAdminCommand().get());
this.hooked = true;
});
}
}
}
});

if (this.hooked)
{
Expand Down

0 comments on commit 7a6a55d

Please sign in to comment.