HybridFix (混合修复)
为 Forge+Bukkit 服务器和客户端环境提供一系列错误修复、优化和实用工具。
已修复的问题
Forge-Bukkit
- Bukkit 插件无法处理某些模组爆炸(例如 Tinkers' Construct EFLN)
- 将部分 Forge 事件桥接至 Bukkit
Forge
- (通用) 修复 Forge JarDiscoverer 尝试读取
module-info.class 及其他多版本类文件的问题。
- (服务端) 修复在服务器完全启动前 Ping 信息中显示
Outdated server 的问题。
模组
通用
- 将 Quark 脆弱的 ASM 转换器补丁替换为 Mixins
- 修复 Aether Legacy 中 Swet 的 AI 控制问题
客户端
- 将 Industrial Craft 2 中昂贵的反射调用替换为直接调用
服务端
- Simple Difficulty、ToughAsNails(及任何类似模组)中的口渴值在玩家重生时未重置 (Luohuayu/CatServer#536)(MohistMC/Mohist#2905)
- The Betweenlands 模组中的戒指复制漏洞 (Luohuayu/CatServer#204)
- 模拟原版玩家重生逻辑,大多数因玩家死亡导致的复制漏洞应已修复
- 修复 Twilight Forest 树苗可绕过反破坏插件保护的问题
- 修复 Twilight Forest 实体(如 Naga)可在受保护区域破坏方块的问题
- 修复 Twilight Forest Chain with Block 可在受保护区域破坏方块的问题
- 修复 Thaumcraft 6 的污秽可扩散至受保护区域的问题
- 修复 Thaumcraft 6 的 Flux Rift 可在受保护区域破坏方块的问题
- 修复 Tinkers' Construct 的特性效果可绕过伤害保护的问题
- 修复 So Many Enchantments 可在受保护区域解除玩家武装的问题
- 修复 Botania Loki 戒指可绕过反破坏保护的问题
- 修复 Botania MineLens 可绕过反破坏保护的问题
- 修复 Botania Rannuncarpus 可绕过反破坏保护的问题
- 修复 Industrial Craft 2 矿工可在受保护区域破坏方块的问题
- 修复 Industrial Craft 2 炸药可在受保护区域破坏方块的问题
- 修复 Draconic Evolution ChaosCrystal 可在受保护区域破坏方块的问题
- 修复 TechReborn(RebornCore) 爆炸可在受保护区域破坏方块的问题
- 为 Applied Energistics 2 Spatial Pylon 提供事件以防止某些未经授权的破坏行为
- 修复 TechGuns 爆炸可破坏受保护区域方块的问题
- 为 Applied Energistics 2 Spatial Pylon 添加实体黑名单/白名单
- 修复 InfernalMobs 的网络可在受保护区域生成
- 修复 EpicSiegeMod 怪物 AI 可在受保护区域进行破坏
- 禁用 Industrial Foregoing 中的 Blackhole Controller 配方(已弃用)
- 修复 Witchery 法术可绕过伤害保护的问题
- 自动修改 Actually Additions 的配置以适配服务器环境
- 防止 Mekanism Digital Miner 挖掘方块实体
功能特性
- 使用自有方法自动覆盖 Mohist 糟糕的内置爆炸处理机制。
- 将 Forge 权限处理桥接至 Bukkit。
- 若无注册监听器,则跳过事件触发。
- 禁用 Timings 以降低性能开销。
- 兼容性优先,不应破坏任何模组/插件。
- 将 Bukkit 插件内置于模组中,为服务器管理员提供实用工具。
- 增强与 FakePlayers 模组的兼容性。
- 为插件开发者提供 API,使其能轻松与 Forge 模组交互。
- 为模组开发者提供丰富的 API,以便轻松维护混合服务器的兼容性。
- 通用 CraftBukkit 性能改进。
- 当安装 Censored ASM 时,自动去混淆插件堆栈跟踪信息以便于调试。
- 跨 ClassLoader 访问,使 Forge 模组能轻松与 Bukkit 插件交互。(详情)
- 从现代版本回溯移植 Bukkit API。
- 内置插件 ASM 补丁器,兼容你喜爱的插件。
- 支持 Bukkit 插件 Mixin,允许通过模组向插件注入代码。 (实验性) (文档)
- 扩展 Forge 的错误恢复系统(
removeErroringEntities 和 removeErroringTileEntities),在发生错误时通知服务器操作员。
- 保护玩家 Tick 过程,踢出玩家而非直接导致崩溃。
- 修复影响服务器游玩体验的 Forge Bug。
- (通用) 优化实体 AI,以实现更快的最近目标查找。
配置文件位于 ${minecraftDir}/config/hybridfix.cfg
如何使用(服务器管理员)
从 CurseForge 下载 HybridFix 及其依赖项(MixinBooter 和 ConfigAnyTime),将 HybridFix 放入 ${minecraftDir}/mods 文件夹。
HybridFix 也可安装在客户端,部分客户端侧的修复和优化将会生效。
如何使用(开发者)
如果你正在开发模组,可以从 Curse Maven 导入 HybridFix:
Gradle (Groovy DSL):
implementation fg.deobf("curse.maven:hybridfix-1166614:{latest_artifact_id}")
如果你正在开发插件,可以直接导入 HybridFix jar:
Maven:
<dependency>
<groupId>io.wdsj</groupId>
<artifactId>hybridfix</artifactId>
<version>{latest_version}</version>
<scope>system</scope>
<systemPath>PATH-TO-JAR</systemPath>
</dependency>
Gradle (Groovy DSL):
compileOnly files("PATH-TO-JAR")
API 位于 io.wdsj.hybridfix.api 和 io.wdsj.hybridfix.duck.api 包中。
插件钩子
得益于 HybridFix 内部插件,我们可以从 Forge 端挂钩到插件以提供更多修复。
目前支持的插件:
插件 ASM 补丁器
HybridFix 使用 ASM 在运行时动态向插件类中注入代码,以解决插件与 Forge+Bukkit 环境的兼容性问题。
当前支持的插件:
- Residence:修复与 Residence 6.0.0.0+ 的兼容性问题。
- Universal:将 InventoryView INVOKEINTERFACE 调用重定向为 INVOKEVIRTUAL。
关于 FakePlayers(假玩家)
HybridFix 使用 Forge 的 FakePlayer 来修复一些破坏漏洞,其命名逻辑为 [modid-ClassName]。
例如,botania rannuncarpus 补丁使用的假玩家名称为 [botania-SubTileRannuncarpus]。
你可以将这些名称添加到你所用插件的白名单/黑名单中,以自定义其行为。
命令
/hybridfix dumpitem - 显示手持物品的详细信息。
/hybridfix dumpentity - 显示目标实体的详细信息。
/hybridfix dumpblock - 显示目标方块的详细信息。
/hybridfix version - 显示版本信息。
/hybridfix eraseentity - 强制移除目标实体。
/mods - 类似于 /plugins,显示所有已加载的模组。
权限
hybridfix.command.use - 允许使用 /hybridfix 命令。
hybridfix.command.eraseentity.use - 允许使用 /hybridfix eraseentity 命令。
hybridfix.command.mods.use - 允许使用 /mods 命令。
注意:命令和权限在 Bukkit 侧注册,这意味着你可以使用 LuckPerms 等 Bukkit 权限插件来管理权限。
许可证
本模组采用 LGPL-2.1 许可证。
向后移植的 Bukkit 类采用 GPL-3.0 许可证。
除非代码中明确指定,否则其他部分均遵循 LGPL-2.1 许可证。
仓库中包含的去混淆并重新映射的 CraftBukkit JAR 文件仅用于开发目的,不包含在发布版本中。
HybridFix (混合修复)
Provide a bunch of bugfixes, optimizations and utilities for Forge+Bukkit server and client environments.
Fixed issues
Forge-Bukkit
- Bukkit plugins cannot handle some mod explosions(e.g., Tinkers' Construct EFLN)
- Bridge some Forge events to Bukkit
Forge
- (Universal) Fix Forge JarDiscoverer attempting to read
module-info.class and other multi-release classes.
- (Server) Fix
Outdated server showing in ping before server fully boots.
Mods
Common
- Replace brittle asm transformer patches of Quark with mixins
- Fix Swet AI control of Aether Legacy
Client
- Replace expensive reflection usages in Industrial Craft 2 with direct calls
Server
- Simple Difficulty, ToughAsNails(And any other similar mods) thirst is not getting reset on player respawn(Luohuayu/CatServer#536)(MohistMC/Mohist#2905)
- Ring dupe bug in The Betweenlands mod(Luohuayu/CatServer#204)
- Simulate vanilla player respawn, most dupe bugs on player death should be fixed
- Fix Twilight Forest saplings can bypass the anti-grief plugin protection bug
- Fix Twilight Forest entities(e.g. Naga) can break blocks in protected areas
- Fix Twilight Forest Chain with Block can break blocks in protected areas
- Fix Thaumcraft 6 taint can spread into protected areas
- Fix Thaumcraft 6 flux rift can break blocks in protected areas
- Fix trait effects in Tinkers' Construct can bypass damage protection
- Fix So Many Enchantments can disarm players in protected areas
- Fix Botania Ring of Loki can bypass grief protection
- Fix Botania MineLens can bypass grief protection
- Fix Botania Rannuncarpus can bypass grief protection
- Fix Industrial Craft 2 miners can break blocks in protected areas
- Fix Industrial Craft 2 explosives can break blocks in protected areas
- Fix Draconic Evolution ChaosCrystal can break blocks in protected areas
- Fix TechReborn(RebornCore) explosions can break blocks in protected areas
- Offer events to Applied Energistics 2 Spatial Pylon to prevent some unpermitted griefing
- Fix TechGuns explosion can break blocks in protected areas
- Add entity blacklist/whitelist to Applied Energistics 2 Spatial Pylon
- Fix webs of InfernalMobs can spawn in protected areas
- Fix EpicSiegeMod mob AIs can grief in protected areas
- Disable recipe of Blackhole Controller (Deprecated) in Industrial Foregoing
- Fix Witchery spells can bypass damage protection
- Auto modify Actually Additions' config to make it fit the server environment
- Prevent Mekanism Digital Miner from mining tile entities
Features
- Auto overrides Mohist's crappy built-in explosion handling with our own method.
- Bridge Forge permission processing to Bukkit.
- Skip firing event if no listeners registered.
- Disable Timings for lower performance overhead.
- Compatibility first, shouldn't break any mods/plugins.
- Built Bukkit plugin into the mod, offers utilities to server owners.
- Enhance compatibility with mod FakePlayers.
- Offer more or less useful apis for plugin developers to interact with Forge mods easily.
- Extensive APIs for mod developers to maintain compatibility with hybrid servers easily.
- General CraftBukkit performance improvements.
- Auto deobfuscate plugin stacktraces when Censored ASM is installed for easier debugging.
- Cross ClassLoader access, make Forge mods can easily interact with Bukkit plugins. (Details)
- Bukkit APIs backported from modern version.
- Builtin plugin ASM patcher, compatible with your favourite plugins.
- Bukkit plugin mixin support, allows you to inject code into plugins via mods. (Experimental) (Docs)
- Extend Forge's error recovery system (
removeErroringEntities and removeErroringTileEntities), notify server operators when errors occurred.
- Guard player ticking process, kick player instead of directly crash.
- Fix Forge bugs that affect server play experience.
- (Universal) Optimize entity AI for faster nearest target lookup.
Configuration file is under ${minecraftDir}/config/hybridfix.cfg
How To (Server Admins)
Download HybridFix and its dependencies(MixinBooter and ConfigAnyTime) from CurseForge, drop HybridFix into ${minecraftDir}/mods folder.
HybridFix can be also installed on the client, some client-side fixes and optimizations will apply.
How To (Developers)
If you are developing mods, you can import HybridFix from curse maven:
Gradle(Groovy DSL):
implementation fg.deobf("curse.maven:hybridfix-1166614:{latest_artifact_id}")
If you are developing plugins, you can import HybridFix jar directly:
Maven:
<dependency>
<groupId>io.wdsj</groupId>
<artifactId>hybridfix</artifactId>
<version>{latest_version}</version>
<scope>system</scope>
<systemPath>PATH-TO-JAR</systemPath>
</dependency>
Gradle(Groovy DSL):
compileOnly files("PATH-TO-JAR")
APIs are located at io.wdsj.hybridfix.api and io.wdsj.hybridfix.duck.api package.
Plugin Hooks
Thanks to HybridFix internal plugin, we can hook into plugins from Forge side to provide more fixes.
Currently patched plugins:
Plugin ASM patcher
HybridFix uses ASM to inject into plugin classes dynamically at runtime
to resolve plugin compatibility problems with Forge+Bukkit environment.
Currently supported plugins:
- Residence: Fixes compatibility with Residence 6.0.0.0+.
- Universal: Redirects InventoryView INVOKEINTERFACE call to INVOKEVIRTUAL.
About FakePlayers
HybridFix utilizes Forge FakePlayer to fix some grief bugs, the naming logic is [modid-ClassName].
For example, the botania rannuncarpus patch is using the fake player with name [botania-SubTileRannuncarpus].
You can add these names into whitelist/blacklist of your plugins to customize behavior.
Commands
/hybridfix dumpitem - Show details of the item holding in the hand.
/hybridfix dumpentity - Show details of the entity targeted.
/hybridfix dumpblock - Show details of the block targeted.
/hybridfix version - Show version info.
/hybridfix eraseentity - Forcibly remove targeted entity.
/mods - Like /plugins, show all loaded mods.
Permissions
hybridfix.command.use - Allow to access /hybridfix command.
hybridfix.command.eraseentity.use - Allow to access /hybridfix eraseentity command.
hybridfix.command.mods.use - Allow to access /mods command.
Note: Commands and permissions are registered on Bukkit side, that means you can manage permissions with Bukkit permission plugins like LuckPerms.
License
This mod is licensed under LGPL-2.1.
Backported Bukkit classes are licensed under GPL-3.0.
Unless explicitly specified in the code, other parts are under LGPL-2.1.
The stripped MCP remapped CraftBukkit JAR in the repository is for development use only and not included in releases.
评论 0
登录后参与评分
还没有评论,来抢沙发吧