Skip to content

Use resource keys for world gen layers#4527

Closed
screret wants to merge 17 commits intoGregTechCEu:1.20.1-v8.0.0from
screret:sc/use-resource-keys-for-world-gen-layers
Closed

Use resource keys for world gen layers#4527
screret wants to merge 17 commits intoGregTechCEu:1.20.1-v8.0.0from
screret:sc/use-resource-keys-for-world-gen-layers

Conversation

@screret
Copy link
Contributor

@screret screret commented Jan 31, 2026

What

Make IWorldGenLayer and its subclasses use ResourceKey<Level> instances for dimension matching instead of 'plain' ResourceLocations

Implementation Details

Changed the field/method arg types to ResourceKey<Level>, removed any .location() calls that were used for converting resource keys to reslocs

Outcome

neater code with less unwrapping and less chances for mistakes

Additional Information

IWorldGenLayer#getLevels was renamed to IWorldGenLayer#getDimensions.
Layers created with KubeJS do not require any changes to function.

Potential Compatibility Issues

Addon mods with custom world gen layers have to change their code slighly.
If they have a custom implementation (like GT's where it's an enum), they have to change it a bit more to fix the method names/args.

@screret screret requested a review from a team as a code owner January 31, 2026 14:28
@YoungOnionMC YoungOnionMC added type: bugfix General bug fixes Release: Major - 0.X.0 Releases focused on Content, changes to gameplay; While maintaining mostly API stability. labels Feb 4, 2026
@Ghostipedia Ghostipedia deleted the branch GregTechCEu:1.20.1-v8.0.0 February 14, 2026 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.20.1 Release: Major - 0.X.0 Releases focused on Content, changes to gameplay; While maintaining mostly API stability. type: bugfix General bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants