Fixed mishandling in PortalTeleportationListener

it's a very stupid mistake... Which caused the "to End" teleportation to teleport the player to the Nether...
This commit is contained in:
Florian CUNY 2019-02-27 14:25:32 +01:00 committed by GitHub
parent d68817863a
commit bbeefc20ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,7 +81,7 @@ public class PortalTeleportationListener implements Listener {
// If this is from the island nether, then go to the same vector, otherwise try island home location
Location to = plugin.getIslands().getIslandAt(e.getFrom()).map(i -> i.getSpawnPoint(Environment.NORMAL)).orElse(e.getFrom().toVector().toLocation(overWorld));
e.setCancelled(true);
// Else other worlds teleport to the nether
// Else other worlds teleport to the overworld
new SafeSpotTeleport.Builder(plugin)
.entity(e.getPlayer())
.location(to)
@ -90,7 +90,7 @@ public class PortalTeleportationListener implements Listener {
return true;
}
// TO END
World endWorld = plugin.getIWM().getNetherWorld(overWorld);
World endWorld = plugin.getIWM().getEndWorld(overWorld);
// If this is to island End, then go to the same vector, otherwise try spawn
Location to = plugin.getIslands().getIslandAt(e.getFrom()).map(i -> i.getSpawnPoint(Environment.THE_END)).orElse(e.getFrom().toVector().toLocation(endWorld));
e.setCancelled(true);
@ -161,4 +161,4 @@ public class PortalTeleportationListener implements Listener {
.build();
return true;
}
}
}