CompactResources 资源包
CompactResources 资源包为 CompactResources Paper 插件基于“海洋之心”创建的各种自定义物品提供了模型。
本资源包是 CompactResources 的配套资源包,主要为该插件开发。该插件负责处理配方、物品元数据、堆叠大小行为以及可选的服务端资源包分发;而本资源包则提供这些物品所需的客户端模型和纹理。
本资源包本身不会添加方块、物品、配方或游戏逻辑。
它仅在特定的 minecraft:heart_of_the_sea 物品堆栈携带预期的 Custom Model Data(自定义模型数据)字符串时,改变其渲染方式。
相关项目:
物品模型契约
本资源包覆盖以下文件:
assets/minecraft/items/heart_of_the_sea.json
该物品定义读取 minecraft:custom_model_data 组件,当其 strings 列表包含以下格式的值时选择对应的模型:
compactresources:<material>/<level>
示例:
compactresources:cobblestone/x9
compactresources:cobblestone/x81
compactresources:cobblestone/x729
本资源包显示自定义模型仅需要 Custom Model Data 字符串。
插件还会写入 Persistent Data Container(持久化数据存储容器)值,以便在服务器上识别该物品。
插件物品结构
CompactResources 将压缩方块创建为带有三个重要元数据的 minecraft:heart_of_the_sea 物品:
minecraft:custom_model_data.strings:在本资源包中选择模型。
- Bukkit Persistent Data Container:标识压缩材质和层级。
minecraft:item_name:显示翻译后的方块名称及层级。
在原版物品组件语法中,一个可被插件识别的 Cobblestone x9 物品等效于以下结构:
heart_of_the_sea[
custom_model_data={strings:["compactresources:cobblestone/x9"]},
custom_data={PublicBukkitValues:{compactresources:compressed_material:"cobblestone",compactresources:compression_level:"x9"}},
item_name=[{"translate":"block.minecraft.cobblestone"}," x9"]
]
若仅用于数据包、命令或战利品表的纯展示用途,minecraft:custom_model_data 组件是关键部分。
若要与 CompactResources 插件保持互操作性,请同时保留 PublicBukkitValues 负载。
/give 命令示例
/give @s heart_of_the_sea[custom_model_data={strings:["compactresources:cobblestone/x9"]},custom_data={PublicBukkitValues:{compactresources:compressed_material:"cobblestone",compactresources:compression_level:"x9"}},item_name=[{"translate":"block.minecraft.cobblestone"}," x9"]] 1
如果您只想测试模型的视觉效果,且不需要插件将该物品视为压缩方块,使用以下更短的命令即可:
/give @s heart_of_the_sea[custom_model_data={strings:["compactresources:cobblestone/x9"]}] 1
支持的材料
<material> 部分必须是以下 ID 之一:
cobblestone
stone
cobbled_deepslate
deepslate
dirt
sand
gravel
clay
coal_block
raw_copper_block
raw_iron_block
raw_gold_block
copper_block
iron_block
gold_block
netherite_block
<level> 部分必须是以下之一:
x9
x81
x729
模型和纹理文件
每个模型存储于:
assets/compactresources/models/item/compressed/<material>_<level>.json
每个纹理存储于:
assets/compactresources/textures/item/compressed/<material>_<level>.png
例如:
assets/compactresources/models/item/compressed/cobblestone_x9.json
assets/compactresources/textures/item/compressed/cobblestone_x9.png
您可以替换 PNG 文件,同时保持相同的路径和文件名。
物品定义和模型文件已经配置好指向这些位置。
通过 CompactResources 插件进行服务端资源包分发
当与 CompactResources 插件配合使用时,请在 config.yml 中使用本资源包的下载链接:
resource-pack:
enabled: true
force: true
url: 'https://cdn.modrinth.com/data/.../versions/.../compact-resources-pack.zip'
sha1: '<zip sha1>'
uuid: '9d54b89a-1738-4307-abd8-3f7f9d8613f5'
CompactResources Pack
CompactResources Pack provides item models for Heart of the Sea based custom items created by the CompactResources Paper plugin.
This pack is the companion resource pack for CompactResources and is developed primarily for that plugin. The plugin handles recipes, item metadata, stack-size behavior, and optional server-side pack delivery; this pack supplies the client-side models and textures those items need.
The pack does not add blocks, items, recipes, or gameplay logic by itself.
It only changes how specific minecraft:heart_of_the_sea item stacks are rendered when they carry the expected Custom Model Data string.
Related projects:
Item Model Contract
The resource pack overrides:
assets/minecraft/items/heart_of_the_sea.json
That item definition reads the minecraft:custom_model_data component and selects a model when its strings list contains a value in this format:
compactresources:<material>/<level>
Example:
compactresources:cobblestone/x9
compactresources:cobblestone/x81
compactresources:cobblestone/x729
Only the Custom Model Data string is required for this resource pack to display the custom model.
The plugin also writes Persistent Data Container values so it can identify the item on the server.
Plugin Item Structure
CompactResources creates compressed blocks as minecraft:heart_of_the_sea items with three important pieces of metadata:
minecraft:custom_model_data.strings: selects the model in this resource pack.
- Bukkit Persistent Data Container: identifies the compressed material and level.
minecraft:item_name: displays a translated block name followed by the level.
In vanilla item component syntax, a plugin-recognizable Cobblestone x9 item is equivalent to this shape:
heart_of_the_sea[
custom_model_data={strings:["compactresources:cobblestone/x9"]},
custom_data={PublicBukkitValues:{compactresources:compressed_material:"cobblestone",compactresources:compression_level:"x9"}},
item_name=[{"translate":"block.minecraft.cobblestone"}," x9"]
]
For display-only use with a datapack, command, or loot table, the minecraft:custom_model_data component is the key part.
For interoperability with the CompactResources plugin, keep the PublicBukkitValues payload as well.
Example /give Command
/give @s heart_of_the_sea[custom_model_data={strings:["compactresources:cobblestone/x9"]},custom_data={PublicBukkitValues:{compactresources:compressed_material:"cobblestone",compactresources:compression_level:"x9"}},item_name=[{"translate":"block.minecraft.cobblestone"}," x9"]] 1
If you only want to test the model visually and do not need the plugin to treat the item as a compressed block, this shorter form is enough:
/give @s heart_of_the_sea[custom_model_data={strings:["compactresources:cobblestone/x9"]}] 1
Supported Materials
The <material> segment must be one of these IDs:
cobblestone
stone
cobbled_deepslate
deepslate
dirt
sand
gravel
clay
coal_block
raw_copper_block
raw_iron_block
raw_gold_block
copper_block
iron_block
gold_block
netherite_block
The <level> segment must be one of:
x9
x81
x729
Model and Texture Files
Each model is stored at:
assets/compactresources/models/item/compressed/<material>_<level>.json
Each texture is stored at:
assets/compactresources/textures/item/compressed/<material>_<level>.png
For example:
assets/compactresources/models/item/compressed/cobblestone_x9.json
assets/compactresources/textures/item/compressed/cobblestone_x9.png
You can replace the PNG files while keeping the same paths and file names.
The item definition and model files are already wired to those locations.
Server Resource Pack Delivery via CompactResources plugin
When used with the CompactResources plugin, use the download link of this pack in config.yml:
resource-pack:
enabled: true
force: true
url: 'https://cdn.modrinth.com/data/.../versions/.../compact-resources-pack.zip'
sha1: '<zip sha1>'
uuid: '9d54b89a-1738-4307-abd8-3f7f9d8613f5'
评论 0
登录后参与评分
还没有评论,来抢沙发吧