use of org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayInClientSettings in project LanternServer by LanternPowered.
the class CodecPlayInClientSettings method decode.
@Override
public MessagePlayInClientSettings decode(CodecContext context, ByteBuffer buf) throws CodecException {
final Locale locale = LocaleCache.get(buf.readLimitedString(16));
final int viewDistance = buf.readByte();
final ChatVisibility visibility = ChatVisibilityRegistryModule.get().getByInternalId(buf.readByte()).get();
final boolean enableColors = buf.readBoolean();
final int skinPartsBitPattern = buf.readByte() & 0xff;
final HandPreference dominantHand = buf.readVarInt() == 1 ? HandPreferences.RIGHT : HandPreferences.LEFT;
return new MessagePlayInClientSettings(locale, viewDistance, visibility, dominantHand, enableColors, skinPartsBitPattern);
}
Aggregations