- 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>
As witch huts use flag "liquid_surface", place_on only can be water. If we want on-shore witch huts, this needs to be solved differently.
Also, probably no witch huts in deep ocean swamp water?
Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4605
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
- breaking cactus will drop randomly in x=-0.75..+0.75, z=-0.75..+0.75
- breaking cactus will have an initial velocity in this direction
- if a larger cactus break, they break into the same direction
- cactus growth rate reduced 4x, to debuff farm efficiency (will need a larger rebalancing)
- cactus only spawns when there is air surrounding it and above, so it does not immediately break
- slightly increase the frequency of cactus to counter this
The first changes make cactus farms possible.
Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4581
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
Stops lighting from being able to strike in locations where rain doesn't occur, but allows lightning in adjacent areas where is allowed.
Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4386
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>
Also *probably* fixed their blast res and hardness
Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4601
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: the-real-herowl <wiktor_t-i@proton.me>
Co-committed-by: the-real-herowl <wiktor_t-i@proton.me>
The absorption effect won't work on damage disabled servers and the
health bar and hunger bar is also hidden leaving the absorption bar
alone which makes it look not good. So not initializing it on those
servers might be a good idea.
Calling `hb.change_bar' with hunger bar on damage disabled server
will crash the server. To not overload other functions to check
`enable_damage' over and over, simply make `hb.change_bar' able to be
called with uninitialized identifiers. #4586
I left it in from another branch, didn't want to force push.
This reverts commit 58d2f59192073acf9f55406358bf48244e008b9b.
Revert "Walls use `source` parameter for default hardness and blast resistance"
I left it in from another branch, didn't want to force push.
This reverts commit e8944cc145dc59db53a9368d8ae269edf366e742.
Revert "Fix prismarine bricks and dark variant blast res."
I left it in from another branch, didn't want to force push.
This reverts commit 6125d625bc6ce15644cf8b579599f75da5bffd07.
Revert "Un-hardcode blast resistance, hardness for walls,"
I left it in from another branch, didn't want to force push.
This reverts commit 26e873703151bc4bfaf7588ad1e3afa731a05fbd.
Revert "All wood-type and nether-type fences now match material's blast resistance"
I left it in from another branch, didn't want to force push.
This reverts commit a1e20f29162462120fb1c046c2d34f8fcebfb413.
- Notably, smooth sandstone (and red) is much more durable than other sandstone variants
- Ender chest isn't actually more explosion resistant than obsidian, hmm
Change blast resistance to 0.75, add an optional hardness override parameter, because cobble is unique here
(Still instant-minable, this is a separate issue)
The old code takes the first return val of `minetest.item_place_node'
which is `itemstack'. Therefore, the variable `success' in the old code
is always true. The new code takes the second val which will be nil if
an invalid node placement occured.
This check is necessary since the ladder may be placed in the front of
pointed block while there is a node with hole (slabs, fences etc.) at
the same place resulting an invalid placement and sound played when
it shouldn't be played.
Previously, horses would continue to move even after the movement key was released. This was because mcl_mobs.drive was returning before stopping the horse. This commit makes mcl_mobs.drive stop the horse before returning.
Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4580
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: THE-NERD2 <pdp9729@gmail.com>
Co-committed-by: THE-NERD2 <pdp9729@gmail.com>
LUAs `math.random(a,b)` expects a and b to be integers. `size` was only randomized once.
Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4583
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
Mangrove tree variants 4, 5 and bees nest were not post processed with root growth.
Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4584
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
Prevents possible item duplication with other mods. Matches the behavior of the default `__builtin:item`.
See also https://github.com/mt-mods/pipeworks/issues/130
Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4530
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: OgelGames <ogelgames@noreply.git.minetest.land>
Co-committed-by: OgelGames <ogelgames@noreply.git.minetest.land>