diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/TranslatorsInit.java b/connector/src/main/java/org/geysermc/connector/network/translators/TranslatorsInit.java index 1268e3273..3cba0151f 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/TranslatorsInit.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/TranslatorsInit.java @@ -37,6 +37,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.server.window.ServerOpenW import com.github.steveice10.mc.protocol.packet.ingame.server.window.ServerSetSlotPacket; import com.github.steveice10.mc.protocol.packet.ingame.server.window.ServerWindowItemsPacket; import com.github.steveice10.mc.protocol.packet.ingame.server.world.*; +import com.github.steveice10.mc.protocol.packet.login.server.LoginPluginRequestPacket; import com.nukkitx.nbt.CompoundTagBuilder; import com.nukkitx.nbt.NbtUtils; import com.nukkitx.nbt.stream.NBTOutputStream; @@ -91,6 +92,8 @@ public class TranslatorsInit { } public static void start() { + Registry.registerJava(LoginPluginRequestPacket.class, new JavaLoginPluginMessageTranslator()); + Registry.registerJava(ServerJoinGamePacket.class, new JavaJoinGameTranslator()); Registry.registerJava(ServerPluginMessagePacket.class, new JavaPluginMessageTranslator()); Registry.registerJava(ServerChatPacket.class, new JavaChatTranslator()); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaLoginPluginMessageTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaLoginPluginMessageTranslator.java new file mode 100644 index 000000000..f92fca9f9 --- /dev/null +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaLoginPluginMessageTranslator.java @@ -0,0 +1,16 @@ +package org.geysermc.connector.network.translators.java; + +import com.github.steveice10.mc.protocol.packet.login.client.LoginPluginResponsePacket; +import com.github.steveice10.mc.protocol.packet.login.server.LoginPluginRequestPacket; +import org.geysermc.connector.network.session.GeyserSession; +import org.geysermc.connector.network.translators.PacketTranslator; + +public class JavaLoginPluginMessageTranslator extends PacketTranslator { + @Override + public void translate(LoginPluginRequestPacket packet, GeyserSession session) { + // A vanilla client doesn't know any PluginMessage in the Login state, so we don't know any either. + session.getDownstream().getSession().send( + new LoginPluginResponsePacket(packet.getMessageId(), null) + ); + } +}