fix(04-bugfix): wire wand via RootInteraction asset (NPE on click)

Root cause: Item.Interactions map value codec is RootInteraction.CHILD_ASSET_CODEC
(expects a String asset id referencing an asset under Item/RootInteractions/), not
an inline Interaction object. Previous JSON used "Primary": { "Type": "GravityFlipWand" }
which silently loaded a RootInteraction asset with no interactionIds -> operations[]
empty -> InteractionManager.serverTick NPE on operation.getWaitForDataFrom() when
the click chain ticked.

Fix:
- New Interaction asset Server/Item/Interactions/gravityflip_wand_click.json
  ({"Type": "GravityFlipWand"}) matching our registered Interaction subtype.
- New RootInteraction asset Server/Item/RootInteractions/gravityflip_wand_root.json
  wrapping the interaction id in its Interactions[] list (required by RootInteraction
  CODEC, see RootInteraction.build() -> OperationsBuilder).
- Item JSON now references the RootInteraction by id:
  "Interactions": { "Primary": "gravityflip_wand_root", "Secondary": "gravityflip_wand_root" }
  matching vanilla Weapon_Wand_Wood.json pattern ("Primary": "Wand_Primary").

Binding (Interaction.CODEC.register("GravityFlipWand", ...)) is unchanged and
correct -- subtype registration on the Interaction AssetCodecMapCodec, consistent
with InstancesPlugin/ExitInstanceInteraction pattern.
This commit is contained in:
2026-04-24 16:34:37 +02:00
parent c2b1f3a73b
commit 0d4cb2e687
3 changed files with 10 additions and 6 deletions
@@ -0,0 +1,3 @@
{
"Type": "GravityFlipWand"
}
@@ -16,12 +16,8 @@
"Compatible": true
},
"Interactions": {
"Primary": {
"Type": "GravityFlipWand"
},
"Secondary": {
"Type": "GravityFlipWand"
}
"Primary": "gravityflip_wand_root",
"Secondary": "gravityflip_wand_root"
},
"IconProperties": {
"Scale": 0.6,
@@ -0,0 +1,5 @@
{
"Interactions": [
"gravityflip_wand_click"
]
}