From 20a3e45effa6f173d158fcff5ecda4e24ec50b0e Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Tue, 15 Apr 2025 19:48:49 -0700 Subject: [PATCH] Fix wrong color for a player going too high & add a new detection method for the player going too high --- .../xyz/lncvrt/galaxylobby/listener/PlayerMoveListener.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/xyz/lncvrt/galaxylobby/listener/PlayerMoveListener.kt b/src/main/kotlin/xyz/lncvrt/galaxylobby/listener/PlayerMoveListener.kt index 51d391c..51cc2a5 100644 --- a/src/main/kotlin/xyz/lncvrt/galaxylobby/listener/PlayerMoveListener.kt +++ b/src/main/kotlin/xyz/lncvrt/galaxylobby/listener/PlayerMoveListener.kt @@ -21,10 +21,10 @@ class PlayerMoveListener(val plugin: GalaxyLobbyPlugin) : Listener { if (location.y < 0) { plugin.resetPlayer(player, true) player.sendComponent(MessageFormat.setPrefix("You happy with yourself?")) - } else if (location.y > 200) { - location.y = 200.0 + } else if (player.world.maxHeight < location.y) { + location.y = player.world.maxHeight.toDouble() player.teleport(location) - player.sendComponent(MessageFormat.setPrefix(MessageFormat.setSecondaryColor("You can't go that high!"))) + player.sendComponent(MessageFormat.setPrefix(MessageFormat.setPrimaryColor("You can't go that high!"))) } }