Common Storage Lib
CSL 旨在接续 Botarium 的工作,致力于实现真正跨平台的存储实现。与它的 predecessor 一样,CSL 允许开发者创建平台无关的存储代码,并可注册到 Fabric 和 NeoForge 各自的 API 中。它借鉴了 Fabric 的 Storage API(具有不可变资源和物品上下文),同时采用了 Forge 的模拟系统。
与它的 predecessor 不同,CSL 将其用于抽象的工具开放供你使用。除了存储抽象外,CSL 还提供了流体资源和配方的抽象、NeoForge 和 Fabric 提供的数据附加系统的抽象,以及两个加载器“实体系统”API 的抽象(NeoForge 上的 Capabilities 和 Fabric 上的 ApiLookup)。这些 API 各自位于独立的模块中,允许你根据自己的需求独立于存储抽象来使用它们。
致非跨平台开发者
对于仅针对 NeoForge 或仅针对 Fabric 的项目,CSL 也能提供一些益处。对于 NeoForge 开发者而言,不可变资源和物品上下文在配合存储使用时非常有用。如果你使用物品上下文,CSL 会自动处理其他模组对你物品的使用情况。Fabric 开发者可能会倾向于使用 CSL 来克服 Fabric 的事务系统。但请注意:由于存储仍然需要注册到 Fabric 的存储系统中,因此你应该谨慎确保你的存储实现符合回滚要求。相关文档将很快提供,但 CSL 已原生支持此功能。希望在 Fabric 上正常运行的存储功能的开发者也应确保其存储符合回滚规范。
CSL 目前处于 Alpha 阶段
CSL 0.0.0 提供了 Botarium 所具备的所有功能以及更多。虽然 Botarium 仅支持能量物品/方块和流体物品/方块,但 CSL 支持能量物品/方块/实体、流体物品/方块/实体 以及 物品物品/方块/实体,并与 Neo 和 Fabric 传输 API 完全兼容。尽管已经进行了初步测试,但它仍处于早期阶段。
请注意:
Fabric 原生不支持物品上的物品存储、实体上的能量存储或实体上的流体存储。CSL 在其命名空间下注册这些查找接口,因此任何选择为这些特定能力使用 CSL 的模组都将彼此兼容,但不与其他模组兼容。这是 Fabric 特有的问题,因为 Fabric 目前没有为此提供 ApiLookup。不过,能量物品/方块、流体物品/方块和物品实体/方块都与更广泛的 Fabric 和 NeoForge 模组生态系统兼容,而 NeoForge 则自动兼容上述查找类型。
社交媒体
查看我们的其他项目
Common Storage Lib
CSL attempts to pick up where Botarium left off in its efforts to make truly cross platform storage implementations possible. CSL, like its predecessor, allows developers to create platform agnostic storage code that can be registered to Fabric and NeoForge's respective APIs. It takes after Fabric's Storage api with immutable resources and item context, but adopts Forge's simulation system.
Unlike its predecessor, CSL makes its abstraction tools that made it possible open for you to use as well. So in addition to abstraction of storage, CSL provides abstraction of fluid resources and ingredients, abstraction of the Data attachment system provided by NeoForge and Fabric, and an abstraction of both loaders "Entity Systems" api (Capabilities on NeoForge, ApiLookup on Fabric). These apis are each in their own module, allowing you to use them independently of the storage abstractions for your own purposes.
To non XPlat Devs
For Neo only/Fabric only projects, CSL also offers some benefit. To Neo developers, immutable resources and item context are extremely useful in usage with storage. CSL automatically handles other mods usage of your item if you make use of item context. Fabric developers might be inclined to use CSL to overcome Fabric's transaction system. A word of caution though: Since the storage still needs to be registered to fabric's storage, you should take caution to make sure you still implement your storage to be compliant with rollbacks. Documentation on how to do this will be provided soon, but it is already natively supported in CSL. Developers looking to have their storage function properly on Fabric should also take care to make sure their storage is rollback compliant.
CSL is currently in Alpha
CSL 0.0.0 provides all the same features Botarium offered and more. While Botarium only supported Energy items/blocks and Fluid items/blocks, CSL supports Energy Item/Blocks/Entities, Fluid item/blocks/entities and Item item/blocks/entities with full compatibility with the Neo and Fabric transfer APIs. While cursory testing has been done, its still very much in the beginning stages.
Please Note:
Fabric does not natively support item storage on items, energy storage on entities, or fluid storage on entities. CSL registers these lookups under its own namespace, so any mod that chooses to use CSL for those specific capabilities will be compatible with each other, but not anything else. This is a Fabric specific issue as Fabric does not currently provide an ApiLookup for these. Energy item/blocks, Fluid item/blocks and Item entities/blocks are all compatible with the larger Fabric and Neoforge modding ecosystem though, and NeoForge is automatically compatible with the aforementioned lookup types.
Socials
Check out our other projects
下载 Common Storage Lib
下载 Common Storage Lib
下载 Common Storage Lib
下载 Common Storage Lib
下载 Common Storage Lib
下载 Common Storage Lib
下载 Common Storage Lib
下载 Common Storage Lib
下载 Common Storage Lib
下载 Common Storage Lib
修复物品上下文未尊重自定义交换函数的问题
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
查看物品与配方
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
适用于 MC 1.18+ 的 Effekseer 加载器
评论 0
登录后参与评分
还没有评论,来抢沙发吧