From cac39a02ddb1143bfe927873464a912b3f785d05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Windy=20=E9=A3=8E=E5=90=9F?= <81475218+windy664@users.noreply.github.com> Date: Fri, 9 Aug 2024 15:50:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8C=87=E4=BB=A4=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/org/windy/teleportoffset/TeleportOffset.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/windy/teleportoffset/TeleportOffset.java b/src/main/java/org/windy/teleportoffset/TeleportOffset.java index 812c6af..2c0e7fc 100644 --- a/src/main/java/org/windy/teleportoffset/TeleportOffset.java +++ b/src/main/java/org/windy/teleportoffset/TeleportOffset.java @@ -85,6 +85,7 @@ public boolean onCommand(CommandSender sender, Command command, String label, St Location location = player.getLocation(); findHighestNonAirBlockLocation(location); player.teleport(location); + return true; }else{ sender.sendMessage(Texts.help); return true; @@ -139,7 +140,7 @@ public void onPlayerTeleport(PlayerTeleportEvent event) { // 在传送前设置玩家为无敌状态,确保玩家在传送过程中不会受到伤害 player.setInvulnerable(true); - // 获取玩家当前的实际 Y 坐标值并记录到日志中,以方便后续检查和比较 + // 获取玩家当前的实际 Y 坐标值并记录到日志中,以方便后续检查和比较 Bukkit.getScheduler().runTaskLaterAsynchronously(TeleportOffset.this, () -> { double currentY = player.getLocation().getY(); log("但是玩家" + playerName + "§c实际Y值是:" + currentY);