From 5186696d1c5e99a1db118f7860b984d983d045b7 Mon Sep 17 00:00:00 2001 From: mathias Date: Thu, 1 Aug 2019 17:25:44 +0300 Subject: [PATCH] Async chunk loading on teleport --- src/main/java/pw/kaboom/extras/commands/CommandSpawn.java | 2 +- .../java/pw/kaboom/extras/modules/player/PlayerDamage.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/pw/kaboom/extras/commands/CommandSpawn.java b/src/main/java/pw/kaboom/extras/commands/CommandSpawn.java index 6ed7e47..b8dd1c7 100644 --- a/src/main/java/pw/kaboom/extras/commands/CommandSpawn.java +++ b/src/main/java/pw/kaboom/extras/commands/CommandSpawn.java @@ -25,7 +25,7 @@ class CommandSpawn implements CommandExecutor { if (!coordBlock.getType().isSolid() && !coordBlock.getRelative(BlockFace.UP).getType().isSolid()) { - player.teleport(yLocation); + player.teleportAsync(yLocation); break; } } diff --git a/src/main/java/pw/kaboom/extras/modules/player/PlayerDamage.java b/src/main/java/pw/kaboom/extras/modules/player/PlayerDamage.java index c25cfd0..9c917bb 100644 --- a/src/main/java/pw/kaboom/extras/modules/player/PlayerDamage.java +++ b/src/main/java/pw/kaboom/extras/modules/player/PlayerDamage.java @@ -68,7 +68,7 @@ class PlayerDamage implements Listener { } if (player.getBedSpawnLocation() != null) { - player.teleport(player.getBedSpawnLocation()); + player.teleportAsync(player.getBedSpawnLocation()); } else { final World world = Bukkit.getWorld("world"); final Location spawnLoc = world.getSpawnLocation(); @@ -79,7 +79,7 @@ class PlayerDamage implements Listener { if (!coordBlock.getType().isSolid() && !coordBlock.getRelative(BlockFace.UP).getType().isSolid()) { - player.teleport(yLocation); + player.teleportAsync(yLocation); return; } }