0
0
Fork 0

Add weeping vines

This commit is contained in:
cora 2022-09-15 04:31:35 +02:00
parent 3fc12ed946
commit 70294d9e34
3 changed files with 28 additions and 16 deletions

View File

@ -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 = {

View File

@ -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

View File

@ -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"},