Fabric API

Fabric API

152M Downloads

possible null Registry access in resource conditions API

MehVahdJukaar opened this issue ยท 1 comments

commented

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

commented

It should be noted that the only major version that this issue pertains to is 1.20.1.