Auto Network Lib 是一个自动化的网络数据包序列化库。
特性:
- 自动序列化和反序列化网络数据包中的字段
- 在主线程中自动处理数据包
- 内置了大多数常用数据类型的序列化器
- 您可以为默认不支持的类型添加自定义序列化器
- 支持泛型列表的序列化
- 支持泛型集合(Set)的序列化
- 支持泛型映射(Map)的序列化
- 支持 Java 数组的序列化
- 支持在泛型集合内部嵌套其他泛型集合的序列化
- 支持任何枚举类型(Enum)的序列化
- 针对性能进行了优化
描述
在编写网络代码时,模组开发者需要手动对数据包中的所有字段进行序列化和反序列化。本库可以自动完成这一过程,从而避免您编写样板代码。您只需在数据包中声明字段即可。 Minecraft 的网络代码运行在与主游戏线程分离的独立线程中,因此在进行任何操作之前,您需要将任务调度到主线程并在其中处理所有逻辑。本库会自动将任务调度到主线程。 开箱即用,本库支持以下数据类型的序列化:int, long, float, double, boolean, Integer, Long, Float, Double, Boolean, String, NBTTagCompound, ItemStack, char, byte, short, Character, Byte, Short, BlockPos, Vec3d, Color3f 本库可以自动序列化以下泛型 Java 集合:List<T>, ArrayList<T>, Stack<T>, Vector<T>, LinkedList<T>, Set<T>, HashSet<T>, Map<T,K>, HashMap<T,K> 本库可以自动序列化任意类型的数组,但目前仅支持一维数组。 本库可以自动序列化嵌套在其他受支持的泛型集合内的受支持泛型集合。例如,它可以序列化以下数据类型:HashMap<Integer, List<Integer>>, List<List<List<String>>>, HashMap<List<String>, List<Integer>> 针对性能进行了优化。反射仅在第一次序列化数据包时使用一次,之后不再需要反射。此外,它使用方法句柄(method handles)而非反射来读写数据,这比通过反射访问数据更快。
Auto Network Lib is an automatic network packet serialization library.
Features:
- Automatic serialization and deserialization of fields in a network packet
- Automatic packet handling in main thread
- Built in serializers of most common data types
- You can add your own serializer for a type that is not supported by default
- Can serialize generic lists
- Can serialize generic sets
- Can serialize generic maps
- Can serialize java arrays
- Can serialize generic collection inside generic collection
- Can serialize any Enum
- Optimized for perfomance
Description
When writing network code modders need to manually serialize and deserialize all fields in a packet. This library can do it automatically so that you don't have to write boiler plate code. You only need to declare fields in a packet. Networking code in Minecraft is running in a separate thread from main game thread and because of this before doing anything you need to schedule task in main thread and handle everything in there. This library automatically schedules task in main thread. Out of the box this library supports serialization for following data types: int, long, float, double, boolean, Integer, Long, Float, Double, Boolean, String, NBTTagCompound, ItemStack, char, byte, short, Character, Byte, Short, BlockPos, Vec3d, Color3f This library can automatically serialize following generic java collections: List<T>, ArrayList<T>, Stack<T>, Vector<T>, LinkedList<T>, Set<T>, HashSet<T>, Map<T,K>, HashMap<T,K> This library can automatically serialize arrays of any type but currently only one dimensional arrays supported. This library can automatically serialize supported generic collections inside of other supported generic collections. For example it can serialize following data types: HashMap<Integer, List<Integer>>, List<List<List<String>>>, HashMap<List<String>, List<Integer>> Optimized for perfomance. Reflection is used only once on first serialization of packet after that no reflection is needed. Also it uses method handles instead of reflection to read and write data which is faster then access via reflection.
下载 Auto Network Lib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Auto Network Lib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Auto Network Lib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Auto Network Lib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Auto Network Lib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Auto Network Lib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Auto Network Lib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Auto Network Lib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Auto Network Lib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Auto Network Lib
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
最后一次更改:
已更改 Maven 仓库
来自之前测试版的更新日志:
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
查看物品与配方
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
适用于 MC 1.18+ 的 Effekseer 加载器
模组
添加区块认领和玩家组队功能,并与 Xaero's Minimap 和 World Map 集成
评论 0
登录后参与评分
还没有评论,来抢沙发吧