Skip to content

fix: make data component type registry optional for pre-1.20.5 versions - #56

Merged
Shonz1 merged 3 commits into
mainfrom
fix/optional-data-component-type-registry
Oct 19, 2026
Merged

Shonz1 merged 3 commits into
mainfrom
fix/optional-data-component-type-registry

Conversation

@Shonz1

@Shonz1 Shonz1 commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

Fixes #55

Problem

MinecraftRegistry declared minecraft:data_component_type as required. Data component types were added in 1.20.5, so registries.json for 1.20.4 and older doesn't have that entry. Deserialization threw JsonException for those versions, which broke every registry lookup (MinecraftItemRegistry, MinecraftMenuRegistry, ...), not only data component types.

Changes

  • MinecraftRegistry.MinecraftDataComponentTypeRegistry is now optional and nullable.
  • When a version has no data component types, MinecraftDataComponentTypeRegistry.GetId / GetIdentifier return their not-found values (-1 / null).
  • Bump Void.Minecraft and Void.Proxy.Api to 0.6.0.
  • Ignore the .omc directory.

Verification

Built with 0 warnings and 0 errors. A throwaway console app run against the bundled resources gave:

Version Item stone DCT custom_data DCT id 0
1.20.2 1 -1 null
1.20.3–1.20.4 1 -1 null
1.20.5–1.20.6 1 0 minecraft:custom_data
1.21–1.21.1 1 0 minecraft:custom_data

The repo has no test project, so this PR doesn't add a regression test.

🤖 Generated with Claude Code

Shonz1 and others added 3 commits October 20, 2026 02:10
Registries for 1.20.4 and older have no minecraft:data_component_type
entry, so deserialization threw and broke every registry lookup for
those versions. The registry is now nullable and the data component
type lookups return their not-found values when it is absent.

Fixes #55

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Shonz1
Shonz1 merged commit e40fc7f into main Oct 19, 2026
3 checks passed
@Shonz1
Shonz1 deleted the fix/optional-data-component-type-registry branch October 19, 2026 23:13
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.

Registries before 1.20.5 fail to load: minecraft:data_component_type is required

1 participant