- peaceful structure spawns would not run in peaceful mode (e.g., parrots)
- water structure spawns (e.g., guardians) would not run because the code required air above
- small code improvements
Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4607
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
Fixes a warning.
Mobs spawners really only need to check the entity `.is_mob` as all mobs should have this set.
Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4501
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: WillConker <willconker@noreply.git.minetest.land>
Co-committed-by: WillConker <willconker@noreply.git.minetest.land>
- local functions, as they are not called by anywhere else
- delay water check of reed, first check height
- reduce number of get_node calls (for height 1,2,3 the old code used 4,5,4 calls, the new only 2,3,3)
- cane growth rate is also reduced
This will make the ABM cheaper.
Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4590
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
No functional changes, just more vector API, which supposedly is faster?
Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4567
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
Use a classic pseudo-random hashing approach, by multiplication of chunk numbers
with large primes that should be more random.
- make slime density (as 1 in N) and maximum light level (default: no limit) configurable
- Allow using a 3d chunking system where y is also used for hashing
This does *not* modify spawn frequency, only the chunk logic.
Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4466
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
Sometimes, pools would spawn deep underground and then produce deep holes.
I noticed that such pools would be at +48, at the block boundary.
IMHO this may be an error in minetest surface detection.
Nevertheless, here is a workaround: require air above pool spawns.
Also clean up the pool code
Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4571
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
Placing the texture at -16 with width 16 means it is not used. At most -14 may be used (0 indexed, I believe) if you want to retain 2x2 pixels.
Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4624
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: kno10 <kno10@noreply.git.minetest.land>
Co-committed-by: kno10 <kno10@noreply.git.minetest.land>
This adds defensive checks to guard against crashing when digging with an unknown item in hand.
Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4623
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: teknomunk <teknomunk@protonmail.com>
Co-committed-by: teknomunk <teknomunk@protonmail.com>
As spawning happens via gennotify anyway, we can omit placing a
structblock right away.
This also avoids certain cases of holes in snow cover or water.
Plus, the code is simpler.
Isolated from the big mapgen overhaul, for the main branch.
Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4619
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>