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

View File

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