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;
}
Aggregations