Skip to content

possible null Registry access in resource conditions API #236

@MehVahdJukaar

Description

@MehVahdJukaar

Minecraft version

1.20.1 (LTS)

Describe the bug

possible null ptr due to thraed local usage

Steps to reproduce

in DataPackContentsMixin, which targets the ReloadableServerResources class reload method, a thread local is set ResourceConditionsImpl.CURRENT_REGISTRIES.
this field is later accessed inside the reloader which assumes the reload happens on same thread.
That is not guaranteed, nothing stops a mod from wrapping the returned reload instance and run it in another thread.
To me this reliance on thread local static field to pass that registry access along seems very brittle and unreliable way to propagate objects around.

This is not an issue in 1.21.1

FabricMC/fabric-api#4791

Logs

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

1.20.1Targets Minecraft 1.20.1bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions