# AttributeUnification **Repository Path**: uicdb/AttributeUnification ## Basic Information - **Project Name**: AttributeUnification - **Description**: 本模组通过将一个属性的属性修饰器重定向到另一个属性,实现了类似功能的属性之间的统一。 可编辑配置文件以实现自己的需求。配置文件名为attributeunification-server.toml 举个例子: 很多模组都添加了暴击率,暴击效果等属性,且都有自己的实现,这会导致暴击重复生效,进而使得伤害数值大大超过预期。本模组通过重定向属性修饰器,把所有暴击的属性都重定向到神化的暴击属性。 - **Primary Language**: Java - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-03-06 - **Last Updated**: 2026-03-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # AttributeUnification AttributeUnification 是一个 Minecraft NeoForge 模组,用于统一和重定向属性修改器。 ## 概述 AttributeUnification 允许玩家和模组开发者配置属性修改器的重定向规则。通过本模组,您可以将一个属性的修改器自动应用到另一个属性上,实现属性的统一管理。 ## 功能特性 - **属性修改器重定向**:将一个属性的修改器重定向到另一个属性 - **配置灵活**:支持通过配置文件定义属性映射关系 - **Mixin 注入**:使用 Mixin 技术无缝注入到游戏属性系统中 - **客户端支持**:提供客户端专用功能 ## 技术架构 ### 核心组件 - **Attributeunification**: 主模组类,负责初始化和事件处理 - **AttributeunificationClient**: 客户端入口类 - **Config**: 配置管理类 - **ModifierRedirector**: 属性重定向核心逻辑 - **IAttributeInstanceWrap / IOriginValue**: 属性实例包装接口 ### Mixin 注入 - **AUAttributeInstanceMixin**: 注入到 `AttributeInstance` 类,处理属性值获取和修改器操作 - **AttributeMapMixin**: 注入到 `AttributeMap` 类,管理属性实例的创建 ## 安装要求 - Minecraft 1.20+ (NeoForge 版本) - NeoForge 模组加载器 ## 安装方法 1. 下载本模组的 JAR 文件 2. 将 JAR 文件放入 `.minecraft/mods` 文件夹中 3. 启动游戏 ## 配置说明 配置文件位于 `config/attributeunification-common.toml`。 ### ATTRIBUTES 配置 通过 `attributes` 配置项定义属性重定向规则: ```toml # 配置示例格式 attributes = ["l2damagetracker:crit_rate,apothic_attributes:crit_chance,0", "lovely_sparkle_pieces:critical_hit_chance,apothic_attributes:crit_chance,0", "critical_strike:chance,apothic_attributes:crit_chance,100,0.01", "l2damagetracker:crit_damage,apothic_attributes:crit_damage,0.5", "critical_strike:damage,apothic_attributes:crit_damage,100,0.01", "l2damagetracker:fire_damage,apothic_attributes:fire_damage,0,1", "l2damagetracker:bow_strength,apothic_attributes:arrow_damage,1,1"] ``` 每个配置项包含源属性和目标属性的映射关系,以及可选的转换函数。 ## 使用示例 配置属性重定向后,修改源属性的修饰符将自动应用到目标属性上。例如: ``` # 将属性 A 的所有修饰符重定向到属性 B ``` ## 构建项目 ```bash ./gradlew build ``` 生成的文件位于 `build/libs/` 目录下。 ## 许可证 本项目遵循 MIT 许可证。 ## 相关链接 - GitHub: https://github.com/uicdb/AttributeUnification - Gitee: https://gitee.com/uicdb/AttributeUnification