mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-10-04 17:38:04 +02:00
Fixed teleportation bug.
This commit is contained in:
parent
2c86e6e89b
commit
eb5e7f3399
@ -180,13 +180,15 @@ public class Teleport implements Listener {
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onEntityTeleport(EntityPortalEvent e) {
|
public void onEntityTeleport(EntityPortalEvent e) {
|
||||||
WorldManager worldManager = skyblock.getWorldManager();
|
WorldManager worldManager = skyblock.getWorldManager();
|
||||||
|
|
||||||
// Do not handle player
|
// Do not handle player
|
||||||
if (e.getEntityType() == EntityType.PLAYER)
|
if (e.getEntityType() == EntityType.PLAYER)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Location from = e.getFrom();
|
Location from = e.getFrom();
|
||||||
Location to = e.getTo();
|
Location to = e.getTo();
|
||||||
// Test which world the event is from
|
|
||||||
if (from.getWorld() == to.getWorld())
|
if (to == null || from.getWorld() == to.getWorld())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (worldManager.getIslandWorld(e.getFrom().getWorld()) != null)
|
if (worldManager.getIslandWorld(e.getFrom().getWorld()) != null)
|
||||||
|
Loading…
Reference in New Issue
Block a user