SQDCLib 是用于 Minecraft NeoForge 的叙事冒险库。它不会添加新的生物、方块或装备,而是为冒险类模组提供四项基础能力:状态追踪、任务系统、对话系统和过场动画系统。该库基于 Java 21 开发,采用 MIT 许可证。
构建冒险模组时,最难的部分通常不是战斗或地图设计,而是那些无法回避的辅助工作。玩家的选择保存在哪里?界面如何得知任务已推进?分支对话逻辑被重写过多少次?谁会在过场动画中途安排任务完成?每个新项目都在重复编写同一个半成品框架,而每个模组最终都拥有自己的版本。SQDCLib 将这些核心关注点提取为一个可单独或部分使用的依赖项。这四个模块彼此解耦,支持仅使用其中某一个。
状态层
玩家状态与世界状态分别存储。玩家状态会自动同步给对应所有者,并在死亡后保留。世界状态在所有维度间共享,且在客户端为只读,以防止意外修改。提供统一的查询 API,使得条件检查无需关心标志位是存储在玩家还是世界中。
条件表达式
支持七种可嵌套的条件类型。任务目标、对话选项和过场动画分支共用一个评估器。条件也会在客户端运行。玩家状态自动同步,世界状态则通过专用的镜像数据包进行同步。
任务层
任务在数据包中定义,支持主线与支线任务、前置条件、可见性条件、目标、开始动作和完成动作。目标没有独立的“已完成”状态。是否完成由其实时计算的条件决定,因此条件和进度不会脱节。任务仅有四种状态:锁定、可用、进行中、已完成。
对话层
对话以服务器权威为准。客户端仅负责绘制界面并回传选择结果。分支选项可按条件过滤,不符合条件的选项永远不会发送给客户端,从而防止伪造。支持节点动作、自动跳转和循环保护。对话期间游戏不会暂停,玩家可通过 Esc 键退出。
过场动画层
支持关键帧摄像机、时间轴事件、淡入淡出、字幕、黑边(letterbox)和移动锁定。时间以刻(ticks)为单位计量,并提供多种缓动选项;旋转插值取最短路径。摄像机接管使用 Mixin,可能与其它修改摄像机位置的模组冲突。仅改变视角角度的模组不受影响。
跨层组合
可在对话中间插入过场动画,或在过场动画中途启动对话,在任务完成时推进故事阶段,根据任务进度显示特定选项。所有这些操作在数据包的 JSON 中只需一行代码。四个模块通过 StoryBridge 回调连接。状态层不依赖于上层模块,当对应模块缺失时,相关动作变为空操作(no-ops),因此不会出现崩溃。
集成
SQDCLib 不依赖任何第三方内容模组,仅使用官方 NeoForge API。内置三个示例数据包和调试命令,可用于冒烟测试。本库面向正在开发 NeoForge 叙事冒险模组、RPG 模组、任务模组或剧情模组的开发者。同样完全支持仅使用状态层。
构建后会得到 sqdclib jar 文件。将其放入 libs 目录,并在你自己的模组中声明依赖。具体集成步骤请参阅仓库。仓库位于 GitHub 上的 mornfire/sqdclib。需要安装与目标 NeoForge 版本兼容的 JDK。
冒险模组最难的部分通常不是玩法本身,而是那些无法避免的辅助工作。SQDCLib 将这些工作整合到一个依赖项中,让开发者能够专注于内容创作。
SQDCLib is a narrative adventure library for Minecraft NeoForge. It does not add new mobs, blocks, or equipment. Instead, it provides four foundational capabilities for adventure mods: state tracking, quest system, dialogue system, and cutscene system. It uses Java 21 and is licensed under MIT.
The hardest part of building an adventure mod is rarely the combat or the map. It is the supporting work that cannot be avoided. Where does a player choice get stored? How does the interface know a quest has advanced? How many times does branching dialogue logic get rewritten? Who schedules a quest completion in the middle of a cutscene? Every new project rewrites the same half-finished framework, and every mod ends up with its own. SQDCLib extracts these four concerns into a single dependency that can be used partially. The four modules are decoupled from each other, and using only one is fully supported.
State layer
Player state and world state are stored separately. Player state syncs automatically to the owner and persists through death. World state is shared across all dimensions and is read-only on the client to prevent accidental modification. A unified query API is provided so condition checks do not need to know whether a flag lives on the player or the world.
Condition expressions
Seven condition types that can be nested. Quest objectives, dialogue options, and cutscene branches share one evaluator. Conditions also run on the client. Player state is synced automatically, and world state has a dedicated mirror packet.
Quest layer
Quests are defined in datapacks with support for main and side quests, prerequisites, visibility conditions, objectives, start actions, and complete actions. Objectives have no completed state. Whether an objective is done is evaluated live from its condition, so conditions and progress cannot drift apart. There are only four states: locked, available, active, and completed.
Dialogue layer
Dialogue is server-authoritative. The client only draws the interface and sends back a selection. Branch options can be filtered by condition, and options that do not meet their condition are never sent to the client, making them impossible to forge. Node actions, automatic jumps, and loop protection are supported. The game does not pause during dialogue, and the player can exit with Esc.
Cutscene layer
Supports keyframe cameras, timeline events, fades, subtitles, letterbox, and movement lock. Time is measured in ticks with multiple easing options, and rotation interpolation takes the shortest path. Camera takeover uses Mixin and may conflict with other mods that modify camera position. Mods that only change angles are unaffected.
Cross-layer composition
Insert a cutscene mid-dialogue, start a dialogue halfway through a cutscene, advance the story phase on quest completion, show an option based on quest progress. All of these are a single action line in a datapack JSON. The four modules connect through StoryBridge callbacks. The state layer does not depend on the layers above it, and actions are no-ops when the corresponding module is absent, so nothing breaks.
Integration
SQDCLib has no third-party content mod dependencies and uses only official NeoForge APIs. Three sample datapacks and debug commands are included for smoke testing. It is aimed at developers building NeoForge narrative adventure mods, RPG mods, quest mods, or story mods. Using only the state layer is also fully supported.
After building you get the sqdclib jar. Place it in libs and declare the dependency in your own mod. See the repository for exact integration steps. The repository is on GitHub at mornfire/sqdclib. A JDK compatible with the target NeoForge version is required.
The hardest part of an adventure mod is rarely the gameplay. It is the supporting work that cannot be avoided. SQDCLib collects that work into one dependency so developers can focus on content.
下载 SQDCLib
下载 SQDCLib
下载 SQDCLib
下载 SQDCLib
下载 SQDCLib
下载 SQDCLib
下载 SQDCLib
下载 SQDCLib
下载 SQDCLib
下载 SQDCLib
暂无更新日志
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
原版世界生成优化模组
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
查看物品与配方
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
评论 0
登录后参与评分
还没有评论,来抢沙发吧