Skip to content

fix(host): make C# item custom values gob-safe#1

Merged
RestartFU merged 1 commit into
bedrock-gophers:masterfrom
MymaQc:fix/csharp-item-values-gob
Jul 15, 2026
Merged

fix(host): make C# item custom values gob-safe#1
RestartFU merged 1 commit into
bedrock-gophers:masterfrom
MymaQc:fix/csharp-item-values-gob

Conversation

@MymaQc

@MymaQc MymaQc commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

This fixes a panic when C# plugins set custom item values that are later encoded by Dragonfly through encoding/gob.

C# item custom values are transported through ValuesNBT. When those values contain compounds or byte arrays, they may be decoded as map[string]any or fixed byte arrays before being passed to item.Stack.WithValue. Dragonfly later serializes stack values with gob, which requires concrete interface types to be registered and byte arrays to use a gob-safe representation.

Changes

  • Register supported custom value container types for gob.
  • Normalize fixed byte arrays from decoded NBT into []byte before storing them on item stacks.
  • Add a regression test covering byte arrays, nested compounds, and gob encoding of custom item values.

@RestartFU
RestartFU merged commit aa99cf4 into bedrock-gophers:master Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants