Commit graph

179 commits

Author SHA1 Message Date
teknomunk
49c8ae2fa0 Quick patch to get cherry saplings growing pending inclusing of a proper tree API 2024-11-09 20:30:33 -06:00
kno10
d49426d453 Cleanup of mcl_core/functions (#4592)
Cleanup of mods/ITEMS/mcl_core/functions.lua

This improves several further ABMs such as vine growing, and uses the `vector` API instead of tables.

Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4592
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>
2024-11-10 02:32:51 +01:00
Mikita Wiśniewski
513413afc7 Use remove_node instead of dig_node in mcl_core ABMs (fixes #4628) (#4629)
The mycelium ABM has been left untouched because of the potential destructiveness. If we ever find that to be an issue, it can be fixed as part of a bigger PR.

Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4629
Reviewed-by: teknomunk <teknomunk@protonmail.com>
Co-authored-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-committed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
2024-09-19 18:54:39 +02:00
kno10
0752ed17d8 Improve cacti and cane growth ABM (#4590)
- 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>
2024-09-09 20:22:04 +02:00
kno10
8fd736e0fd Improve cactus drops and spawning (#4581)
- 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>
2024-08-30 18:22:05 +02:00
kno10
5e6e4967f0 Fix crying obsidian particles (#4583)
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>
2024-08-16 22:01:19 +02:00
WillConker
6c614d8376 Added line breaks in water freezing condition 2024-08-03 14:21:33 +02:00
WillConker
a785be59d9 Changed node light check to artificial light so that water can freeze in the day 2024-08-03 14:21:33 +02:00
cora
f23014005f Only freeze water under open air
and if light level < 10
2024-08-03 14:21:33 +02:00
cora
c2098d777f Prevent water freezing and ice melting ABMs from fighting 2024-08-03 14:21:33 +02:00
cora
dc07eea590 Freeze water in cold areas 2024-08-03 14:21:33 +02:00
𝕵𝖔𝖍𝖆𝖓𝖓𝖊𝖘 𝕱𝖗𝖎𝖙𝖟
a620d24ec8 Fix a number of crashes involving unknown nodes, also fix fishbuckets on_place (#3914)
Fixes: #3913 #3915

~~You can reproduce the crash by placing a fish bucket on top snow above an unknown node.

I also noticed that the code always uses pointed_thing.above so I fixed that and also added a function to mcl_utils to figure out where a node should be placed (either above or below). Looks like the rest of the code could also use improvement but at least it does not crash now.~~

Cora fixed a bunch of related crashes in Mineclona so I am replacing my commit and cherry picking all her commits here.
https://codeberg.org/mineclonia/mineclonia/pulls/549

Here is the list of fixes from that PR:
- Crash when placing snow layer on unknown nodes
- Crash when snow layers on unknown nodes are flooded
- Crash when placing fishbucket on snow on top of unknown nodes
- Crash when placing chorus flower and stem on unknown
- Crash when placing mob spawners on unknown
- The fishbucket on place to actually replace buildable_to

Co-authored-by: cora <coradelamouche@gmx.ch>
Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/3914
Reviewed-by: ancientmarinerdev <ancientmariner_dev@proton.me>
Co-authored-by: 𝕵𝖔𝖍𝖆𝖓𝖓𝖊𝖘 𝕱𝖗𝖎𝖙𝖟 <mrrar@noreply.git.minetest.land>
Co-committed-by: 𝕵𝖔𝖍𝖆𝖓𝖓𝖊𝖘 𝕱𝖗𝖎𝖙𝖟 <mrrar@noreply.git.minetest.land>
2023-09-29 18:47:07 +00:00
ancientmarinerdev
67ddad987d Fix grass not growing issue 2023-03-06 17:45:38 +00:00
FossFanatic
e82ff4781a Add grass palette nodes in a special group
This commit adds any nodes which make use of a grass palette to a `grass_palette` group, to avoid having to create a list of said nodes every time.
2023-03-05 12:45:44 +00:00
FossFanatic
0abda8ff20 Add new function for water nodes 2023-02-18 08:25:08 +00:00
FossFanatic
68e6965dd0 Remove excessive functions and change the appropriate stuff 2023-02-16 18:09:39 +00:00
FossFanatic
bea9bbe212 Improve certain functions 2023-02-14 18:10:49 +00:00
FossFanatic
abdd5e11c0 Shorten code slightly 2023-02-13 15:46:08 +00:00
FossFanatic
e17fab385b Add nil checks 2023-02-13 15:44:23 +00:00
FossFanatic
c88f0047c1 Merge branch 'master' into biome_colored_foliage 2023-02-12 08:44:29 +00:00
FossFanatic
0400d9a2a5 Even further improvements to some foliage code 2023-02-12 08:28:21 +00:00
FossFanatic
a70a6ef13d Improve some foliage code 2023-02-12 08:21:14 +00:00
FossFanatic
81dbdaab94 Adjust palette foliage check
The excessive 128 blocks high check has been changed to now check only up to 30 blocks, since the tallest 2x2 jungle tree I seemed to get was only 29 blocks tall.

I also discovered that the search area wasn't wide enough, so sometimes the most outer leaves avoided the check. I also adjusted that.
2023-02-11 07:53:12 +00:00
FossFanatic
7fbc84971e Remove useless function
This commit removes an useless function which wasn't really needed.
2023-02-10 15:12:37 +00:00
FossFanatic
1defd03408 Make the function work self grown saplings
Saplings now also get the biome's foliage colour when grown by themselves.
2023-02-10 10:06:55 +00:00
FossFanatic
d163faeb42 Use more fitting names for the newly added function
Basically renaming anything related to leaves in the new function to something more broad such as foliage, so vines aren't indirectly considered leaves. An aesthetic change, basically.
2023-02-10 08:08:28 +00:00
FossFanatic
197d3ae00b Make sapling foliage grab biome colour 2023-02-10 08:04:13 +00:00
FossFanatic
198375a18e Change stuff in mcl_core
Simply put, this commit changes some code so that leaves don't use `param2` to see if they rot or not, and will now use the biome colours.

This commit also makes it so vines do the same (use biome colours).
2023-02-08 16:11:38 +00:00
Michieal
ec7a97ba3e Made LBM run at every load, so that it catches anything missed from previous passes. 2023-02-06 16:54:23 -05:00
Michieal
de00b7228e Fix "mcl_core:dirt_with_dry_grass" to be "mcl_core:dirt_with_grass" with the savanna color index. 2023-02-05 21:17:53 -05:00
FossFanatic
54548ecfdf Merge branch 'master' into simplified_palette_index 2022-12-29 14:51:17 +00:00
FossFanatic
18e932997d Rename _mcl_palette_index to _mcl_grass_palette_index 2022-12-28 19:31:11 +00:00
Gregor Parzefall
8522b87444 Removed two duplicated sound definitions 2022-12-20 21:08:59 +01:00
kabou
adcf03e0c6 Refactor leaf decay ABM.
* The leaf decay ABM no longer scans all leaves nodes.  Now only
  "orphaned" leaves are decayed.  These nodes are placed by callbacks
  in tree trunk nodes upon their destruction.
* This commit also removes the tree trunk node caching system and an
  abm throttling mechanism and its associated globalstep function.
2022-12-15 22:42:08 +00:00
cora
48d6a2fd72 Add some ABM limits for lava ABMs 2022-11-03 14:11:03 +01:00
cora
8e41d5a1f4 Fix propagule growth 2022-08-02 12:02:20 +02:00
Sumyjkl
5fc662664f cactus will act as if dug instead of its own hardcoded breaking function 2022-07-24 15:59:00 +10:00
cora
da4aa9bc35 improve crying obsidian visuals 2022-07-18 22:21:58 +02:00
cora
efad7dad24 clean up 2022-07-05 11:19:47 +02:00
cora
27a945b8f3 Tweak crying obsidian particles 2022-07-05 11:19:47 +02:00
cora
78e187537f Add crying obsidian particle effect 2022-06-30 01:43:49 +02:00
cora
a83a2e9aba generate podzol under huge spruce trees 2022-04-21 22:25:47 +00:00
kabou
3f4dafc68f Add check for unknown nodes.
* Check if node has a definition table before attempting to evaluate its
  attributes.
* Define local variable to cache multiple accesses to `registered_nodes[]`
  and improve readability.
2022-03-09 14:14:45 +01:00
Elias Fleckenstein
970988cb39
Add sugar cane colorisation 2021-11-03 19:58:50 +01:00
NO11
bf62eb33fa Change label of cactus abm 2021-09-03 14:06:21 +00:00
NO11
0da7b3fbda Make cactus mechanisms more MC like (Fix #1741) 2021-09-02 20:38:01 +00:00
NO11
549bdeb6e9 Remove object:is_player 2021-07-12 21:41:57 +00:00
AFCMS
e81da3c4ff fix some mods using "core" insteed of "minetest" 2021-06-12 00:18:52 +02:00
AFCMS
cd33d406b2 fix many codestyle issues (functions, strings, modpaths) 2021-05-29 16:12:33 +02:00
NO11
bb77443892 [mcl_core] fix function codestyle in functions.lua 2021-05-26 17:43:42 +00:00