forked from GeyserMC/Geyser
Merge pull request #134 from Tim203/geyser-identity
Added a simple way to identify Geyser players.
This commit is contained in:
commit
6fb819c27b
2 changed files with 19 additions and 0 deletions
|
@ -95,6 +95,7 @@ public class TranslatorsInit {
|
|||
|
||||
public static void start() {
|
||||
Registry.registerJava(ServerJoinGamePacket.class, new JavaJoinGameTranslator());
|
||||
Registry.registerJava(ServerPluginMessagePacket.class, new JavaPluginMessageTranslator());
|
||||
Registry.registerJava(ServerChatPacket.class, new JavaChatTranslator());
|
||||
Registry.registerJava(ServerTitlePacket.class, new JavaTitleTranslator());
|
||||
Registry.registerJava(ServerUpdateTimePacket.class, new JavaUpdateTimeTranslator());
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
package org.geysermc.connector.network.translators.java;
|
||||
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.client.ClientPluginMessagePacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.server.ServerPluginMessagePacket;
|
||||
import org.geysermc.connector.GeyserConnector;
|
||||
import org.geysermc.connector.network.session.GeyserSession;
|
||||
import org.geysermc.connector.network.translators.PacketTranslator;
|
||||
|
||||
public class JavaPluginMessageTranslator extends PacketTranslator<ServerPluginMessagePacket> {
|
||||
@Override
|
||||
public void translate(ServerPluginMessagePacket packet, GeyserSession session) {
|
||||
if (packet.getChannel().equals("minecraft:brand")) {
|
||||
session.getDownstream().getSession().send(
|
||||
new ClientPluginMessagePacket(packet.getChannel(), GeyserConnector.NAME.getBytes())
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue