1
0
Fork 0

Compare commits

...

31 Commits

Author SHA1 Message Date
the-real-herowl c8ac243589 Add missing mcl_util functions 2023-12-31 02:00:59 +01:00
the-real-herowl a8d451c1b0 Remove missing dependency 2023-12-31 01:47:58 +01:00
cora d729eaf2b6 Fix glow berry vines shears and normal drop 2023-12-31 01:46:05 +01:00
cora 354e2364cb Drop glow berries on rightclick instead of leftclick 2023-12-31 01:45:55 +01:00
laireia d94bd636d1 Use Lua voxel manipulator to make Azalea trees 2023-12-31 01:45:40 +01:00
laireia 7b8a9a6fc8 Fix azalea tree trunk under ground 2023-12-31 01:45:30 +01:00
laireia 984b394865 Allow flowers, bamboo and sugarcane to be placed on moss blocks
Add Moss to groups: soil_bamboo, soil_sugarcane
Add moss to allowed flower placement blocks
2023-12-31 01:44:58 +01:00
laireia 8c21b81dcf More information for the azalea definition
Add azaleas to the 'deco_block' group and fill in some help data
2023-12-31 01:44:45 +01:00
laireia 6fe3cd7449 Do not predict node placement for Spore Blossoms and Azaleas 2023-12-31 01:44:30 +01:00
laireia f26d46f31b Add potted azaleas 2023-12-31 01:44:16 +01:00
laireia 4fcc7da417 Use azaleas as fuel 2023-12-31 01:43:35 +01:00
laireia 4827730d07 Grow azalea trees with bone meal 2023-12-31 01:42:28 +01:00
laireia b173ef8b40 Center the trunk of the azalea tree schematic
The trunk of the azalea tree is off center in the schematic so placing it with
random rotation makes predicting where the trunk will end up impossible.

This enlarges the schematic to 7x6x7 blocks with the trunk in the center.
2023-12-31 01:42:19 +01:00
laireia d065d84259 Vegetate moss spreading with Azaleas
Replaces the Azalea Leaves for Azaleas when using bone meal to spread moss.
2023-12-31 01:42:07 +01:00
laireia d80c27e8ca Register Azalea and Flowering Azalea nodes 2023-12-31 01:41:55 +01:00
laireia 7d58e4df40 Fill in the Azalea textures
The Azalea nodes look better when they are opaque rather than transparent. Also
adds three missing textures.
2023-12-31 01:41:36 +01:00
laireia a6f9a0a978 Remove unused azalea textures 2023-12-31 01:40:49 +01:00
cora e179fb8aed Fix empty if-branch in lush caves 2023-12-31 01:38:45 +01:00
laireia 55926e3f4f Generate vegetation on top of spreading moss
Various types of vegetation generate on the spreading moss with differing
probabilities.
2023-12-31 01:38:33 +01:00
laireia b58d68b467 Spread moss using bone meal
Moss spreads when bone meal is used on it. There is some randomness that depends
on distance from the bone-mealed block. Moss can spread up to three blocks in
the x- and z-axes and up to four blocks up and six blocks down on the y-axis.
2023-12-31 01:38:23 +01:00
laireia 64af5cc268 Add "converts_to_moss" group for nodes
Some blocks should convert to moss when in the vicinity of a moss block that has
had bone meal used on it. Add the group to these node registrations.
2023-12-31 01:37:49 +01:00
cora 26fd36ba78 Fix wrong is_ground_content fields 2023-12-31 01:24:22 +01:00
cora 100a39e4fa Fix dripleaf bonemealing, remove typo-files 2023-12-31 01:18:03 +01:00
cora 47a0f3e5ac optimize textures 2023-12-31 01:17:51 +01:00
cora 6f3691da5e Add spore blossom particles 2023-12-31 01:17:39 +01:00
cora 5327bdfda9 Add Spore blossom 2023-12-31 01:16:58 +01:00
cora 46f01e9ce1 Clean up a bit 2023-12-31 01:15:26 +01:00
cora c888095e61 Adjust dripleaf selectionbox 2023-12-31 01:15:11 +01:00
cora c0a928a411 Make claypools less likely to leak 2023-12-31 01:14:58 +01:00
cora eb2574aa91 Move dripleaf and nodes to separate files 2023-12-31 01:14:27 +01:00
cora 9a77064fd1 Add mcl_lush_caves 2023-12-31 01:11:11 +01:00
59 changed files with 1105 additions and 27 deletions

View File

@ -22,6 +22,13 @@ function table.update_nil(t, ...)
return t
end
-- Copies the table then updates
function table.merge(t, ...)
local t2 = table.copy(t)
return table.update(t2, ...)
end
---Works the same as `pairs`, but order returned by keys
---
---Taken from https://www.lua.org/pil/19.3.html
@ -630,6 +637,21 @@ function mcl_util.replace_mob(obj, mob)
return obj
end
function mcl_util.traverse_tower(pos, dir, callback)
local node = minetest.get_node(pos)
local i = 0
while minetest.get_node(pos).name == node.name do
if callback and callback(pos, dir, node) then
return pos,i,true
end
i = i + 1
pos = vector.offset(pos, 0, dir, 0)
end
return vector.offset(pos, 0, -dir, 0), i
end
function mcl_util.get_pointed_thing(player, liquid)
local pos = vector.offset(player:get_pos(), 0, player:get_properties().eye_height, 0)
local look_dir = vector.multiply(player:get_look_dir(), 5)

View File

@ -437,7 +437,7 @@ mcl_mobs.register_mob("mobs_mc:wither", {
})
local wither_rose_soil = { "group:grass_block", "mcl_core:dirt", "mcl_core:coarse_dirt", "mcl_nether:netherrack", "group:soul_block", "mcl_mud:mud", "mcl_moss:moss" }
local wither_rose_soil = { "group:grass_block", "mcl_core:dirt", "mcl_core:coarse_dirt", "mcl_nether:netherrack", "group:soul_block", "mcl_mud:mud", "mcl_lush_caves:moss" }
local function spawn_wither_rose(obj)
local n = minetest.find_node_near(obj:get_pos(),2,wither_rose_soil)
if n then

View File

@ -117,6 +117,7 @@ minetest.register_node("mcl_barrels:barrel_closed", {
_doc_items_longdesc = S("Barrels are containers which provide 27 inventory slots."),
_doc_items_usagehelp = S("To access its inventory, rightclick it. When broken, the items will drop out."),
tiles = { "mcl_barrels_barrel_top.png^[transformR270", "mcl_barrels_barrel_bottom.png", "mcl_barrels_barrel_side.png" },
is_ground_content = false,
paramtype = "light",
paramtype2 = "facedir",
on_place = function(itemstack, placer, pointed_thing)
@ -166,6 +167,7 @@ minetest.register_node("mcl_barrels:barrel_open", {
_doc_items_usagehelp = S("To access its inventory, rightclick it. When broken, the items will drop out."),
_doc_items_create_entry = false,
tiles = { "mcl_barrels_barrel_top_open.png", "mcl_barrels_barrel_bottom.png", "mcl_barrels_barrel_side.png" },
is_ground_content = false,
paramtype = "light",
paramtype2 = "facedir",
drop = "mcl_barrels:barrel_closed",

View File

@ -236,6 +236,7 @@ minetest.register_node("mcl_beacons:beacon", {
collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
mesh = "mcl_beacon.b3d",
tiles = {"beacon_UV.png"},
is_ground_content = false,
use_texture_alpha = "clip",
on_construct = function(pos)
local meta = minetest.get_meta(pos)

View File

@ -33,6 +33,7 @@ for i=0,4 do
"respawn_anchor_bottom.png",
"respawn_anchor_side0.png"
},
is_ground_content = false,
on_rightclick = rightclick,
groups = {pickaxey=1, material_stone=1},
_mcl_hardness = 22.5,

View File

@ -10,6 +10,7 @@ minetest.register_node("mcl_cartography_table:cartography_table", {
"mcl_cartography_table_side3.png", "mcl_cartography_table_side2.png",
"mcl_cartography_table_side3.png", "mcl_cartography_table_side1.png"
},
is_ground_content = false,
paramtype2 = "facedir",
groups = { axey = 2, handy = 1, deco_block = 1, material_wood = 1, flammable = 1 },
sounds = mcl_sounds.node_sound_wood_defaults(),

View File

@ -390,6 +390,7 @@ local function register_chest(basename, desc, longdesc, usagehelp, tt_help, tile
drawtype = "mesh",
mesh = "mcl_chests_chest.b3d",
tiles = small_textures,
is_ground_content = false,
use_texture_alpha = "opaque",
paramtype = "light",
paramtype2 = "facedir",

View File

@ -27,7 +27,7 @@ minetest.register_node("mcl_core:stone", {
tiles = {"default_stone.png"},
is_ground_content = true,
stack_max = 64,
groups = {pickaxey=1, stone=1, building_block=1, material_stone=1},
groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, stonecuttable = 1, converts_to_moss = 1},
drop = "mcl_core:cobble",
sounds = mcl_sounds.node_sound_stone_defaults(),
_mcl_blast_resistance = 6,
@ -297,7 +297,7 @@ minetest.register_node("mcl_core:granite", {
tiles = {"mcl_core_granite.png"},
is_ground_content = true,
stack_max = 64,
groups = {pickaxey=1, stone=1, building_block=1, material_stone=1},
groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, converts_to_moss = 1},
sounds = mcl_sounds.node_sound_stone_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 1.5,
@ -309,7 +309,7 @@ minetest.register_node("mcl_core:granite_smooth", {
tiles = {"mcl_core_granite_smooth.png"},
stack_max = 64,
is_ground_content = false,
groups = {pickaxey=1, stone=1, building_block=1, material_stone=1},
groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, converts_to_moss = 1},
sounds = mcl_sounds.node_sound_stone_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 1.5,
@ -321,7 +321,7 @@ minetest.register_node("mcl_core:andesite", {
tiles = {"mcl_core_andesite.png"},
is_ground_content = true,
stack_max = 64,
groups = {pickaxey=1, stone=1, building_block=1, material_stone=1},
groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, converts_to_moss = 1},
sounds = mcl_sounds.node_sound_stone_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 1.5,
@ -333,7 +333,7 @@ minetest.register_node("mcl_core:andesite_smooth", {
tiles = {"mcl_core_andesite_smooth.png"},
is_ground_content = false,
stack_max = 64,
groups = {pickaxey=1, stone=1, building_block=1, material_stone=1},
groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, converts_to_moss = 1},
sounds = mcl_sounds.node_sound_stone_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 1.5,
@ -345,7 +345,7 @@ minetest.register_node("mcl_core:diorite", {
tiles = {"mcl_core_diorite.png"},
is_ground_content = true,
stack_max = 64,
groups = {pickaxey=1, stone=1, building_block=1, material_stone=1},
groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, converts_to_moss = 1},
sounds = mcl_sounds.node_sound_stone_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 1.5,
@ -357,7 +357,7 @@ minetest.register_node("mcl_core:diorite_smooth", {
tiles = {"mcl_core_diorite_smooth.png"},
is_ground_content = false,
stack_max = 64,
groups = {pickaxey=1, stone=1, building_block=1, material_stone=1},
groups = {pickaxey=1, stone=1, building_block=1, material_stone=1, converts_to_moss = 1},
sounds = mcl_sounds.node_sound_stone_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 1.5,
@ -380,7 +380,8 @@ minetest.register_node("mcl_core:dirt_with_grass", {
handy = 1, shovely = 1, dirt = 2, grass_block = 1, grass_block_no_snow = 1,
soil = 1, soil_sapling = 2, soil_sugarcane = 1, cultivatable = 2,
spreading_dirt_type = 1, enderman_takable = 1, building_block = 1,
compostability = 30, path_creation_possible = 1, grass_palette = 1
compostability = 30, path_creation_possible = 1, grass_palette = 1,
converts_to_moss = 1
},
drop = "mcl_core:dirt",
sounds = mcl_sounds.node_sound_dirt_defaults({
@ -434,7 +435,9 @@ minetest.register_node("mcl_core:mycelium", {
tiles = {"mcl_core_mycelium_top.png", "default_dirt.png", {name="mcl_core_mycelium_side.png", tileable_vertical=false}},
is_ground_content = true,
stack_max = 64,
groups = { handy = 1, shovely = 1, dirt = 2, spreading_dirt_type = 1, enderman_takable = 1, building_block = 1, soil_sapling = 2, path_creation_possible=1, mycelium=1},
groups = { handy = 1, shovely = 1, dirt = 2, spreading_dirt_type = 1, enderman_takable = 1,
building_block = 1, soil_sapling = 2, path_creation_possible=1, mycelium=1, converts_to_moss = 1
},
drop = "mcl_core:dirt",
sounds = mcl_sounds.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.1},
@ -492,7 +495,7 @@ minetest.register_node("mcl_core:podzol", {
tiles = {"mcl_core_dirt_podzol_top.png", "default_dirt.png", {name="mcl_core_dirt_podzol_side.png", tileable_vertical=false}},
is_ground_content = true,
stack_max = 64,
groups = {handy=1,shovely=3, dirt=2,soil=1, soil_sapling=2, soil_sugarcane=1, enderman_takable=1, building_block=1,path_creation_possible=1},
groups = {handy=1,shovely=3, dirt=2,soil=1, soil_sapling=2, soil_sugarcane=1, enderman_takable=1, building_block=1, path_creation_possible=1, converts_to_moss = 1},
drop = "mcl_core:dirt",
sounds = mcl_sounds.node_sound_dirt_defaults(),
on_construct = mcl_core.on_snowable_construct,
@ -510,7 +513,9 @@ minetest.register_node("mcl_core:dirt", {
tiles = {"default_dirt.png"},
is_ground_content = true,
stack_max = 64,
groups = {handy=1,shovely=1, dirt=1,soil=1, soil_sapling=2, soil_sugarcane=1, cultivatable=2, enderman_takable=1, building_block=1, path_creation_possible=1},
groups = {handy=1,shovely=1, dirt=1,soil=1, soil_sapling=2, soil_sugarcane=1, cultivatable=2, enderman_takable=1,
building_block=1, path_creation_possible=1, converts_to_moss = 1
},
sounds = mcl_sounds.node_sound_dirt_defaults(),
_mcl_blast_resistance = 0.5,
_mcl_hardness = 0.5,
@ -522,7 +527,9 @@ minetest.register_node("mcl_core:coarse_dirt", {
tiles = {"mcl_core_coarse_dirt.png"},
is_ground_content = true,
stack_max = 64,
groups = { handy = 1,shovely = 1, dirt = 3, soil = 1, soil_sugarcane = 1, cultivatable = 1, enderman_takable = 1, building_block = 1, soil_sapling = 2, path_creation_possible=1},
groups = { handy = 1,shovely = 1, dirt = 3, soil = 1, soil_sugarcane = 1, cultivatable = 1, enderman_takable = 1,
building_block = 1, soil_sapling = 2, path_creation_possible=1, converts_to_moss = 1
},
sounds = mcl_sounds.node_sound_dirt_defaults(),
_mcl_blast_resistance = 0.5,
_mcl_hardness = 0.5,

View File

@ -19,7 +19,7 @@ minetest.register_node("mcl_deepslate:deepslate", {
paramtype2 = "facedir",
is_ground_content = true,
on_place = mcl_util.rotate_axis,
groups = { pickaxey = 1, stone = 1, building_block = 1, material_stone = 1 },
groups = { pickaxey = 1, stone = 1, building_block = 1, material_stone = 1, converts_to_moss = 1 },
drop = cobble,
sounds = mcl_sounds.node_sound_stone_defaults(),
on_rotate = screwdriver.rotate_3way,
@ -47,7 +47,7 @@ minetest.register_node("mcl_deepslate:tuff", {
_doc_items_longdesc = S("Tuff is an ornamental rock formed from volcanic ash, occurring in underground blobs below Y=16."),
_doc_items_hidden = false,
tiles = { "mcl_deepslate_tuff.png" },
groups = { pickaxey = 1, deco_block = 1 },
groups = { pickaxey = 1, deco_block = 1, converts_to_moss = 1 },
sounds = mcl_sounds.node_sound_stone_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 1.5,
@ -199,6 +199,7 @@ local function register_deepslate_variant(item, desc, longdesc)
_doc_items_longdesc = S(longdesc),
_doc_items_hidden = false,
tiles = { "mcl_"..texture..".png" },
is_ground_content = false,
groups = { pickaxey = 1, building_block = 1, material_stone = 1 },
sounds = mcl_sounds.node_sound_stone_defaults(),
_mcl_blast_resistance = 6,

View File

@ -1,6 +1,6 @@
local S = minetest.get_translator(minetest.get_current_modname())
local planton = {"mcl_core:dirt_with_grass", "mcl_core:dirt", "mcl_core:podzol", "mcl_core:coarse_dirt", "mcl_farming:soil", "mcl_farming:soil_wet", "mcl_moss:moss"}
local planton = {"mcl_core:dirt_with_grass", "mcl_core:dirt", "mcl_core:podzol", "mcl_core:coarse_dirt", "mcl_farming:soil", "mcl_farming:soil_wet", "mcl_lush_caves:moss"}
for i=0, 3 do
local texture = "mcl_farming_sweet_berry_bush_" .. i .. ".png"

View File

@ -10,6 +10,7 @@ minetest.register_node("mcl_fletching_table:fletching_table", {
"fletching_table_side.png", "fletching_table_side.png"
},
paramtype2 = "facedir",
is_ground_content = false,
groups = { axey = 2, handy = 1, deco_block = 1, material_wood = 1, flammable = 1 },
sounds = mcl_sounds.node_sound_wood_defaults(),
_mcl_blast_resistance = 2.5,

View File

@ -41,7 +41,7 @@ local on_place_flower = mcl_util.generate_on_place_plant_function(function(pos,
end
--[[ Placement requirements:
* Dirt or grass block
* Dirt, grass or moss block
* If not flower, also allowed on podzol and coarse dirt
* Light level >= 8 at any time or exposed to sunlight at day
]]
@ -51,11 +51,11 @@ local on_place_flower = mcl_util.generate_on_place_plant_function(function(pos,
if (light_night and light_night >= 8) or (light_day and light_day >= minetest.LIGHT_MAX) then
light_ok = true
end
if itemstack:get_name() == "mcl_flowers:wither_rose" and ( minetest.get_item_group(soil_node.name, "grass_block") > 0 or soil_node.name == "mcl_core:dirt" or soil_node.name == "mcl_core:coarse_dirt" or soil_node.name == "mcl_mud:mud" or soil_node.name == "mcl_moss:moss" or soil_node.name == "mcl_nether:netherrack" or minetest.get_item_group(soil_node.name, "soul_block") > 0 ) then
if itemstack:get_name() == "mcl_flowers:wither_rose" and ( minetest.get_item_group(soil_node.name, "grass_block") > 0 or soil_node.name == "mcl_core:dirt" or soil_node.name == "mcl_core:coarse_dirt" or soil_node.name == "mcl_mud:mud" or soil_node.name == "mcl_lush_caves:moss" or soil_node.name == "mcl_nether:netherrack" or minetest.get_item_group(soil_node.name, "soul_block") > 0 ) then
return true,colorize
end
local is_flower = minetest.get_item_group(itemstack:get_name(), "flower") == 1
local ok = (soil_node.name == "mcl_core:dirt" or minetest.get_item_group(soil_node.name, "grass_block") == 1 or (not is_flower and (soil_node.name == "mcl_core:coarse_dirt" or soil_node.name == "mcl_core:podzol" or soil_node.name == "mcl_core:podzol_snow"))) and light_ok
local ok = (soil_node.name == "mcl_core:dirt" or minetest.get_item_group(soil_node.name, "grass_block") == 1 or soil_node.name == "mcl_lush_caves:moss" or (not is_flower and (soil_node.name == "mcl_core:coarse_dirt" or soil_node.name == "mcl_core:podzol" or soil_node.name == "mcl_core:podzol_snow"))) and light_ok
return ok, colorize
end)
@ -318,11 +318,11 @@ local function add_large_plant(name, desc, longdesc, bottom_img, top_img, inv_im
end
-- Placement rules:
-- * Allowed on dirt or grass block
-- * Allowed on dirt, grass or moss block
-- * If not a flower, also allowed on podzol and coarse dirt
-- * Only with light level >= 8
-- * Only if two enough space
if (floor.name == "mcl_core:dirt" or minetest.get_item_group(floor.name, "grass_block") == 1 or (not is_flower and (floor.name == "mcl_core:coarse_dirt" or floor.name == "mcl_core:podzol" or floor.name == "mcl_core:podzol_snow"))) and bottom_buildable and top_buildable and light_ok then
if (floor.name == "mcl_core:dirt" or minetest.get_item_group(floor.name, "grass_block") == 1 or floor.name == "mcl_lush_caves:moss" or (not is_flower and (floor.name == "mcl_core:coarse_dirt" or floor.name == "mcl_core:podzol" or floor.name == "mcl_core:podzol_snow"))) and bottom_buildable and top_buildable and light_ok then
local param2
if grass_color then
param2 = get_palette_color_from_pos(bottom)
@ -419,7 +419,7 @@ minetest.register_abm({
return
end
-- Pop out flower if not on dirt, grass block or too low brightness
if (below.name ~= "mcl_core:dirt" and minetest.get_item_group(below.name, "grass_block") ~= 1) or (minetest.get_node_light(pos, 0.5) < 8) then
if (below.name ~= "mcl_core:dirt" and minetest.get_item_group(below.name, "grass_block") ~= 1 and below.name ~= "mcl_lush_caves:moss") or (minetest.get_node_light(pos, 0.5) < 8) then
minetest.dig_node(pos)
return
end

View File

@ -56,6 +56,7 @@ minetest.register_node("mcl_honey:honeycomb_block", {
tiles = {
"mcl_honey_honeycomb_block.png"
},
is_ground_content = false,
groups = { handy = 1, deco_block = 1 },
sounds = {
dig = { name = "slimenodes_dug", gain = 0.6, pitch = 1.2 },
@ -84,6 +85,7 @@ minetest.register_node("mcl_honey:honey_block", {
description = S("Honey Block"),
_doc_items_longdesc = S("Honey Block. Used as a decoration and in redstone. Is sticky on some sides."),
tiles = { "mcl_honey_block_side.png" },
is_ground_content = false,
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "blend" or true,
groups = { handy = 1, deco_block = 1, fall_damage_add_percent = -80 },
sounds = {

View File

@ -11,6 +11,7 @@ minetest.register_node("mcl_loom:loom", {
"loom_side.png", "loom_front.png"
},
paramtype2 = "facedir",
is_ground_content = false,
groups = { axey = 2, handy = 1, deco_block = 1, material_wood = 1, flammable = 1 },
sounds = mcl_sounds.node_sound_wood_defaults(),
_mcl_blast_resistance = 2.5,

View File

@ -0,0 +1,236 @@
local modname = minetest.get_current_modname()
local S = minetest.get_translator(modname)
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 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
function mcl_lush_caves.dripleaf_grow(pos, node)
local t = mcl_util.traverse_tower(pos,1) -- 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"})
return true
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 = {{ -3/16, -8/16, -3/16, 3/16, 8/16, 3/16 }},
},
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_bone_meal = function(itemstack,placer, pointed_thing, pos, node)
if not pos then return end
return mcl_lush_caves.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 = {{ -3/16, -8/16, -3/16, 3/16, 8/16, 3/16 }},
},
drop = "",
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_bone_meal = function(itemstack, clicker, pointed_thing, pos, node)
return mcl_lush_caves.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)
mcl_lush_caves.dripleaf_grow(vector.offset(pos,0,-1,0),{name = "mcl_lush_caves:dripleaf_big_stem" })
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)
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,
})
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)

View File

@ -0,0 +1,282 @@
mcl_lush_caves = {}
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
local S = minetest.get_translator(modname)
local PARTICLE_DISTANCE = 25
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 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
dofile(modpath.."/nodes.lua")
dofile(modpath.."/dripleaf.lua")
local spore_blossom_particlespawner = {
texture = "mcl_lush_caves_spore_blossom_particle.png",
amount = 32,
time = 25,
minvel = vector.zero(),
maxvel = vector.zero(),
minacc = vector.new(-0.2, -0.1, -0.2),
maxacc = vector.new(0.2, -0.3, 0.2),
minexptime = 1.5,
maxexptime = 8.5,
minsize = 0.1,
maxsize= 0.4,
glow = 4,
collisiondetection = true,
collision_removal = true,
}
minetest.register_abm({
label = "Spore Blossom Particles",
nodenames = {"mcl_lush_caves:spore_blossom"},
interval = 25,
chance = 10,
action = function(pos, node)
if minetest.get_node(vector.offset(pos, 0, -1, 0)).name ~= "air" then return end
for _,pl in pairs(minetest.get_connected_players()) do
if vector.distance(pos,pl:get_pos()) < PARTICLE_DISTANCE then
minetest.add_particlespawner(table.merge(spore_blossom_particlespawner, {
minpos = vector.offset(pos, -0.25, -0.5, -0.25),
maxpos = vector.offset(pos, 0.25, -0.5, 0.25),
playername = pl:get_player_name(),
}))
end
end
end
})
function mcl_lush_caves.makelake(pos,def,pr)
local p1 = vector.offset(pos,-8,-4,-8)
local p2 = vector.offset(pos,8,4,8)
local nn = minetest.find_nodes_in_area_under_air(p1,p2,{"group:solid"})
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(p1,p2,{"mcl_core:water_source"})
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
mcl_lush_caves.dripleaf_grow(d,{name = "mcl_lush_caves:dripleaf_big_stem"})
end
end
end
return true
end
local function set_of_content_ids_by_group(group)
local result = {}
for name, def in pairs(minetest.registered_nodes) do
if def.groups[group] then
result[minetest.get_content_id(name)] = true
end
end
return result
end
local CONVERTS_TO_ROOTED_DIRT = set_of_content_ids_by_group("material_stone")
CONVERTS_TO_ROOTED_DIRT[minetest.get_content_id("mcl_core:dirt")] = true
CONVERTS_TO_ROOTED_DIRT[minetest.get_content_id("mcl_core:coarse_dirt")] = true
local CONTENT_HANGING_ROOTS = minetest.get_content_id("mcl_lush_caves:hanging_roots")
local CONTENT_ROOTED_DIRT = minetest.get_content_id("mcl_lush_caves:rooted_dirt")
local function squared_average(a, b)
local s = a + b
return s*s/4
end
-- Azalea tree voxel manipulator buffer
local data = {}
function mcl_lush_caves.makeazalea(pos, def, pr)
local distance = {x = 4, y = 40, z = 4}
local airup = minetest.find_nodes_in_area_under_air(vector.offset(pos, 0, distance.y, 0), pos, {"mcl_core:dirt_with_grass"})
if #airup == 0 then return end
local surface_pos = airup[1]
local function squared_distance(x, z)
local dx = x - pos.x
local dz = z - pos.z
return dx*dx + dz*dz
end
local maximum_random_value = squared_average(distance.x, distance.z) + 1
local min = vector.offset(pos, -distance.x, -1, -distance.z)
local max = vector.offset(pos, distance.x, distance.y, distance.z)
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
vm:get_data(data)
local a = VoxelArea:new({MinEdge = emin, MaxEdge = emax})
local vi, below
for z = min.z, max.z do
for y = min.y + 1, surface_pos.y - 1 do
for x = min.x, max.x do
vi = a:index(x, y, z)
local probability_value = maximum_random_value - squared_distance(x, z)
if CONVERTS_TO_ROOTED_DIRT[data[vi]] and pr:next(1, maximum_random_value) <= probability_value then
data[vi] = CONTENT_ROOTED_DIRT
below = a:index(x, y - 1, z)
if data[below] == minetest.CONTENT_AIR then
data[below] = CONTENT_HANGING_ROOTS
end
end
end
end
end
data[a:index(surface_pos.x, surface_pos.y, surface_pos.z)] = CONTENT_ROOTED_DIRT
vm:set_data(data)
minetest.place_schematic_on_vmanip(vm,
vector.offset(surface_pos, -3, 1, -3),
modpath.."/schematics/azalea1.mts",
"random",nil,nil,
"place_center_x place_center_z"
)
vm:calc_lighting()
vm:write_to_map()
minetest.log("action","[mcl_lush_caves] Azalea generated at "..minetest.pos_to_string(surface_pos))
return true
end
local lushcaves = { "LushCaves", "LushCaves_underground", "LushCaves_ocean", "LushCaves_deep_ocean"}
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
})
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,
fill_ratio = 0.01,
terrain_feature = true,
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",
terrain_feature = true,
y_max =0,
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
end
if mcl_lush_caves.makeazalea(pos,def,pr) then
table.insert(azaleas,pos)
return true
end
end
})
--[[
minetest.set_gen_notify({cave_begin = true})
minetest.set_gen_notify({large_cave_begin = true})
mcl_mapgen_core.register_generator("lush_caves",nil, function(minp, maxp, blockseed)
local gennotify = minetest.get_mapgen_object("gennotify")
for _, pos in pairs(gennotify["large_cave_begin"] or {}) do
--minetest.log("large cave at "..minetest.pos_to_string(pos))
end
for _, pos in pairs(gennotify["cave_begin"] or {}) do
minetest.log("cave at "..minetest.pos_to_string(pos))
end
end, 99999, true)
--]]
minetest.register_craft({
type = "fuel",
recipe = "mcl_lush_caves:azalea",
burntime = 5,
})
minetest.register_craft({
type = "fuel",
recipe = "mcl_lush_caves:azalea_flowering",
burntime = 5,
})
mcl_flowerpots.register_potted_flower("mcl_lush_caves:azalea", {
name = "azalea",
desc = S("Azalea Plant"),
image = "mcl_lush_caves_azalea_side.png",
})
mcl_flowerpots.register_potted_flower("mcl_lush_caves:azalea_flowering", {
name = "azalea_flowering",
desc = S("Flowering Azalea Plant"),
image = "mcl_lush_caves_azalea_flowering_side.png",
})

View File

@ -0,0 +1,3 @@
name = mcl_lush_caves
author = cora
depends = mcl_util, mcl_structures, mcl_flowerpots

View File

@ -0,0 +1,420 @@
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
local S = minetest.get_translator(modname)
-- Return a vegetation type with the following chances
-- Tall Grass: 52.08%
-- Moss Carpet: 26.04%
-- Double Grass: 10.42%
-- Azalea: 7.29%
-- Flowering Azalea: 4.17%
local function random_moss_vegetation()
local x = math.random()
if x < 0.5208 then
return "mcl_flowers:tallgrass"
elseif x < 0.7812 then
return "mcl_lush_caves:moss_carpet"
elseif x < 0.8854 then
return "mcl_flowers:double_grass"
elseif x < 0.9583 then
return "mcl_lush_caves:azalea"
else
return "mcl_lush_caves:azalea_flowering"
end
end
-- sets the node at 'pos' to moss and with a 60% chance sets the node above to
-- vegatation
local function set_moss_with_chance_vegetation(pos)
minetest.set_node(pos, { name = "mcl_lush_caves:moss" })
if math.random() < 0.6 then
local vegetation = random_moss_vegetation()
local pos_up = vector.offset(pos, 0, 1, 0)
if vegetation == "mcl_flowers:double_grass" then
local pos_up2 = vector.offset(pos, 0, 2, 0)
if minetest.registered_nodes[minetest.get_node(pos_up2).name].buildable_to then
minetest.set_node(pos_up, { name = "mcl_flowers:double_grass" })
minetest.set_node(pos_up2, { name = "mcl_flowers:double_grass_top" })
else
minetest.set_node(pos_up, { name = "mcl_flowers:tallgrass" })
end
else
minetest.set_node(pos_up, { name = vegetation })
end
end
end
function mcl_lush_caves.bone_meal_moss(itemstack, placer, pointed_thing, pos)
if minetest.get_node(vector.offset(pos, 0, 1, 0)).name ~= "air" then
return false
end
local x_max = math.random(2, 3)
local z_max = math.random(2, 3)
local area_positions = minetest.find_nodes_in_area_under_air(
vector.offset(pos, -x_max, -6, -z_max),
vector.offset(pos, x_max, 4, z_max),
{ "group:converts_to_moss" }
)
for _, conversion_pos in pairs(area_positions) do
local x_distance = math.abs(pos.x - conversion_pos.x)
local z_distance = math.abs(pos.z - conversion_pos.z)
if not ( x_distance == x_max and z_distance == z_max ) then
if x_distance == x_max or z_distance == z_max then
if math.random() < 0.75 then
set_moss_with_chance_vegetation(conversion_pos)
end
else
set_moss_with_chance_vegetation(conversion_pos)
end
end
end
return true
end
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"},
groups = { handy=1, hoey=2, dirt=1, soil=1, soil_bamboo=1, soil_sapling=2, soil_sugarcane=1, 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,
_on_bone_meal = mcl_lush_caves.bone_meal_moss,
})
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, converts_to_moss = 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,
_mcl_shears_drop = true,
drop = {
max_items = 2,
items = {
{
items = {
"mcl_lush_caves:glow_berry ",
"mcl_lush_caves:cave_vines",
},
},
},
},
on_rightclick = 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:rooted_dirt", {
description = S("Rooted dirt"),
_doc_items_longdesc = S("Rooted dirt"),
_doc_items_hidden = false,
tiles = {"mcl_lush_caves_rooted_dirt.png"},
groups = {handy=1, shovely=1, dirt=1, building_block=1, path_creation_possible=1, converts_to_moss = 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."),
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 = S("Azalea Leaves"),
_doc_items_longdesc = S("Leaves of an Azalea tree"),
_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",
groups = {
hoey = 1, shearsy = 1, dig_by_piston = 1,
leaves = 1, leafdecay = 5, deco_block = 1,
flammable = 2, fire_encouragement = 30, fire_flammability = 60,
compostability = 30
},
drop = {
max_items = 1,
items = {
--{
-- items = {sapling},
-- rarity = 10
--},
{
items = {"mcl_core:stick 1"},
rarity = 3
},
{
items = {"mcl_core:stick 2"},
rarity = 6
},
}
},
sounds = mcl_sounds.node_sound_leaves_defaults(),
_mcl_blast_resistance = 0.2,
_mcl_hardness = 0.2,
_mcl_shears_drop = true,
_mcl_silk_touch_drop = true,
})
minetest.register_node("mcl_lush_caves:azalea_leaves_flowering", {
description = S("Flowering Azalea Leaves"),
_doc_items_longdesc = S("The Flowering Leaves of an Azalea tree"),
_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",
groups = {
hoey = 1, shearsy = 1, dig_by_piston = 1,
leaves = 1, leafdecay = 5, deco_block = 1,
flammable = 2, fire_encouragement = 30, fire_flammability = 60,
compostability = 30
},
drop = {
max_items = 1,
items = {
--{
-- items = {sapling},
-- rarity = 10
--},
{
items = {"mcl_core:stick 1"},
rarity = 3
},
{
items = {"mcl_core:stick 2"},
rarity = 6
},
}
},
sounds = mcl_sounds.node_sound_leaves_defaults(),
_mcl_blast_resistance = 0.2,
_mcl_hardness = 0.2,
_mcl_shears_drop = true,
_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 = "meshoptions",
place_param2 = 4,
groups = {handy = 1, plant = 1},
sounds = mcl_sounds.node_sound_dirt_defaults(),
selection_box = {
type = "fixed",
fixed = {{ -3/16, -2/16, -3/16, 3/16, 8/16, 3/16 }},
},
_mcl_blast_resistance = 0.5,
_mcl_hardness = 0.5,
node_placement_prediction = "",
on_place = mcl_util.generate_on_place_plant_function(function(place_pos, place_node,stack)
local above = vector.offset(place_pos,0,1,0)
local snn = minetest.get_node_or_nil(above).name
if not snn then return false end
if minetest.get_item_group(snn,"soil_sapling") > 0 then
return true
end
end)
})
local tpl_azalea = {
_tt_help = S("Needs soil and bone meal to grow"),
_doc_items_hidden = false,
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{ -8/16, -4/16, -8/16, 8/16, 8/16, 8/16 },
{ -2/16, -8/16, -2/16, 2/16, -4/16, 2/16 },
}
},
is_ground_content = false,
groups = {
handy = 1, shearsy = 1,
plant = 1, non_mycelium_plant = 1,
dig_by_piston = 1, dig_by_water = 1,
flammable = 2, fire_encouragement = 15, fire_flammability = 40,
deco_block = 1,
},
sounds = mcl_sounds.node_sound_dirt_defaults(),
paramtype = "light",
sunlight_propagates = true,
_mcl_blast_resistance = 0,
_mcl_hardness = 0,
use_texture_alpha = "clip",
node_placement_prediction = "",
on_place = mcl_util.generate_on_place_plant_function(function(pos, node, itemstack)
local floor_name = minetest.get_node_or_nil(vector.offset(pos, 0, -1, 0)).name
if not floor_name then return false end
if minetest.get_item_group(floor_name, "soil_sapling") > 0 or floor_name == "mcl_lush_caves:rooted_dirt" or floor_name == "mcl_mangrove:mangrove_mud_roots" or floor_name == "mcl_mud:mud" or floor_name == "mcl_core:clay" then
return true
end
end),
_on_bone_meal = function(itemstack, placer, pointed_thing, pos)
if math.random() > 0.45 or not mcl_trees.check_growth_simple(pos, 6) then return end
minetest.set_node(vector.offset(pos, 0, -1, 0), { name = "mcl_lush_caves:rooted_dirt" })
minetest.remove_node(pos)
minetest.place_schematic(
vector.offset(pos, -3, 0, -3),
modpath.."/schematics/azalea1.mts",
"random",
nil,
false,
"place_center_x place_center_z"
)
return true
end
}
local azalea = table.merge(
tpl_azalea, {
description = S("Azalea"),
_doc_items_longdesc = S("Azalea is a small plant which often occurs in lush caves. It can be broken by hand or any tool. By using bone meal, azalea can be turned into an azalea tree."),
_doc_items_entry_name = "azalea",
tiles = {
"mcl_lush_caves_azalea_top.png",
"mcl_lush_caves_azalea_bottom.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",
},
})
azalea.groups.compostability = 65
minetest.register_node("mcl_lush_caves:azalea", azalea)
local azalea_flowering = table.merge(
tpl_azalea, {
description = S("Flowering Azalea"),
_doc_items_longdesc = S("Flowering azalea is a small plant which often occurs in lush caves. It can be broken by hand or any tool. By using bone meal, flowering azalea can be turned into an azalea tree."),
_doc_items_entry_name = "azalea_flowering",
tiles = {
"mcl_lush_caves_azalea_flowering_top.png",
"mcl_lush_caves_azalea_flowering_bottom.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",
},
})
azalea_flowering.groups.compostability = 85
minetest.register_node("mcl_lush_caves:azalea_flowering", azalea_flowering)

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 700 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 725 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 322 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 705 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 554 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 B

View File

@ -5,13 +5,12 @@ minetest.register_node("mcl_mud:mud", {
_doc_items_longdesc = S("Mud is a decorative block that generates in mangrove swamps. Mud can also be obtained by using water bottles on dirt or coarse dirt."),
_doc_items_hidden = false,
tiles = {"mcl_mud.png"},
is_ground_content = true,
sounds = {
footstep = {name="mud_footsteps", gain=1},
dug = {name="mud_place_dug", gain=1},
place = {name="mud_place_dug", gain=1},
},
groups = {handy=1, shovely=1, enderman_takable=1, grass_block=1, soil_sugarcane=1, building_block=1},
groups = {handy=1, shovely=1, enderman_takable=1, grass_block=1, soil_sugarcane=1, building_block=1, converts_to_moss = 1},
_mcl_blast_resistance = 0.5,
_mcl_hardness = 0.5,
collision_box = {
@ -27,6 +26,7 @@ minetest.register_node("mcl_mud:packed_mud", {
_doc_items_longdesc = S("Packed mud is a decorative block used to craft mud bricks."),
_doc_items_hidden = false,
tiles = {"mcl_mud_packed_mud.png"},
is_ground_content = false,
groups = {handy=1, pickaxey=1, building_block=1},
sounds = mcl_sounds.node_sound_dirt_defaults(),
_mcl_blast_resistance = 3,
@ -39,6 +39,7 @@ minetest.register_node("mcl_mud:mud_bricks", {
_doc_items_hidden = false,
tiles = {"mcl_mud_bricks.png"},
groups = {handy=1, pickaxey=1, building_block=1},
is_ground_content = false,
sounds = mcl_sounds.node_sound_stone_defaults(),
_mcl_blast_resistance = 3,
_mcl_hardness = 1.5,

View File

@ -70,7 +70,7 @@ minetest.register_node("mcl_nether:netheriteblock", {
_doc_items_longdesc = S("Netherite block is very hard and can be made of 9 netherite ingots."),
stack_max = 64,
tiles = {"mcl_nether_netheriteblock.png"},
is_ground_content = true,
is_ground_content = false,
groups = { pickaxey=4, building_block=1, material_stone=1, xp = 0, fire_immune=1 },
drop = "mcl_nether:netheriteblock",
sounds = mcl_sounds.node_sound_stone_defaults(),

View File

@ -662,6 +662,7 @@ minetest.register_node("mcl_ocean:dried_kelp_block", {
description = S("Dried Kelp Block"),
_doc_items_longdesc = S("A decorative block that serves as a great furnace fuel."),
tiles = { "mcl_ocean_dried_kelp_top.png", "mcl_ocean_dried_kelp_bottom.png", "mcl_ocean_dried_kelp_side.png" },
is_ground_content = false,
groups = {
handy = 1, hoey = 1, building_block = 1, compostability = 50,
flammable = 2, fire_encouragement = 30, fire_flammability = 60

View File

@ -3530,6 +3530,101 @@ local function register_decorations()
for k, _ in pairs(corals) do
register_coral_decos(k)
end
local lushcaves = { "LushCaves", "LushCaves_underground", "LushCaves_ocean", "LushCaves_deep_ocean"}
local lushcaves_underground = { "LushCaves_underground", "LushCaves_ocean", "LushCaves_deep_ocean"}
minetest.register_decoration({
decoration = "mcl_lush_caves:moss",
deco_type = "simple",
place_on = {"mcl_core:stone","mcl_deepslate:deepslate","mcl_deepslate:tuff","group:material_stone", "mcl_core:gravel", "mcl_core:bedrock"},
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"},
biomes = lushcaves,
fill_ratio = 1,
flags = "all_floors",
})
minetest.register_decoration({
decoration = "mcl_lush_caves:cave_vines",
deco_type = "simple",
place_on = {"mcl_lush_caves:moss"},
height = 1,
height_max = 4,
fill_ratio = 0.2,
flags = "all_ceilings",
biomes = lushcaves_underground,
})
minetest.register_decoration({
decoration = "mcl_lush_caves:cave_vines_lit",
deco_type = "simple",
place_on = {"mcl_lush_caves:moss"},
height = 1,
height_max = 4,
fill_ratio = 0.3,
flags = "all_ceilings",
biomes = lushcaves_underground,
})
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,
height_max = 4,
fill_ratio = 0.1,
flags = "all_ceilings",
biomes = lushcaves_underground,
})
minetest.register_decoration({
decoration = "mcl_lush_caves:cave_vines",
deco_type = "simple",
place_on = {"mcl_lush_caves:cave_vines_lit","mcl_lush_caves:cave_vines"},
height = 1,
height_max = 5,
fill_ratio = 0.1,
flags = "all_ceilings",
biomes = lushcaves_underground,
})
minetest.register_decoration({
place_on = {"mcl_lush_caves:rooted_dirt"},
decoration = "mcl_lush_caves:hanging_roots",
deco_type = "simple",
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"},
spawn_by = {"air"},
num_spawn_by = 4,
fill_ratio = 0.8,
param2 = 4,
flags = "all_ceilings",
biomes = lushcaves_underground,
})
minetest.register_decoration({
decoration = "mcl_lush_caves:moss_carpet",
deco_type = "simple",
place_on = {"group:material_stone","mcl_core:gravel","mcl_lush_caves:moss"},
fill_ratio = 0.1,
flags = "all_floors",
biomes = lushcaves,
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"group:sand", "mcl_core:gravel", "mcl_mud:mud"},