From 62781f9f881629d8195dcb44a10bb341320474fc Mon Sep 17 00:00:00 2001 From: Daniel Saukel Date: Sun, 15 May 2016 18:49:20 +0200 Subject: [PATCH] Fix respawn task console errors --- .../java/io/github/dre2n/dungeonsxl/task/RespawnTask.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/github/dre2n/dungeonsxl/task/RespawnTask.java b/src/main/java/io/github/dre2n/dungeonsxl/task/RespawnTask.java index a497ad33..a5d2e2f8 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/task/RespawnTask.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/task/RespawnTask.java @@ -38,8 +38,10 @@ public class RespawnTask extends BukkitRunnable { @Override public void run() { - if (player.getLocation().distance(location) > 2) { - PlayerUtil.secureTeleport(player, location); + if (player.getWorld() == location.getWorld()) { + if (player.getLocation().distance(location) > 2) { + PlayerUtil.secureTeleport(player, location); + } } DGlobalPlayer dPlayer = DungeonsXL.getInstance().getDPlayers().getByPlayer(player);