Merge pull request 'Adjust amethyst bud growth' (#3374) from Amethyst_Bud_Growth into master

Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/3374
Reviewed-by: ancientmarinerdev <ancientmariner_dev@proton.me>
This commit is contained in:
ancientmarinerdev 2023-02-02 15:26:20 +00:00
commit 060732cd66

@ -38,13 +38,15 @@ minetest.register_abm({
label = "Spawn Amethyst Bud", label = "Spawn Amethyst Bud",
nodenames = { "mcl_amethyst:budding_amethyst_block" }, nodenames = { "mcl_amethyst:budding_amethyst_block" },
neighbors = { "air", "group:water" }, neighbors = { "air", "group:water" },
interval = 20, interval = 34.135, -- 34.135 is 1/2 of 68.27, which is the average time for one bud to grow 1 stage.
chance = 2, chance = 2,
action = function(pos) action = function(pos)
local check_pos = vector.add(all_directions[math.random(1, #all_directions)], pos) local check_pos = vector.add(all_directions[math.random(1, #all_directions)], pos)
local check_node = minetest.get_node(check_pos) local check_node = minetest.get_node(check_pos)
local check_node_name = check_node.name local check_node_name = check_node.name
if check_node_name ~= "air" and minetest.get_item_group(check_node_name, "water") == 0 then return end if check_node_name ~= "air" and minetest.get_item_group(check_node_name, "water") == 0 then
return
end
local param2 = minetest.dir_to_wallmounted(vector.subtract(pos, check_pos)) local param2 = minetest.dir_to_wallmounted(vector.subtract(pos, check_pos))
local new_node = { name = "mcl_amethyst:small_amethyst_bud", param2 = param2 } local new_node = { name = "mcl_amethyst:small_amethyst_bud", param2 = param2 }
minetest.swap_node(check_pos, new_node) minetest.swap_node(check_pos, new_node)