AttributeFix Sync
AttributeFix Sync 是 AttributeFix 模组的一个非官方附加组件,旨在解决服务器端修改的属性上限未同步到客户端的问题。
问题描述
在原始的 AttributeFix 中,如果你在服务器配置中修改了属性的上限(例如 generic.max_health 或 generic.attack_damage):
- 服务器会根据你的配置正确计算伤害和生命值(例如,限制为 5000)。
- 客户端仍然使用默认上限(例如,1,000,000)。
- 结果:Jade、WTHIT 或原版血条等模组会显示错误的数值,因为客户端不知道服务器施加的更严格限制。
功能
本模组通过数据包同步解决了上述问题:
- 自动同步:当玩家加入服务器时,模组会自动将服务器上配置的所有属性上限(最大值)发送给客户端。
- 内存补丁:接收到数据后,客户端会通过 Mixin 动态修改内存中的属性定义。
- 正确可视化:Jade、WTHIT 和原版血条现在将根据实际服务器限制正确显示数值。
- 无污染:当玩家断开连接时,模组会自动将客户端的属性上限恢复为原始状态,确保单人世界或其他服务器不受影响。
安装与使用
依赖项
使用方法
- 服务器:必需。无需配置。它会自动读取 AttributeFix 的最终值并发送给玩家。
- 客户端:必需。用于接收同步数据包。
配置
客户端配置文件位于 config/attributefixsync-client.toml。
| 选项 |
默认值 |
描述 |
enableSync |
true |
是否接受来自服务器的属性上限同步。 |
showSyncMessages |
true |
是否在同步属性时显示聊天消息。 |
注意:要更改实际的属性上限(例如最大生命值),请编辑位于 config/attributefix/ 中的 AttributeFix 配置文件。
许可证与致谢
本项目采用 MIT License 许可。
- 核心逻辑基于 Minecraft NeoForge API。
- 特别感谢 Darkhax 开发了原始的 AttributeFix 模组。本模组仅作为其补充工具存在。
这不是 Darkhax 的官方作品。如果您遇到与同步相关的问题,请在此仓库报告,而不是联系原作者。
AttributeFix Sync
AttributeFix Sync is an unofficial addon for the AttributeFix mod, designed to solve the synchronization issue where modified attribute limits on the server are not reflected on the client.
The Problem
In the original AttributeFix, if you modify the upper limit of an attribute (e.g., generic.max_health or generic.attack_damage) in the server configuration:
- The Server correctly calculates damage and health based on your config (e.g., capped at 5000).
- The Client still uses the default limit (e.g., 1,000,000).
- Result: Mods like Jade, WTHIT, or the vanilla health bar display incorrect values because the client isn't aware of the stricter limit enforced by the server.
Features
This mod solves the above problem via packet synchronization:
- Automatic Synchronization: When a player joins the server, the mod automatically sends all attribute limits (Max Values) configured on the server to the client.
- In-Memory Patching: Upon receiving the data, the client dynamically modifies the attribute definitions in memory via Mixin.
- Correct Visualization: Jade, WTHIT, and vanilla bars will now correctly display values based on the actual server limits.
- Pollution-Free: When the player disconnects, the mod automatically restores the client's attribute limits to their original state, ensuring single-player worlds or other servers are not affected.
Installation & Usage
Dependencies
- Minecraft: 1.21.1
- Loader: NeoForge
- Required Mod: AttributeFix
Usage
- Server: Required. No configuration needed. It automatically reads the final values from AttributeFix and sends them to players.
- Client: Required. Necessary to receive the synchronization packets.
Configuration
The client configuration file can be found at config/attributefixsync-client.toml.
| Option |
Default |
Description |
enableSync |
true |
Whether to accept attribute limit synchronization from the server. |
showSyncMessages |
true |
Whether to show a chat message when attributes are synchronized. |
Note: To change the actual attribute limits (e.g., max health), please edit the AttributeFix config files located in config/attributefix/.
License & Credits
This project is licensed under the MIT License.
- Core logic is based on the Minecraft NeoForge API.
- Special thanks to Darkhax for developing the original AttributeFix mod. This mod exists solely as a supplementary tool for it.
This is not an official work by Darkhax. If you have issues related to synchronization, please report them to this repository, not the original author.
评论 0
登录后参与评分
还没有评论,来抢沙发吧