mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-28 05:35:44 +01:00
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:
parent
8452a080f7
commit
2713f58ac5
@ -172,6 +172,25 @@ public class NewIsland {
|
||||
// Delete the old island
|
||||
plugin.getIslands().deleteIsland(oldIsland, true);
|
||||
}
|
||||
|
||||
// Fire exit event
|
||||
Reason reasonDone = Reason.CREATED;
|
||||
switch (reason) {
|
||||
case CREATE:
|
||||
reasonDone = Reason.CREATED;
|
||||
break;
|
||||
case RESET:
|
||||
reasonDone = Reason.RESETTED;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
IslandEvent.builder()
|
||||
.involvedPlayer(user.getUniqueId())
|
||||
.reason(reasonDone)
|
||||
.island(island)
|
||||
.location(island.getCenter())
|
||||
.build();
|
||||
});
|
||||
// Make nether island
|
||||
if (plugin.getIWM().isNetherGenerate(world) && plugin.getIWM().isNetherIslands(world) && plugin.getIWM().getNetherWorld(world) != null) {
|
||||
@ -186,25 +205,6 @@ public class NewIsland {
|
||||
// Set default settings
|
||||
island.setFlagsDefaults();
|
||||
|
||||
// Fire exit event
|
||||
Reason reasonDone = Reason.CREATED;
|
||||
switch (reason) {
|
||||
case CREATE:
|
||||
reasonDone = Reason.CREATED;
|
||||
break;
|
||||
case RESET:
|
||||
reasonDone = Reason.RESETTED;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
IslandEvent.builder()
|
||||
.involvedPlayer(user.getUniqueId())
|
||||
.reason(reasonDone)
|
||||
.island(island)
|
||||
.location(island.getCenter())
|
||||
.build();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user