Sky Resources 2

Sky Resources 2

3M Downloads

API: IslandLeaveEvent NPE

Opened this issue ยท 2 comments

commented

Im using yours API, but when try get island position of leaved island, got NPE because getIslandPosition() returns null.

My code:

	@SubscribeEvent
	public void onIslandLeave(IslandLeaveEvent event) {
		Player player = Sponge.getServer().getPlayer(event.getPlayerUUID()).get();
		System.out.println("Player " + player.getName());
		System.out.println("Position " + event.getIslandPosition() );  <----  null object
        .......

Console output:

[09:38:52] [Server thread/INFO] [STDOUT]: [net.rebelgames.srbridge.SRBridge:onIslandLeave:141]: Player HunterzCZ
[09:38:52] [Server thread/INFO] [STDOUT]: [net.rebelgames.srbridge.SRBridge:onIslandLeave:142]: Position null

IslandCreateEvent, IslandInviteEvent works without problem.

commented

Looking into it soon

commented

Fixed in next version.

Also, note that if a island pos is null after the next update, it means the player doesn't have an island :D (I think, been a while since I put it in)