Sync this

This commit is contained in:
Xephi 2013-04-14 15:42:39 +02:00
parent 2350a9e6d2
commit 6c8ba0d7ef

View File

@ -120,13 +120,20 @@ public class Utils {
final int fY = y; final int fY = y;
final Location loc = new Location(world, x, y + 0.6D, z); final Location loc = new Location(world, x, y + 0.6D, z);
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(pl, loc); Bukkit.getScheduler().runTask(AuthMe.getInstance(), new Runnable() {
AuthMe.getInstance().getServer().getPluginManager().callEvent(tpEvent);
if(!tpEvent.isCancelled()) { @Override
if (!tpEvent.getTo().getWorld().getChunkAt(tpEvent.getTo()).isLoaded()) public void run() {
tpEvent.getTo().getWorld().getChunkAt(tpEvent.getTo()).load(); AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(pl, loc);
pl.teleport(tpEvent.getTo()); AuthMe.getInstance().getServer().getPluginManager().callEvent(tpEvent);
} if(!tpEvent.isCancelled()) {
if (!tpEvent.getTo().getChunk().isLoaded())
tpEvent.getTo().getChunk().load();
pl.teleport(tpEvent.getTo());
}
}
});
id = Bukkit.getScheduler().runTaskTimer(AuthMe.authme, new Runnable() id = Bukkit.getScheduler().runTaskTimer(AuthMe.authme, new Runnable()
{ {