1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-30 19:22:14 +00:00

Extend core.generate_decorations to generate biomes respecting the biome map (#16397)

Large structures which are generated in on_generated callbacks
independently by Lua cannot influence decoration placement. This
change enables such a callback to assume responsibility for generating
decorations itself, presumably after structures are placed, by
disabling decorations in mg_flags and executing
core.generate_decorations.

---------

Co-authored-by: Po Lu <luangruo@yahoo.com>
This commit is contained in:
Cora de la Mouche 2025-09-20 13:44:19 +02:00 committed by GitHub
parent 29490cb0f7
commit fc6bef7de6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 52 additions and 15 deletions

View file

@ -5847,6 +5847,8 @@ Utilities
on_timer_four_args = true,
-- `ParticleSpawner` definition supports `exclude_player` field (5.14.0)
particlespawner_exclude_player = true,
-- core.generate_decorations() supports `use_mapgen_biomes` parameter (5.14.0)
generate_decorations_biomes = true,
}
```
@ -6739,10 +6741,14 @@ Environment access
* Generate all registered ores within the VoxelManip `vm` and in the area
from `pos1` to `pos2`.
* `pos1` and `pos2` are optional and default to mapchunk minp and maxp.
* `core.generate_decorations(vm[, pos1, pos2])`
* `core.generate_decorations(vm[, pos1, pos2, [use_mapgen_biomes]])`
* Generate all registered decorations within the VoxelManip `vm` and in the
area from `pos1` to `pos2`.
* `pos1` and `pos2` are optional and default to mapchunk minp and maxp.
* `use_mapgen_biomes` (optional boolean). For use in on_generated callbacks only.
If set to true, decorations are placed in respect to the biome map of the current chunk.
`pos1` and `pos2` must match the positions of the current chunk, or an error will be raised.
default: `false`
* `core.clear_objects([options])`
* Clear all objects in the environment
* Takes an optional table as an argument with the field `mode`.