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

Standardise WrapperLookup params and fields to "registries" #3956

Merged
merged 6 commits into from
Aug 27, 2024

Conversation

Juuxel
Copy link
Member

@Juuxel Juuxel commented Aug 22, 2024

  • Some old more descriptive names like nonReloadables, first/second, fullRegistry and base/patches were retained.
  • I also added this class as well as a few similar cases to CONVENTIONS.md.
    • Another option is a general rule for these "providers" (and MatrixStack is sort of already covered under the collection rules). It would just lead to refactors like registry, blockRegistry -> blocks, which are out of scope here. 😅

Juuxel added 2 commits August 22, 2024 14:54
Some old more descriptive names like `nonReloadables`, `first`/`second`, `fullRegistry`
and `base`/`patches` were retained.
@Juuxel Juuxel added refactor A PR that renames existing names. snapshot A PR that targets a snapshot version of Minecraft labels Aug 22, 2024
@Juuxel Juuxel requested a review from a team as a code owner August 22, 2024 12:13
@Juuxel Juuxel requested a review from a team August 22, 2024 12:13
Copy link
Member

@NebelNidas NebelNidas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall a welcome change! However, searching for ARG \d registryLookup reveals further untouched entries. Have you left them as-is intentionally or have you simply missed them? Long-term we should let Name Proposal handle this via default parameter names attached to the corresponding class mappings.

@Juuxel
Copy link
Member Author

Juuxel commented Aug 22, 2024

I used MIO to look at all WrapperLookup fields and all methods with a WrapperLookup parameter and map all of the disallowed names (lookup, registryLookup, registriesLookup and wrapperLookup) to registries.

I excluded lambdas/synthetics to avoid name clashes with the enclosing context just in case - that's where some of them come from. I'll fix this.

(There's also one instance of a synthetic method's WrapperLookup param being called nbt?) That was just a bug in my code.

@Juuxel
Copy link
Member Author

Juuxel commented Aug 22, 2024

The PR now has all existing WrapperLookup params and new params for all missing non-synthetic cases. I excluded the synthetic ones since it'd also include mapping invisible capture params for lambdas.

@apple502j
Copy link
Contributor

Note: I think for block/item/etc registry it makes sense to use Registry suffix. There are too many instances of lists/maps/sets of blocks or items that differentiating between them by name appears justified.

I am neutral on registryLookup vs registries. Does need a standard, though.

@Juuxel
Copy link
Member Author

Juuxel commented Aug 22, 2024

Yeah, I agree on registries benefitting from the suffix.

I used registries as the name of the wrapper lookups as they are basically dictionaries of registry key -> view of registry. (And it was one of the original names used in Yarn for this type, along with the *lookup ones).

@Shnupbups Shnupbups dismissed NebelNidas’s stale review August 23, 2024 20:55

Request was addressed.

@Shnupbups Shnupbups requested a review from modmuss50 August 23, 2024 20:55
@modmuss50 modmuss50 merged commit 62e6179 into FabricMC:24w34a Aug 27, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor A PR that renames existing names. snapshot A PR that targets a snapshot version of Minecraft
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants