Fix to fire Island events after an island is created.

Events were firing too early before the island had been fully pasted
async.
This commit is contained in:
tastybento 2019-01-03 10:24:50 -08:00
parent 8452a080f7
commit 2713f58ac5

View File

@ -172,19 +172,6 @@ public class NewIsland {
// Delete the old island
plugin.getIslands().deleteIsland(oldIsland, true);
}
});
// Make nether island
if (plugin.getIWM().isNetherGenerate(world) && plugin.getIWM().isNetherIslands(world) && plugin.getIWM().getNetherWorld(world) != null) {
plugin.getSchemsManager().paste(plugin.getIWM().getNetherWorld(world), island, "nether-" + name);
}
// Make end island
if (plugin.getIWM().isEndGenerate(world) && plugin.getIWM().isEndIslands(world) && plugin.getIWM().getEndWorld(world) != null) {
plugin.getSchemsManager().paste(plugin.getIWM().getEndWorld(world), island, "end-" + name);
}
// Set default settings
island.setFlagsDefaults();
// Fire exit event
Reason reasonDone = Reason.CREATED;
@ -204,6 +191,19 @@ public class NewIsland {
.island(island)
.location(island.getCenter())
.build();
});
// Make nether island
if (plugin.getIWM().isNetherGenerate(world) && plugin.getIWM().isNetherIslands(world) && plugin.getIWM().getNetherWorld(world) != null) {
plugin.getSchemsManager().paste(plugin.getIWM().getNetherWorld(world), island, "nether-" + name);
}
// Make end island
if (plugin.getIWM().isEndGenerate(world) && plugin.getIWM().isEndIslands(world) && plugin.getIWM().getEndWorld(world) != null) {
plugin.getSchemsManager().paste(plugin.getIWM().getEndWorld(world), island, "end-" + name);
}
// Set default settings
island.setFlagsDefaults();
}