From 096a013ebd1cb7d6da2d6dcd2758fddb5800ae94 Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Sun, 20 Oct 2024 14:00:40 +0700 Subject: [PATCH] trying to fix gregnant horse, but not working i get timeout :( but yes, it is because of SRV records stuff. it seems to work by redirecting clients that do SRV to mc.pregnanthorse.net, which is the trap server. but since the minecraft client doesn't resolve any, it just uses pregnanthorse.net, which is the actual server. anyways, heres the exception Internal Exception: io.netty.channel.ConnectTimeoutException: connection timed out after 30000 ms: pregnant.horse/172.67.143.132:25565 --- src/main/java/me/chayapak1/chomens_bot/Bot.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/me/chayapak1/chomens_bot/Bot.java b/src/main/java/me/chayapak1/chomens_bot/Bot.java index 472ac51..28dcbd7 100644 --- a/src/main/java/me/chayapak1/chomens_bot/Bot.java +++ b/src/main/java/me/chayapak1/chomens_bot/Bot.java @@ -4,6 +4,7 @@ import me.chayapak1.chomens_bot.plugins.*; import me.chayapak1.chomens_bot.util.ComponentUtilities; import me.chayapak1.chomens_bot.util.RandomStringUtilities; import org.geysermc.mcprotocollib.auth.GameProfile; +import org.geysermc.mcprotocollib.network.BuiltinFlags; import org.geysermc.mcprotocollib.network.Session; import org.geysermc.mcprotocollib.network.event.session.*; import org.geysermc.mcprotocollib.network.packet.Packet; @@ -160,6 +161,10 @@ public class Bot { this.session = session; + // this replicates the minecraft behavior of not resolving SRV records. + // some servers check for this, so that's why i have it here + session.setFlag(BuiltinFlags.ATTEMPT_SRV_RESOLVE, false); + session.addListener(new SessionAdapter() { // fard