Mgv6: Add heightmap. Do not make large caves that are entirely above ground #2410
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds a heightmap to mgv6, which is needed by decorations if they are used in future in mgv6.
Mgv5 and mgv7 already have heightmaps, the heightmap is available for use in an 'on generated' function as the 'mapgen object heightmap'.
Checks startpoint and endpoint of large caves, if both are above ground aborts cave generation, if one is above and one below the cave passes through the surface and therefore is needed to shape terrain as currently.
Tested by flying around for 5 minutes, could not find a single shadow bug.
I also tested the code by making large caves formed from water nodes to confirm they are still often formed intersecting (and therefore shaping) the terrain surface, while also not being formed high above terrain as noticed before.
This may occasionally slightly change mgv6 terrain from how it has been before, but this will be very rare and i feel is justified by the bugfix.