概览
ElegantNetworking 是一个数据包系统框架,旨在让 MinecraftForge 模组中的客户端-服务器交互变得尽可能简单。
数据包声明示例:
以及数据包的使用方式:
这就是你需要的一切!
主要功能
- 数据包自动注册
- 只需通过注解标记数据包类即可
- 你可以忘记频道和数据包 ID 了
- 自动序列化/反序列化
- 支持原始类型、集合、数据类(POJO)以及整体代数数据类型
- 存在可覆盖序列化逻辑的机制
- 发送的数据结构和接收处理器集中在同一位置
- API 设计旨在不依赖 Minecraft 的具体版本
- 兼容混淆器(测试较少)
快速开始
请查看 主仓库中的 readme.md
致谢
感谢 @Dahaka934 进行的讨论与审查
感谢 @tox1cozZ 提醒我注意注解处理器
感谢 @Plasticable 建议使用 gradle 4.4.1(虽已不再适用,但在当时很有帮助)
感谢 @Icosider 就 gradle 配置提供的咨询
感谢 @AmaZ1nG 提出的关于 NBT 及其他在模组开发中常用基础类型序列化的想法
感谢 @CDAGaming 提供了与 gradle 5+ 兼容的 FG2.1 分支
感谢 @Liahim85 设计了精美的 Logo
链接
源代码
Overview
ElegantNetworking is a packet system framework which seeks to make client-server interaction in MinecraftForge mods as easy as possible.
Example of packet declaration:
And usage of packet:
And that's all you need!
General features
- Auto-registration of packets
- enough to mark packet class by annotation
- you can forget about the channel and packet id's
- Automatic serialization/deserialization
- supported primitives, collections, data-classes(POJO) and algebric data types overall
- exists able to override logic of serialization
- Sendable data structure and receiving handler is localised in one place
- Design of api is offers to do not depend on the version of Minecraft
- Compatible with obfuscators(less tested)
Getting started
Look for readme.md at main repository
Gratitudes
Thx @Dahaka934 for discussion and review
Thx @tox1cozZ for drew my attention to the annotation processors
Thx @Plasticable for advice of using gradle 4.4.1 (not actualy, but helpful in due time)
Thx @Icosider for consulting about gradle configuration
Thx @AmaZ1nG for idea about serialization of nbt and other basic types that useful in modding
Thx @CDAGaming for the fork of FG2.1 that compatible with gradle 5+
Thx @Liahim85 for pretty logo
Links
Source Code
评论 0
登录后参与评分
还没有评论,来抢沙发吧