BorisLib
Arcana Novum 和 Ancestral Archetypes 背后的服务端 Fabric 工具包。
构建拥有真实 GUI、配置项、保存数据和自定义效果(状态效果)的模组。玩家无需安装任何额外模组。
是因为某个模组提示你安装这个吗? 将 jar 文件放入服务器的 mods 文件夹中,与 Fabric API 放在一起,然后跳转到 服务器设置。这就足够了。
正在制作模组? 请继续阅读。
为什么选择 BorisLib
服务端模组可以在原版客户端上运行,这也意味着菜单、配置项、保存数据和状态效果都需要手动构建。BorisLib 是我在制作 Arcana Novum(一个包含 80+ 物品、Boss 战和全游戏内菜单的魔法模组)时构建的一套系统。每个系统都已在实际服务器上投入使用,你可以仅用一行 Gradle 代码就在你的模组中使用它们。
你能获得什么
- 支持分页、排序和过滤的物品栏 GUI。 将列表交给
PagedGui,它会自动处理分页和按钮。内置了 60 多种可着色纹理图标,未安装资源包的玩家会看到对应的原版物品占位符。
- 几行代码即可定义配置项。 声明类型化的设置,即可获得带注释的
.properties 文件、带有自动补全和验证功能的 /yourmod config 命令,以及针对每个设置的权限节点。
- 玩家、世界和服务器的保存数据。 注册一个键值,即可在任何地方读取或写入对象。它支持离线玩家,且每种作用域都有防崩溃备份。
- 条件系统:像属性一样叠加的状态效果。 任意数量的来源可以应用相同的效果,相反的效果会相互抵消,强度可以无限大以实现完全免疫或完全禁锢。内置了 31 种条件,从伤害和速度到重力、治疗和生物检测范围。
- 过场动画。 沿关键帧路径移动玩家的摄像机,支持缓动和样条插值,可在当前维度或其他维度进行,并在玩家原位置留下替身。即使断开连接或崩溃,玩家状态也能恢复。
- 计时器和登录回调。 在延迟后、间隔时间内或下次玩家登录时运行代码。
- 粒子形状。 线条、圆形、球体和动态闪电,长距离可见。
- 丰富的实用工具集。 多实体射线投射、加权随机、安全传送检查、物品栏和物品数据辅助、文本标记、数字格式化和音效。
快速预览
任意列表的分页式可排序菜单:
PagedGui<Item> gui = new PagedGui<>(MenuType.GENERIC_9x6, player, items);
gui.itemElemBuilder((item, index) -> GuiElementBuilder.from(item.getDefaultInstance()));
gui.elemClickFunction((item, index, click) -> player.sendSystemMessage(Component.translatable(item.getDescriptionId())));
gui.curSort(ItemSort.ALPHABETICAL);
GuiHelper.outlineGUI(gui, 0x1155dd, Component.literal("Items"));
gui.buildPage();
gui.open();
一种可与所有其他来源叠加的伤害增益:
// 10秒内增加50%造成的伤害
Conditions.addCondition(server, player, new ConditionInstance(Conditions.MIGHT, id, 200, 0.5f));
跟随玩家的保存数据,无论在线与否:
Wallet wallet = DataAccess.getPlayer(uuid, Wallet.KEY);
wallet.coins += 5;
DataAccess.setPlayer(uuid, Wallet.KEY, wallet);
摄像机过场动画:
CameraPath path = CameraPath.builder()
.add(CameraKeyframe.at(0.0).pos(0, 80, 0).rot(0, 20).build())
.add(CameraKeyframe.at(1.0).pos(60, 80, 0).rot(90, 0).interp(InterpolationType.EASE_IN_OUT).build())
.build();
SequenceManager.start(player, new CutsceneSequence(player.getUUID(), path, 200, true));
将其添加到你的模组中
repositories {
maven { url = "https://maven.borisshoes.net/releases" }
maven { url = "https://maven.nucleoid.xyz" }
}
dependencies {
implementation "net.borisshoes:BorisLib:4.0.0+26.3"
}
使用与你 Minecraft 版本匹配的 版本页面 中的版本。要将 BorisLib 打包进你自己的 jar 文件中,以便服务器管理员无需安装额外内容,请将该行包裹在 include(...) 中。
GitHub 上的 API 指南 记录了每个系统的示例,类中也包含了完整的 Javadoc 文档。如果遇到困难,请在 Discord 提问。
基于 BorisLib 制作的模组
安装以下任一模组,在编写代码之前先看看该库能做什么。
Minecraft 最大的服务端魔法模组:包含 80+ Arcana 物品、多方块祭坛、190+ 附加组件、研究系统、成就以及 Boss 战斗。其《法典》和《百科全书》菜单基于 BorisLib GUI,400+ 项设置构成一个 BorisLib 配置文件,物品效果则使用 Conditions(条件)机制。
| 在星光熔炉中锻造 |
Starpath 祭坛 |
后期装备 |
 |
 |
 |
一款 Origins 风格的模组,每位玩家可以选择一种基于生物的原型(Archetype)并获得其能力。该模组高度可配置,并为竞技服务器进行了平衡调整,运行于 BorisLib 的配置、数据存储和 Conditions 机制之上。
更多基于 BorisLib 构建的模组
所有服务端 Fabric 模组——无需客户端安装。
|
模组 |
描述 |
链接 |
 |
Ender Nexus |
将高度可配置的 /home、/spawn、/warp、/tpa 和 /rtp 命令合而为一,并支持单独禁用。 |
|
 |
Fabric Mail |
游戏内虚拟邮箱系统,用于在线与离线玩家之间发送包裹和消息。 |
|
 |
Fabric Trade |
新增 /trade 命令,提供安全的双人交易界面。 |
|
 |
Limited AFK |
AFK(闲置)检测与管理,为服务器提供可配置的踢出阈值。 |
|
使用 BorisLib 制作了什么东西?请在 Discord 上告诉我,我会将其添加到此列表中。
服务器设置
- 在服务器上安装 Fabric Loader 和 Fabric API,然后将 BorisLib jar 文件放入
mods 文件夹。其他所有依赖库均已打包,玩家无需进行任何安装。
- 启动服务器一次以生成配置文件。
- 打开
config/polymer/auto-host.json,将 "enabled": false 改为 true。服务器现在会为 BorisLib 及其构建的模组生成资源包,并在玩家连接时发送给他们。
- (可选)在同一文件中,你可以使该资源包变为必填项,或设置玩家在请求下载时会看到的
"message" 信息。
部分模组(包括 Arcana Novum 和 Ancestral Archetypes)已将 BorisLib 包含在其自身的 jar 文件中。仅当某个模组将 BorisLib 列为单独的依赖项时,你才需要单独下载它。
管理员可以使用 /borislib condition 检查和应用条件,每个命令都配有一个 Fabric Permissions API 节点,并回退至原版权限等级。完整参考文档见 GitHub:commands 和 permission nodes。
支持
问题请前往 Discord,Bug 报告和建议请提交至 GitHub Issues。
翻译:俄语由 Reset1712 完成,西班牙语由 Llama303 完成。
支持我的工作
BorisLib 和我基于它制作的所有模组都是免费的,并且将始终保持免费。我利用业余时间开发它们,如果它们对你或你的服务器有所帮助,并且你希望支持我的持续开发,可以在 borisshoes.net/donate 进行捐赠。支持者可以获得 Arcana Novum 中的特殊皮肤,以及在 Discord 中的特殊角色和频道。每一份支持都备受感激。
许可证声明
以任何形式使用本项目,即表示您“明确同意”本项目的许可证条款,并确认我(BorisShoes)已履行许可证规定的义务,即“在现有情况下尽合理努力获得接收者对本许可证条款的明确同意。”
BorisLib
The server-side Fabric toolkit behind Arcana Novum and Ancestral Archetypes.
Build mods with real GUIs, configs, saved data and custom effects. Players don't need any mods.
Here because a mod told you to install this? Put the jar in your server's mods folder next to Fabric API and jump to Server Setup. That is all you need.
Making a mod? Read on.
Why BorisLib
Server-side mods work on vanilla clients, which also means that menus, configs, saved data and status effects all have to be built by hand. BorisLib is the set of systems I built for that while making Arcana Novum, a magic mod with 80+ items, boss fights and an in-game menu for everything. Each system is used on live servers, and you can use them in your mod with one Gradle line.
What You Get
- Chest GUIs that page, sort and filter. Hand
PagedGui a list and it handles the pages and the buttons. Over 60 textured, dyeable icons are included, and players without the resource pack see vanilla items in their place.
- A config in a few lines. Declare typed settings and get a commented
.properties file, a /yourmod config command with tab completion and validation, and a permission node for every setting.
- Saved data for players, worlds and the server. Register one key and read or write your object anywhere. It works for offline players, and every scope has crash-safe backups.
- Conditions: status effects that stack like attributes. Any number of sources can apply the same effect, opposing effects cancel out, and magnitudes can reach infinity for full immunity or a full root. 31 conditions are built in, from damage and speed to gravity, healing and mob detection range.
- Cutscenes. Move a player's camera along a keyframed path with easing and splines, in their own dimension or another one, with a stand-in left where they were standing. Their state is restored even after a disconnect or a crash.
- Timers and login callbacks. Run code after a delay, on an interval, or the next time a player logs in.
- Particle shapes. Lines, circles, spheres and animated lightning bolts, visible at long range.
- A large utility set. Multi-entity raycasts, weighted random, safe teleport checks, inventory and item data helpers, text markup, number formatting and sounds.
A Quick Look
A paged, sortable menu of any list:
PagedGui<Item> gui = new PagedGui<>(MenuType.GENERIC_9x6, player, items);
gui.itemElemBuilder((item, index) -> GuiElementBuilder.from(item.getDefaultInstance()));
gui.elemClickFunction((item, index, click) -> player.sendSystemMessage(Component.translatable(item.getDescriptionId())));
gui.curSort(ItemSort.ALPHABETICAL);
GuiHelper.outlineGUI(gui, 0x1155dd, Component.literal("Items"));
gui.buildPage();
gui.open();
A damage buff that stacks with every other source:
// +50% damage dealt for 10 seconds
Conditions.addCondition(server, player, new ConditionInstance(Conditions.MIGHT, id, 200, 0.5f));
Data that follows a player, online or not:
Wallet wallet = DataAccess.getPlayer(uuid, Wallet.KEY);
wallet.coins += 5;
DataAccess.setPlayer(uuid, Wallet.KEY, wallet);
A camera cutscene:
CameraPath path = CameraPath.builder()
.add(CameraKeyframe.at(0.0).pos(0, 80, 0).rot(0, 20).build())
.add(CameraKeyframe.at(1.0).pos(60, 80, 0).rot(90, 0).interp(InterpolationType.EASE_IN_OUT).build())
.build();
SequenceManager.start(player, new CutsceneSequence(player.getUUID(), path, 200, true));
Add It to Your Mod
repositories {
maven { url = "https://maven.borisshoes.net/releases" }
maven { url = "https://maven.nucleoid.xyz" }
}
dependencies {
implementation "net.borisshoes:BorisLib:4.0.0+26.3"
}
Use the version from the versions page that matches your Minecraft version. To ship BorisLib inside your own jar, so that server owners have nothing extra to install, wrap the line in include(...).
The API Guide on GitHub documents every system with examples, and the classes carry Javadoc throughout. If you get stuck, ask on Discord.
Mods Built with BorisLib
Install one of these to see what the library can do before you write any code.
Minecraft's biggest server-side magic mod: 80+ Arcana Items, multiblock altars, 190+ augmentations, research, achievements and boss fights. Its Tome and Compendium menus are BorisLib GUIs, its 400+ settings are a BorisLib config, and its item effects use Conditions.
| Forging at the Starlight Forge |
The Starpath Altar |
Late-game gear |
 |
 |
 |
An Origins-style mod where each player picks a mob-based Archetype and gains its abilities. It is highly configurable and balanced for competitive servers, and it runs on BorisLib's config, data storage and Conditions.
More Mods Built with BorisLib
All server-side Fabric mods — no client installation required.
|
Mod |
Description |
Links |
 |
Ender Nexus |
Highly configurable /home, /spawn, /warp, /tpa and /rtp commands all in one, and individually disablable. |
|
 |
Fabric Mail |
An in-game virtual mailbox system for sending packages and messages between online and offline players. |
|
 |
Fabric Trade |
Adds /trade, a secure player-to-player trading interface. |
|
 |
Limited AFK |
AFK detection and management with configurable kick thresholds for servers. |
|
Made something with BorisLib? Tell me on Discord and I will add it here.
Server Setup
- Install Fabric Loader and Fabric API on your server, then put the BorisLib jar in the
mods folder. Every other library is bundled, and players do not need to install anything.
- Launch the server once to generate the configs.
- Open
config/polymer/auto-host.json and change "enabled": false to true. The server now generates the resource pack for BorisLib and the mods built on it, and sends it to players when they connect.
- (Optional) In the same file you can make the resource pack required, or set the
"message" that players see when they are asked to download it.
Some mods, including Arcana Novum and Ancestral Archetypes, already include BorisLib in their own jar. You only need this download when a mod lists BorisLib as a separate requirement.
Admins can inspect and apply conditions with /borislib condition, and every command has a Fabric Permissions API node with a vanilla permission level fallback. The full reference is on GitHub: commands and permission nodes.
Support
Questions go to the Discord, and bug reports and suggestions go to GitHub Issues.
Translations: Russian by Reset1712 and Spanish by Llama303.
Support My Work
BorisLib and every mod I build on it are free and will stay that way. I make them in my spare time, so if they have been useful to you or your server and you would like to help keep development going, you can chip in at borisshoes.net/donate. Supporters get access to special skins in Arcana Novum, along with a special role and channel on the Discord. Every bit is always appreciated.
License Notice
By using this project in any form, you hereby give your "express assent" for the terms of the license of this project, and acknowledge that I, BorisShoes, have fulfilled my obligation under the license to "make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License."
评论 0
登录后参与评分
还没有评论,来抢沙发吧