Skip to content

Commit

Permalink
Fixes error when island is reset.
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Dec 29, 2019
1 parent d36f02d commit b4a8f08
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ public void onIslandEnterEvent(IslandEnterEvent e) {
}

@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onIslandExitEvent(IslandDeleteEvent e) {
OfflinePlayer p = Bukkit.getOfflinePlayer(e.getOwner());
if (p.isOnline()) {
BorderAPI.getApi().resetWorldBorderToGlobal(p.getPlayer());
public void onIslandDeleteEvent(IslandDeleteEvent e) {
if (e.getPlayerUUID() != null) {
OfflinePlayer p = Bukkit.getOfflinePlayer(e.getPlayerUUID());
if (p.isOnline()) {
BorderAPI.getApi().resetWorldBorderToGlobal(p.getPlayer());
}
}
}

Expand Down

0 comments on commit b4a8f08

Please sign in to comment.