From b9afe9bc46ec76b9e9d2d85dc2fcaccf2eecce4d Mon Sep 17 00:00:00 2001 From: Hare Date: Tue, 9 Dec 2025 07:19:34 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=95=B4=E6=95=B0=E5=BA=A7=E6=A8=99?= =?UTF-8?q?=E3=81=AE=E8=A3=9C=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/net/hareworks/on_join_spawn/App.kt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/net/hareworks/on_join_spawn/App.kt b/src/main/kotlin/net/hareworks/on_join_spawn/App.kt index 9f0874d..9560c8b 100644 --- a/src/main/kotlin/net/hareworks/on_join_spawn/App.kt +++ b/src/main/kotlin/net/hareworks/on_join_spawn/App.kt @@ -26,7 +26,19 @@ class App : JavaPlugin(), Listener { } // Get the world's spawn location - val spawnLocation = player.world.spawnLocation + val spawnLocation = player.world.spawnLocation.clone() + + // Add 0.5 to X and Z coordinates if they are whole numbers + // This centers the player on the block + val x = spawnLocation.x + val z = spawnLocation.z + + if (x == x.toInt().toDouble()) { + spawnLocation.x = x + 0.5 + } + if (z == z.toInt().toDouble()) { + spawnLocation.z = z + 0.5 + } // Teleport player to spawn immediately // This happens before the player is fully loaded into the world