From 9fe91fe22c01a707b4998619a7372592dd6a3e52 Mon Sep 17 00:00:00 2001 From: HaHaWTH Date: Fri, 20 Oct 2023 21:30:36 +0800 Subject: [PATCH] Use TeleportUtils --- .../fr/xephi/authme/listener/LoginLocationFixListener.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/fr/xephi/authme/listener/LoginLocationFixListener.java b/src/main/java/fr/xephi/authme/listener/LoginLocationFixListener.java index 05eef86a..2b482322 100644 --- a/src/main/java/fr/xephi/authme/listener/LoginLocationFixListener.java +++ b/src/main/java/fr/xephi/authme/listener/LoginLocationFixListener.java @@ -2,6 +2,7 @@ package fr.xephi.authme.listener; import fr.xephi.authme.AuthMe; import fr.xephi.authme.api.v3.AuthMeApi; import fr.xephi.authme.settings.properties.SecuritySettings; +import fr.xephi.authme.util.TeleportUtils; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.World; @@ -50,7 +51,7 @@ public class LoginLocationFixListener implements Listener { boolean solved = false; for (BlockFace face : faces) { if (JoinBlock.getRelative(face).getType().equals(Material.AIR) && JoinBlock.getRelative(face).getRelative(BlockFace.UP).getType().equals(Material.AIR)) { - player.teleport(JoinBlock.getRelative(face).getLocation().add(0.5, 0.1, 0.5)); + TeleportUtils.teleport(player, JoinBlock.getRelative(face).getLocation().add(0.5, 0.1, 0.5)); solved = true; break; } @@ -77,12 +78,12 @@ public class LoginLocationFixListener implements Listener { if (JoinBlock.getRelative(BlockFace.DOWN).getType().equals(Material.LAVA)) { JoinBlock.getRelative(BlockFace.DOWN).setType(Material.DIRT); } - player.teleport(JoinBlock.getLocation().add(0.5, 0.1, 0.5)); + TeleportUtils.teleport(player, JoinBlock.getLocation().add(0.5, 0.1, 0.5)); player.sendMessage("§a你被埋住了, 坐标已修正, 下次下线之前请小心!"); break; } if (i == MaxHeight) { - player.teleport(JoinBlock.getLocation().add(0.5, 1.1, 0.5)); + TeleportUtils.teleport(player, JoinBlock.getLocation().add(0.5, 1.1, 0.5)); player.sendMessage("§a你被埋住了, 坐标无法修正, 只好送你去了最高点, 自求多福吧少年~"); } }