diff --git a/plugin/src/main/java/net/elytrium/limboapi/injection/login/LoginTasksQueue.java b/plugin/src/main/java/net/elytrium/limboapi/injection/login/LoginTasksQueue.java index bc027dbd..be00a881 100644 --- a/plugin/src/main/java/net/elytrium/limboapi/injection/login/LoginTasksQueue.java +++ b/plugin/src/main/java/net/elytrium/limboapi/injection/login/LoginTasksQueue.java @@ -89,7 +89,7 @@ public class LoginTasksQueue { private static final BiConsumer MC_CONNECTION_SETTER; private static final MethodHandle CONNECT_TO_INITIAL_SERVER_METHOD; private static final MethodHandle SET_CLIENT_BRAND; - private static final BiConsumer BRAND_CHANNEL_SETTER; + public static final BiConsumer BRAND_CHANNEL_SETTER; private final LimboAPI plugin; private final Object handler; diff --git a/plugin/src/main/java/net/elytrium/limboapi/server/LimboPlayerImpl.java b/plugin/src/main/java/net/elytrium/limboapi/server/LimboPlayerImpl.java index f26767f2..cc16a49d 100644 --- a/plugin/src/main/java/net/elytrium/limboapi/server/LimboPlayerImpl.java +++ b/plugin/src/main/java/net/elytrium/limboapi/server/LimboPlayerImpl.java @@ -43,6 +43,7 @@ import net.elytrium.limboapi.api.protocol.packets.data.AbilityFlags; import net.elytrium.limboapi.api.protocol.packets.data.MapData; import net.elytrium.limboapi.api.protocol.packets.data.MapPalette; +import net.elytrium.limboapi.injection.login.LoginTasksQueue; import net.elytrium.limboapi.protocol.packets.s2c.ChangeGameStatePacket; import net.elytrium.limboapi.protocol.packets.s2c.MapDataPacket; import net.elytrium.limboapi.protocol.packets.s2c.PlayerAbilitiesPacket; @@ -299,8 +300,9 @@ private void sendToRegisteredServer(RegisteredServer server) { if (this.connection.getProtocolVersion().compareTo(ProtocolVersion.MINECRAFT_1_20_2) >= 0) { this.sessionHandler.disconnectToConfig(() -> { // Rollback original CONFIG handler - this.connection.setActiveSessionHandler(StateRegistry.CONFIG, - new ClientConfigSessionHandler(this.plugin.getServer(), this.player)); + ClientConfigSessionHandler handler = new ClientConfigSessionHandler(this.plugin.getServer(), this.player); + LoginTasksQueue.BRAND_CHANNEL_SETTER.accept(handler, "minecraft:brand"); + this.connection.setActiveSessionHandler(StateRegistry.CONFIG, handler); this.player.createConnectionRequest(server).fireAndForget(); }); } else {