From 12470e5cfb0151b27d3649eff851d47919e280d5 Mon Sep 17 00:00:00 2001 From: tastybento Date: Sat, 26 Jan 2019 16:35:05 -0800 Subject: [PATCH] Uses new GameModeAddon API 1.1.1 --- pom.xml | 4 ++-- .../world/bentobox/acidisland/AcidIsland.java | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index f29c5aa..cd1c4cd 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ world.bentobox acidisland - 1.1-SNAPSHOT + 1.1.1-SNAPSHOT AcidIsland AcidIsland is an add-on for BentoBox, an expandable Minecraft Bukkit plugin for island-type games like SkyBlock or AcidIsland. @@ -91,7 +91,7 @@ world.bentobox bentobox - 1.1-SNAPSHOT + 1.1.1-SNAPSHOT provided diff --git a/src/main/java/world/bentobox/acidisland/AcidIsland.java b/src/main/java/world/bentobox/acidisland/AcidIsland.java index 9ab9ec0..3a883ba 100644 --- a/src/main/java/world/bentobox/acidisland/AcidIsland.java +++ b/src/main/java/world/bentobox/acidisland/AcidIsland.java @@ -3,7 +3,9 @@ package world.bentobox.acidisland; import org.bukkit.World; import org.bukkit.WorldCreator; import org.bukkit.WorldType; +import org.bukkit.generator.ChunkGenerator; import org.bukkit.plugin.PluginManager; +import org.eclipse.jdt.annotation.NonNull; import world.bentobox.acidisland.commands.AcidCommand; import world.bentobox.acidisland.commands.AiCommand; @@ -24,6 +26,7 @@ public class AcidIsland extends GameModeAddon { private AISettings settings; private AcidTask acidTask; + private @NonNull ChunkGenerator chunkGenerator; private static final String NETHER = "_nether"; private static final String THE_END = "_the_end"; @@ -94,7 +97,8 @@ public class AcidIsland extends GameModeAddon { getLogger().info("Creating AcidIsland..."); } // Create the world if it does not exist - islandWorld = WorldCreator.name(worldName).type(WorldType.FLAT).environment(World.Environment.NORMAL).generator(new ChunkGeneratorWorld(this)) + chunkGenerator = new ChunkGeneratorWorld(this); + islandWorld = WorldCreator.name(worldName).type(WorldType.FLAT).environment(World.Environment.NORMAL).generator(chunkGenerator) .createWorld(); // Make the nether if it does not exist @@ -105,7 +109,7 @@ public class AcidIsland extends GameModeAddon { if (!settings.isNetherIslands()) { netherWorld = WorldCreator.name(worldName + NETHER).type(WorldType.NORMAL).environment(World.Environment.NETHER).createWorld(); } else { - netherWorld = WorldCreator.name(worldName + NETHER).type(WorldType.FLAT).generator(new ChunkGeneratorWorld(this)) + netherWorld = WorldCreator.name(worldName + NETHER).type(WorldType.FLAT).generator(chunkGenerator) .environment(World.Environment.NETHER).createWorld(); } } @@ -117,7 +121,7 @@ public class AcidIsland extends GameModeAddon { if (!settings.isEndIslands()) { endWorld = WorldCreator.name(worldName + THE_END).type(WorldType.NORMAL).environment(World.Environment.THE_END).createWorld(); } else { - endWorld = WorldCreator.name(worldName + THE_END).type(WorldType.FLAT).generator(new ChunkGeneratorWorld(this)) + endWorld = WorldCreator.name(worldName + THE_END).type(WorldType.FLAT).generator(chunkGenerator) .environment(World.Environment.THE_END).createWorld(); } } @@ -135,4 +139,9 @@ public class AcidIsland extends GameModeAddon { } } + @Override + public @NonNull ChunkGenerator getDefaultWorldGenerator(String worldName, String id) { + return chunkGenerator; + } + }