Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Datapack Registry Callbacks #1158

Open
frqnny opened this issue Jun 22, 2024 · 4 comments
Open

[Feature] Datapack Registry Callbacks #1158

frqnny opened this issue Jun 22, 2024 · 4 comments
Labels
enhancement New (or improvement to existing) feature or request

Comments

@frqnny
Copy link

frqnny commented Jun 22, 2024

Unless I am mistaken, there currently is no way to modify datapack registries in the API. I'm wondering if its planned or if its in the works?

@frqnny frqnny added the enhancement New (or improvement to existing) feature or request label Jun 22, 2024
@frqnny frqnny changed the title Datapack Registry Callbacks [Feature] Datapack Registry Callbacks Jun 22, 2024
@ChampionAsh5357 ChampionAsh5357 added the needs response Further information is requested label Jun 22, 2024
@ChampionAsh5357
Copy link
Contributor

Could you provide more information? What do you mean by 'modify data registries'? Like add entries to it? Modify existing objects like biomes? Something else entirely?

@frqnny
Copy link
Author

frqnny commented Jun 22, 2024

I believe the 1.20.2 Registry Rework has a ModifyRegistryEvent that only applies to Builtin Registries. In that event, you can add a callback to each time an object is added to that registry.

It would be particularly useful to do so with datapack registries, as the hook for that is particularly more hidden and should be handled by the API.

@frqnny
Copy link
Author

frqnny commented Jun 22, 2024

#257 (comment)

Found some discussion around it being done at a later date according to this comment in the PR.

@ChampionAsh5357 ChampionAsh5357 removed the needs response Further information is requested label Jun 22, 2024
@ChampionAsh5357
Copy link
Contributor

Ah, I'm guessing that's because the datapack registries are added during level load. I don't see any difficulty in adding another event around where RegistryDataLoader.RegistryData#create is called, assuming that the WritableRegistry doesn't get overridden later in the pipeline.

Someone just needs to create the PR for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New (or improvement to existing) feature or request
Projects
None yet
Development

No branches or pull requests

2 participants