Adds missing locations to the event builder.

Some addons check the location and have NPE's if it is not set.
This commit is contained in:
tastybento 2019-02-03 16:28:03 -08:00
parent bf1b59076c
commit 472b9fa7b6
2 changed files with 3 additions and 0 deletions

View File

@ -74,6 +74,7 @@ public class AdminRegisterCommand extends ConfirmableCommand {
user.sendMessage("general.success");
IslandBaseEvent event = IslandEvent.builder()
.island(i)
.location(i.getCenter())
.reason(IslandEvent.Reason.REGISTERED)
.involvedPlayer(targetUUID)
.admin(true)
@ -92,6 +93,7 @@ public class AdminRegisterCommand extends ConfirmableCommand {
user.sendMessage("general.success");
IslandBaseEvent event = IslandEvent.builder()
.island(i)
.location(i.getCenter())
.reason(IslandEvent.Reason.CREATED)
.involvedPlayer(targetUUID)
.admin(true)

View File

@ -54,6 +54,7 @@ public class AdminUnregisterCommand extends CompositeCommand {
user.sendMessage("general.success");
IslandBaseEvent event = IslandEvent.builder()
.island(oldIsland)
.location(oldIsland.getCenter())
.reason(IslandEvent.Reason.UNREGISTERED)
.involvedPlayer(targetUUID)
.admin(true)