Better Runtime Resource Pack (BRRP)
BRRP (Better Runtime Resource Pack) is a library mod designed for generating resources directly during gameplay. This project is a fork of the ARRP (Advanced Runtime Resource Pack) mod.
Important note: Starting from version 1.0.0, the mod identifier has been changed from better_runtime_resource_pack to brrp_v1. The new version implements code changes without backward compatibility with older versions, although they can coexist. It is recommended to use the current version unless there is a specific need for the old variant.
What are Runtime Resource Packs?
Runtime Resource Packs (RRP) are a system for generating game resources and data in real-time, allowing to avoid repetitive routine tasks. For mods containing large numbers of similar blocks and items, this technology significantly reduces the final mod file size.
Consider a practical example: loot tables for most blocks are typically described as "dropping the block itself". Some blocks drop only when using Silk Touch, and double slabs when broken yield two units instead of one. Each block requires a separate JSON file for the loot table - creating all these files manually takes considerable time. Additionally, almost every block needs block state files, block models, and item models (there may be multiple block models). If we account for loot tables and crafting recipes, each block requires at least 5 JSON files for full functionality. Runtime resource packs generate this data within the game process instead of storing it in the mod's JAR file.
In terms of functionality, runtime resource packs are no different from regular ones. Standard resource packs (including built-in mod resources and manually installed resource packs or data packs) can override the contents of runtime packs or interact with them. A typical example: block models are defined in runtime packs, while texture files are stored in mod files in the usual way (since generating textures during gameplay is impractical).
Compared to traditional resource packs, runtime versions reduce input/output operations but add the process of object serialization, which is their drawback. When generating resource packs, objects are converted to byte form (usually JSON) - this process is called serialization. When the game loads these packs, the byte data is analyzed to create game objects - this is deserialization. In traditional packs, all resources are already serialized, and the game only needs to deserialize them upon loading. In runtime packs, both processes occur.
Briefly compare the loading processes of traditional and runtime resource packs:
- Traditional: File → byte form → game objects
- Runtime: Code → ARRP objects → byte form → game objects
Future versions plan to enable direct use of objects generated in-game without serialization and deserialization processes. This is already theoretically possible, but additional development is required for integration in resource pack format with the ability to be overridden by traditional packs.
About This Mod
BRRP is an independent fork of ARRP. Starting from version 1.0.0, the mod has become completely autonomous and no longer provides ARRP features, although it can work in parallel with it.
The project is open source and distributed under the MPLv2 license.
Additional information is available on GitHub.