Fixed teleportation bug.

This commit is contained in:
Wertík 2020-03-31 22:54:21 +02:00 committed by Brianna
parent 2c86e6e89b
commit eb5e7f3399

View File

@ -180,13 +180,15 @@ public class Teleport implements Listener {
@EventHandler
public void onEntityTeleport(EntityPortalEvent e) {
WorldManager worldManager = skyblock.getWorldManager();
// Do not handle player
if (e.getEntityType() == EntityType.PLAYER)
return;
Location from = e.getFrom();
Location to = e.getTo();
// Test which world the event is from
if (from.getWorld() == to.getWorld())
if (to == null || from.getWorld() == to.getWorld())
return;
if (worldManager.getIslandWorld(e.getFrom().getWorld()) != null)