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

Closed
uecasm opened this issue Oct 24, 2024 · 2 comments · Fixed by #1677
Closed

LootTableLoadEvent does not have registry access #1625

uecasm opened this issue Oct 24, 2024 · 2 comments · Fixed by #1677
Labels
enhancement New (or improvement to existing) feature or request

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 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
@Matyrobbrt Matyrobbrt added enhancement New (or improvement to existing) feature or request and removed triage Needs triaging and confirmation labels Dec 15, 2024
@neoforged-releases
Copy link

🚀 This issue has been resolved in NeoForge version 21.4.40-beta, as part of #1677.

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

Successfully merging a pull request may close this issue.

3 participants