Compare commits

...

3 Commits

Author SHA1 Message Date
cora 1520063ef5 Add dripleaf ans spore blossom nodes 2022-06-06 04:12:29 +02:00
cora 965af98560 Add Glow berries 2022-06-06 04:12:29 +02:00
cora d67bbf45f3 Add lush caves 2022-06-06 04:12:29 +02:00
33 changed files with 439 additions and 0 deletions

View File

@ -0,0 +1,437 @@
local S = minetest.get_translator(minetest.get_current_modname())
local pr = PseudoRandom(minetest.get_mapgen_setting("seed"))
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 vector_distance_xz = function(a, b)
return vector.distance(
{ x=a.x, y=0, z=a.z },
{ x=b.x, y=0, z=b.z }
)
end
local function makelake(pos)
local p1 = vector.offset(pos,-5,-10,-5)
local p2 = vector.offset(pos,5,10,5)
local nn = minetest.find_nodes_in_area_under_air(p1,p2,{"group:stone","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 y = nn[1].y
for i=1,math.random(#nn) do
if nn[i].y == y then
minetest.set_node(nn[i],{name="mcl_core:water_source"})
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,10) == 1 then
minetest.set_node(vector.offset(pp,0,1,0),{name="mcl_lush_caves:moss_carpet"})
end
end
end
end
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: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},
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_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}
},
},
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_big", {
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_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,
--drop = "mcl_lush_caves:glow_berry",
})
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,
--drop = "mcl_lush_caves:glow_berry",
})
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_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","mcl_lush_caves_spore_blossom.png"},
drawtype = "plantlike_rooted",
param2type = "wallmounted",
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_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_decoration({
decoration = "mcl_lush_caves:moss",
deco_type = "simple",
place_on = {"group:stone","mcl_core:gravel"},
sidelen = 80,
fill_ratio = 0.5,
flags = "place_center_x, place_center_z, force_placement, all_floors, all_ceilings",
--biomes = get_ocean_biomes(),
y_max=-10,
})
minetest.register_decoration({
decoration = "mcl_lush_caves:moss_carpet",
deco_type = "simple",
place_on = {"group:stone","mcl_core:gravel"},
sidelen = 80,
fill_ratio = 0.5,
flags = "place_center_x, place_center_z, force_placement, all_floors",
--biomes = get_ocean_biomes(),
y_max=-10,
})
minetest.register_decoration({
decoration = "mcl_lush_caves:rooted_dirt",
deco_type = "simple",
place_on = {"group:stone","mcl_core:gravel"},
sidelen = 80,
fill_ratio = 0.3,
flags = "place_center_x, place_center_z, force_placement, all_ceilings",
--biomes = get_ocean_biomes(),
y_max=-10,
})
minetest.register_decoration({
decoration = "mcl_lush_caves:hanging_roots",
deco_type = "simple",
place_on = {"mcl_lush_caves:rooted_dirt",},
sidelen = 80,
fill_ratio = 0.1,
flags = "place_center_x, place_center_z, force_placement, all_ceilings",
--biomes = get_ocean_biomes(),
y_max=-10,
})
minetest.register_decoration({
decoration = "mcl_lush_caves:spore_blossom",
deco_type = "simple",
place_on = {"mcl_lush_caves:moss","group:material_stone"},
sidelen = 80,
fill_ratio = 0.1,
flags = "place_center_x, place_center_z, force_placement, all_ceilings",
--biomes = get_ocean_biomes(),
y_max=-10,
})
minetest.register_decoration({
decoration = "mcl_lush_caves:cave_vines",
deco_type = "simple",
place_on = {"mcl_lush_caves:moss"},
sidelen = 80,
fill_ratio = 0.1,
flags = "place_center_x, place_center_z, force_placement, all_ceilings",
--biomes = get_ocean_biomes(),
y_max=-10,
})
minetest.register_decoration({
decoration = "mcl_lush_caves:lake_structblock",
deco_type = "simple",
place_on = {"group:stone","mcl_core:gravel","mcl_lush_caves:moss"},
sidelen = 80,
fill_ratio = 0.1,
flags = "place_center_x, place_center_z, force_placement, all_floors",
--biomes = get_ocean_biomes(),
y_max=-10,
})
minetest.register_abm({
label = "Cave vines grow",
nodenames = {"mcl_lush_caves:cave_vines_lit","mcl_lush_caves:cave_vines"},
interval = 5,
chance = 2,
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.set_node(pd,node)
else
minetest.set_node(pos,{name="mcl_lush_caves:cave_vines_lit"})
end
end
})
minetest.register_lbm({
name = "mcl_lush_caves:make_lakes",
run_at_every_load = true,
nodenames = {"mcl_lush_caves:lake_structblock"},
action = function(pos, node)
minetest.set_node(pos,{name="air"})
makelake(pos)
end
})

View File

@ -0,0 +1,2 @@
name = mcl_lush_caves
depends = mcl_sounds

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB