Update to latest API

This commit is contained in:
tastybento 2018-07-29 17:18:40 -07:00
parent d460f20499
commit 046ac2e311
6 changed files with 15 additions and 15 deletions

View File

@ -18,7 +18,7 @@
<resources>
<resource>
<targetPath>.</targetPath>
<filtering>true</filtering>
<filtering>false</filtering>
<directory>${basedir}</directory>
<includes>
<include>*.yml</include>
@ -63,7 +63,7 @@
<dependency>
<groupId>world.bentobox</groupId>
<artifactId>bentobox</artifactId>
<version>LATEST</version>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>

View File

@ -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() {

View File

@ -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);
}
/**

View File

@ -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);

View File

@ -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);
}

View File

@ -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<Entity> newItemsInWater = new HashSet<>();
getEntityStream().filter(e -> e.getType().equals(EntityType.DROPPED_ITEM)
&& (e.getLocation().getBlock().getType().name().contains("WATER"))