Merge remote-tracking branch 'origin/plugin' into plugin

This commit is contained in:
RednedEpic 2020-02-26 19:31:45 -06:00
commit f9a1656b8e
2 changed files with 19 additions and 0 deletions

View file

@ -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());

View file

@ -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)
);
}
}