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 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()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user