Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions schemas/pluginJson.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"export_namespace",
"bounding_box",
"display_item",
"custom_model_data_offset",
"baked_animations"
],
"properties": {
Expand All @@ -36,6 +37,11 @@
"default": "minecraft:white_dye",
"description": "The item to display the Blueprints models in-game. Multiple Blueprints can be placed on the same item and they will be merged automatically."
},
"custom_model_data_offset": {
"type": "number",
"default": 0,
"description": "The offset to use for the Custom Model Data of the Display Item. Allows multiple Blueprints on the same item, but in separate, unaffiliated Resource Packs."
},
"baked_animations": {
"type": "boolean",
"default": true,
Expand Down
6 changes: 6 additions & 0 deletions src/components/blueprintSettingsDialog.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,12 @@
valueChecker={displayItemChecker}
/>

<NumberSlider
label={translate('dialog.blueprint_settings.custom_model_data_offset.title',)}
tooltip={translate('dialog.blueprint_settings.custom_model_data_offset.description')}
bind:value={customModelDataOffset}
/>

<Checkbox
label={translate('dialog.blueprint_settings.baked_animations.title')}
tooltip={translate('dialog.blueprint_settings.baked_animations.description')}
Expand Down
19 changes: 8 additions & 11 deletions src/systems/jsonCompiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export interface IExportedJSON {
bounding_box: (typeof defaultValues)['bounding_box']
// Resource Pack Settings
display_item: (typeof defaultValues)['display_item']
custom_model_data_offset: (typeof defaultValues)['custom_model_data_offset']
// Plugin Settings
baked_animations: (typeof defaultValues)['baked_animations']
}
Expand Down Expand Up @@ -230,18 +231,14 @@ export function exportJSON(options: {
}
}

const blueprintSettings = { ...aj } as any
delete blueprintSettings.enable_plugin_mode
delete blueprintSettings.data_pack_export_mode
delete blueprintSettings.enable_advanced_data_pack_settings
delete blueprintSettings.data_pack
delete blueprintSettings.summon_commands
delete blueprintSettings.interpolation_duration
delete blueprintSettings.teleportation_duration
delete blueprintSettings.use_storage_for_animation

const json: IExportedJSON = {
settings: blueprintSettings,
settings: {
export_namespace: aj.export_namespace,
bounding_box: aj.bounding_box,
display_item: options.displayItemPath,
custom_model_data_offset: aj.custom_model_data_offset,
baked_animations: aj.baked_animations,
},
textures: mapObjEntries(rig.textures, (id, texture) => [
texture.uuid,
serializeTexture(id, texture),
Expand Down