From 046ac2e311fdb6268645427261c81a92f849fcf9 Mon Sep 17 00:00:00 2001 From: tastybento Date: Sun, 29 Jul 2018 17:18:40 -0700 Subject: [PATCH] Update to latest API --- pom.xml | 4 ++-- .../java/bentobox/addon/acidisland/AcidIsland.java | 12 ++++++------ .../addon/acidisland/listeners/AcidEffect.java | 4 ++-- .../addon/acidisland/listeners/LavaCheck.java | 2 +- .../addon/acidisland/world/AcidIslandWorld.java | 4 ++-- .../bentobox/addon/acidisland/world/AcidTask.java | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/pom.xml b/pom.xml index 65dabb7..2cde934 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ . - true + false ${basedir} *.yml @@ -63,7 +63,7 @@ world.bentobox bentobox - LATEST + 1.0 org.mockito diff --git a/src/main/java/bentobox/addon/acidisland/AcidIsland.java b/src/main/java/bentobox/addon/acidisland/AcidIsland.java index c6d1fd5..6fcb2d6 100644 --- a/src/main/java/bentobox/addon/acidisland/AcidIsland.java +++ b/src/main/java/bentobox/addon/acidisland/AcidIsland.java @@ -39,10 +39,8 @@ public class AcidIsland extends Addon { // Register listeners PluginManager manager = getServer().getPluginManager(); // Acid Effects - manager.registerEvents(new AcidEffect(this), this.getBSkyBlock()); - manager.registerEvents(new LavaCheck(this), this.getBSkyBlock()); - // New Islands - //manager.registerEvents(new IslandBuilder(this), this.getBSkyBlock()); + manager.registerEvents(new AcidEffect(this), this.getPlugin()); + manager.registerEvents(new LavaCheck(this), this.getPlugin()); // Register commands new AcidCommand(this); new AiCommand(this); @@ -54,7 +52,9 @@ public class AcidIsland extends Addon { public void onDisable(){ acidTask.cancelTasks(); // Save settings - new BSBConfig<>(this, AISettings.class).saveConfigObject(settings); + if (settings != null) { + new BSBConfig<>(this, AISettings.class).saveConfigObject(settings); + } } public AISettings getSettings() { @@ -78,7 +78,7 @@ public class AcidIsland extends Addon { @Override public void log(String string) { - getBSkyBlock().log(string); + getPlugin().log(string); } public static AcidIsland getInstance() { diff --git a/src/main/java/bentobox/addon/acidisland/listeners/AcidEffect.java b/src/main/java/bentobox/addon/acidisland/listeners/AcidEffect.java index 5a65f40..f5e3bf1 100644 --- a/src/main/java/bentobox/addon/acidisland/listeners/AcidEffect.java +++ b/src/main/java/bentobox/addon/acidisland/listeners/AcidEffect.java @@ -125,7 +125,7 @@ public class AcidEffect implements Listener { } } } - }.runTaskTimer(addon.getBSkyBlock(), 0L, 20L); + }.runTaskTimer(addon.getPlugin(), 0L, 20L); } @@ -165,7 +165,7 @@ public class AcidEffect implements Listener { } } } - }.runTaskTimer(addon.getBSkyBlock(), 0L, 20L); + }.runTaskTimer(addon.getPlugin(), 0L, 20L); } /** diff --git a/src/main/java/bentobox/addon/acidisland/listeners/LavaCheck.java b/src/main/java/bentobox/addon/acidisland/listeners/LavaCheck.java index 131ddde..1c83661 100644 --- a/src/main/java/bentobox/addon/acidisland/listeners/LavaCheck.java +++ b/src/main/java/bentobox/addon/acidisland/listeners/LavaCheck.java @@ -33,7 +33,7 @@ public class LavaCheck implements Listener { return; } Material prev = e.getToBlock().getType(); - addon.getServer().getScheduler().runTask(addon.getBSkyBlock(), () -> { + addon.getServer().getScheduler().runTask(addon.getPlugin(), () -> { if (e.getToBlock().getType().equals(Material.STONE)) { e.getToBlock().setType(prev); e.getToBlock().getWorld().playSound(e.getToBlock().getLocation(), Sound.ENTITY_CREEPER_PRIMED, 1F, 2F); diff --git a/src/main/java/bentobox/addon/acidisland/world/AcidIslandWorld.java b/src/main/java/bentobox/addon/acidisland/world/AcidIslandWorld.java index 7ccb777..b0f05d7 100644 --- a/src/main/java/bentobox/addon/acidisland/world/AcidIslandWorld.java +++ b/src/main/java/bentobox/addon/acidisland/world/AcidIslandWorld.java @@ -33,7 +33,7 @@ public class AcidIslandWorld { // Create the world if it does not exist islandWorld = WorldCreator.name(worldName).type(WorldType.FLAT).environment(World.Environment.NORMAL).generator(new ChunkGeneratorWorld(addon)) .createWorld(); - addon.getBSkyBlock().registerWorld(islandWorld, addon.getSettings()); + addon.getPlugin().registerWorld(islandWorld, addon.getSettings()); // Make the nether if it does not exist if (addon.getSettings().isNetherGenerate()) { @@ -61,7 +61,7 @@ public class AcidIslandWorld { } // Load schematics - addon.getBSkyBlock().getSchemsManager().loadIslands(islandWorld); + addon.getPlugin().getSchemsManager().loadIslands(islandWorld); } diff --git a/src/main/java/bentobox/addon/acidisland/world/AcidTask.java b/src/main/java/bentobox/addon/acidisland/world/AcidTask.java index e81bdc9..f9f3d5d 100644 --- a/src/main/java/bentobox/addon/acidisland/world/AcidTask.java +++ b/src/main/java/bentobox/addon/acidisland/world/AcidTask.java @@ -40,7 +40,7 @@ public class AcidTask { */ private void burnEntities() { // This part will kill monsters if they fall into the water because it is acid - entityBurnTask = Bukkit.getScheduler().scheduleSyncRepeatingTask(addon.getBSkyBlock(), () -> getEntityStream() + entityBurnTask = Bukkit.getScheduler().scheduleSyncRepeatingTask(addon.getPlugin(), () -> getEntityStream() .filter(e -> !(e instanceof Guardian || e instanceof Squid)) // TODO: remove backwards compatibility hack .filter(w -> w.getLocation().getBlock().getType().name().contains("WATER")) @@ -73,7 +73,7 @@ public class AcidTask { if (addon.getSettings().getAcidDestroyItemTime() <= 0) { return; } - itemBurnTask = Bukkit.getScheduler().scheduleSyncRepeatingTask(addon.getBSkyBlock(), () -> { + itemBurnTask = Bukkit.getScheduler().scheduleSyncRepeatingTask(addon.getPlugin(), () -> { Set newItemsInWater = new HashSet<>(); getEntityStream().filter(e -> e.getType().equals(EntityType.DROPPED_ITEM) && (e.getLocation().getBlock().getType().name().contains("WATER"))