mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-12-22 08:37:49 +01:00
Sync this
This commit is contained in:
parent
2350a9e6d2
commit
6c8ba0d7ef
@ -120,13 +120,20 @@ public class Utils {
|
||||
final int fY = y;
|
||||
final Location loc = new Location(world, x, y + 0.6D, z);
|
||||
|
||||
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(pl, loc);
|
||||
AuthMe.getInstance().getServer().getPluginManager().callEvent(tpEvent);
|
||||
if(!tpEvent.isCancelled()) {
|
||||
if (!tpEvent.getTo().getWorld().getChunkAt(tpEvent.getTo()).isLoaded())
|
||||
tpEvent.getTo().getWorld().getChunkAt(tpEvent.getTo()).load();
|
||||
pl.teleport(tpEvent.getTo());
|
||||
}
|
||||
Bukkit.getScheduler().runTask(AuthMe.getInstance(), new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(pl, loc);
|
||||
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()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user