简介
Abstractium 是一个相对简单的模组,旨在提供工具以抽象模组与给定依赖项之间的交互代码。
它的作用是什么?
Abstractium 的分支结构大致如下:
- Abstractium = "Api" + "Minecraft Abstraction"(Minecraft 抽象层);
- Api = "Events"(事件系统)+ "Abstraction Tools"(抽象工具)。
Events(事件系统)的功能与其他大多数事件系统类似,但不同之处在于它还具备并发能力和基于字符串的标识系统。它用于保存 mixin 的主要“功能”,这些功能可能在其他更新中无法正常工作。
Abstraction Tools(抽象工具)提供了一种简便的方式来实现预定义调用的接口,即“抽象映射”(Abstraction Mappings)。不同版本的抽象映射通过入口点(entrypoint)进行注册。AbstractionHandler.java 类会自动处理所有版本控制问题。抽象映射还允许存在“子抽象”(sub-abstraction),即特定的调用子集可以驻留其中。以下是一个示例层级结构:
- AbstractClientCalls{
- AbstractRenderCalls{
- AbstractWorldRenderCalls{
- AbstractBlockRenderCalls{},
- AbstractEntityRenderCalls{} },
- AbstractGuiRenderCalls{} },
- AbstractWorldRenderCalls{
- AbstractSoundCalls{
- AbstractEntitySoundCalls{},
- AbstractBlockSoundCalls{} } }
- AbstractRenderCalls{
Minecraft Abstraction(Minecraft 抽象层)将上述内容整合在一起,为其他模组提供一个内置的抽象层。请注意,目前这远未完成。仅实现了让我的模组移植到该抽象层所需的最基本功能。如果你愿意贡献代码,请记住我只会接受适用于此 API 支持的所有内置版本的抽象实现。
如何使用它?
如果你想使用我内置的 Minecraft 抽象层,实际上非常简单!只需将我的模组添加到你的依赖列表中(文档即将发布),然后访问 AbstractiumClient#CLIENT_ABSTRACTION_HANDLER 或 AbstractiumCommon#COMMON_ABSTRACTION_HANDLER。如果你想创建自己的抽象处理逻辑,那就复杂得多,但你需要遵循 net.feltmc.abstractium.library 中的实现方式。未来某个时候会有一个维基(Wiki)。
开发路线图
目前目标相当有限。支持 fabric 1.18.2 到 最新版本。未来有可能性而非计划涉及以下内容:
- Code Wrapper(代码包装器):这将允许来自不同版本的模组在新版本上运行而无需修改。
- Legacy Support(旧版支持):支持低于 1.18.2 的版本。
- Forge Abstraction(Forge 抽象层):抽象并包装 Forge 代码(取决于另一个 PatchworkMC 项目)
为什么制作这个?
我制作这个 API 是因为 Mojang 喜欢重构他们自己的代码。我知道模组开发者们都同意我的观点,Mojang 的重构使得模组开发变得如此繁琐且令人沮丧。它迫使我们开发者将精力从改进模组转移到重写代码以适应最新版本上。此外,如果有人想维护多个版本,就必须用补丁/改进更新多个分支,这在后勤上是一场噩梦。对于用户来说,这导致许多模组分散在不同的版本中。这使得人们无法在最新版本的一个整合包中玩到他们所有的最爱模组。这种挫败感被积极地转化为一个雄心勃勃的 API,旨在彻底消除这些恼人的麻烦。
Summary
Abstractium is a moderately simple mod that provides tools to abstract interactive code between a mod and given dependency.
What does this do?
Abstractium's branch looks a little like this:
- Abstractium = "Api" + "Minecraft Abstraction";
- Api = "Events" + "Abstraction Tools";
Events function similarly to basically every other event system out there with the small difference that it also has concurrent capabilities and string-based identification systems. It is used to hold the main "function" of a mixin that potentially might not work in another update.
The Abstraction Tools provide an easy way to essentially implement an interface of pre-made calls a.k.a "Abstraction Mappings". The different versions of abstraction mappings are registered through an entrypoint. The AbstractionHandler.java class handles all the versioning automatically. The abstraction mappings also allow for "sub-abstraction", where a subset of specific calls can reside. Here is an example hierarchy:
- AbstractClientCalls{
- AbstractRenderCalls{
- AbstractWorldRenderCalls{
- AbstractBlockRenderCalls{},
- AbstractEntityRenderCalls{}
- },
- AbstractGuiRenderCalls{}
- AbstractWorldRenderCalls{
- },
- AbstractSoundCalls{
- AbstractEntitySoundCalls{},
- AbstractBlockSoundCalls{}
- }
- AbstractRenderCalls{
- }
The Minecraft Abstraction puts all this together to provide an inbuilt abstraction layer for other mods to use. Please keep in mind that this is far from finished. There is a bare minimum to get my mods ported to it but that's about it. If you feel like contributing, just keep in mind that I'll only accept abstractions that work for all inbuilt versions this api supports.
How do I use this?
Well if you do want to use my inbuilt minecraft abstraction, it's actually really easy! Just add my mod
to your dependency list (There will be documentation for that shortly) and access
AbstractiumClient#CLIENT_ABSTRACTION_HANDLER or AbstractiumCommon#COMMON_ABSTRACTION_HANDLER.
If you want to make your own abstraction handling, well that's quite a bit more complicated but you will
need to follow how it's done in net.feltmc.abstractium.library.
There will be a wiki some time in the future.
Development Roadmap
For now this has rather limited goals. Support fabric 1.18.2 to the latest version. In the future there are possibilities not plans for the following:
- Code Wrapper: This would allow mods from different versions running on newer ones without modifications.
- Legacy Support: Supporting versions below 1.18.2.
- Forge Abstraction: Abstracting and wrapping forge code (contingent upon another PatchworkMC)
Why was this made?
I made this api because of how much mojang loves to refactor their own code. I know mod devs alike can agree with me that mojang's refactors make modding so tedious and demotivating. It forces us devs to focus less on improving the mod and more on rewriting code to get it working on the latest versions. Then, if someone wants to maintain multiple versions, multiple branches have to be updated with patches/improvements which is a logistical nightmare. For the users it causes many, many mods to be split amongst different versions. This stops people from playing all their favourite mods in one modpack, on the latest versions. This frustration has been productively redirected to an ambitious api to finally nuke these irritating nuisances out of existence.
下载 Abstractium
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Abstractium
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Abstractium
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Abstractium
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Abstractium
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Abstractium
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Abstractium
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Abstractium
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Abstractium
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Abstractium
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
修复更多问题
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
查看物品与配方
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
适用于 MC 1.18+ 的 Effekseer 加载器
模组
那是什么?一个 Waila/Hwyla 的分支。
评论 0
登录后参与评分
还没有评论,来抢沙发吧