From a119181b46c18d36b635dfacac109ec368408ee8 Mon Sep 17 00:00:00 2001 From: tastybento Date: Sun, 5 May 2019 00:41:57 -0700 Subject: [PATCH] Startup (#21) * Fixed for BentoBox 1.5.0 API Enables dedicated caveblock world operation * Added island near command. * Update pom.xml --- pom.xml | 4 ++-- .../java/world/bentobox/caveblock/CaveBlock.java | 14 ++++++++------ .../bentobox/caveblock/commands/IslandCommand.java | 5 +++-- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/pom.xml b/pom.xml index 78c6b86..3e8058b 100644 --- a/pom.xml +++ b/pom.xml @@ -46,7 +46,7 @@ 1.8 1.13.2-R0.1-SNAPSHOT - 1.4.0 + 1.5.0 ${build.version}-SNAPSHOT @@ -226,4 +226,4 @@ - \ No newline at end of file + diff --git a/src/main/java/world/bentobox/caveblock/CaveBlock.java b/src/main/java/world/bentobox/caveblock/CaveBlock.java index 811932d..fb03fca 100644 --- a/src/main/java/world/bentobox/caveblock/CaveBlock.java +++ b/src/main/java/world/bentobox/caveblock/CaveBlock.java @@ -32,6 +32,12 @@ public class CaveBlock extends GameModeAddon this.saveDefaultConfig(); this.loadSettings(); this.saveWorldSettings(); + + this.chunkGenerator = new ChunkGeneratorWorld(this); + + this.playerCommand = new IslandCommand(this); + this.adminCommand = new AdminCommand(this); + } @@ -41,8 +47,6 @@ public class CaveBlock extends GameModeAddon @Override public void onEnable() { - this.playerCommand = new IslandCommand(this); - this.adminCommand = new AdminCommand(this); // Register flags CaveBlock.ALTERNATIVE_TELEPORT_FLAG.addGameModeAddon(this); @@ -113,8 +117,6 @@ public class CaveBlock extends GameModeAddon this.getLogger().info("Creating CaveBlock world ..."); } - this.chunkGenerator = new ChunkGeneratorWorld(this); - // Create the world if it does not exist this.islandWorld = WorldCreator.name(worldName). type(WorldType.FLAT). @@ -249,7 +251,7 @@ public class CaveBlock extends GameModeAddon * into void and this flag is enabled, then he will be teleported to different world. */ public final static Flag ALTERNATIVE_TELEPORT_FLAG = - new Flag.Builder("ALTERNATIVE_TELEPORT_FLAG", Material.ENDER_PEARL). + new Flag.Builder("ALTERNATIVE_TELEPORT_FLAG", Material.ENDER_PEARL). type(Flag.Type.WORLD_SETTING). defaultSetting(false). build(); @@ -260,7 +262,7 @@ public class CaveBlock extends GameModeAddon * top of the world. */ public final static Flag SKY_WALKER_FLAG = - new Flag.Builder("SKY_WALKER_FLAG", Material.FEATHER). + new Flag.Builder("SKY_WALKER_FLAG", Material.FEATHER). type(Flag.Type.WORLD_SETTING). defaultSetting(false). build(); diff --git a/src/main/java/world/bentobox/caveblock/commands/IslandCommand.java b/src/main/java/world/bentobox/caveblock/commands/IslandCommand.java index 91e95e4..37b9813 100644 --- a/src/main/java/world/bentobox/caveblock/commands/IslandCommand.java +++ b/src/main/java/world/bentobox/caveblock/commands/IslandCommand.java @@ -16,8 +16,8 @@ public class IslandCommand extends CompositeCommand { public IslandCommand(CaveBlock addon) { super(addon, - addon.getSettings().getIslandCommand().split(" ")[0], - addon.getSettings().getIslandCommand().split(" ")); + addon.getSettings().getIslandCommand().split(" ")[0], + addon.getSettings().getIslandCommand().split(" ")); } /* (non-Javadoc) @@ -44,6 +44,7 @@ public class IslandCommand extends CompositeCommand { new IslandBanCommand(this); new IslandUnbanCommand(this); new IslandBanlistCommand(this); + new IslandNearCommand(this); // Expel command new IslandExpelCommand(this);