BRRP(Better Runtime Resource Pack)是一个用于在运行时生成资源的库模组,它是 ARRP(Advanced Runtime Resource Pack)模组的分支。
欢迎加入腾讯 QQ 群 587928350 或 KOOK(开黑啦)频道邀请码 KlFS0n,以体验本模组的最新更新。
注意:自版本 1.0.0 起,模组 ID 已从 better_runtime_resource_pack 更改为 brrp_v1,并且修改了代码,不再兼容旧版本,但可以与旧版本共存。除非必要,请勿使用旧版本。
什么是运行时资源包?
运行时资源包(RRP)是指在 Minecraft 运行时生成的资产和数据文件,以避免一些重复性工作。对于拥有大量相似方块和物品的模组来说,运行时资源包可以显著减少模组文件的大小。
例如,大多数方块的战利品表可以描述为“掉落自身”。某些方块仅在具有精准采集时才会掉落。对于台阶方块,当双层台阶被破坏时,会掉落两个方块而不是一个。在战利品表中,每个方块都需要一个战利品表 JSON 文件;创建它们非常耗时。此外,几乎每个方块都需要一个“方块状态”、方块模型和物品模型(方块模型可能不止一个)。如果计算战利品表和配方(如果存在),每个方块至少需要 5 个 JSON 文件才能实现完整功能。相比之下,运行时资源包使这些内容在游戏实例内部生成,而不是存储在模组 JAR 文件中。
就功能而言,运行时资源包与普通资源包没有区别。普通资源包(包括模组的内置资源和手动安装的资源包或数据包)可以覆盖运行时资源包的内容,或与运行时资源包关联。一个典型的例子是,方块模型定义在运行时资源包中,而它们的纹理文件则像往常一样存储在模组文件中(因为不适合在运行时生成纹理文件)。
与传统资源包相比,运行时资源包减少了 I/O 操作,但增加了对象序列化的过程,这是运行时资源包的一个缺点。当生成资源包时,对象会被转换为字节形式(通常是 JSON)。这个过程称为序列化。当游戏实例读取这些资源包时,这些字节格式的内容会被分析以生成游戏内的对象。这个过程称为反序列化。在传统资源包中,所有资源都已序列化,游戏实例只需在加载资源时反序列化它们即可。然而,运行时资源包需要经历序列化和反序列化两个过程。
再次总结传统资源包和运行时资源包在游戏内读取的过程:
- 传统 文件 → (读取为) 字节形式 → (反序列化为) 游戏内对象
- 运行时 代码 → ARRP 对象 → (序列化为) 字节形式 → (反序列化为) 游戏内对象
我计划在未来的版本中实现直接使用游戏内生成的对象,无需经过反序列化和序列化过程。这在理论上已经可行,但以资源包的形式并允许被传统资源包和数据包覆盖,还需要进一步的研究。
关于此模组
此模组(BRRP)是 ARRP 的分支。自 1.0.0 起,此模组已独立于 ARRP,不再提供 ARRP 的功能,但可以与 ARRP 模组共存。
此模组是开源的,并在 MPLv2 许可下发布。
更多详细信息可在 GitHub 上查看。
BRRP (Better Runtime Resource Pack), is a library mod used for generate resources at runtime, which is a branch of ARRP (Advanced Runtime Resource Pack) mod.
Welcome to join Tencent QQ group 587928350 or KOOK (KaiHeiLa) channel invitation code KlFS0n to experience the latest update of this mod.
Notice: Since version 1.0.0, the ID of the mod was changed from better_runtime_resource_pack to brrp_v1, and modified the code without compatibility for older versions, but can co-exist with older versions. Unless needed, please do not used old version.
What is a runtime resource pack?
Runtime resource pack (RRP) refers to asset and data files generated when Minecraft is running, in avoidance of some repetitive works. For mods with masses of similar blocks and items, runtime resource pack helps to significantly reduce the size of mod file.
For instance, the loot table of most blocks can be described as "drop the block itself". Some blocks drop only when with Silk Touch. For slab blocks, when double slab block is broken, two blocks are dropped instead of one. In loot tables, each block requires a loot table JSON file; creating them is quite time-consuming. Moreover, almost each block requires a "block states", block model and item model (block models may be more than one). If loot tables and recipes (if it exists) are counted, each block requires at least 5 JSONs to achieve full features. In contrast, runtime resource packs make them generated inside the game instance, instead of stored in the mod JAR file.
Runtime resource packs have no difference than regular resource packs with regard to features. Normal resource packs (including the mod's builtin resource and manually-installed resource-packs or data-packs) can override contents of runtime resource packs, or have relations to runtime resource packs. A typical example is, block models are defined in runtime resource packs, and their texture files are stored in mod files as usual (as it's not appropriate to generate texture files in runtime).
Compared to traditional resource packs, runtime resource packs reduce I/Os, but adds the process of object serialization, which is a drawback of runtime resource pack. When resource packs are generated, objects are converted to byte forms (usually JSON). This process is called serialization. When game instance reads these resource packs, these byte-form contents are analysed to generate objects in game. This process is called deserialization. In traditional resource packs, all resources are serialized, and the game instance needs only to deserialize them when loading resources. However, runtime resource packs require the process of both serialization and deserialization.
To summarize again the process traditional resource packs and runtime resource packs are read in game:
- Traditional File → (read as) byte form → (deserialized as) in-game objects
- Runtime Code → ARRP objects → (serialized as) byte form → (deserialized as) in-game objects
It's been in my plan to make it possible to directly use objects generated in game in future versions, without the process of deserialization and serialization. This is already possible in theory, but to be in the form of resource pack and allow overriding by traditional resource packs and data packs, some further research is required.
About this mod
This mod (BRRP) is a branch of ARRP. Since 1.0.0, this mod has become independent of ARRP, no longer provides features of ARRP, but can co-exist with ARRP mod.
This mod is open-source and published under the MPLv2 license.
More details are available on GitHub.
下载 Better Runtime Resource Pack (BRRP)
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Better Runtime Resource Pack (BRRP)
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Better Runtime Resource Pack (BRRP)
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Better Runtime Resource Pack (BRRP)
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Better Runtime Resource Pack (BRRP)
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Better Runtime Resource Pack (BRRP)
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Better Runtime Resource Pack (BRRP)
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Better Runtime Resource Pack (BRRP)
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Better Runtime Resource Pack (BRRP)
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Better Runtime Resource Pack (BRRP)
- 修复了与某些修改数据驱动内容的模组的冲突。
- 优化了战利品表生成的实现。
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
查看物品与配方
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
适用于 MC 1.18+ 的 Effekseer 加载器
模组
那是什么?一个 Waila/Hwyla 的分支。
评论 0
登录后参与评分
还没有评论,来抢沙发吧