package Ġme . b scal . run ec raft . utils Ċ Ċ import Ġkotlinx . serialization .* Ċ import Ġkotlinx . serialization . builtins . List Serializer Ċ import Ġkotlinx . serialization . descriptors . Primitive Kind Ċ import Ġkotlinx . serialization . descriptors . Primitive Serial Descriptor Ċ import Ġkotlinx . serialization . descriptors . Serial Descriptor Ċ import Ġkotlinx . serialization . encoding . Decoder Ċ import Ġkotlinx . serialization . encoding . Encoder Ċ import Ġkotlinx . serialization . protobuf . Proto Buf Ċ import Ġnet . ax ay . k sp ig ot . data . NBT Data Ċ import Ġorg . bukkit . persistence . Persistent Data Adapter Context Ċ import Ġorg . bukkit . persistence . Persistent DataType Ċ Ċ class ĠN BT DataList Tag Type Ġ: ĠPersistent DataType < ByteArray , ĠList < NBT Data >> Ċ { Ċ ĉ override Ġfun Ġget Primitive Type (): ĠClass < ByteArray > Ġ= ĠByteArray :: class . java ĊĊ ĉ override Ġfun Ġget Complex Type (): ĠClass < List < NBT Data >> Ġ= ĠList :: class . java Ġas ĠClass < List < NBT Data >> ĊĊ ĉ override Ġfun Ġto Primitive ( complex : ĠList < NBT Data >, Ġcontext : ĠPersistent Data Adapter Context ): ĠByteArray Ċ ĉ { Ċĉ ĉ return ĠProto Buf . encode To ByteArray ( NBT DataList Serializer , Ġcomplex ) Ċ ĉ } ĊĊ ĉ override Ġfun Ġfrom Primitive ( primitive : ĠByteArray , Ġcontext : ĠPersistent Data Adapter Context ): ĠList < NBT Data > Ċ ĉ { Ċĉ ĉ return ĠProto Buf . decode From ByteArray ( NBT DataList Serializer , Ġprimitive ) Ċ ĉ } Ċ } Ċ Ċ object ĠN BT DataList Serializer Ġ: ĠK Serializer < List < NBT Data >> Ċ { Ċ ĉ private Ġval Ġdelegate Serializer Ġ= ĠList Serializer ( NBT Data Serializer ) Ċ ĉ override Ġval Ġdescriptor Ġ= ĠSerial Descriptor (" Object Open HashSet ", Ġdelegate Serializer . descriptor ) ĊĊ ĉ override Ġfun Ġdeserialize ( decoder : ĠDecoder ): ĠList < NBT Data > Ċ ĉ { Ċĉ ĉ return Ġdecoder . decode Serializable Value ( delegate Serializer ) Ċ ĉ } ĊĊ ĉ override Ġfun Ġserialize ( encoder : ĠEncoder , Ġvalue : ĠList < NBT Data >) Ċ ĉ { Ċĉ ĉ encoder . encode Serializable Value ( delegate Serializer , Ġvalue ) Ċ ĉ } Ċ } Ċ Ċ object ĠN BT Data Serializer Ġ: ĠK Serializer < NBT Data > Ċ { Ċ ĉ override Ġval Ġdescriptor : ĠSerial Descriptor Ċĉ ĉ get () Ġ= ĠPrimitive Serial Descriptor (" NBT Data ", ĠPrimitive Kind . STRING ) ĊĊ ĉ override Ġfun Ġdeserialize ( decoder : ĠDecoder ): ĠN BT Data Ċ ĉ { Ċĉ ĉ return ĠN BT Data . deserialize ( decoder . decode String ()) Ċ ĉ } ĊĊ ĉ override Ġfun Ġserialize ( encoder : ĠEncoder , Ġvalue : ĠN BT Data ) Ċ ĉ { Ċĉ ĉ encoder . encode String ( value . serialize ()) Ċ ĉ } Ċ Ċ }