SkyBlock Item List + Enhanced Storage 兼容
? 重要提示
本模组需要安装 旧版 的 Enhanced Storage(0.8.2 或更低版本),因为新版本对其代码库进行了完全重写“以提高可靠性和可维护性”。本模组将不会更新以支持新版 Enhanced Storage。
这是一个简单的模组,用于将 Enhanced Storage 与 SkyBlock Item List 进行整合。本模组主要实现两个功能:
- 实现一个 Item List 插件,以便在 Enhanced Storage 的界面中添加排除区域。
- 将 Enhanced Storage 的 UI 向下移动,防止其与 Item List 的分页控件重叠。
“常见”问题解答
我需要同时安装 SkyBlock Item List 和 Enhanced Storage 吗?
是的,本模组依赖于这两个模组,因为它会对 Enhanced Storage 进行补丁处理,并为 SkyBlock Item List 实现一个插件。如果你未同时安装这两个模组,游戏仍能正常运行,但本模组会在启动时检测到缺失的相关模组并自动禁用自身。
为什么只为了这个功能就创建一个单独的模组?
我最初的计划是向 Enhanced Storage GitHub 仓库 提交拉取请求。但不幸的是,由于以下原因,我不得不放弃该计划。
简短回答: Enhanced Storage 的源代码……嗯,我们就说它很“奇特”吧。尝试为其做出贡献的过程令人不快,且对我而言得不偿失,因此我得出的最佳行动方案就是为此创建一个单独的模组。
长篇(技术)回答:
Enhanced Storage 已经与其他一些模组实现了集成(主要是 Reliable Recipe Viewer 和 Skyblocker)。自然,我想遵循类似的代码模式以遵守维护者的惯例。
然而,上述集成是通过反射实现的,目的是将被集成的模组保持为软依赖(顺便说一句,这是不必要的,因为有更合理的方法可以实现这一点)。
要为 SkyBlock Item List 创建插件,你需要在其 API 中创建一个实现其 Plugin 接口 的类,并在你的模组的 fabric.mod.json 中添加一个 skyblock-item-list 入口点。
考虑到这一点,如果我想向 Enhanced Storage 提交拉取请求,我有三种选择:
-
遵循 Enhanced Storage 维护者进行集成的方式并使用反射。这将需要使用 Proxy 来实现 SkyBlock Item List 的 Plugin 接口,这对于此用例来说显然是杀鸡用牛刀。这还需要以某种方式通知 Item List 应用插件,而无需在模组的元数据文件中添加入口点,因为我假设维护者希望避免这种情况。出于明显的原因,我没有选择这个选项。
-
放弃 SkyBlock Item List 的插件 API 系统,直接通过反射注册排除区域。我不想这样做,因为这是一种非常黑客式的解决方案,并且如果 SkyBlock Item List 决定更新其内部排除区域注册系统,它将更容易出现不兼容问题。
-
忽略维护者的惯例,实际上将 SkyBlock Item List 作为依赖项添加(这仍被视为软依赖)。在贡献项目时,这是非常糟糕的做法,所以我出于原则不能选择这个选项。
既然这些选项都不令我满意,我试图通过模组主页上提供的 Discord 服务器联系维护者。然而,该服务器的结构简直是一场视觉灾难,我不愿参与其中。因此,我最终创建了本模组。
为什么不创建另一个存储覆盖模组?
我不想投入精力去启动这样一个具有实质性功能的项目,尤其是考虑到已经有模组(在很大程度上)很好地完成了这项工作。也许未来会考虑。
你会允许将此模组直接集成到 Enhanced Storage 中吗?
当然可以,前提是实现符合 GPL-3.0 许可协议,这也是本项目所采用的许可证。
Enhanced Storage 的维护者或贡献者也可以自由联系我以解决这个问题,无论是通过私信、Discord 上的共同服务器,还是其他讨论平台。
为什么这个模组的名字这么拗口?
是的。
SkyBlock Item List + Enhanced Storage Compatibility
? IMPORTANT
This mod requires an OLDER version of Enhanced Storage (0.8.2 or lower) to be installed, as newer versions include a complete rewrite of its codebase "to improve reliability and maintainability". This mod will not be updated to support newer versions of Enhanced Storage.
A simple mod to integrate Enhanced Storage with SkyBlock Item List. This mod does two things:
- Implement a Item List plugin to add exclusion zones with Enhanced Storage's screen.
- Shift Enhanced Storage's UI down to prevent it from overlapping with Item List's pagination controls.
"Frequently" Asked Questions
Do I need both SkyBlock Item List and Enhanced Storage installed?
Yes, this mod depends on both of these mods, as it patches Enhanced Storage and implements a plugin for SkyBlock Item List. Your game will run fine if you do not have both of these mods installed, but the mod will disable itself at launch when it detects either of the mentioned mods are missing.
Why create an entirely seperate mod just for this?
My original plan was to make a pull request to the Enhanced Storage GitHub repository. I unfortunately had to scratch the plan for reasons explained below.
Short answer: Enhanced Storage's source code is... well, let's just say "peculiar". Attempting to contribute on it was unpleasant and not worth the effort to me, and I have concluded that my best course of action is to just create a seperate mod for this.
Long (technical) answer:
Enhanced Storage already has some integrations done with other mods (namely Reliable Recipe Viewer and Skyblocker). Naturally, I wanted to follow a similar code pattern to follow the maintainer's conventions.
However, these aforementioned integrations were done via reflection in order to keep the mods being integrated a soft dependency (which, by the way, is unnecessary as there are much saner methods to achieve this).
In order to create a plugin for SkyBlock Item List, you need to create a class implementing their Plugin interface in their API and add a skyblock-item-list entrypoint in your mod's fabric.mod.json.
With this in mind, this situation left me with three options if I wanted to make a pull request to Enhanced Storage:
-
Follow Enhanced Storage's maintainer's way of making integrations and use reflection. This would require the use of a Proxy to implement the Plugin interface from SkyBlock Item List, which is very much overkill for this use case. This would also require to somehow signal Item List to apply the plugin without adding an entrypoint in the mod's metadata file, as I would assume the maintainer would want to avoid this. For obvious reasons, I did not choose this option.
-
Forgo SkyBlock Item List's plugin API system and directly register the exclusion zones via reflection. I did not want to do this as it is a very hacky solution, and it would be more susceptible to incompatibilities should SkyBlock Item List ever decide to update their internal exclusion zone registration system.
-
Ignore the maintainer's conventions and actually add SkyBlock Item List as a dependency (which would still be considered a soft dependency). This is very poor practice when it comes to contributing to a project, so I couldn't pick this option out of principle.
With none of these options being satisfactory to me, I attempted to contact the maintainer via the Discord server provided in the mod homepage. However, the server's structure was an absolute visual mess, and I did not want to engage in it. This has thus led me into creating this mod.
Why didn't you create another storage overlay mod instead?
I did not want to commit into starting a project with such a substantial feature yet, especially considering there's already a mod that does this (mostly) fine. Maybe in the future.
Will you allow this mod to be implemented directly into Enhanced Storage?
Sure, provided that the implementation complies with the GPL-3.0, which is what this project is licensed under.
The maintainer or contributors of Enhanced Storage are also free to contact me in order to work this out, whether that'd be through direct messages or a mutual server on Discord, or on a different discussion platform.
Why is the name of this mod such a mouthful?
Yes.
评论 0
登录后参与评分
还没有评论,来抢沙发吧