From c2b1f3a73be2bb9c253e035a178b0731fba01e41 Mon Sep 17 00:00:00 2001 From: kayjaydee Date: Fri, 24 Apr 2026 15:34:55 +0200 Subject: [PATCH] fix(04-bugfix): move wand JSON to Server/Item/Items/ and clone Weapon_Wand_Root template Empirical findings from HytaleServer.jar decompile + Assets.zip introspection: - AssetRegistryLoader.loadAssets0() resolves each plugin asset-pack root to /Server/, then iterates AssetStores and loads from Server//. For the Item AssetStore, path is 'Item/Items'. So the wand JSON MUST live at Server/Item/Items/. - The previous src/main/resources/Items/gravityflip_wand.json path was never scanned: the loader would look at /Server/Item/Items/. - Key function is Item::getId with item.id = blockTypeKey (filename minus .json). So file 'gravityflip_wand.json' -> lookup id 'gravityflip_wand'. JSON content cloned from vanilla Weapon_Wand_Root.json (extracted from HYTALE SERVER/Assets.zip), which is the minimal wand template: - Categories: ['Items.Weapons'] -> shows up in builder/creative menu. - Icon/Model/Texture reuse vanilla wand assets (no custom art shipped). - PlayerAnimationsId: Wand -> proper holding animation. - ItemSoundSetId: ISS_Weapons_Wand -> pickup/drop SFX. - Utility.Compatible=true and Weapon={} keep it functional in builder tools. - Interactions.Primary/Secondary are inline {Type: GravityFlipWand} objects, which the plugin's CodecRegistry(Interaction.CODEC).register call binds to GravityFlipWandInteraction.CODEC (04-01 pattern, Finding 3). --- .../resources/Items/gravityflip_wand.json | 16 ------ .../Server/Item/Items/gravityflip_wand.json | 50 +++++++++++++++++++ 2 files changed, 50 insertions(+), 16 deletions(-) delete mode 100644 src/main/resources/Items/gravityflip_wand.json create mode 100644 src/main/resources/Server/Item/Items/gravityflip_wand.json diff --git a/src/main/resources/Items/gravityflip_wand.json b/src/main/resources/Items/gravityflip_wand.json deleted file mode 100644 index 8e00e47..0000000 --- a/src/main/resources/Items/gravityflip_wand.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "Icon": "Torch_Fire", - "TranslationProperties": { - "Translation": "Gravity Flip Wand" - }, - "ResourceType": "Utility", - "MaxStackSize": 1, - "Interactions": { - "Primary": { - "Type": "GravityFlipWand" - }, - "Secondary": { - "Type": "GravityFlipWand" - } - } -} diff --git a/src/main/resources/Server/Item/Items/gravityflip_wand.json b/src/main/resources/Server/Item/Items/gravityflip_wand.json new file mode 100644 index 0000000..bb4b152 --- /dev/null +++ b/src/main/resources/Server/Item/Items/gravityflip_wand.json @@ -0,0 +1,50 @@ +{ + "TranslationProperties": { + "Name": "Gravity Flip Wand", + "Description": "Primary click: set pos1. Secondary click: set pos2. Use /gravityflip define to finalise a region." + }, + "Categories": [ + "Items.Weapons" + ], + "Icon": "Icons/ItemsGenerated/Weapon_Wand_Wood.png", + "Quality": "Rare", + "ItemLevel": 40, + "Model": "Items/Weapons/Wand/Wood.blockymodel", + "Texture": "Items/Weapons/Wand/Wood_Texture.png", + "PlayerAnimationsId": "Wand", + "Utility": { + "Compatible": true + }, + "Interactions": { + "Primary": { + "Type": "GravityFlipWand" + }, + "Secondary": { + "Type": "GravityFlipWand" + } + }, + "IconProperties": { + "Scale": 0.6, + "Translation": [ + -13, + -16 + ], + "Rotation": [ + 45, + 90, + 0 + ] + }, + "DroppedItemAnimation": "Items/Animations/Dropped/Dropped_Diagonal_Left.blockyanim", + "Tags": { + "Type": [ + "Weapon" + ], + "Family": [ + "Wand" + ] + }, + "Weapon": {}, + "ItemSoundSetId": "ISS_Weapons_Wand", + "MaxStackSize": 1 +}