mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-06 18:49:39 +01:00
let bukkit load the chunk
This commit is contained in:
parent
872856e729
commit
3ede8f0dae
@ -216,17 +216,15 @@ public class Utils {
|
|||||||
if (theWorld == null)
|
if (theWorld == null)
|
||||||
theWorld = pl.getWorld();
|
theWorld = pl.getWorld();
|
||||||
final World world = theWorld;
|
final World world = theWorld;
|
||||||
final Location locat = new Location(world, x, y, z);
|
final Location loc = new Location(world, x, y, z);
|
||||||
|
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
|
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(pl, locat);
|
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(pl, loc);
|
||||||
plugin.getServer().getPluginManager().callEvent(tpEvent);
|
plugin.getServer().getPluginManager().callEvent(tpEvent);
|
||||||
if (!tpEvent.isCancelled()) {
|
if (!tpEvent.isCancelled()) {
|
||||||
if (!tpEvent.getTo().getChunk().isLoaded())
|
|
||||||
tpEvent.getTo().getChunk().load();
|
|
||||||
pl.teleport(tpEvent.getTo());
|
pl.teleport(tpEvent.getTo());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user