From cb868962235f17467d07aed26a78170f17421678 Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Sun, 3 Nov 2024 19:34:57 +0700 Subject: [PATCH] "fix": doesn't work --- .../java/me/chayapak1/chomens_bot/plugins/PositionPlugin.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/chayapak1/chomens_bot/plugins/PositionPlugin.java b/src/main/java/me/chayapak1/chomens_bot/plugins/PositionPlugin.java index 95efe62..5bce50a 100644 --- a/src/main/java/me/chayapak1/chomens_bot/plugins/PositionPlugin.java +++ b/src/main/java/me/chayapak1/chomens_bot/plugins/PositionPlugin.java @@ -161,6 +161,7 @@ public class PositionPlugin extends Bot.Listener { // for now this is used in CorePlugin when placing the command block private void handleHeightLimit () { final int y = position.getY(); + final int minY = bot.world.minY; final int maxY = bot.world.maxY; if (y < maxY) { @@ -183,7 +184,7 @@ public class PositionPlugin extends Bot.Listener { position = newPosition; - if (position.getY() > maxY + 500) { + if (position.getY() > maxY + 500 || position.getY() < minY) { String command = "/"; if (bot.serverPluginsManager.hasPlugin(ServerPluginsManagerPlugin.ESSENTIALS)) command += "essentials:";