跳到正文

Replacement Finder

作者:tfarecnim

A mod to help track down registry replacements that lead to mod incompatibilties

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

Overview

 

Once upon a time, the most popular way to mod was by changing the class files in the minecraft jar and distributing those.  But there was a problem.

If more than 1 mod touched the same class, then it was extremely difficult to fix because of overwriting.  Hence a mod api was created and agreed upon so that mods could add their stuff without changing base classes and causing hard incompatibilities.  This was all well and good until mods wanted to change the properties of vanilla objects.

It could be done using a coremod, however, it was so difficult that most people either didn’t bother or wrote coremods so fragile that if another mod touched it would cause errors.

So in 1.12, registry replacement was invented as a way of allowing mods to alter vanilla blocks without coremods.  However, it has several issues.

 

1) Only one mod per pack can override an object at a time, last one takes priority.  Furthermore, there is no way to choose which mod “wins” since mod loading is nondeterministic and can change at any time.

 

2) Unlike coremods which usually only cause issues when touching the same method, registry replacements of the same object are always incompatible regardless of what they change.

 

3) The only way to be compatible with other mods that registry replaces is to write specific compats for every mod and those mods need to add support in turn or everything breaks down.  This is often infeasible in the case of ARR/closed source mods where implementing code can be problematic.  In either case, automatic hard incompatibility is a very bad thing.

 

4) These objects are cached everywhere in vanilla code including the fields of some objects, leading to issues in replacing some of them. (Cough DefaultBiomeFeatures).

 

So, in an effort to help identify such problematic mods, I created a tool that logs registry replacement of vanilla objects to track down incompatibilities.  It will log any registry replacement that happens and what class it was replaced with.  Example snippit below.

 

 

.Such mods should seek to find a more mod friendly way to alter blocks such as coremods or mixins as outright replacement is too destructive to be used on vanilla objects.

常见问题

Replacement Finder 支持哪些 Minecraft 版本?

Replacement Finder 支持 Minecraft Java 版 1.15.2–1.16.3,共 2 个版本。下载时注意选择和你游戏版本一致的文件。

Replacement Finder 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 模组加载器,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。

评论

登录后评论和评分

tfarecnim 的其他作品

查看全部 →