From 3dd98f10486f38064adf2503dd98b57023b2a588 Mon Sep 17 00:00:00 2001 From: snowleo Date: Tue, 16 Oct 2012 22:21:48 +0200 Subject: [PATCH] Always teleport in sync thread --- Essentials/src/net/ess3/Teleport.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Essentials/src/net/ess3/Teleport.java b/Essentials/src/net/ess3/Teleport.java index 2573f2442..9fcc5202f 100644 --- a/Essentials/src/net/ess3/Teleport.java +++ b/Essentials/src/net/ess3/Teleport.java @@ -233,11 +233,19 @@ public class Teleport implements Runnable, ITeleport teleTimer = ess.getPlugin().scheduleSyncRepeatingTask(this, 10, 10); } - private void now(Target target, TeleportCause cause) throws Exception + private void now(final Target target, final TeleportCause cause) throws Exception { cancel(); user.setLastLocation(); - user.getPlayer().teleport(LocationUtil.getSafeDestination(target.getLocation()), cause); + final Location loc = LocationUtil.getSafeDestination(target.getLocation()); + ess.getPlugin().scheduleSyncDelayedTask(new Runnable() + { + @Override + public void run() + { + user.getPlayer().teleport(loc, cause); + } + }); } @Override