概览
本模组使用 Mixins(混入)技术而非注册表替换,提供了一种更兼容其他模组、侵入性更低的熔炉优化方案,且支持仅在服务端运行。
如需了解更详细的信息,请阅读下方的折叠内容。
也许你会好奇,既然已经有类似的模组了,为什么还要发布这个呢?
Forge 不是已经有这个模组了吗?
嗯,你说得对,但它存在一个主要缺陷:注册表替换。
简而言之,注册表替换允许模组开发者替换游戏中的任何方块/物品/流体等,并用其自身的子类进行替代。
然而,这种方法有几个问题。
1) 在一个整合包中,只能有一个模组对同一目标进行注册表替换。如果有多个模组尝试替换同一个方块,其他的覆盖操作将被丢弃。
2) 所有对旧对象的引用将失效,可能导致不良行为,例如破坏其他模组甚至原版游戏本身(试着去替换石头吧,我敢打赌你做不到。)
3) 如果子类覆盖了那些方法且没有调用 super(父类方法),那么所有的 mixins、核心模组等都不会被调用。(这就是为什么 blast processing [爆炸处理] 无法与普通的快速熔炉配合工作,因为它替换了原版熔炉的 tick 函数,导致我的 mixins 无法生效。)
Mixin 版本相比注册表替换版本的优势在于:
1) 它不使用注册表替换,因此可以与其他修改熔炉的模组良好兼容。
2) 由于它不修改注册表,因此可以仅在服务端运行,因为处理逻辑只发生在(逻辑)服务端上(是的,该模组在单人游戏中也能正常工作)。
3) 没有方法被覆盖,因此可以与其他注入相同方法的模组协同工作。
注意:本模组需要 mixinbootstrap,但如果希望,可以仅在服务端运行
需要定制模组并支付合理费用?只是想聊聊?或者有复杂问题需要进一步讨论?欢迎加入 Discord:
Overview
This mod uses Mixins instead of registry replacement for a more mod friendly, less invasive way of optimizing the furnace that can also be done server only.
For more detailed info read the spoiler below.
Now what you might be wondering is why release this at all then?
Doesn't Forge already have this mod?
Well yes, you would be correct, however, it has one major flaw: registry replacement.
In essence, what registry replacement does is allow a modder to replace any block/item/fluid, etc... in the game and subsitute it with their own subclass.
However, there's a few catches.
1) Only one mod in a pack can registry replace per pack, if more than one mod attempts to registry replace the same block, the other overrides will be discarded.
2) All references to the old object become invalid and can lead to bad behavior such as breaking other mods or even vanilla itself (try registry replacing stone, I dare you.)
3) All mixins, coremods, etc will not get called if the subclass overrides those methods and doesn't call super (why blast processing won't work with normal fast furnace, as it replaces the tick function of the vanilla furnace so my own mixins won't apply)
The advantages of the mixin version vs the registry replacement version is:
1) it doesn't use registry replacement so it will work fine with other mods that modify the furnace.
2) Because it doesn't modify registries, it can be ran serverside only as processing only happens on the (logical) server (yes, the mod still works in singleplayer).
3) No methods are overridden so it will work with other mods injecting into the same method.
Note: this mod does require mixinbootstrap but can be ran serverside only if desired
Need a custom mod for a reasonable fee? Just want to chat? Have a complex issue needing additional discussion? Come join the Discord:
评论 0
登录后参与评分
还没有评论,来抢沙发吧