Update Bot.java

Added a ping response from the server
This commit is contained in:
huper1 authored and GitHub committed 2024-08-04 00:14:02 +03:00
1 parent fb99076f88
commit 9d6f7a5598
1 file changed
+3
@@ -99,6 +99,9 @@ public class Bot extends Thread {
client.send(new ServerboundAcceptTeleportationPacket(p.getTeleportId())); client.send(new ServerboundAcceptTeleportationPacket(p.getTeleportId()));
} }
else if (packet instanceof ClientboundPingPacket) {
client.send(new ServerboundPongPacket(((ClientboundPingPacket) packet).getId()));
}
else if (packet instanceof ClientboundPlayerCombatKillPacket){ else if (packet instanceof ClientboundPlayerCombatKillPacket){
if (Main.autoRespawnDelay >= 0) { if (Main.autoRespawnDelay >= 0) {
Log.info("Bot " + nickname + " died. Respawning in " + Main.autoRespawnDelay + " ms."); Log.info("Bot " + nickname + " died. Respawning in " + Main.autoRespawnDelay + " ms.");