mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-09-28 14:47:30 +02:00
Revert "Added null checking for world when changing worlds"
This reverts commit 054934fded
.
This commit is contained in:
parent
054934fded
commit
1dc566922b
@ -55,7 +55,7 @@ public class JoinLeaveListener implements Listener {
|
|||||||
if (!players.isKnown(playerUUID)) {
|
if (!players.isKnown(playerUUID)) {
|
||||||
firstTime(user);
|
firstTime(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure the player is loaded into the cache or create the player if they don't exist
|
// Make sure the player is loaded into the cache or create the player if they don't exist
|
||||||
players.addPlayer(playerUUID);
|
players.addPlayer(playerUUID);
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ public class JoinLeaveListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -130,11 +130,8 @@ public class JoinLeaveListener implements Listener {
|
|||||||
*/
|
*/
|
||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
public void onPlayerSwitchWorld(final PlayerChangedWorldEvent event) {
|
public void onPlayerSwitchWorld(final PlayerChangedWorldEvent event) {
|
||||||
World world = Util.getWorld(event.getPlayer().getWorld());
|
|
||||||
// Clear inventory if required
|
// Clear inventory if required
|
||||||
if (world != null) {
|
clearPlayersInventory(Util.getWorld(event.getPlayer().getWorld()), User.getInstance(event.getPlayer()));
|
||||||
clearPlayersInventory(world, User.getInstance(event.getPlayer()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -217,13 +214,13 @@ public class JoinLeaveListener implements Listener {
|
|||||||
|
|
||||||
// Call Protection Range Change event. Does not support cancelling.
|
// Call Protection Range Change event. Does not support cancelling.
|
||||||
IslandEvent.builder()
|
IslandEvent.builder()
|
||||||
.island(island)
|
.island(island)
|
||||||
.location(island.getCenter())
|
.location(island.getCenter())
|
||||||
.reason(IslandEvent.Reason.RANGE_CHANGE)
|
.reason(IslandEvent.Reason.RANGE_CHANGE)
|
||||||
.involvedPlayer(user.getUniqueId())
|
.involvedPlayer(user.getUniqueId())
|
||||||
.admin(true)
|
.admin(true)
|
||||||
.protectionRange(range, oldRange)
|
.protectionRange(range, oldRange)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user