免责声明
我收到了多份关于 LibCD 模组 JSON 中存在无效条目的问题报告。这不会导致崩溃。这不是你的整合包无法加载的原因。请在日志中进一步查找导致崩溃的真正原因。
LibCapableData(简称 LibCD)添加了各种钩子,使数据包更易于使用。
条件数据
LibCD 最初的功能是作为挂钩,根据元数据文件有条件地加载数据包元素。它专注于简单性和可扩展性,同时兼容其他模组添加的任何资源类型。此模组需要 Minecraft 1.14 及以上版本的 Fabric 启动器。
对于条件资源,添加一个文件 <目标资源名及扩展名>.mcmeta。该文件将被解析为 JSON 以检查是否应加载此资源。每个键值对将指定一个必须满足的条件,才能使配方被加载。系统预置了四种条件,其他模组也可能添加自己的条件:
libcd:mod_loaded(传入字符串):如果存在指定模组 ID 的模组,则返回 true。libcd:item_exists(传入字符串):如果存在指定物品 ID 的物品,则返回 true。
libcd:not(传入单个元素的 JSON 对象):如果给定对象中列出的条件 不 为真,则返回 true。libcd:any_of(传入一个 JSON 对象):如果给定对象中列出的 任意 条件为真,则返回 true。警告:目前,如果传入的参数不正确,条件会静默地返回 false。希望将来能对此进行修改,但如果你认为某个内容应该加载却没有加载,请检查你的条件。
开发者使用
LibCD 允许任何模组注册自己的条件,从而基于配置或更高级的逻辑阻止配方加载。LibCD 可在 Cotton maven 上获取。
要添加新条件,请调用 LibConditionalData.registerCondition(),传入表示条件名称的 Identifier 以及用于判断条件是否适用的 `Predicate`。
传递给 predicate 的对象将是一个装箱的基本类型(Integer、Float、Boolean 等)、String、List、JsonObject 或 null。请使用 instanceof 检查来确认你接收到的具体类型。
有关创建 Tweaker 实用程序的信息,请查看 LibCD wiki 页面。
DISCLAIMER
I have received multiple reports of an issue regarding invalid entries in the LibCD mod jSON. THIS DOES NOT CAUSE A CRASH. THIS IS NOT THE REASON YOUR PACK IS NOT LOADING. PLEASE LOOK FURTHER IN THE LOG FOR THE REAL CAUSE OF THE CRASH.
LibCapableData, or LibCD, adds various hooks to make data packs more usable.
Conditional Data
LibCD's original function was as a hook to conditionally load data pack elements based on a metadata file. It's focused on being simple and extensible, along with being compatible with any resource type added by other mods. This mod requires the Fabric launcher for Minecraft 1.14 and above.
For conditional resources, add a file <target resource with extension>.mcmeta. This will be parsed as JSON to check whether the resource should be loaded. Each key-value pair will specify a condition that must be met for the recipe to be loaded. There are four conditions pre-included, and other mods may add their own:
libcd:mod_loaded(passed a string): Will return true if a mod with the given mod ID is loaded.libcd:item_exists(passed a string): Will return true if an item with the given item ID is loaded.libcd:not(passed a single-element json object) Will return true if the condition listed in the given object is not true.libcd:any_of(passed a json object): Will return true if any condition listed in the given object is true.
WARNING: Currently, conditions silently return false if they are passed an improper parameter. This will hopefully be changed in the future, but if you think something should be loaded and it isn't, check your conditions.
Developer Use
LibCD allows any mod to register their own conditions, to prevent recipe loadin based on config or more advanced logic. LibCD is available on the Cotton maven.
To add a new condition, call LibConditionalData.registerCondition(), passing an Identifier for the condition's name and a `Predicate for the use of the condition.
The Object passed to the predicate will be a boxed primitive (Integer, Float, Boolean, etc.), a String, a List, a JsonObject, or null. Use an instanceof check to be sure what you're being passed.
For information on creating Tweaker utilities, check the LibCD wiki page.
下载 LibCapableData (LibCD)
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 LibCapableData (LibCD)
下载 LibCapableData (LibCD)
下载 LibCapableData (LibCD)
下载 LibCapableData (LibCD)
下载 LibCapableData (LibCD)
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 LibCapableData (LibCD)
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
修复了标签扩展系统从根 JSON 对象而非 libcd 块读取的问题。
(抱歉!这个版本最初于九月发布,但由于倦怠和学业压力,我完全忘记了在此处发布。)
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
查看物品与配方
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
适用于 MC 1.18+ 的 Effekseer 加载器
模组
添加区块认领和玩家组队功能,并与 Xaero's Minimap 和 World Map 集成
评论 0
登录后参与评分
还没有评论,来抢沙发吧