BlossomBridge
Tywrap Studios 模组使用的小型 API,添加了一些次要功能。
自
2.1.0版本的 BBAPI(目前仅作为 master-SNAPSHOT 可用)起,建议将 API 捆绑到你的项目中,而不是依赖此模组,并转而依赖 Fabric Language Kotlin。因此,你在此页面上能找到的最大可下载版本为 2.0.2。我们将不再发布此模组的 jar 文件,以保持尽可能高的兼容性。
对于开发者:请在 2.1.0 更新文档 发布后尽快阅读,以了解如何正确更新你的 BBAPI 版本,然后按照后续更新文档操作,直至最新版本。祝好运!
例如:
- 利用 Jankson 和一些逻辑魔法实现的配置系统。
- 简单但专业的日志系统,用于保持所有模组日志格式的一致性。
- 良好的 JavaDoc,以便你能真正正确地理解代码。
面向开发者:
项目设置 
想在你的模组中使用此 API?
尽管用吧!但要记住,这里的大部分内容都是针对我们工作流特定的,因此可能不适用于你的用例。
此外,目前的代码相当精简,所以很多时候并不值得。
Gradle 设置
BlossomBridge 可以像其他 Fabric 模组一样轻松依赖。
只需在你的 build.gradle 文件中添加以下内容:
repositories {
maven { url "https://jitpack.io" }
}
dependencies {
// 其他依赖...
modImplementation("com.github.Tywrap-Studios:BlossomBridge:${project.blossombridge_version}")
}
并在你的 gradle.properties 文件中添加这一行:
blossombridge_version="1.1.1"
# 或者你想使用的任何版本 :)
始终建议使用最新的 STABLE 版本,这样你就不会遇到 WIP 功能的意外问题。
最后但同样重要的是,你需要在 fabric.mod.json 文件中添加以下内容:
{
"depends": {
"blossombridge": "1.1.1"
}
}
模组设置
一旦你将模组添加到项目中,就可以开始使用了!
所有代码都通过 JavaDoc 进行了详细记录,你应该能够弄清楚如何使用它。
作为一般准则,你可以这样做:创建一个继承 AbstractConfig 的配置类,然后创建一个新的 ConfigManager 来加载和使用它。同时,构建一个 LoggingHandler,你就可以正常使用了!
不要使用 BlossomBridge 类!事实上,不要使用 main 包中的任何东西!
main 包中的所有内容都不是 API 的一部分,而是属于实际“模组”部分的代码!
所有 是 API 的内容都在 api 包中(当然)。
举个例子,我建议查看 Constructra,它实现并使用了大量此 API 的代码。
BlossomBridge
A small API for Tywrap Studios Mods, that adds a few minor things.
Since version
2.1.0of BBAPI (which is currently only available as a master-SNAPSHOT), it is suggested to bundle the API with your project instead of depending on this mod, and depending on Fabric Language Kotlin instead. As such, the maximum downloadable version you will find on this page is 2.0.2. We will no longer release this as a mod jar to keep compatibility as high as possible.
For developers: please read our 2.1.0 update docs as soon as it becomes available for more information on how to update your BBAPI version correctly, then follow the update docs subsequently until you reach the latest version. Happy days!
Such As:
- A fletched Config system utilizing Jankson and some logic magic.
- A simple, yet niche Logging system, to maintain a consistent log format for all our mods.
- Good JavaDocs, so you can actually properly understand the code.
For Devs:
Project Setup 
Want to use this API in your mod?
Feel free to! But keep in mind that a lot of stuff in here is specific to our workflows, so it may not be applicable to your use case.
Plus, the code is pretty minimal the moment, so it's not really worth it half the time.
Gradle Setup
BlossomBridge can easily be depended on like any other Fabric mod.
Just add the following to your build.gradle file:
repositories {
maven { url "https://jitpack.io" }
}
dependencies {
// Other dependencies...
modImplementation("com.github.Tywrap-Studios:BlossomBridge:${project.blossombridge_version}")
}
And you add this to your gradle.properties file:
blossombridge_version="1.1.1"
# Or whatever version you want to use :)
it is always recommended to use the latest STABLE version, so you don't get any unexpected hiccups of WIP features.
Last but not least, you need to add the following to your fabric.mod.json file:
{
"depends": {
"blossombridge": "1.1.1"
}
}
Mod Setup
Once you've added the mod to your project, you can start using it!
All the code is well documented using JavaDoc, so you should be able to figure out how to use it.
But as a general line of thumb, you do the following: Make a Config class that extends AbstractConfig, and then you can make a new ConfigManager to load and use it. Alongside that, also construct a LoggingHandler and you're good to go!
Do not use the BlossomBridge class! Matter of fact, don't use anything from the main package!
ANYTHING IN THE main PACKAGE IS NOT PART OF THE API, AND IS INSTEAD FOR THE ACTUAL "MOD" PART OF THE CODE!
Everything that is api is inside the api package (of course)
As an example, I suggest taking a look at Constructra, which has a lot of this API's code implemented and used.
下载 BlossomBridge API
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 BlossomBridge API
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 BlossomBridge API
下载 BlossomBridge API
下载 BlossomBridge API
下载 BlossomBridge API
自 2.0.0 版本起,该模组使用 Kotlin 编写,并进行了以下补丁:
更改(2.0.0):
- 代码库改为 Kotlin。
LoggingHandler.literalDebug()现在始终忽略配置。ConfigManager.loadConfig()在验证后也会运行saveConfig()。- 移除了主包,改为一个非常简单的
ModInitializer对象。 AbstractConfigClass->BasicConfigClass(重命名)net.tywrapstudios.blossombridge->org.tywrapstudios.blossombridge(重命名)
更改(2.0.1):
fabric.mod.json中 Minecraft 版本依赖格式错误。ConfigManager.getConfig()不再安全处理 null,而在 Kotlin 重写之前它是安全的。 (真是讽刺)
更改(2.0.2):
- Kotlin 的
BasicConfigClass无法被 Jankson 序列化或其他原因,因此已替换为 Java 类。
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
查看物品与配方
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
适用于 MC 1.18+ 的 Effekseer 加载器
模组
那是什么?一个 Waila/Hwyla 的分支。
评论 0
登录后参与评分
还没有评论,来抢沙发吧