mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-28 05:05:14 +01:00
Remove REALLY old loading chunk system before teleport
This commit is contained in:
parent
f149c21eb7
commit
8ad2fde798
@ -69,12 +69,8 @@ public class ProcessSyncronousPlayerLogin implements Runnable {
|
|||||||
protected void teleportBackFromSpawn() {
|
protected void teleportBackFromSpawn() {
|
||||||
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(player, limbo.getLoc());
|
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(player, limbo.getLoc());
|
||||||
pm.callEvent(tpEvent);
|
pm.callEvent(tpEvent);
|
||||||
if (!tpEvent.isCancelled()) {
|
if (!tpEvent.isCancelled() && tpEvent.getTo() != null) {
|
||||||
Location fLoc = tpEvent.getTo();
|
player.teleport(tpEvent.getTo());
|
||||||
if (!fLoc.getChunk().isLoaded()) {
|
|
||||||
fLoc.getChunk().load();
|
|
||||||
}
|
|
||||||
player.teleport(fLoc);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,12 +78,8 @@ public class ProcessSyncronousPlayerLogin implements Runnable {
|
|||||||
Location spawnL = plugin.getSpawnLocation(player);
|
Location spawnL = plugin.getSpawnLocation(player);
|
||||||
SpawnTeleportEvent tpEvent = new SpawnTeleportEvent(player, player.getLocation(), spawnL, true);
|
SpawnTeleportEvent tpEvent = new SpawnTeleportEvent(player, player.getLocation(), spawnL, true);
|
||||||
pm.callEvent(tpEvent);
|
pm.callEvent(tpEvent);
|
||||||
if (!tpEvent.isCancelled()) {
|
if (!tpEvent.isCancelled() && tpEvent.getTo() != null) {
|
||||||
Location fLoc = tpEvent.getTo();
|
player.teleport(tpEvent.getTo());
|
||||||
if (!fLoc.getChunk().isLoaded()) {
|
|
||||||
fLoc.getChunk().load();
|
|
||||||
}
|
|
||||||
player.teleport(fLoc);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user