From eb7feb4a87bdfb2ee8dfbb51ad4e01623c38fee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenzo=20Dellac=C3=A0?= Date: Wed, 24 Jun 2020 02:31:00 +0200 Subject: [PATCH] small lambda runnable change --- .../mindoverflow/hubthat/utils/TeleportUtils.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/mindoverflow/hubthat/utils/TeleportUtils.java b/src/main/java/net/mindoverflow/hubthat/utils/TeleportUtils.java index c558cbf..fd677b4 100644 --- a/src/main/java/net/mindoverflow/hubthat/utils/TeleportUtils.java +++ b/src/main/java/net/mindoverflow/hubthat/utils/TeleportUtils.java @@ -27,8 +27,11 @@ public class TeleportUtils if(player == null) return; fixInvisibilityBefore(player, location); - plugin.getServer().getScheduler().runTaskLater(plugin, () -> player.teleport(location), 1); - fixInvisibilityAfter(player); + plugin.getServer().getScheduler().runTaskLater(plugin, () -> + { + player.teleport(location); + fixInvisibilityAfter(player); + }, 1); } // Method to teleport a player, given its username and defined if it's a hub or a spawn. @@ -126,8 +129,12 @@ public class TeleportUtils // Store the location in a variable and teleport the player to it. final Location finalLocation = new Location(destinationWorld, x, y, z, (float)yaw, (float)pitch); fixInvisibilityBefore(player, finalLocation); - plugin.getServer().getScheduler().runTaskLater(plugin, () -> player.teleport(finalLocation), 1); - fixInvisibilityAfter(player); + plugin.getServer().getScheduler().runTaskLater(plugin, () -> + { + player.teleport(finalLocation); + fixInvisibilityAfter(player); + + }, 1); // Check if the player is teleporting to the hub. if(type == FileUtils.FileType.HUB_YAML)