Search in sources :

Example 1 with Entry

use of org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutStatistics.Entry in project LanternServer by LanternPowered.

the class CodecPlayOutStatistics method encode.

@Override
public ByteBuffer encode(CodecContext context, MessagePlayOutStatistics message) throws CodecException {
    ByteBuffer buf = context.byteBufAlloc().buffer();
    Set<Entry> entries = message.getEntries();
    buf.writeVarInt(entries.size());
    for (Entry entry : entries) {
        buf.writeString(entry.getName());
        buf.writeVarInt(entry.getValue());
    }
    return buf;
}
Also used : Entry(org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutStatistics.Entry) ByteBuffer(org.lanternpowered.server.network.buffer.ByteBuffer)

Aggregations

ByteBuffer (org.lanternpowered.server.network.buffer.ByteBuffer)1 Entry (org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutStatistics.Entry)1