diff --git a/build-number.txt b/build-number.txt index 71db39d5..82c78282 100644 --- a/build-number.txt +++ b/build-number.txt @@ -1 +1 @@ -1216 \ No newline at end of file +1218 \ No newline at end of file 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 f603bcea..ab205625 100644 --- a/src/main/java/me/chayapak1/chomens_bot/plugins/PositionPlugin.java +++ b/src/main/java/me/chayapak1/chomens_bot/plugins/PositionPlugin.java @@ -166,7 +166,7 @@ public class PositionPlugin extends Bot.Listener { final int minY = bot.world.minY; final int maxY = bot.world.maxY; - if (y < maxY) { + if (y < maxY && y > minY) { if (isGoingDownFromHeightLimit) { isGoingDownFromHeightLimit = false; @@ -178,15 +178,7 @@ public class PositionPlugin extends Bot.Listener { isGoingDownFromHeightLimit = true; - final Vector3d newPosition = Vector3d.from( - position.getX(), - position.getY() - 2, - position.getZ() - ); - - position = newPosition; - - if (position.getY() > maxY + 500 || position.getY() < minY) { + if (y > maxY + 500 || y < minY) { String command = "/"; if (bot.serverPluginsManager.hasPlugin(ServerPluginsManagerPlugin.ESSENTIALS)) command += "essentials:"; @@ -198,6 +190,14 @@ public class PositionPlugin extends Bot.Listener { return; } + final Vector3d newPosition = Vector3d.from( + position.getX(), + position.getY() - 2, + position.getZ() + ); + + position = newPosition; + bot.session.send(new ServerboundMovePlayerPosPacket( false, false,