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:
@@ -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"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user