diff --git a/src/main/java/me/chayapak1/chomens_bot/plugins/ChatPlugin.java b/src/main/java/me/chayapak1/chomens_bot/plugins/ChatPlugin.java index efaf9335..33a048e3 100644 --- a/src/main/java/me/chayapak1/chomens_bot/plugins/ChatPlugin.java +++ b/src/main/java/me/chayapak1/chomens_bot/plugins/ChatPlugin.java @@ -266,10 +266,14 @@ public class ChatPlugin extends Bot.Listener { } public void sendCommandInstantly (String command) { + if (!bot.loggedIn) return; + bot.session.send(new ServerboundChatCommandPacket(command)); } public void sendChatInstantly (String message) { + if (!bot.loggedIn) return; + bot.session.send(new ServerboundChatPacket( message, Instant.now().toEpochMilli(), 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 5bce50a3..e3ebc783 100644 --- a/src/main/java/me/chayapak1/chomens_bot/plugins/PositionPlugin.java +++ b/src/main/java/me/chayapak1/chomens_bot/plugins/PositionPlugin.java @@ -43,7 +43,7 @@ public class PositionPlugin extends Bot.Listener { // notchian clients also does this, sends the position packet every second bot.executor.scheduleAtFixedRate(() -> { - if (isGoingDownFromHeightLimit) return; + if (!bot.loggedIn || isGoingDownFromHeightLimit) return; bot.session.send(new ServerboundMovePlayerPosPacket( false,