Add relative side and direction nullable codecs

This commit is contained in:
DBotThePony 2025-04-11 06:54:52 +07:00
parent 77443ee801
commit e9a0983ab2
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -39,6 +39,8 @@ object StreamCodecs {
val BLOCK_TYPE = MatteryStreamCodec.Of(FriendlyByteBuf::writeBlockType, FriendlyByteBuf::readBlockType)
val RELATIVE_SIDE = MatteryStreamCodec.Enum<FriendlyByteBuf, RelativeSide>(RelativeSide::class.java)
val DIRECTION = MatteryStreamCodec.Enum<FriendlyByteBuf, Direction>(Direction::class.java)
val RELATIVE_SIDE_NULLABLE = RELATIVE_SIDE.nullable()
val DIRECTION_NULLABLE = DIRECTION.nullable()
val RGBA: MatteryStreamCodec<ByteBuf, RGBAColor> = StreamCodec.of<ByteBuf, RGBAColor>(
{ s, v -> s.writeFloat(v.red); s.writeFloat(v.green); s.writeFloat(v.blue); s.writeFloat(v.alpha) },