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

LootTableLoadEvent does not have registry access #1625

Open
uecasm opened this issue Oct 24, 2024 · 1 comment · May be fixed by #1677
Open

LootTableLoadEvent does not have registry access #1625

uecasm opened this issue Oct 24, 2024 · 1 comment · May be fixed by #1677
Labels
triage Needs triaging and confirmation

Comments

@uecasm
Copy link

uecasm commented Oct 24, 2024

Minecraft Version: 1.21.1

NeoForge Version: 21.1.9

Description of issue:

The LootTableLoadEvent appears to be missing some API changes that were made around other loot-table-adjacent things in 1.20.5; in particular:

  • getName() returns a ResourceLocation and there's no method that returns the New Hotness ResourceKey<LootTable> used elsewhere.
    • This is mostly cosmetic, but it's an inconsistency with other API changes,
  • There doesn't appear to be any way to access a HolderLookup.Provider from this event, which is required to access various registries -- for example, if you want to add an enchantment condition check you need some way to access the enchantment registry.
    • Since this event is fired during deserialization, there is not yet any server OR client, so CommonHooks.resolveLookup always fails.
    • The codec (or rather the RegistryOps) should have access to the registry lookups, but it needs to be passed into the event.
@uecasm uecasm added the triage Needs triaging and confirmation label Oct 24, 2024
@ZestyBlaze
Copy link
Contributor

Oh how did I miss this during #1529 , I'll look into this when I get a chance

Matyrobbrt added a commit to Matyrobbrt/NeoForge that referenced this issue Nov 9, 2024
@Matyrobbrt Matyrobbrt linked a pull request Nov 9, 2024 that will close this issue
Matyrobbrt added a commit to Matyrobbrt/NeoForge that referenced this issue Dec 4, 2024
Technici4n added a commit to Matyrobbrt/NeoForge that referenced this issue Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Needs triaging and confirmation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants