AlexModGuy / Citadel

A Library containing shared code used throughout most of my projects. Can be considered a continuation of LLibrary, of which this borrows the majority of its source code from.
24 stars 28 forks source link

Cache merged surface rules based on input #130

Closed Su5eD closed 9 months ago

Su5eD commented 9 months ago

The issue

Currently, surface rules are merged once per NoiseBasedChunkGenerator instance, ignoring any change in the original value. However, this becomes an issue when another mod modifies NoiseGeneratorSettings.surfaceRules after mergedSurfaceRule has been calculated, as its changes never take effect.

For reproduction steps, see

The solution

Rather than keeping the first calculated mergedSurfaceRule forever, we re-run this calculation every time the input rules change. This ensures the merged rules will always be up to date and compatible with other mods that might modify them.

Fixes Sinytra/Connector#149