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

ChunkGenerator - add getHeight to ChunkData #12311

Merged
merged 8 commits into from
Mar 23, 2025

Conversation

ShaneBeee
Copy link
Contributor

This PR aims to add an option to ChunkGenerator.ChunkData to get the current height.
This allows to get the height generated in a previous step.
For example, let's say I have a generator where I allow Minecraft to generate the noise, but I want to generate the surface.
I can get the height that was previously generated in the noise step, and plop my surface block on top of that in the surface step.

Closes #12048

@ShaneBeee ShaneBeee requested a review from a team as a code owner March 17, 2025 18:43
@Lulu13022002
Copy link
Contributor

A check for out of bound position might be nice like the other methods and then return 0 (or throw) to avoid unexpected value. And the first line of javadocs seems incomplete.

@ShaneBeee
Copy link
Contributor Author

ShaneBeee commented Mar 18, 2025

A check for out of bound position might be nice like the other methods and then return 0 (or throw) to avoid unexpected value.

Thats a good idea, thank you, good catch.

And the first line of javadocs seems incomplete.

Well that is embarrassing 😬

edit: updated! thanks again.

- not sure what I did here, but I missed a good chunk of this
@kennytv
Copy link
Member

kennytv commented Mar 21, 2025

I'd just throw if it's OOB and make the checks clearer with <0 / >15

@ShaneBeee
Copy link
Contributor Author

I'd just throw if it's OOB and make the checks clearer with <0 / >15

Sounds good to me, thank you.
Changes have been made!

@Warriorrrr Warriorrrr added scope: api type: feature Request for a new Feature. labels Mar 23, 2025
@Warriorrrr Warriorrrr merged commit 7819df1 into PaperMC:main Mar 23, 2025
7 checks passed
@ShaneBeee ShaneBeee deleted the shane/chunk-data-height branch March 24, 2025 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: api type: feature Request for a new Feature.
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

ChunkGenerator - Implement a way to get noise terrain height in surface generation
5 participants