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:
parent
29490cb0f7
commit
fc6bef7de6
3 changed files with 52 additions and 15 deletions
|
@ -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`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue