From 8cb6b307bdf58ce53864f9a00ebc33d28cea634c Mon Sep 17 00:00:00 2001 From: Duckelekuuk Date: Thu, 1 Aug 2024 19:26:15 +0200 Subject: [PATCH 1/2] Add custom model data offset field as plugin configuration --- src/components/blueprintSettingsDialog.svelte | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/blueprintSettingsDialog.svelte b/src/components/blueprintSettingsDialog.svelte index d4c077a2..db1f5e04 100644 --- a/src/components/blueprintSettingsDialog.svelte +++ b/src/components/blueprintSettingsDialog.svelte @@ -500,6 +500,12 @@ valueChecker={displayItemChecker} /> + + Date: Thu, 1 Aug 2024 13:38:58 -0400 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=9A=A7=20Make=20exported=20settings?= =?UTF-8?q?=20more=20specific?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- schemas/pluginJson.schema.json | 6 ++++++ src/systems/jsonCompiler.ts | 19 ++++++++----------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/schemas/pluginJson.schema.json b/schemas/pluginJson.schema.json index 873827bf..fb9ed438 100644 --- a/schemas/pluginJson.schema.json +++ b/schemas/pluginJson.schema.json @@ -12,6 +12,7 @@ "export_namespace", "bounding_box", "display_item", + "custom_model_data_offset", "baked_animations" ], "properties": { @@ -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, diff --git a/src/systems/jsonCompiler.ts b/src/systems/jsonCompiler.ts index f5de3b3b..d81e63e6 100644 --- a/src/systems/jsonCompiler.ts +++ b/src/systems/jsonCompiler.ts @@ -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'] } @@ -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),