use of org.dragonet.protocol.WrappedPEPacket in project DragonProxy by DragonetMC.
the class PCPluginMessagePacketTranslator method translate.
@Override
public PEPacket[] translate(UpstreamSession session, ServerPluginMessagePacket packet) {
if (packet.getChannel().equals("DragonProxy")) {
BinaryStream bis = new BinaryStream(packet.getData());
String command = bis.getString();
if (command.equals("PacketForward")) {
boolean enabled = bis.getBoolean();
session.getPacketProcessor().setPacketForwardMode(enabled);
} else if (command.equals("SendPacket")) {
WrappedPEPacket wrapped = new WrappedPEPacket(bis.getByteArray());
session.sendPacket(wrapped);
}
return null;
}
return null;
}
Aggregations