From 70294d9e34cc44a5e7050c1ec3c3c7aa397f7aec Mon Sep 17 00:00:00 2001 From: cora Date: Thu, 15 Sep 2022 04:31:35 +0200 Subject: [PATCH] Add weeping vines --- mods/ITEMS/mcl_crimson/init.lua | 28 ++++++++++++++-------------- mods/ITEMS/mcl_crimson/mod.conf | 2 +- mods/MAPGEN/mcl_biomes/init.lua | 14 +++++++++++++- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/mods/ITEMS/mcl_crimson/init.lua b/mods/ITEMS/mcl_crimson/init.lua index 741ed33d9..4262e41bb 100644 --- a/mods/ITEMS/mcl_crimson/init.lua +++ b/mods/ITEMS/mcl_crimson/init.lua @@ -13,19 +13,19 @@ function generate_crimson_tree(pos) minetest.place_schematic(pos,modpath.."/schematics/crimson_fungus_1.mts","random",nil,false,"place_center_x,place_center_z") end -function grow_twisting_vines(pos, moreontop) - local y = pos.y + 1 - while not (moreontop == 0) do - if minetest.get_node({x = pos.x, y = y, z = pos.z}).name == "air" then - minetest.set_node({x = pos.x, y = y, z = pos.z}, {name="mcl_crimson:twisting_vines"}) - moreontop = moreontop - 1 - y = y + 1 - elseif minetest.get_node({x = pos.x, y = y, z = pos.z}).name == "mcl_crimson:twisting_vines" then - y = y + 1 - else - moreontop = 0 +function grow_vines(pos, moreontop ,vine, dir) + if dir == nil then dir = 1 end + local n + repeat + pos = vector.offset(pos,0,dir,0) + n = minetest.get_node(pos) + if n.name == "air" then + for i=0,math.max(moreontop,1) do + minetest.set_node(vector.offset(pos,0,i*dir,0),{name=vine}) end - end + break + end + until n.name ~= "air" and n.name ~= vine end minetest.register_node("mcl_crimson:warped_fungus", { @@ -77,10 +77,10 @@ minetest.register_node("mcl_crimson:twisting_vines", { on_rightclick = function(pos, node, pointed_thing, itemstack) if pointed_thing:get_wielded_item():get_name() == "mcl_crimson:twisting_vines" then itemstack:take_item() - grow_twisting_vines(pos, 1) + grow_vines(pos, 1, "mcl_crimson:twisting_vines") elseif pointed_thing:get_wielded_item():get_name() == "mcl_dye:white" then itemstack:take_item() - grow_twisting_vines(pos, math.random(1, 3)) + grow_vines(pos, math.random(1, 3),"mcl_crimson:twisting_vines") end end, drop = { diff --git a/mods/ITEMS/mcl_crimson/mod.conf b/mods/ITEMS/mcl_crimson/mod.conf index 2e5550775..84dc7d8f6 100644 --- a/mods/ITEMS/mcl_crimson/mod.conf +++ b/mods/ITEMS/mcl_crimson/mod.conf @@ -1,3 +1,3 @@ name = mcl_crimson author = debiankaios -depends = mcl_stairs, mobs_mc, mcl_util, mcl_dye +depends = mcl_core, mcl_stairs, mobs_mc, mcl_util, mcl_dye diff --git a/mods/MAPGEN/mcl_biomes/init.lua b/mods/MAPGEN/mcl_biomes/init.lua index 4aa843053..38003535a 100644 --- a/mods/MAPGEN/mcl_biomes/init.lua +++ b/mods/MAPGEN/mcl_biomes/init.lua @@ -4794,7 +4794,7 @@ local function register_dimension_decorations() deco_type = "simple", place_on = {"mcl_crimson:warped_nylium","mcl_crimson:twisting_vines"}, sidelen = 16, - fill_ratio = 0.012, + fill_ratio = 0.032, biomes = {"WarpedForest"}, y_min = mcl_vars.mg_lava_nether_max + 1, flags = "all_floors", @@ -4877,6 +4877,18 @@ local function register_dimension_decorations() size = {x = 7, y = 13, z = 7}, rotation = "random", }) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"mcl_crimson:warped_nylium","mcl_crimson:weeping_vines","mcl_nether:netherrack"}, + sidelen = 16, + fill_ratio = 0.063, + biomes = {"CrimsonForest"}, + y_min = mcl_vars.mg_lava_nether_max + 1, + flags = "all_ceilings", + height = 2, + height_max = 8, + decoration = "mcl_crimson:weeping_vines", + }) minetest.register_decoration({ deco_type = "simple", place_on = {"mcl_crimson:crimson_nylium"},