From 46f01e9ce165c6c2a4e577a28be673b46b49e622 Mon Sep 17 00:00:00 2001 From: cora Date: Mon, 7 Aug 2023 16:07:36 +0200 Subject: [PATCH] Clean up a bit --- mods/ITEMS/mcl_lush_caves/dripleaf.lua | 31 ++++++-------------------- mods/ITEMS/mcl_lush_caves/init.lua | 1 + mods/ITEMS/mcl_lush_caves/mod.conf | 2 +- 3 files changed, 9 insertions(+), 25 deletions(-) diff --git a/mods/ITEMS/mcl_lush_caves/dripleaf.lua b/mods/ITEMS/mcl_lush_caves/dripleaf.lua index 3e9f78455..0f7a1b632 100644 --- a/mods/ITEMS/mcl_lush_caves/dripleaf.lua +++ b/mods/ITEMS/mcl_lush_caves/dripleaf.lua @@ -144,12 +144,13 @@ local dripleaf = { mcl_lush_caves.dripleaf_grow(vector.offset(pos,0,-1,0),{name = "mcl_lush_caves:dripleaf_big_stem" }) end } -local dripleaf_tipped = table.copy(dripleaf) -dripleaf_tipped.walkable = false -dripleaf_tipped.tiles = {"mcl_lush_caves_big_dripleaf_tip.png"} -dripleaf_tipped.on_timer = function(p,e) - minetest.swap_node(p,{name="mcl_lush_caves:dripleaf_big"}) -end +local dripleaf_tipped = table.merge(dripleaf, { + walkable = false, + tiles = {"mcl_lush_caves_big_dripleaf_tip.png"}, + on_timer = function(p,e) + minetest.swap_node(p,{name="mcl_lush_caves:dripleaf_big"}) + end, +}) dripleaf.mesecons = {effector = { action_on = function(pos, node) @@ -162,24 +163,6 @@ dripleaf.mesecons = {effector = { end, rules = mesecon.rules.alldirs, }} -local player_dripleaf = {} -minetest.register_globalstep(function(dtime) - for _,p in pairs(minetest.get_connected_players()) do - local pos = p:get_pos() - local n = minetest.get_node(pos) - if n.name == "mcl_lush_caves:dripleaf_big" and n.param2 == 0 then - if not player_dripleaf[p] then player_dripleaf[p] = 0 end - player_dripleaf[p] = player_dripleaf[p] + dtime - if player_dripleaf[p] > 1 then - minetest.swap_node(pos,{name = "mcl_lush_caves:dripleaf_big_tipped"}) - player_dripleaf[p] = nil - local t = minetest.get_node_timer(pos) - t:start(3) - end - end - end -end) - minetest.register_node("mcl_lush_caves:dripleaf_big",dripleaf) minetest.register_node("mcl_lush_caves:dripleaf_big_tipped",dripleaf_tipped) diff --git a/mods/ITEMS/mcl_lush_caves/init.lua b/mods/ITEMS/mcl_lush_caves/init.lua index 2d805591b..ec821b3d6 100644 --- a/mods/ITEMS/mcl_lush_caves/init.lua +++ b/mods/ITEMS/mcl_lush_caves/init.lua @@ -124,6 +124,7 @@ mcl_structures.register_structure("clay_pool",{ spawn_by = {"air"}, num_spawn_by = 1, fill_ratio = 0.01, + terrain_feature = true, flags = "all_floors", y_max = -10, biomes = lushcaves, diff --git a/mods/ITEMS/mcl_lush_caves/mod.conf b/mods/ITEMS/mcl_lush_caves/mod.conf index 2c53b0749..56fe1361c 100644 --- a/mods/ITEMS/mcl_lush_caves/mod.conf +++ b/mods/ITEMS/mcl_lush_caves/mod.conf @@ -1,3 +1,3 @@ name = mcl_lush_caves author = cora -depends = mcl_biomes, mcl_structures +depends = mcl_util, mcl_structures