Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-11-20 06:50:09 +01:00
Added a response to the PluginMessage packet in the Login state
Dieser Commit ist enthalten in:
Ursprung
41a24ca6ab
Commit
b97fa2b1c8
@ -40,6 +40,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.ServerSetSlotPacket;
|
||||||
import com.github.steveice10.mc.protocol.packet.ingame.server.window.ServerWindowItemsPacket;
|
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.ingame.server.world.*;
|
||||||
|
import com.github.steveice10.mc.protocol.packet.login.server.LoginPluginRequestPacket;
|
||||||
import com.nukkitx.nbt.CompoundTagBuilder;
|
import com.nukkitx.nbt.CompoundTagBuilder;
|
||||||
import com.nukkitx.nbt.NbtUtils;
|
import com.nukkitx.nbt.NbtUtils;
|
||||||
import com.nukkitx.nbt.stream.NBTOutputStream;
|
import com.nukkitx.nbt.stream.NBTOutputStream;
|
||||||
@ -94,6 +95,8 @@ public class TranslatorsInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void start() {
|
public static void start() {
|
||||||
|
Registry.registerJava(LoginPluginRequestPacket.class, new JavaLoginPluginMessageTranslator());
|
||||||
|
|
||||||
Registry.registerJava(ServerJoinGamePacket.class, new JavaJoinGameTranslator());
|
Registry.registerJava(ServerJoinGamePacket.class, new JavaJoinGameTranslator());
|
||||||
Registry.registerJava(ServerPluginMessagePacket.class, new JavaPluginMessageTranslator());
|
Registry.registerJava(ServerPluginMessagePacket.class, new JavaPluginMessageTranslator());
|
||||||
Registry.registerJava(ServerChatPacket.class, new JavaChatTranslator());
|
Registry.registerJava(ServerChatPacket.class, new JavaChatTranslator());
|
||||||
|
@ -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<LoginPluginRequestPacket> {
|
||||||
|
@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)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren