CoreLib 是一个用于处理数据的库类模组。
功能
额外的编解码器(Codecs)
CoreLib 提供了针对多种新类的编解码器,包括但不限于:
- BigInteger
- BigDecimal
- GameProfile
- OptionalLong
- RegistryKey
- TagKey
自动编解码器生成
CoreLib 可以自动解析给定类的编解码器,包括带有类型参数的泛型类。
它还可以为任何枚举以及几乎所有记录(Record)动态创建新的编解码器。
只要 CoreLib 能够解析该记录所有组件的编解码器,它就能解析记录的编解码器。
自动数据保存/加载
CoreLib 还包含一个 SaveData<T> 类,负责处理数据与磁盘之间的保存和加载。继承自此类的一些类会自动保存和加载你的数据。其中一个适用于附加到实例(整合包)的数据,另一个则适用于附加到每个世界(存档文件)的数据。
自动数据同步
CoreLib 包含一个 SyncedData<T> 类,用于通过名为 Synchronisation 的工具类将数据自动同步到客户端。
CoreLib 包含实现了此接口的 SaveData<T> 类,并会自动向_所有_客户端进行同步。
CoreLib is a library mod for data handling.
Features
Extra codecs
CoreLib comes with new codecs for classes including, but not limited to:
- BigInteger
- BigDecimal
- GameProfile
- OptionalLong
- RegistryKey
- TagKey
Automatic codec generation
CoreLib can automatically resolve codecs for given classes, including generic classes with type parameters.
It can also dynamically create new codecs for any enum, as well almost any record.
CoreLib can resolve a codec for a record as long as it can also resolve a codec for all the record's components.
Automatic data saving / loading
CoreLib also features a SaveData<T> class, which handles saving and loading data to and from the disk. Certain classes that extend from this class automatically save and load your data. One is meant for data attached to an instance (modpack), while the other is meant for data attached to each world (save file).
Automatic data synchronisation
CoreLib includes a SyncedData<T> class, for automatically synchronising data to client through a utility class called Synchronisation.
CoreLib includes SaveData<T> classes that implement this interface and are automatically synced to all clients.
评论 0
登录后参与评分
还没有评论,来抢沙发吧