Compare commits
13 Commits
master
...
lush_caves
Author | SHA1 | Date |
---|---|---|
cora | d52827de69 | |
cora | 394eaa5db8 | |
cora | c8f66b1748 | |
cora | 202b80bae9 | |
cora | b6c6dbca95 | |
cora | 6e04a5e9a2 | |
cora | db52b4a918 | |
cora | 4aa9bdce68 | |
cora | eaa06289a1 | |
cora | 81cc114a0f | |
cora | 3cdc56ce9b | |
cora | aec291af70 | |
cora | 1bcd46cda4 |
|
@ -0,0 +1,677 @@
|
|||
local modname = minetest.get_current_modname()
|
||||
local modpath = minetest.get_modpath(modname)
|
||||
local S = minetest.get_translator(modname)
|
||||
|
||||
local adjacents = {
|
||||
vector.new(1,0,0),
|
||||
vector.new(-1,0,0),
|
||||
vector.new(0,0,1),
|
||||
vector.new(0,0,-1),
|
||||
vector.new(0,-1,0)
|
||||
}
|
||||
local plane_adjacents = {
|
||||
vector.new(1,0,0),
|
||||
vector.new(-1,0,0),
|
||||
vector.new(0,0,1),
|
||||
vector.new(0,0,-1)
|
||||
}
|
||||
local function vector_distance_xz(a, b)
|
||||
return vector.distance(
|
||||
{ x=a.x, y=0, z=a.z },
|
||||
{ x=b.x, y=0, z=b.z }
|
||||
)
|
||||
end
|
||||
mcl_lush_caves = {}
|
||||
|
||||
local function find_top(pos,node)
|
||||
local p = pos
|
||||
repeat
|
||||
p = vector.offset(p,0,1,0)
|
||||
until minetest.get_node(p).name ~= node.name
|
||||
return p
|
||||
end
|
||||
|
||||
local function get_height(pos,node)
|
||||
local p = pos
|
||||
local i = 0
|
||||
repeat
|
||||
i = i + 1
|
||||
p = vector.offset(p,0,-1,0)
|
||||
until minetest.get_node(p).name ~= node.name
|
||||
return i - 1
|
||||
end
|
||||
|
||||
local function dripleaf_grow(pos, node)
|
||||
local t = find_top(pos,node)
|
||||
local h = get_height(t,node)
|
||||
local target = vector.offset(t,0,1,0)
|
||||
if minetest.get_node(target).name ~= "air" then return end
|
||||
if h >= 5 then return end
|
||||
minetest.set_node(t,node)
|
||||
minetest.set_node(target,{name = "mcl_lush_caves:dripleaf_big"})
|
||||
end
|
||||
|
||||
function mcl_lush_caves.makelake(pos,def,pr)
|
||||
local p1 = vector.offset(pos,-5,-2,-5)
|
||||
local p2 = vector.offset(pos,5,1,5)
|
||||
local nn = minetest.find_nodes_in_area_under_air(p1,p2,{"group:material_stone","mcl_core:clay","mcl_lush_caves:moss"})
|
||||
table.sort(nn,function(a, b)
|
||||
return vector_distance_xz(pos, a) < vector_distance_xz(pos, b)
|
||||
end)
|
||||
if not nn[1] then return end
|
||||
local dripleaves = {}
|
||||
for i=1,pr:next(1,#nn) do
|
||||
minetest.set_node(nn[i],{name="mcl_core:water_source"})
|
||||
if pr:next(1,20) == 1 then
|
||||
table.insert(dripleaves,nn[i])
|
||||
end
|
||||
end
|
||||
local nnn = minetest.find_nodes_in_area_under_air(p1,p2,{"mcl_core:water_source","group:water"})
|
||||
for k,v in pairs(nnn) do
|
||||
for kk,vv in pairs(adjacents) do
|
||||
local pp = vector.add(v,vv)
|
||||
local an = minetest.get_node(pp)
|
||||
if an.name ~= "mcl_core:water_source" then
|
||||
minetest.set_node(pp,{name="mcl_core:clay"})
|
||||
if pr:next(1,20) == 1 then
|
||||
minetest.set_node(vector.offset(pp,0,1,0),{name="mcl_lush_caves:moss_carpet"})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
for _,d in pairs(dripleaves) do
|
||||
if minetest.get_item_group(minetest.get_node(d).name,"water") > 0 then
|
||||
minetest.set_node(vector.offset(d,0,-1,0),{name="mcl_lush_caves:dripleaf_big_waterroot"})
|
||||
minetest.registered_nodes["mcl_lush_caves:dripleaf_big_stem"].on_construct(d)
|
||||
for ii = 1, pr:next(1,4) do
|
||||
dripleaf_grow(d,{name = "mcl_lush_caves:dripleaf_big_stem"})
|
||||
end
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
function mcl_lush_caves.makeazaela(pos,def,pr)
|
||||
local airup = minetest.find_nodes_in_area_under_air(vector.offset(pos,0,40,0),pos,{"mcl_core:dirt_with_grass"})
|
||||
if #airup == 0 then
|
||||
return end
|
||||
local surface_pos = airup[1]
|
||||
local nn = minetest.find_nodes_in_area(vector.offset(pos,-4,0,-4),vector.offset(pos,4,40,4),{"group:material_stone","mcl_core:dirt","mcl_core:coarse_dirt"})
|
||||
table.sort(nn,function(a, b) return vector_distance_xz(surface_pos, a) < vector_distance_xz(surface_pos, b) end)
|
||||
minetest.set_node(pos,{name="mcl_lush_caves:rooted_dirt"})
|
||||
for i=1,math.random(1,#nn) do
|
||||
local below = vector.offset(nn[i],0,-1,0)
|
||||
minetest.set_node(nn[i],{name="mcl_lush_caves:rooted_dirt"})
|
||||
if minetest.get_node(below).name == "air" then
|
||||
minetest.set_node(below,{name = "mcl_lush_caves:hanging_roots"})
|
||||
end
|
||||
end
|
||||
for _,v in pairs(nn) do
|
||||
for _,a in pairs(adjacents) do
|
||||
local p = vector.add(v,a)
|
||||
if minetest.get_item_group(minetest.get_node(p).name,"material_stone") > 0 then
|
||||
if math.random(2) == 1 then minetest.set_node(p,{name="mcl_core:stone"}) end
|
||||
end
|
||||
end
|
||||
end
|
||||
minetest.place_schematic(vector.offset(surface_pos,-2,0,-2),modpath.."/schematics/azalea1.mts","random",nil,nil,"place_center_x place_center_z")
|
||||
minetest.log("action","[mcl_lush_caves] Azalea generated at "..minetest.pos_to_string(surface_pos))
|
||||
return true
|
||||
end
|
||||
|
||||
minetest.register_node("mcl_lush_caves:lake_structblock", {drawtype="airlike",walkable = false,pointable=false,groups = {structblock=1,not_in_creative_inventory=1},})
|
||||
minetest.register_node("mcl_lush_caves:azalea_structblock", {drawtype="airlike",walkable = false,pointable=false,groups = {structblock=1,not_in_creative_inventory=1},})
|
||||
|
||||
minetest.register_node("mcl_lush_caves:moss", {
|
||||
description = S("Moss"),
|
||||
_doc_items_longdesc = S("Moss is a green block found in lush caves"),
|
||||
_doc_items_entry_name = "moss",
|
||||
_doc_items_hidden = false,
|
||||
tiles = {"mcl_lush_caves_moss_block.png"},
|
||||
is_ground_content = false,
|
||||
groups = {handy=1, hoey=2, dirt=1, soil=1, soil_sapling=2, enderman_takable=1, building_block=1,flammable=1,fire_encouragement=60, fire_flammability=20, grass_block_no_snow = 1 },
|
||||
sounds = mcl_sounds.node_sound_dirt_defaults(),
|
||||
_mcl_blast_resistance = 0.1,
|
||||
_mcl_hardness = 0.1,
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_lush_caves:moss_carpet", {
|
||||
description = S("Moss carpet"),
|
||||
_doc_items_longdesc = S("Moss carpet"),
|
||||
_doc_items_entry_name = "moss_carpet",
|
||||
|
||||
is_ground_content = false,
|
||||
tiles = {"mcl_lush_caves_moss_carpet.png"},
|
||||
wield_image ="mcl_lush_caves_moss_carpet.png",
|
||||
wield_scale = { x=1, y=1, z=0.5 },
|
||||
groups = {handy=1, carpet=1,supported_node=1,flammable=1,fire_encouragement=60, fire_flammability=20, deco_block=1, dig_by_water=1 },
|
||||
sounds = mcl_sounds.node_sound_wool_defaults(),
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-8/16, -8/16, -8/16, 8/16, -7/16, 8/16},
|
||||
},
|
||||
},
|
||||
_mcl_hardness = 0.1,
|
||||
_mcl_blast_resistance = 0.1,
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_lush_caves:hanging_roots", {
|
||||
description = S("Hanging roots"),
|
||||
_doc_items_create_entry = S("Hanging roots"),
|
||||
_doc_items_entry_name = S("Hanging roots"),
|
||||
_doc_items_longdesc = S("Hanging roots"),
|
||||
paramtype = "light",
|
||||
--paramtype2 = "meshoptions",
|
||||
place_param2 = 3,
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
--drop = "mcl_farming:wheat_seeds",
|
||||
tiles = {"mcl_lush_caves_hanging_roots.png"},
|
||||
inventory_image = "mcl_lush_caves_hanging_roots.png",
|
||||
wield_image = "mcl_lush_caves_hanging_roots.png",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}
|
||||
},
|
||||
},
|
||||
groups = { shearsy = 1, dig_immediate=3, plant=1, supported_node=0, dig_by_water=1,destroy_by_lava_flow=1, dig_by_piston=1, cultivatable=1 },
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
_mcl_blast_resistance = 0,
|
||||
_mcl_blast_hardness = 0,
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_lush_caves:cave_vines", {
|
||||
description = S("Cave vines"),
|
||||
_doc_items_create_entry = S("Cave vines"),
|
||||
_doc_items_entry_name = S("Cave vines"),
|
||||
_doc_items_longdesc = S("Cave vines"),
|
||||
paramtype = "light",
|
||||
--paramtype2 = "meshoptions",
|
||||
place_param2 = 3,
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
--drop = "mcl_farming:wheat_seeds",
|
||||
tiles = {"mcl_lush_caves_cave_vines.png"},
|
||||
inventory_image = "mcl_lush_caves_cave_vines.png",
|
||||
wield_image = "mcl_lush_caves_cave_vines.png",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}
|
||||
},
|
||||
},
|
||||
groups = { shearsy = 1, dig_immediate=3, plant=1, supported_node=0, dig_by_water=1,destroy_by_lava_flow=1, dig_by_piston=1, cultivatable=1 },
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
_mcl_blast_resistance = 0,
|
||||
_mcl_blast_hardness = 0,
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_lush_caves:cave_vines_lit", {
|
||||
description = S("Cave vines"),
|
||||
_doc_items_create_entry = S("Cave vines"),
|
||||
_doc_items_entry_name = S("Cave vines"),
|
||||
_doc_items_longdesc = S("Cave vines"),
|
||||
paramtype = "light",
|
||||
--paramtype2 = "meshoptions",
|
||||
place_param2 = 3,
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
--drop = "mcl_farming:wheat_seeds",
|
||||
light_source = 9,
|
||||
tiles = {"mcl_lush_caves_cave_vines_lit.png"},
|
||||
inventory_image = "mcl_lush_caves_cave_vines_lit.png",
|
||||
wield_image = "mcl_lush_caves_cave_vines_lit.png",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}
|
||||
},
|
||||
},
|
||||
groups = { shearsy = 1, handy = 1, plant=1, supported_node=0, dig_by_water=1,destroy_by_lava_flow=1, dig_by_piston=1 },
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
_mcl_blast_resistance = 0,
|
||||
_mcl_blast_hardness = 1,
|
||||
drop = "mcl_lush_caves:glow_berry",
|
||||
on_dig = function(pos)
|
||||
minetest.add_item(pos,"mcl_lush_caves:glow_berry")
|
||||
minetest.set_node(pos,{name="mcl_lush_caves:cave_vines"})
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_lush_caves:dripleaf_big_waterroot", {
|
||||
drawtype = "plantlike_rooted",
|
||||
paramtype = "light",
|
||||
paramtype2 = "leveled",
|
||||
place_param2 = 16,
|
||||
tiles = { "default_clay.png" },
|
||||
special_tiles = {
|
||||
{ name = "mcl_lush_caves_big_dripleaf_stem.png",
|
||||
animation = {type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0},
|
||||
tileable_vertical = true,
|
||||
}
|
||||
},
|
||||
inventory_image = "mcl_lush_caves_big_dripleaf_stem.png",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{ -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
|
||||
{ -0.5, 0.5, -0.5, 0.5, 1.0, 0.5 },
|
||||
}
|
||||
},
|
||||
groups = { handy = 1, dig_immediate = 3, not_in_creative_inventory = 1 },
|
||||
drop = "",
|
||||
node_placement_prediction = "",
|
||||
_mcl_hardness = 0,
|
||||
_mcl_blast_resistance = 0,
|
||||
_mcl_silk_touch_drop = true,
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
if itemstack:get_name() ~= "mcl_dye:white" then return itemstack end
|
||||
itemstack:take_item(1)
|
||||
--dripleaf_grow(pos,node)
|
||||
end
|
||||
})
|
||||
minetest.register_node("mcl_lush_caves:dripleaf_big_stem", {
|
||||
description = S("Dripleaf stem"),
|
||||
_doc_items_create_entry = S("Dripleaf stem"),
|
||||
_doc_items_entry_name = S("Dripleaf stem"),
|
||||
_doc_items_longdesc = S("Dripleaf stem"),
|
||||
paramtype = "light",
|
||||
place_param2 = 3,
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
tiles = {"mcl_lush_caves_big_dripleaf_stem.png"},
|
||||
inventory_image = "mcl_lush_caves_big_dripleaf_stem.png",
|
||||
wield_image = "mcl_lush_caves_big_dripleaf_stem.png",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}
|
||||
},
|
||||
},
|
||||
drops = "",
|
||||
groups = { shearsy = 1, handy = 1, plant=1, supported_node=0, destroy_by_lava_flow=1, dig_by_piston=1 },
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
_mcl_blast_resistance = 0,
|
||||
_mcl_blast_hardness = 0,
|
||||
on_construct = function(pos)
|
||||
local p = pos
|
||||
local l = 0
|
||||
local in_water = false
|
||||
for _,a in pairs(plane_adjacents) do
|
||||
if minetest.get_item_group(minetest.get_node(vector.add(pos,a)).name,"water") > 0 then
|
||||
in_water = true
|
||||
end
|
||||
end
|
||||
if not in_water then return end
|
||||
repeat
|
||||
l = l + 1
|
||||
p = vector.offset(p,0,1,0)
|
||||
until minetest.get_item_group(minetest.get_node(p).name,"water") <= 0
|
||||
minetest.set_node(p,{name = "mcl_lush_caves:dripleaf_big"})
|
||||
minetest.set_node(vector.offset(pos,0,-1,0),{ name = "mcl_lush_caves:dripleaf_big_waterroot", param2 = l * 16})
|
||||
end,
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
if itemstack:get_name() ~= "mcl_dye:white" then return itemstack end
|
||||
itemstack:take_item(1)
|
||||
dripleaf_grow(pos,node)
|
||||
end
|
||||
})
|
||||
local dripleaf = {
|
||||
description = S("Dripleaf"),
|
||||
_doc_items_create_entry = S("Dripleaf"),
|
||||
_doc_items_entry_name = S("Dripleaf"),
|
||||
_doc_items_longdesc = S("Dripleaf"),
|
||||
paramtype = "light",
|
||||
place_param2 = 0,
|
||||
sunlight_propagates = true,
|
||||
walkable = true,
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-8/16, -8/16, -8/16, 8/16, -7/16, 8/16},
|
||||
},
|
||||
},
|
||||
tiles = {"mcl_lush_caves_big_dripleaf_top.png"},
|
||||
inventory_image = "mcl_lush_caves_big_dripleaf_top.png",
|
||||
wield_image = "mcl_lush_caves_big_dripleaf_top.png",
|
||||
use_texture_alpha = "clip",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-8/16, -8/16, -8/16, 8/16, -7/16, 8/16},
|
||||
},
|
||||
},
|
||||
groups = { shearsy = 1, handy = 1, plant=1, supported_node=0, dig_by_water=1,destroy_by_lava_flow=1, dig_by_piston=1 },
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
_mcl_blast_resistance = 0,
|
||||
_mcl_blast_hardness = 0,
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
if itemstack:get_name() ~= "mcl_dye:white" then return itemstack end
|
||||
itemstack:take_item(1)
|
||||
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
|
||||
|
||||
dripleaf.mesecons = {effector = {
|
||||
action_on = function(pos, node)
|
||||
node.param2 = 1
|
||||
minetest.swap_node(pos, node)
|
||||
end,
|
||||
action_off = function(pos, node)
|
||||
node.param2 = 0
|
||||
minetest.swap_node(pos, node)
|
||||
end,
|
||||
rules = mesecon.rules.alldirs,
|
||||
}}
|
||||
|
||||
|
||||
minetest.register_node("mcl_lush_caves:dripleaf_big",dripleaf)
|
||||
minetest.register_node("mcl_lush_caves:dripleaf_big_tipped",dripleaf_tipped)
|
||||
|
||||
minetest.register_node("mcl_lush_caves:dripleaf_small_stem", {
|
||||
description = S("Small dripleaf stem"),
|
||||
_doc_items_create_entry = S("Small dripleaf stem"),
|
||||
_doc_items_entry_name = S("Small dripleaf stem"),
|
||||
_doc_items_longdesc = S("Small dripleaf stem"),
|
||||
paramtype = "light",
|
||||
place_param2 = 3,
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
tiles = {"mcl_lush_caves_small_dripleaf_stem_top.png"},
|
||||
inventory_image = "mcl_lush_caves_small_dripleaf_stem_top.png",
|
||||
wield_image = "mcl_lush_caves_small_dripleaf_stem_top.png",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}
|
||||
},
|
||||
},
|
||||
groups = { shearsy = 1, handy = 1, plant=1, supported_node=0, dig_by_water=1,destroy_by_lava_flow=1, dig_by_piston=1 },
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
_mcl_blast_resistance = 0,
|
||||
_mcl_blast_hardness = 0,
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_lush_caves:dripleaf_small", {
|
||||
description = S("Dripleaf"),
|
||||
_doc_items_create_entry = S("Dripleaf"),
|
||||
_doc_items_entry_name = S("Dripleaf"),
|
||||
_doc_items_longdesc = S("Dripleaf"),
|
||||
paramtype = "light",
|
||||
place_param2 = 3,
|
||||
sunlight_propagates = true,
|
||||
walkable = true,
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-8/16, -8/16, -8/16, 8/16, -7/16, 8/16},
|
||||
},
|
||||
},
|
||||
tiles = {"mcl_lush_caves_small_dripleaf_top.png"},
|
||||
inventory_image = "mcl_lush_caves_small_dripleaf_top.png",
|
||||
wield_image = "mcl_lush_caves_small_dripleaf_top.png",
|
||||
use_texture_alpha = "clip",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-8/16, -8/16, -8/16, 8/16, -7/16, 8/16},
|
||||
},
|
||||
},
|
||||
groups = { shearsy = 1, handy = 1, plant=1, supported_node=0, dig_by_water=1,destroy_by_lava_flow=1, dig_by_piston=1 },
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
_mcl_blast_resistance = 0,
|
||||
_mcl_blast_hardness = 0,
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_lush_caves:rooted_dirt", {
|
||||
description = S("Rooted dirt"),
|
||||
_doc_items_longdesc = S("Rooted dirt"),
|
||||
_doc_items_hidden = false,
|
||||
tiles = {"mcl_lush_caves_rooted_dirt.png"},
|
||||
is_ground_content = true,
|
||||
stack_max = 64,
|
||||
groups = {handy=1,shovely=1, dirt=1, building_block=1, path_creation_possible=1},
|
||||
sounds = mcl_sounds.node_sound_dirt_defaults(),
|
||||
_mcl_blast_resistance = 0.5,
|
||||
_mcl_hardness = 0.5,
|
||||
})
|
||||
|
||||
minetest.register_craftitem("mcl_lush_caves:glow_berry", {
|
||||
description = S("Glow berry"),
|
||||
_doc_items_longdesc = S("This is a food item which can be eaten."),
|
||||
stack_max = 64,
|
||||
inventory_image = "mcl_lush_caves_glow_berries.png",
|
||||
on_place = minetest.item_eat(2),
|
||||
on_secondary_use = minetest.item_eat(2),
|
||||
groups = {food = 2, eatable = 2, compostability = 50},
|
||||
_mcl_saturation = 1.2,
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_lush_caves:azalea_leaves", {
|
||||
description = description,
|
||||
_doc_items_longdesc = longdesc,
|
||||
_doc_items_hidden = false,
|
||||
drawtype = "allfaces_optional",
|
||||
waving = 2,
|
||||
place_param2 = 1, -- Prevent leafdecay for placed nodes
|
||||
tiles = { "mcl_lush_caves_azalea_leaves.png" },
|
||||
paramtype = "light",
|
||||
stack_max = 64,
|
||||
groups = {
|
||||
hoey = 1, shearsy = 1, swordy = 1, dig_by_piston = 1,
|
||||
leaves = 1, leafdecay = leafdecay_distance, deco_block = 1,
|
||||
flammable = 2, fire_encouragement = 30, fire_flammability = 60,
|
||||
compostability = 30
|
||||
},
|
||||
_mcl_shears_drop = true,
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
_mcl_blast_resistance = 0.2,
|
||||
_mcl_hardness = 0.2,
|
||||
_mcl_silk_touch_drop = true,
|
||||
})
|
||||
--[[
|
||||
minetest.register_node("mcl_lush_caves:spore_blossom", {
|
||||
description = S("Spore blossom"),
|
||||
_doc_items_longdesc = S("Spore blossom"),
|
||||
_doc_items_hidden = false,
|
||||
tiles = {"mcl_lush_caves_spore_blossom.png"},
|
||||
drawtype = "plantlike",
|
||||
param2type = "light",
|
||||
is_ground_content = true,
|
||||
stack_max = 64,
|
||||
groups = {handy = 1, plant = 1},
|
||||
sounds = mcl_sounds.node_sound_dirt_defaults(),
|
||||
_mcl_blast_resistance = 0.5,
|
||||
_mcl_hardness = 0.5,
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node("mcl_lush_caves:azalea", {
|
||||
description = S("Azalea"),
|
||||
inventory_image = "mcl_lush_caves_azalea_plant.png",
|
||||
drawtype = "allfaces_optional",
|
||||
-- drawtype = "nodebox",
|
||||
-- node_box = {
|
||||
-- type = "fixed",
|
||||
-- fixed = {
|
||||
-- { -16/16, -0/16, -16/16, 16/16, 16/16, 16/16 },
|
||||
-- { -2/16, -16/16, -2/16, 2/16, 0/16, 2/16 },
|
||||
-- }
|
||||
-- },
|
||||
--tiles = { "blank.png" },
|
||||
tiles = {
|
||||
"mcl_lush_caves_azalea_top.png",
|
||||
"mcl_lush_caves_azalea_top.png",
|
||||
"mcl_lush_caves_azalea_side.png",
|
||||
"mcl_lush_caves_azalea_side.png",
|
||||
"mcl_lush_caves_azalea_side.png",
|
||||
"mcl_lush_caves_azalea_side.png",
|
||||
},
|
||||
is_ground_content = false,
|
||||
groups = { handy=1 },
|
||||
sounds = mcl_sounds.node_sound_dirt_defaults(),
|
||||
_mcl_blast_resistance = 0,
|
||||
_mcl_hardness = 0,
|
||||
use_texture_alpha = "clip",
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_lush_caves:azalea_flowering", {
|
||||
description = S("Flowering azalea"),
|
||||
inventory_image = "mcl_lush_caves_azalea_flowering_top.png",
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{ -16/16, -4/16, -16/16, 16/16, 16/16, 16/16 },
|
||||
{ -2/16, -16/16, -2/16, 2/16, -4/16, 2/16 },
|
||||
}
|
||||
},
|
||||
--tiles = { "blank.png" },
|
||||
tiles = {
|
||||
"mcl_lush_caves_azalea_flowering_top.png",
|
||||
"mcl_lush_caves_azalea_flowering_top.png",
|
||||
"mcl_lush_caves_azalea_flowering_side.png",
|
||||
"mcl_lush_caves_azalea_flowering_side.png",
|
||||
"mcl_lush_caves_azalea_flowering_side.png",
|
||||
"mcl_lush_caves_azalea_flowering_side.png",
|
||||
},
|
||||
is_ground_content = false,
|
||||
groups = { handy=1 },
|
||||
sounds = mcl_sounds.node_sound_dirt_defaults(),
|
||||
_mcl_blast_resistance = 0,
|
||||
_mcl_hardness = 0,
|
||||
use_texture_alpha = "clip",
|
||||
})
|
||||
--]]
|
||||
|
||||
minetest.register_node("mcl_lush_caves:azalea_leaves_flowering", {
|
||||
description = description,
|
||||
_doc_items_longdesc = longdesc,
|
||||
_doc_items_hidden = false,
|
||||
drawtype = "allfaces_optional",
|
||||
waving = 2,
|
||||
place_param2 = 1, -- Prevent leafdecay for placed nodes
|
||||
tiles = { "mcl_lush_caves_azalea_leaves_flowering.png" },
|
||||
paramtype = "light",
|
||||
stack_max = 64,
|
||||
groups = {
|
||||
handy = 1, hoey = 1, shearsy = 1, swordy = 1, dig_by_piston = 1,
|
||||
leaves = 1, leafdecay = leafdecay_distance, deco_block = 1,
|
||||
flammable = 2, fire_encouragement = 30, fire_flammability = 60,
|
||||
compostability = 30
|
||||
},
|
||||
_mcl_shears_drop = true,
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
_mcl_blast_resistance = 0.2,
|
||||
_mcl_hardness = 0.2,
|
||||
_mcl_silk_touch_drop = true,
|
||||
})
|
||||
|
||||
|
||||
|
||||
minetest.register_abm({
|
||||
label = "Cave vines grow",
|
||||
nodenames = {"mcl_lush_caves:cave_vines_lit","mcl_lush_caves:cave_vines"},
|
||||
interval = 180,
|
||||
chance = 5,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local pu = vector.offset(pos,0,1,0)
|
||||
local pun = minetest.get_node(pu).name
|
||||
local pd = vector.offset(pos,0,-1,0)
|
||||
local pd2 = minetest.get_node(vector.offset(pos,0,-2,0)).name
|
||||
if pun ~= "mcl_lush_caves:cave_vines_lit" and pun ~= "mcl_lush_caves:cave_vines" and pun ~= "mcl_lush_caves:moss" then
|
||||
minetest.set_node(pos,{name="air"})
|
||||
return
|
||||
end
|
||||
node.name = "mcl_lush_caves:cave_vines"
|
||||
if math.random(5) == 1 then
|
||||
node.name="mcl_lush_caves:cave_vines_lit"
|
||||
end
|
||||
if minetest.get_node(pd).name == "air" and pd2 == "air" then
|
||||
minetest.swap_node(pd,node)
|
||||
else
|
||||
minetest.swap_node(pos,{name="mcl_lush_caves:cave_vines_lit"})
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
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)
|
||||
|
||||
local lushcaves = { "LushCaves", "LushCaves_underground", "LushCaves_ocean", "LushCaves_deep_ocean"}
|
||||
|
||||
mcl_structures.register_structure("clay_pool",{
|
||||
place_on = {"group:material_stone","mcl_core:gravel","mcl_lush_caves:moss","mcl_core:clay"},
|
||||
spawn_by = {"air"},
|
||||
num_spawn_by = 1,
|
||||
noise_params = {
|
||||
offset = 0,
|
||||
scale = 0.01,
|
||||
spread = {x = 250, y = 250, z = 250},
|
||||
seed = 78375213,
|
||||
octaves = 5,
|
||||
persist = 0.1,
|
||||
flags = "absvalue",
|
||||
},
|
||||
flags = "all_floors",
|
||||
y_max = -10,
|
||||
biomes = lushcaves,
|
||||
place_func = mcl_lush_caves.makelake,
|
||||
})
|
||||
|
||||
local azaleas = {}
|
||||
local az_limit = 500
|
||||
mcl_structures.register_structure("azalea_tree",{
|
||||
place_on = {"group:material_stone","mcl_core:gravel","mcl_lush_caves:moss","mcl_core:clay"},
|
||||
spawn_by = {"air"},
|
||||
num_spawn_by = 1,
|
||||
fill_ratio = 0.15,
|
||||
flags = "all_ceilings",
|
||||
y_max =-10,
|
||||
y_min = mcl_vars.mg_overworld_min + 15,
|
||||
biomes = lushcaves,
|
||||
place_func = function(pos,def,pr)
|
||||
for _,a in pairs(azaleas) do
|
||||
if vector.distance(pos,a) < az_limit then
|
||||
return true
|
||||
end
|
||||
if mcl_lush_caves.makeazalea(pos,def,pr) then
|
||||
table.insert(azaleas,pos)
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
})
|
|
@ -0,0 +1,3 @@
|
|||
name = mcl_lush_caves
|
||||
author = cora
|
||||
depends = mcl_sounds, mesecons, mcl_mapgen_core, mcl_structures
|
After Width: | Height: | Size: 6.7 KiB |
After Width: | Height: | Size: 6.7 KiB |
After Width: | Height: | Size: 7.4 KiB |
After Width: | Height: | Size: 7.4 KiB |
After Width: | Height: | Size: 7.2 KiB |
After Width: | Height: | Size: 7.2 KiB |
After Width: | Height: | Size: 6.6 KiB |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 7.4 KiB |
After Width: | Height: | Size: 5.4 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 5.3 KiB |
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 6.6 KiB |
After Width: | Height: | Size: 7.1 KiB |
After Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 6.9 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 6.0 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 7.7 KiB |
After Width: | Height: | Size: 7.2 KiB |
After Width: | Height: | Size: 6.7 KiB |
After Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 194 B |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 6.6 KiB |
After Width: | Height: | Size: 6.2 KiB |
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 6.2 KiB |
|
@ -127,6 +127,7 @@ local function register_biomes()
|
|||
"MesaBryce",
|
||||
"MesaPlateauF",
|
||||
"MesaPlateauFM",
|
||||
"LushCaves",
|
||||
}
|
||||
|
||||
-- Ice Plains Spikes (rare)
|
||||
|
@ -1442,6 +1443,44 @@ local function register_biomes()
|
|||
_mcl_palette_index = 29,
|
||||
})
|
||||
|
||||
minetest.register_biome({
|
||||
name = "LushCaves",
|
||||
node_top = "mcl_core:dirt_with_grass",
|
||||
depth_top = 1,
|
||||
node_filler = "mcl_core:dirt",
|
||||
depth_filler = 3,
|
||||
node_riverbed = "mcl_core:sand",
|
||||
node_cave_liquid = "mcl_core:water_source",
|
||||
depth_riverbed = 2,
|
||||
y_min = 2,
|
||||
y_max = 20,
|
||||
vertical_blend = 1,
|
||||
humidity_point = 45,
|
||||
heat_point = 53,
|
||||
--humidity_point = 83,
|
||||
--heat_point = 55,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_palette_index = 0,
|
||||
})
|
||||
|
||||
minetest.register_biome({
|
||||
name = "LushCaves_ocean",
|
||||
node_top = "mcl_core:sand",
|
||||
depth_top = 1,
|
||||
node_filler = "mcl_core:sand",
|
||||
depth_filler = 3,
|
||||
node_riverbed = "mcl_core:sand",
|
||||
node_cave_liquid = "mcl_core:water_source",
|
||||
depth_riverbed = 2,
|
||||
y_min = OCEAN_MIN,
|
||||
y_max = 0,
|
||||
vertical_blend = 1,
|
||||
humidity_point = 83,
|
||||
heat_point = 57,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_palette_index = 0,
|
||||
})
|
||||
|
||||
-- Add deep ocean and underground biomes automatically.
|
||||
for i=1, #overworld_biomes do
|
||||
local biome = overworld_biomes[i]
|
||||
|
@ -2414,7 +2453,8 @@ local function register_dimension_ores()
|
|||
|
||||
end
|
||||
|
||||
|
||||
local deco_id_makelake
|
||||
local deco_id_makeazalea
|
||||
-- All mapgens except mgv6
|
||||
|
||||
-- Template to register a grass or fern decoration
|
||||
|
@ -4323,6 +4363,135 @@ local function register_decorations()
|
|||
register_flower("allium", nil, 0) -- flower Forest only
|
||||
register_flower("blue_orchid", {"Swampland"}, 64500, false)
|
||||
|
||||
--Lush Caves
|
||||
local lushcaves = { "LushCaves", "LushCaves_underground", "LushCaves_ocean", "LushCaves_deep_ocean"}
|
||||
minetest.register_decoration({
|
||||
decoration = "mcl_lush_caves:moss",
|
||||
deco_type = "simple",
|
||||
place_on = {"group:material_stone", "mcl_core:gravel", "mcl_core:bedrock"},
|
||||
spawn_by = {"air"},
|
||||
num_spawn_by = 1,
|
||||
sidelen = 80,
|
||||
y_max = 1,
|
||||
biomes = lushcaves,
|
||||
fill_ratio = 10,
|
||||
flags = "all_floors, all_ceilings",
|
||||
})
|
||||
|
||||
minetest.register_decoration({
|
||||
decoration = "mcl_flowers:tallgrass",
|
||||
deco_type = "simple",
|
||||
place_on = {"mcl_lush_caves:moss"},
|
||||
spawn_by = {"air"},
|
||||
num_spawn_by = 4,
|
||||
sidelen = 16,
|
||||
y_max = -1,
|
||||
biomes = lushcaves,
|
||||
fill_ratio = 1,
|
||||
flags = "all_floors",
|
||||
})
|
||||
minetest.register_decoration({
|
||||
decoration = "mcl_flowers:tallgrass",
|
||||
deco_type = "simple",
|
||||
place_on = {"mcl_core:dirt_with_grass"},
|
||||
spawn_by = {"air"},
|
||||
num_spawn_by = 4,
|
||||
sidelen = 16,
|
||||
biomes = lushcaves,
|
||||
fill_ratio = 0.1,
|
||||
})
|
||||
|
||||
|
||||
minetest.register_decoration({
|
||||
decoration = "mcl_lush_caves:cave_vines",
|
||||
deco_type = "simple",
|
||||
place_on = {"mcl_lush_caves:moss"},
|
||||
height = 1,
|
||||
max_height = 4,
|
||||
sidelen = 16,
|
||||
fill_ratio = 0.2,
|
||||
y_max = -10,
|
||||
flags = "all_ceilings",
|
||||
biomes = lushcaves,
|
||||
})
|
||||
minetest.register_decoration({
|
||||
decoration = "mcl_lush_caves:cave_vines_lit",
|
||||
deco_type = "simple",
|
||||
place_on = {"mcl_lush_caves:moss"},
|
||||
height = 1,
|
||||
max_height = 4,
|
||||
sidelen = 16,
|
||||
fill_ratio = 0.3,
|
||||
flags = "all_ceilings",
|
||||
biomes = lushcaves,
|
||||
})
|
||||
|
||||
minetest.register_decoration({
|
||||
decoration = "mcl_lush_caves:cave_vines_lit",
|
||||
deco_type = "simple",
|
||||
place_on = {"mcl_lush_caves:cave_vines_lit","mcl_lush_caves:cave_vines"},
|
||||
height = 1,
|
||||
max_height = 4,
|
||||
sidelen = 16,
|
||||
fill_ratio = 0.1,
|
||||
flags = "all_ceilings",
|
||||
biomes = lushcaves,
|
||||
})
|
||||
minetest.register_decoration({
|
||||
decoration = "mcl_lush_caves:cave_vines_lit",
|
||||
deco_type = "simple",
|
||||
place_on = {"mcl_lush_caves:cave_vines_lit","mcl_lush_caves:cave_vines"},
|
||||
height = 1,
|
||||
max_height = 4,
|
||||
sidelen = 16,
|
||||
fill_ratio = 0.1,
|
||||
flags = "all_ceilings",
|
||||
biomes = lushcaves,
|
||||
})
|
||||
|
||||
minetest.register_decoration({
|
||||
decoration = "mcl_lush_caves:hanging_roots",
|
||||
deco_type = "simple",
|
||||
sidelen = 16,
|
||||
fill_ratio = 10,
|
||||
flags = "all_ceilings",
|
||||
biomes = lushcaves,
|
||||
})
|
||||
--[[
|
||||
minetest.register_decoration({
|
||||
decoration = "mcl_lush_caves:spore_blossom",
|
||||
deco_type = "simple",
|
||||
place_on = {"mcl_lush_caves:moss","group:material_stone"},
|
||||
spawn_by = {"air"},
|
||||
num_spawn_by = 4,
|
||||
sidelen = 16,
|
||||
fill_ratio = 0,
|
||||
flags = "place_center_x, place_center_z, force_placement, all_ceilings",
|
||||
biomes = { "LushCaves_underground", "LushCaves_ocean", "LushCaves_deep_ocean" },
|
||||
})--]]
|
||||
|
||||
minetest.register_decoration({
|
||||
decoration = "mcl_lush_caves:moss_carpet",
|
||||
deco_type = "simple",
|
||||
place_on = {"group:material_stone","mcl_core:gravel","mcl_lush_caves:moss"},
|
||||
spawn_by = {"air"},
|
||||
num_spawn_by = 4,
|
||||
sidelen = 16,
|
||||
fill_ratio = 0.1,
|
||||
flags = "all_floors",
|
||||
biomes = lushcaves,
|
||||
})
|
||||
--[[]
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = "mcl_lush_caves:moss","mcl_core:clay",
|
||||
sidelen = 16,
|
||||
fill_ratio = 5,
|
||||
biomes = lushcaves,
|
||||
decoration = "mcl_flowers:tallgrass",
|
||||
flags = "all_floors",
|
||||
})
|
||||
--]]
|
||||
end
|
||||
|
||||
-- Decorations in non-Overworld dimensions
|
||||
|
@ -4680,7 +4849,6 @@ local function register_dimension_decorations()
|
|||
|
||||
deco_id_chorus_plant = minetest.get_decoration_id("mcl_biomes:chorus_plant")
|
||||
minetest.set_gen_notify({decoration=true}, { deco_id_chorus_plant })
|
||||
|
||||
-- TODO: End cities
|
||||
|
||||
end
|
||||
|
@ -4750,5 +4918,4 @@ if mg_name ~= "singlenode" then
|
|||
end
|
||||
end)
|
||||
end
|
||||
|
||||
end
|
||||
|
|