Skip to content

Fix registry issues - #108

Open
SpaceWalkerRS wants to merge 8 commits into
gen2from
fix-registry-issues
Open

SpaceWalkerRS wants to merge 8 commits into
gen2from
fix-registry-issues

Conversation

@SpaceWalkerRS

Copy link
Copy Markdown
Member
  • fixes Registry::iterator returning an Iterator without a reliable order - now it returns a iterator that's ordered by numerical IDs
  • fixes crashes in 18w43a+

In 18w43a+, Registry::<clinit> both creates and populates all registries. Several OSL APIs wrap Vanilla registries, which was triggered in regular mod entrypoints, which are invoked before Registry::<clinit>. This leads to the OSL registries being null and as a result crashes if any mod tries to use those APIs to register content.

The new registry-init entrypoint is carefully invoked after vanilla registries are created but before they are populated, which avoids the earlier issue. In 1.13.2- this issue does not exist, and the registry-init entrypoint is simply invoked at the beginning of Bootstrap::init.

This fixes an issue in 18w43a+, where Registry::<clinit> both creates and populates all registries. Several OSL APIs wrap Vanilla registries, which was triggered in regular mod entrypoints, which are invoked before Registry::<clinit>. This leads to the OSL registries being null and as a result crashes if any mod tries to use those APIs to register content.

The new registry-init entrypoint is carefully invoked after vanilla registries are created but before they are populated, which avoids the earlier issue. In 1.13.2- this issue does not exist, and the registry-init entrypoint is simply invoked at the beginning of Bootstrap::init
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.

1 participant