Compare commits

...

62 Commits

Author SHA1 Message Date
cora 07c020ae62 use noise instead of fill_ratio for distribution 2022-06-13 23:59:22 +02:00
cora d092fa887f add surface pools 2022-06-13 23:59:22 +02:00
cora 19d4f77ce8 Do not replace bedrock during geode gen. 2022-06-13 23:59:22 +02:00
cora d46e577b9f Add outer geode layer
uses deepslate until smooth basalt is there
2022-06-13 23:59:22 +02:00
cora bd6aba921f Add proper logging + some fixes 2022-06-13 23:59:22 +02:00
cora 7737c06562 Add API documentation, minor fixes 2022-06-13 23:59:22 +02:00
cora b0059e5f4b Add /spawnstruct support 2022-06-13 23:59:22 +02:00
cora f7e4fd4bca Geodes as test for place by function 2022-06-13 23:59:22 +02:00
cora 8d03c5678c use gennotify instead of lbm for placement
keep the lbm for secondary structures
2022-06-13 23:59:22 +02:00
cora 03def3809d Add Structure placement api 2022-06-13 23:59:22 +02:00
cora b3cd77506f old registered_structures -> structure_data 2022-06-13 23:59:22 +02:00
cora e9792b09a3 Tweak biome config 2022-06-13 23:59:17 +02:00
cora 7d1bfa3fbd Limit Azalea tree generation by distance too
The other way would sometimes have multiple azaleas fairly close
2022-06-13 23:59:17 +02:00
cora 6847148b45 Tweak dripleaf behavior 2022-06-13 23:59:17 +02:00
cora 524535f7c3 some cleanup 2022-06-13 23:59:17 +02:00
cora 97d8413fc4 Generate some glowing vines immediately 2022-06-13 23:59:17 +02:00
cora 2026a2f80c Add dripleaf functionality 2022-06-13 23:59:17 +02:00
cora f85b9782f8 Generate Azalea tree 2022-06-13 23:59:17 +02:00
cora 47f9b14d7c use gennotify for lakegen 2022-06-13 23:59:17 +02:00
cora 2b9f0a74a5 Add biome 2022-06-13 23:59:17 +02:00
cora 5624638ff1 Add dripleaf ans spore blossom nodes 2022-06-13 23:59:17 +02:00
cora bc1178876f Add Glow berries 2022-06-13 23:59:17 +02:00
cora a4682e8e60 Add lush caves 2022-06-13 23:59:17 +02:00
cora 27a9cc651a remove superfluous dependencies 2022-06-13 23:59:12 +02:00
cora 29626ad7ca remove check for mcl_copper, fix recipe 2022-06-13 23:59:12 +02:00
cora e1ac19195c spaces -> tabs 2022-06-13 23:59:12 +02:00
PrairieAstronomer 1237debcbb Removed screenshots and Liscense 2022-06-13 23:59:12 +02:00
NO11 b06fb84294 mcl_spyglass by NO11 2022-06-13 23:59:12 +02:00
MysticTempest 41707088f0 Bell can be activated by redstone 2022-06-13 23:59:09 +02:00
cora 56911644fd make nether mushroom rotation random 2022-06-13 23:59:03 +02:00
cora 063930114d replace algorithmic fungus gen by schematic
it was always the same anyways (except for the shroomlight)
2022-06-13 23:59:03 +02:00
cora a5522ffb10 remove enderman spawning 2022-06-13 23:59:03 +02:00
AFCMS bb42fb0390 Fix some codestyle issues with `mcl_crimson` 2022-06-13 23:59:03 +02:00
cora 67c96ad838 fix whitespace 2022-06-13 23:59:03 +02:00
cora 418f0933ea rename mcl_mushroom to mcl_crimson 2022-06-13 23:59:03 +02:00
3raven bc03cca667 Correct name 2022-06-13 23:59:03 +02:00
kay27 5ba9b9d047 fix 2022-06-13 23:59:03 +02:00
3raven 16029aabeb fix 2022-06-13 23:59:03 +02:00
3raven 7aac992b15 Non flammable/modify by similiraty with trees 2022-06-13 23:59:03 +02:00
3raven afa16aca9f Same for crimson hyphae 2022-06-13 23:59:03 +02:00
3raven a3d70d3b95 Add warped hyphae stripped and bark 2022-06-13 23:59:03 +02:00
3raven 87afaa8849 Add texture files for stripped stem
Add texture files for stripped stem
2022-06-13 23:59:03 +02:00
kay27 1a092562c7 Bump ABM intervals to 1 second 2022-06-13 23:59:03 +02:00
3raven 1937ec7c1a fix texture 2022-06-13 23:59:03 +02:00
3raven c9ef4f3f58 mcl_mushroom.fr.tr
Translation
2022-06-13 23:59:03 +02:00
kay27 3beb97be5c #41 Remove proprietary textures, update game screenshot 2022-06-13 23:59:03 +02:00
debiankaios c9cac83aac german translation 2022-06-13 23:59:03 +02:00
debiankaios 31327e042e german translation 2022-06-13 23:59:03 +02:00
debiankaios 005398c88a Added textures for the sprouts and roots. 2022-06-13 23:59:03 +02:00
debiankaios a654e59db9 Add more decoration blocks.
Added the decorations lbocks, and chancheg generation of decoration a bit.
2022-06-13 23:59:03 +02:00
debiankaios a015c02485 Add twisting_vines textures 2022-06-13 23:59:03 +02:00
debiankaios b37f174e17 Fixed warnings
Warnings because a var which not exist
2022-06-13 23:59:03 +02:00
debiankaios 7a24cb5da9 New Textures 2022-06-13 23:59:03 +02:00
debiankaios f1e0bd36d3 New Textures 2022-06-13 23:59:03 +02:00
debiankaios e54339bed7 New Textures 2022-06-13 23:59:03 +02:00
debiankaios 657315dbfd New Textures 2022-06-13 23:59:03 +02:00
debiankaios 0be3581a52 New Textures 2022-06-13 23:59:03 +02:00
debiankaios f9f4bb6f2d New Textures 2022-06-13 23:59:03 +02:00
debiankaios de996cea3a Bufixes
Fixed Bug that trees generating in other blocks. The slab and stairbug was fixed too.
2022-06-13 23:59:03 +02:00
Lizzy Fleckenstein 8ae3ba4c0d Fix light_source warning in mcl_mushroom 2022-06-13 23:59:03 +02:00
cora 600a01b691 comment out ore generation for now 2022-06-13 23:59:03 +02:00
debiankaios 978d747b50 Add warped and crimson 2022-06-13 23:59:03 +02:00
92 changed files with 2191 additions and 129 deletions

View File

@ -39,6 +39,10 @@ minetest.register_node("mcl_bells:bell", {
_mcl_hardness = 5,
on_rightclick = mcl_bells.ring_once,
use_texture_alpha = "clip",
mesecons = {effector = {
action_on = mcl_bells.ring_once,
rules = mesecon.rules.flat,
}},
})
if has_mcl_wip then

View File

@ -1,2 +1,3 @@
name = mcl_bells
depends = mesecons
optional_depends = mcl_wip

View File

@ -0,0 +1,662 @@
local modname = minetest.get_current_modname()
local S = minetest.get_translator(modname)
local modpath = minetest.get_modpath(modname)
-- Warped and Crimson fungus
-- by debiankaios
-- adapted for mcl2 by cora
local function generate_warped_tree(pos)
minetest.place_schematic(vector.offset(pos,-2,0,-2),modpath.."/schematics/warped_mushroom.mts","random")
end
function generate_crimson_tree(pos)
minetest.place_schematic(vector.offset(pos,-2,0,-2),modpath.."/schematics/crimson_mushroom.mts","random")
end
minetest.register_node("mcl_crimson:warped_fungus", {
description = S("Warped Fungus Mushroom"),
drawtype = "plantlike",
tiles = { "farming_warped_fungus.png" },
inventory_image = "farming_warped_fungus.png",
wield_image = "farming_warped_fungus.png",
sunlight_propagates = true,
paramtype = "light",
walkable = false,
groups = {dig_immediate=3,mushroom=1,attached_node=1,dig_by_water=1,destroy_by_lava_flow=1,dig_by_piston=1,enderman_takable=1,deco_block=1},
light_source = 1,
selection_box = {
type = "fixed",
fixed = { -3/16, -0.5, -3/16, 3/16, -2/16, 3/16 },
},
node_placement_prediction = "",
on_rightclick = function(pos, node, pointed_thing, player, itemstack)
if pointed_thing:get_wielded_item():get_name() == "mcl_dye:white" then
local nodepos = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z})
if nodepos.name == "mcl_crimson:warped_nylium" or nodepos.name == "mcl_nether:netherrack" then
local random = math.random(1, 5)
if random == 1 then
generate_warped_tree(pos)
end
end
end
end,
_mcl_blast_resistance = 0,
})
minetest.register_node("mcl_crimson:twisting_vines", {
description = S("Twisting Vines"),
drawtype = "plantlike",
tiles = { "twisting_vines_plant.png" },
inventory_image = "twisting_vines.png",
sunlight_propagates = true,
paramtype = "light",
walkable = false,
climbable = true,
buildable_to = true,
groups = {dig_immediate=3,vines=1,dig_by_water=1,destroy_by_lava_flow=1,dig_by_piston=1,deco_block=1, shearsy = 1},
selection_box = {
type = "fixed",
fixed = { -3/16, -0.5, -3/16, 3/16, 0.5, 3/16 },
},
node_placement_prediction = "",
on_rightclick = function(pos, node, pointed_thing, itemstack)
if pointed_thing:get_wielded_item():get_name() == "mcl_crimson:twisting_vines" then
itemstack:take_item()
grow_twisting_vines(pos, 1)
elseif pointed_thing:get_wielded_item():get_name() == "mcl_dye:white" then
itemstack:take_item()
grow_twisting_vines(pos, math.random(1, 3))
end
end,
drop = {
max_items = 1,
items = {
{items = {"mcl_crimson:twisting_vines"}, rarity = 3},
},
},
_mcl_shears_drop = true,
_mcl_silk_touch_drop = true,
_mcl_fortune_drop = {
items = {
{items = {"mcl_crimson:twisting_vines"}, rarity = 3},
},
items = {
{items = {"mcl_crimson:twisting_vines"}, rarity = 1.8181818181818181},
},
"mcl_crimson:twisting_vines",
"mcl_crimson:twisting_vines",
},
_mcl_blast_resistance = 0,
})
minetest.register_node("mcl_crimson:nether_sprouts", {
description = S("Nether Sprouts"),
drawtype = "plantlike",
tiles = { "nether_sprouts.png" },
inventory_image = "nether_sprouts.png",
sunlight_propagates = true,
paramtype = "light",
walkable = false,
buildable_to = true,
groups = {dig_immediate=3,vines=1,dig_by_water=1,destroy_by_lava_flow=1,dig_by_piston=1,deco_block=1, shearsy = 1},
selection_box = {
type = "fixed",
fixed = { -4/16, -0.5, -4/16, 4/16, 0, 4/16 },
},
node_placement_prediction = "",
drop = "",
_mcl_shears_drop = true,
_mcl_silk_touch_drop = false,
_mcl_blast_resistance = 0,
})
minetest.register_node("mcl_crimson:warped_roots", {
description = S("Warped Roots"),
drawtype = "plantlike",
tiles = { "warped_roots.png" },
inventory_image = "warped_roots.png",
sunlight_propagates = true,
paramtype = "light",
walkable = false,
buildable_to = true,
groups = {dig_immediate=3,vines=1,dig_by_water=1,destroy_by_lava_flow=1,dig_by_piston=1,deco_block=1, shearsy = 1},
selection_box = {
type = "fixed",
fixed = { -6/16, -0.5, -6/16, 6/16, -4/16, 6/16 },
},
node_placement_prediction = "",
_mcl_silk_touch_drop = false,
_mcl_blast_resistance = 0,
})
minetest.register_node("mcl_crimson:warped_wart_block", {
description = S("Warped Wart Block"),
tiles = {"warped_wart_block.png"},
groups = {handy = 1, hoe = 7, swordy = 1, deco_block = 1},
_mcl_hardness = 2,
})
minetest.register_node("mcl_crimson:shroomlight", {
description = S("Shroomlight"),
tiles = {"shroomlight.png"},
groups = {handy = 1, hoe = 7, swordy = 1, leafdecay = 1, leafdecay_distance = 1, leaves = 1, deco_block = 1},
-- this is 15 in Minecraft
light_source = 14,
_mcl_hardness = 2,
})
minetest.register_node("mcl_crimson:warped_hyphae", {
description = S("Warped Hyphae"),
_doc_items_longdesc = S("The stem of a warped hyphae"),
_doc_items_hidden = false,
tiles = {
"warped_hyphae.png",
"warped_hyphae.png",
"warped_hyphae_side.png",
"warped_hyphae_side.png",
"warped_hyphae_side.png",
"warped_hyphae_side.png",
},
paramtype2 = "facedir",
on_place = mcl_util.rotate_axis,
groups = {handy = 1, axey = 1, tree = 1, building_block = 1, material_wood = 1},
sounds = mcl_sounds.node_sound_wood_defaults(),
on_rotate = on_rotate,
_mcl_blast_resistance = 2,
_mcl_hardness = 2,
_mcl_stripped_variant = "mcl_crimson:stripped_warped_hyphae",
})
minetest.register_node("mcl_crimson:warped_nylium", {
description = S("Warped Nylium"),
tiles = {
"warped_nylium.png",
"mcl_nether_netherrack.png",
"mcl_nether_netherrack.png^warped_nylium_side.png",
"mcl_nether_netherrack.png^warped_nylium_side.png",
"mcl_nether_netherrack.png^warped_nylium_side.png",
"mcl_nether_netherrack.png^warped_nylium_side.png",
},
paramtype2 = "facedir",
is_ground_content = true,
drop = "mcl_nether:netherrack",
groups = {pickaxey=1, building_block=1, material_stone=1},
_mcl_hardness = 0.4,
_mcl_blast_resistance = 0.4,
_mcl_silk_touch_drop = true,
})
minetest.register_node("mcl_crimson:warped_checknode", {
description = S("Warped Checknode - only to check!"),
tiles = {"mcl_nether_netherrack.png"},
groups = {pickaxey = 1, building_block = 1, material_stone = 1, not_in_creative_inventory = 1},
paramtype2 = "facedir",
_mcl_hardness = 0.4,
_mcl_blast_resistance = 0.4,
is_ground_content = true,
drop = "mcl_nether:netherrack"
})
--Stem bark, stripped stem and bark
minetest.register_node("mcl_crimson:warped_hyphae_bark", {
description = S("Warped Hyphae Bark"),
_doc_items_longdesc = S("This is a decorative block surrounded by the bark of an hyphae."),
tiles = {"warped_hyphae_side.png"},
paramtype2 = "facedir",
on_place = mcl_util.rotate_axis,
groups = {handy = 1, axey = 1, bark = 1, building_block = 1, material_wood = 1},
sounds = mcl_sounds.node_sound_wood_defaults(),
is_ground_content = false,
on_rotate = on_rotate,
_mcl_blast_resistance = 2,
_mcl_hardness = 2,
_mcl_stripped_variant = "mcl_crimson:stripped_warped_hyphae_bark",
})
minetest.register_craft({
output = "mcl_crimson:warped_hyphae_bark 3",
recipe = {
{ "mcl_crimson:warped_hyphae", "mcl_crimson:warped_hyphae" },
{ "mcl_crimson:warped_hyphae", "mcl_crimson:warped_hyphae" },
},
})
minetest.register_node("mcl_crimson:stripped_warped_hyphae", {
description = description_stripped_trunk,
_doc_items_longdesc = longdesc,
_doc_items_hidden = false,
tiles = {tile_stripped_inner, tile_stripped_inner, tile_stripped_bark},
paramtype2 = "facedir",
on_place = mcl_util.rotate_axis,
groups = {handy = 1, axey = 1, tree = 1, building_block = 1, material_wood = 1},
sounds = mcl_sounds.node_sound_wood_defaults(),
on_rotate = on_rotate,
_mcl_blast_resistance = 2,
_mcl_hardness = 2,
})
minetest.register_node("mcl_crimson:stripped_warped_hyphae_bark", {
description = description_stripped_bark,
_doc_items_longdesc = longdesc_wood,
tiles = {tile_stripped_bark},
paramtype2 = "facedir",
on_place = mcl_util.rotate_axis,
groups = {handy = 1, axey = 1, bark = 1, building_block = 1, material_wood = 1},
sounds = mcl_sounds.node_sound_wood_defaults(),
is_ground_content = false,
on_rotate = on_rotate,
_mcl_blast_resistance = 2,
_mcl_hardness = 2,
})
minetest.register_craft({
output = "mcl_crimson:stripped_warped_hyphae_bark 3",
recipe = {
{ "mcl_crimson:stripped_warped_hyphae", "mcl_crimson:stripped_warped_hyphae" },
{ "mcl_crimson:stripped_warped_hyphae", "mcl_crimson:stripped_warped_hyphae" },
},
})
--Wood
minetest.register_node("mcl_crimson:warped_hyphae_wood", {
description = S("Warped Hyphae Wood"),
tiles = {"warped_hyphae_wood.png"},
groups = {handy = 5,axey = 1, flammable = 3, wood=1,building_block = 1, material_wood = 1, fire_encouragement = 5, fire_flammability = 20},
paramtype2 = "facedir",
_mcl_hardness = 2,
})
mcl_stairs.register_stair_and_slab_simple("warped_hyphae_wood", "mcl_crimson:warped_hyphae_wood", S("Warped Stair"), S("Warped Slab"), S("Double Warped Slab"))
minetest.register_craft({
output = "mcl_crimson:warped_hyphae_wood 4",
recipe = {
{"mcl_crimson:warped_hyphae"},
},
})
minetest.register_craft({
output = "mcl_crimson:warped_nyliumd 2",
recipe = {
{"mcl_crimson:warped_wart_block"},
{"mcl_nether:netherrack"},
},
})
minetest.register_abm({
label = "mcl_crimson:warped_fungus",
nodenames = {"mcl_crimson:warped_fungus"},
interval = 11,
chance = 128,
action = function(pos)
local nodepos = minetest.get_node(vector.offset(pos, 0, -1, 0))
if nodepos.name == "mcl_crimson:warped_nylium" or nodepos.name == "mcl_nether:netherrack" then
if pos.y < -28400 then
generate_warped_tree(pos)
end
end
end
})
minetest.register_abm({
label = "mcl_crimson:warped_checknode",
nodenames = {"mcl_crimson:warped_checknode"},
interval = 1,
chance = 1,
action = function(pos)
local pos1 = vector.offset(pos, 0, 1, 0)
local nodepos = minetest.get_node(pos1)
if nodepos.name == "air" then
minetest.swap_node(pos, { name = "mcl_crimson:warped_nylium" })
local randomg = math.random(1, 40)
if randomg == 2 then
minetest.set_node(pos1, { name = "mcl_crimson:warped_fungus" })
elseif randomg == 7 then
generate_warped_tree(pos1)
end
else
minetest.swap_node(pos, { name = "mcl_nether:netherrack" })
end
end,
})
minetest.register_node("mcl_crimson:crimson_fungus", {
description = S("Crimson Fungus Mushroom"),
drawtype = "plantlike",
tiles = { "farming_crimson_fungus.png" },
inventory_image = "farming_crimson_fungus.png",
wield_image = "farming_crimson_fungus.png",
sunlight_propagates = true,
paramtype = "light",
walkable = false,
groups = {dig_immediate=3,mushroom=1,attached_node=1,dig_by_water=1,destroy_by_lava_flow=1,dig_by_piston=1,enderman_takable=1,deco_block=1},
light_source = 1,
selection_box = {
type = "fixed",
fixed = { -3/16, -0.5, -3/16, 3/16, -2/16, 3/16 },
},
node_placement_prediction = "",
on_rightclick = function(pos, node, pointed_thing, player)
if pointed_thing:get_wielded_item():get_name() == "mcl_dye:white" then
local nodepos = minetest.get_node(vector.offset(pos, 0, -1, 0))
if nodepos.name == "mcl_crimson:crimson_nylium" or nodepos.name == "mcl_nether:netherrack" then
local random = math.random(1, 5)
if random == 1 then
generate_crimson_tree(pos)
end
end
end
end,
_mcl_blast_resistance = 0,
})
minetest.register_node("mcl_crimson:crimson_roots", {
description = S("Crimson Roots"),
drawtype = "plantlike",
tiles = { "crimson_roots.png" },
inventory_image = "crimson_roots.png",
sunlight_propagates = true,
paramtype = "light",
walkable = false,
buildable_to = true,
groups = {dig_immediate=3,vines=1,dig_by_water=1,destroy_by_lava_flow=1,dig_by_piston=1,deco_block=1, shearsy = 1},
selection_box = {
type = "fixed",
fixed = { -6/16, -0.5, -6/16, 6/16, -4/16, 6/16 },
},
node_placement_prediction = "",
_mcl_silk_touch_drop = false,
_mcl_blast_resistance = 0,
})
minetest.register_node("mcl_crimson:crimson_hyphae", {
description = S("Crimson Hyphae"),
_doc_items_longdesc = S("The stem of a crimson hyphae"),
_doc_items_hidden = false,
tiles = {
"crimson_hyphae.png",
"crimson_hyphae.png",
"crimson_hyphae_side.png",
"crimson_hyphae_side.png",
"crimson_hyphae_side.png",
"crimson_hyphae_side.png",
},
paramtype2 = "facedir",
on_place = mcl_util.rotate_axis,
groups = {handy = 1, axey = 1, tree = 1, building_block = 1, material_wood = 1},
sounds = mcl_sounds.node_sound_wood_defaults(),
on_rotate = on_rotate,
_mcl_blast_resistance = 2,
_mcl_hardness = 2,
_mcl_stripped_variant = stripped_variant,
})
--Stem bark, stripped stem and bark
minetest.register_node("mcl_crimson:crimson_hyphae_bark", {
description = S("Crimson Hyphae Bark"),
_doc_items_longdesc = S("This is a decorative block surrounded by the bark of an hyphae."),
tiles = {"crimson_hyphae_side.png"},
paramtype2 = "facedir",
on_place = mcl_util.rotate_axis,
groups = {handy = 1, axey = 1, bark = 1, building_block = 1, material_wood = 1},
sounds = mcl_sounds.node_sound_wood_defaults(),
is_ground_content = false,
on_rotate = on_rotate,
_mcl_blast_resistance = 2,
_mcl_hardness = 2,
_mcl_stripped_variant = "mcl_crimson:stripped_crimson_hyphae_bark",
})
minetest.register_craft({
output = "mcl_crimson:crimson_hyphae_bark 3",
recipe = {
{ "mcl_crimson:crimson_hyphae", "mcl_crimson:crimson_hyphae" },
{ "mcl_crimson:crimson_hyphae", "mcl_crimson:crimson_hyphae" },
},
})
minetest.register_node("mcl_crimson:stripped_crimson_hyphae", {
description = S("Stripped Crimson Hyphae"),
_doc_items_longdesc = S("The stripped stem of a crimson hyphae"),
_doc_items_hidden = false,
tiles = {"stripped_crimson_stem_top.png", "stripped_crimson_stem_top.png", "stripped_crimson_stem_side.png"},
paramtype2 = "facedir",
on_place = mcl_util.rotate_axis,
groups = {handy = 1, axey = 1, tree = 1, building_block = 1, material_wood = 1},
sounds = mcl_sounds.node_sound_wood_defaults(),
on_rotate = on_rotate,
_mcl_blast_resistance = 2,
_mcl_hardness = 2,
})
minetest.register_node("mcl_crimson:stripped_crimson_hyphae_bark", {
description = S("Stripped Crimson Hyphae Bark"),
_doc_items_longdesc = S("The stripped wood of a crimson hyphae"),
tiles = {"stripped_crimson_stem_side.png"},
paramtype2 = "facedir",
on_place = mcl_util.rotate_axis,
groups = {handy = 1, axey = 1, bark = 1, building_block = 1, material_wood = 1},
sounds = mcl_sounds.node_sound_wood_defaults(),
is_ground_content = false,
on_rotate = on_rotate,
_mcl_blast_resistance = 2,
_mcl_hardness = 2,
})
minetest.register_craft({
output = "mcl_crimson:stripped_crimson_hyphae_bark 3",
recipe = {
{ "mcl_crimson:stripped_crimson_hyphae", "mcl_crimson:stripped_crimson_hyphae" },
{ "mcl_crimson:stripped_crimson_hyphae", "mcl_crimson:stripped_crimson_hyphae" },
},
})
--Wood
minetest.register_node("mcl_crimson:crimson_hyphae_wood", {
description = S("Crimson Hyphae Wood"),
tiles = {"crimson_hyphae_wood.png"},
groups = {handy = 5, axey = 1, wood = 1, building_block = 1, material_wood = 1},
paramtype2 = "facedir",
_mcl_hardness = 2,
})
minetest.register_node("mcl_crimson:crimson_nylium", {
description = S("Crimson Nylium"),
tiles = {
"crimson_nylium.png",
"mcl_nether_netherrack.png",
"mcl_nether_netherrack.png^crimson_nylium_side.png",
"mcl_nether_netherrack.png^crimson_nylium_side.png",
"mcl_nether_netherrack.png^crimson_nylium_side.png",
"mcl_nether_netherrack.png^crimson_nylium_side.png",
},
groups = {pickaxey = 1, building_block = 1, material_stone = 1},
paramtype2 = "facedir",
is_ground_content = true,
drop = "mcl_nether:netherrack",
_mcl_hardness = 0.4,
_mcl_blast_resistance = 0.4,
_mcl_silk_touch_drop = true,
})
minetest.register_node("mcl_crimson:crimson_checknode", {
description = S("Crimson Checknode - only to check!"),
tiles = {"mcl_nether_netherrack.png"},
groups = {pickaxey = 1, building_block = 1, material_stone = 1, not_in_creative_inventory = 1},
paramtype2 = "facedir",
is_ground_content = true,
drop = "mcl_nether:netherrack",
_mcl_hardness = 0.4,
_mcl_blast_resistance = 0.4,
})
minetest.register_craft({
output = "mcl_crimson:crimson_hyphae_wood 4",
recipe = {
{"mcl_crimson:crimson_hyphae"},
},
})
minetest.register_craft({
output = "mcl_crimson:crimson_nyliumd 2",
recipe = {
{"mcl_nether:nether_wart"},
{"mcl_nether:netherrack"},
},
})
mcl_stairs.register_stair_and_slab_simple("crimson_hyphae_wood", "mcl_crimson:crimson_hyphae_wood", "Crimson Stair", "Crimson Slab", "Double Crimson Slab")
minetest.register_abm({
label = "mcl_crimson:crimson_fungus",
nodenames = {"mcl_crimson:crimson_fungus"},
interval = 11,
chance = 128,
action = function(pos)
local nodepos = minetest.get_node(vector.offset(pos, 0, -1, 0))
if nodepos.name == "mcl_crimson:crimson_nylium" or nodepos.name == "mcl_nether:netherrack" then
if pos.y < -28400 then
generate_crimson_tree(pos)
end
end
end
})
minetest.register_abm({
label = "mcl_crimson:crimson_checknode",
nodenames = {"mcl_crimson:crimson_checknode"},
interval = 1,
chance = 1,
action = function(pos)
local pos1 = vector.offset(pos, 0, 1, 0)
local nodepos = minetest.get_node(pos1)
if nodepos.name == "air" then
minetest.swap_node(pos, { name = "mcl_crimson:crimson_nylium" })
local randomg = math.random(1, 400)
if randomg <= 10 then
minetest.set_node(pos1, { name = "mcl_crimson:crimson_fungus" })
elseif randomg > 10 and randomg <= 25 then
generate_crimson_tree(pos1)
elseif randomg > 25 and randomg <= 30 then
minetest.set_node(pos1, { name = "mcl_crimson:warped_fungus" })
elseif randomg > 30 and randomg <= 130 then
minetest.set_node(pos1, { name = "mcl_crimson:crimson_roots" })
end
else
minetest.swap_node(pos, { name = "mcl_nether:netherrack" })
end
end
})
--[[
FIXME: Biomes are to rare
FIXME: Decoration don't do generate
WARNING: Outdatet, the biomes gernerate now different, with Ores
-- biomes in test!
minetest.register_biome({
name = "WarpedForest",
node_filler = "mcl_nether:netherrack",
node_stone = "mcl_nether:netherrack",
node_top = "mcl_crimson:warped_nylium",
node_water = "air",
node_river_water = "air",
y_min = -29065,
y_max = -28940,
heat_point = 100,
humidity_point = 0,
_mcl_biome_type = "hot",
_mcl_palette_index = 19,
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"mcl_crimson:warped_nylium"},
sidelen = 16,
noise_params = {
offset = 0.01,
scale = 0.0022,
spread = {x = 250, y = 250, z = 250},
seed = 2,
octaves = 3,
persist = 0.66
},
biomes = {"WarpedForest"},
y_min = -29065,
y_max = -28940 + 80,
decoration = "mcl_crimson:warped_fungus",
})
]]
--[[ No Ore gen for now
minetest.register_ore({
ore_type = "sheet",
ore = "mcl_crimson:warped_checknode",
-- Note: Stone is included only for v6 mapgen support. Netherrack is not generated naturally
-- in v6, but instead set with the on_generated function in mcl_mapgen_core.
wherein = {"mcl_nether:netherrack", "mcl_core:stone"},
clust_scarcity = 14 * 14 * 14,
clust_size = 10,
y_min = -29065,
y_max = -28940,
noise_threshold = 0.0,
noise_params = {
offset = 0.5,
scale = 0.1,
spread = {x = 8, y = 8, z = 8},
seed = 4996,
octaves = 1,
persist = 0.0
},
})
minetest.register_ore({
ore_type = "sheet",
ore = "mcl_crimson:crimson_checknode",
-- Note: Stone is included only for v6 mapgen support. Netherrack is not generated naturally
-- in v6, but instead set with the on_generated function in mcl_mapgen_core.
wherein = {"mcl_nether:netherrack", "mcl_core:stone"},
clust_scarcity = 10 * 10 * 10,
clust_size = 10,
y_min = -29065,
y_max = -28940,
noise_threshold = 0.0,
noise_params = {
offset = 1,
scale = 0.5,
spread = {x = 12, y = 12, z = 12},
seed = 12948,
octaves = 1,
persist = 0.0
},
})
--]]
--[[
minetest.register_decoration({
deco_type = "simple",
place_on = {"mcl_crimson:warped_nylium"},
sidelen = 16,
fill_ratio = 0.1,
biomes = {"Nether"},
y_max = -28940,
y_min = -29065,
decoration = "mcl_crimson:warped_fungus",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"mcl_crimson:crimson_nylium"},
sidelen = 16,
fill_ratio = 0.1,
biomes = {"Nether"},
y_max = -28940,
y_min = -29065,
decoration = "mcl_crimson:crimson_fungus",
})
]]

View File

@ -0,0 +1,24 @@
# textdomain: mcl_crimson
Warped Fungus Mushroom=Wirrpilz
Twisting Vines=Zwirbelranken
Nether Sprouts=Nethersprossen
Warped Roots=Wirrwurzeln
Warped Wart Block=Wirrwarzenblock
Shroomlight=Pilzlicht
Warped Hyphae=Wirrhyphe
Warped Nylium=Wirr-Nezel
Warped Checknode - only to check!=Wirr Checkblock - Nur zum checken!
Warped Hyphae Wood=Wirrhyphen Holz
Warped Stair=Wirrtreppe
Warped Slab=Wirrstufe
Double Warped Slab=Doppelte Wirrstufe
Crimson Fungus Mushroom=Karmesinpilz
Crimson Roots=Karmesinwurzeln
Crimson Hyphae=Karmesinhyphe
Crimson Hyphae Wood=Karmesinhyphenholz
Crimson Stair=Karmesintreppe
Crimson Slab=Karmesinstufe
Double Crimson Slab=Doppelte Karmesinstufe
Crimson Nylium=Karmesin-Nezel
Crimson Checknode - only to check!=Karmesin Checkblock - Nur zum checken!

View File

@ -0,0 +1,23 @@
# textdomain: mcl_crimson
Warped Fungus Mushroom=Champignon tordu
Twisting Vines=Liane tordue
Nether Sprouts=Racines du nether
Warped Roots=Racines tordues
Warped Wart Block=Bloc de verrues tordu
Shroomlight=Champilampe
Warped Hyphae=Tige tordue
Warped Nylium=Nylium tordu
Warped Checknode - only to check!=Bloc de vérification tordu - seulement pour vérifier !
Warped Hyphae Wood=Planches tordues
Warped Stair=Escalier tordu
Warped Slab=Dalle tordue
Crimson Fungus Mushroom=Champignon écarlate
Crimson Roots=Racines écarlates
Crimson Hyphae=Tige écarlate
Crimson Hyphae Wood=Planches écarlates
Crimson Stair=Escalier écarlate
Crimson Slab=Dalle écarlate
Double Crimson Slab=Dalle double écarlate
Crimson Nylium=Nylium écarlate
Crimson Checknode - only to check!=Bloc de vérification écarlate - seulement pour vérifier !

View File

@ -0,0 +1,23 @@
# textdomain: mcl_crimson
Warped Fungus Mushroom=
Twisting Vines=
Nether Sprouts=
Warped Roots=
Warped Wart Block=
Shroomlight=
Warped Hyphae=
Warped Nylium=
Warped Checknode - only to check!=
Warped Hyphae Wood=
Warped Stair=
Warped Slab=
Crimson Fungus Mushroom=
Crimson Roots=
Crimson Hyphae=
Crimson Hyphae Wood=
Crimson Stair=
Crimson Slab=
Double Crimson Slab=
Crimson Nylium=
Crimson Checknode - only to check!=

View File

@ -0,0 +1,4 @@
name = mcl_crimson
author = debiankaios
depends = mcl_stairs, mobs_mc, mcl_util

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 446 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 565 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 581 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 479 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 461 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 434 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 426 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 462 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

@ -87,7 +87,7 @@ minetest.register_craftitem("mcl_end:ender_eye", {
end
local origin = user:get_pos()
origin.y = origin.y + 1.5
local strongholds = mcl_structures.get_registered_structures("stronghold")
local strongholds = mcl_structures.get_structure_data("stronghold")
local dim = mcl_worlds.pos_to_dimension(origin)
local is_creative = minetest.is_creative_enabled(user:get_player_name())

View File

@ -0,0 +1,671 @@
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,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"})
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
end
function mcl_lush_caves.makeazaela(pos,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 azaleas = {}
local az_limit = 500
local deco_id_makelake = minetest.get_decoration_id("mcl_biomes:lake_structblock")
local deco_id_makeazalea = minetest.get_decoration_id("mcl_biomes:azalea_structblock")
minetest.set_gen_notify({decoration=true}, { deco_id_makelake })
minetest.set_gen_notify({decoration=true}, { deco_id_makeazalea })
mcl_mapgen_core.register_generator("mcl_lush_caves", nil, function(minp, maxp, blockseed)
local gennotify = minetest.get_mapgen_object("gennotify")
local pr = PseudoRandom(blockseed + 15)
local az = false
for _, pos in pairs(gennotify["decoration#"..deco_id_makeazalea] or {}) do
local realpos = vector.offset(pos,0,-1,0)
local node = minetest.get_node(realpos)
if node and node.name == "mcl_lush_caves:azalea_structblock" then
minetest.remove_node(realpos)
for _,a in pairs(azaleas) do
if vector.distance(realpos,a) < az_limit then
az = true
end
end
if not az and mcl_lush_caves.makeazaela(realpos) then
table.insert(azaleas,realpos)
az = true
end
end
end
for _, pos in pairs(gennotify["decoration#"..deco_id_makelake] or {}) do
local realpos = vector.offset(pos,0,1,0)
local node = minetest.get_node(realpos)
if node and node.name == "mcl_lush_caves:lake_structblock" then
minetest.remove_node(realpos)
mcl_lush_caves.makelake(realpos, pr)
end
end
end)

View File

@ -0,0 +1,3 @@
name = mcl_lush_caves
author = cora
depends = mcl_sounds, mesecons, mcl_mapgen_core

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

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

View File

@ -0,0 +1,73 @@
local S = minetest.get_translator(minetest.get_current_modname())
minetest.register_tool("mcl_spyglass:spyglass",{
description = S("Spyglass"),
_doc_items_longdesc = S("A spyglass is an item that can be used for zooming in on specific locations."),
inventory_image = "mcl_spyglass.png",
stack_max = 1,
_mcl_toollike_wield = true,
})
minetest.register_craft({
output = "mcl_spyglass:spyglass",
recipe = {
{"mcl_amethyst:amethyst_shard"},
{"mcl_copper:copper_ingot"},
{"mcl_copper:copper_ingot"},
}
})
local spyglass_scope = {}
local function add_scope(player)
local wielditem = player:get_wielded_item()
if wielditem:get_name() == "mcl_spyglass:spyglass" then
spyglass_scope[player] = player:hud_add({
hud_elem_type = "image",
position = {x = 0.5, y = 0.5},
scale = {x = -100, y = -100},
text = "mcl_spyglass_scope.png",
})
player:hud_set_flags({wielditem = false})
end
end
local function remove_scope(player)
if spyglass_scope[player] then
player:hud_remove(spyglass_scope[player])
spyglass_scope[player] = nil
player:hud_set_flags({wielditem = true})
player:set_fov(86.1)
end
end
controls.register_on_press(function(player, key)
if key ~= "RMB" then return end
add_scope(player)
end)
controls.register_on_release(function(player, key, time)
if key ~= "RMB" then return end
remove_scope(player)
end)
controls.register_on_hold(function(player, key, time)
if key ~= "RMB" then return end
local wielditem = player:get_wielded_item()
if wielditem:get_name() == "mcl_spyglass:spyglass" then
player:set_fov(8, false, 0.1)
if spyglass_scope[player] == nil then
add_scope(player)
end
else
remove_scope(player)
end
end)
minetest.register_on_dieplayer(function(player)
remove_scope(player)
end)
minetest.register_on_leaveplayer(function(player)
spyglass_scope[player] = nil
end)

View File

@ -0,0 +1,3 @@
# textdomain: mcl_spyglass
Spyglass=Подзорная труба
A spyglass is an item that can be used for zooming in on specific locations.=Подзорная труба это предмет который позволяет смотреть вдаль.

View File

@ -0,0 +1,3 @@
# textdomain: mcl_spyglass
Spyglass=
A spyglass is an item that can be used for zooming in on specific locations.=

View File

@ -0,0 +1,4 @@
name = mcl_spyglass
author = NO11
description = This mod adds a spyglass, which is an item that can be used for zooming in on specific locations.
depends = mcl_core, controls

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -125,6 +125,7 @@ local function register_biomes()
"MesaBryce",
"MesaPlateauF",
"MesaPlateauFM",
"LushCaves",
}
-- Ice Plains Spikes (rare)
@ -1440,6 +1441,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]
@ -2211,7 +2250,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
@ -3906,6 +3946,163 @@ 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({
name = "mcl_biomes:lake_structblock",
decoration = "mcl_lush_caves:lake_structblock",
deco_type = "simple",
place_on = {"group:material_stone","mcl_core:gravel","mcl_lush_caves:moss","mcl_core:clay"},
spawn_by = {"air"},
num_spawn_by = 2,
sidelen = 16,
fill_ratio = 1,
y_max = -10,
flags = "all_floors",
biomes = lushcaves,
})
minetest.register_decoration({
name = "mcl_biomes:azalea_structblock",
decoration = "mcl_lush_caves:azalea_structblock",
deco_type = "simple",
place_on = {"group:material_stone","mcl_core:gravel","mcl_lush_caves:moss","mcl_core:clay"},
spawn_by = {"air"},
num_spawn_by = 4,
y_min = -25,
y_max = -5,
sidelen = 16,
fill_ratio = 0.2,
flags = "all_ceilings",
biomes = lushcaves,
})
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
@ -3939,7 +4136,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
@ -3992,6 +4188,4 @@ if mg_name ~= "singlenode" then
end
end)
end
end

View File

@ -0,0 +1,88 @@
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),
vector.new(0,-1,0)
}
local function set_node_no_bedrock(pos,node)
local n = minetest.get_node(pos)
if n.name == "mcl_core:bedrock" then return end
return minetest.set_node(pos,node)
end
local function makegeode(pos,pr)
local size = pr:next(4,7)
local p1 = vector.offset(pos,-size,-size,-size)
local p2 = vector.offset(pos,size,size,size)
local calcite = {}
local nn = minetest.find_nodes_in_area(p1,p2,{"group:material_stone"})
table.sort(nn,function(a, b)
return vector.distance(pos, a) < vector.distance(pos, b)
end)
if not nn[1] then return end
for i=1,math.random(#nn) do
set_node_no_bedrock(nn[i],{name="mcl_amethyst:amethyst_block"})
end
for k,v in pairs(minetest.find_nodes_in_area(p1,p2,{"mcl_amethyst:amethyst_block"})) do
local all_amethyst = true
for kk,vv in pairs(adjacents) do
local pp = vector.add(v,vv)
local an = minetest.get_node(pp)
if an.name ~= "mcl_amethyst:amethyst_block" then
if minetest.get_item_group(an.name,"material_stone") > 0 then
set_node_no_bedrock(pp,{name="mcl_amethyst:calcite"})
table.insert(calcite,pp)
if pr:next(1,5) == 1 then
set_node_no_bedrock(v,{name="mcl_amethyst:budding_amethyst_block"})
end
all_amethyst = false
elseif an.name ~= "mcl_amethyst:amethyst_block" and an.name ~= "air" then
all_amethyst = false
end
end
end
if all_amethyst then set_node_no_bedrock(v,{name="air"}) end
end
for _,v in pairs(calcite) do
for _,vv in pairs(minetest.find_nodes_in_area(vector.offset(v,-1,-1,-1),vector.offset(v,1,1,1),{"group:material_stone"})) do
set_node_no_bedrock(vv,{name="mcl_blackstone:basalt_smooth"})
end
end
for k,v in pairs(minetest.find_nodes_in_area_under_air(p1,p2,{"mcl_amethyst:amethyst_block","mcl_amethyst:budding_amethyst_block"})) do
local r = pr:next(1,50)
if r < 10 then
set_node_no_bedrock(vector.offset(v,0,1,0),{name="mcl_amethyst:amethyst_cluster",param2=1})
end
end
return true
end
mcl_structures.register_structure("geode",{
place_on = {"mcl_core:stone"},
noise_params = {
offset = 0,
scale = 0.00022,
spread = {x = 250, y = 250, z = 250},
seed = 7894353,
octaves = 3,
persist = 0.001,
flags = "absvalue",
},
flags = "place_center_x, place_center_z, force_placement",
biomes = ocean_biomes,
y_max = -24,
y_min = mcl_vars.mg_overworld_min,
filenames = schems,
y_offset = function(pr) return pr:next(-4,-2) end,
place_func = function(pos,def,pr)
local p = vector.new(pos.x + pr:next(-30,30),pos.y,pos.z + pr:next(-30,30))
return makegeode(p,pr)
end
})

View File

@ -0,0 +1,3 @@
name = mcl_geodes
author = cora
depends = mcl_init, mcl_structures

View File

@ -8,11 +8,11 @@ local pr = PseudoRandom(seed)
--schematics by chmodsayshello
local schems = {
"shipwreck_full_damaged",
"shipwreck_full_normal",
"shipwreck_full_back_damaged",
"shipwreck_half_front",
"shipwreck_half_back",
modpath.."/schematics/".."shipwreck_full_damaged"..".mts",
modpath.."/schematics/".."shipwreck_full_normal"..".mts",
modpath.."/schematics/".."shipwreck_full_back_damaged"..".mts",
modpath.."/schematics/".."shipwreck_half_front"..".mts",
modpath.."/schematics/".."shipwreck_half_back"..".mts",
}
local function get_supply_loot()
@ -75,61 +75,105 @@ local function fill_chests(p1,p2)
end
end
local function get_ocean_biomes()
local r = {}
for k,_ in pairs(minetest.registered_biomes) do
if k:find("_ocean") then table.insert(r,k) end
end
return r
end
local function get_beach_biomes()
local r = {}
for k,_ in pairs(minetest.registered_biomes) do
if k:find("_beach") or k:find("_shore") then table.insert(r,k) end
end
return r
end
local ocean_biomes = {
"RoofedForest_ocean",
"JungleEdgeM_ocean",
"BirchForestM_ocean",
"BirchForest_ocean",
"IcePlains_deep_ocean",
"Jungle_deep_ocean",
"Savanna_ocean",
"MesaPlateauF_ocean",
"ExtremeHillsM_deep_ocean",
"Savanna_deep_ocean",
"SunflowerPlains_ocean",
"Swampland_deep_ocean",
"Swampland_ocean",
"MegaSpruceTaiga_deep_ocean",
"ExtremeHillsM_ocean",
"JungleEdgeM_deep_ocean",
"SunflowerPlains_deep_ocean",
"BirchForest_deep_ocean",
"IcePlainsSpikes_ocean",
"Mesa_ocean",
"StoneBeach_ocean",
"Plains_deep_ocean",
"JungleEdge_deep_ocean",
"SavannaM_deep_ocean",
"Desert_deep_ocean",
"Mesa_deep_ocean",
"ColdTaiga_deep_ocean",
"Plains_ocean",
"MesaPlateauFM_ocean",
"Forest_deep_ocean",
"JungleM_deep_ocean",
"FlowerForest_deep_ocean",
"MushroomIsland_ocean",
"MegaTaiga_ocean",
"StoneBeach_deep_ocean",
"IcePlainsSpikes_deep_ocean",
"ColdTaiga_ocean",
"SavannaM_ocean",
"MesaPlateauF_deep_ocean",
"MesaBryce_deep_ocean",
"ExtremeHills+_deep_ocean",
"ExtremeHills_ocean",
"MushroomIsland_deep_ocean",
"Forest_ocean",
"MegaTaiga_deep_ocean",
"JungleEdge_ocean",
"MesaBryce_ocean",
"MegaSpruceTaiga_ocean",
"ExtremeHills+_ocean",
"Jungle_ocean",
"RoofedForest_deep_ocean",
"IcePlains_ocean",
"FlowerForest_ocean",
"ExtremeHills_deep_ocean",
"MesaPlateauFM_deep_ocean",
"Desert_ocean",
"Taiga_ocean",
"BirchForestM_deep_ocean",
"Taiga_deep_ocean",
"JungleM_ocean"
}
minetest.register_node("mcl_shipwrecks:structblock", {drawtype="airlike", walkable = false, pointable = false,groups = {structblock=1,not_in_creative_inventory=1}})
local beach_biomes = {
"FlowerForest_beach",
"Forest_beach",
"StoneBeach",
"ColdTaiga_beach_water",
"Taiga_beach",
"Savanna_beach",
"Plains_beach",
"ExtremeHills_beach",
"ColdTaiga_beach",
"Swampland_shore",
"MushroomIslandShore",
"JungleM_shore",
"Jungle_shore"
}
minetest.register_decoration({
decoration = "mcl_shipwrecks:structblock",
deco_type = "simple",
mcl_structures.register_structure("shipwreck",{
place_on = {"group:sand","mcl_core:gravel"},
spawn_by = {"group:water"},
num_spawn_by = 4,
sidelen = 80,
fill_ratio = 0.00002,
flags = "place_center_x, place_center_z, force_placement",
biomes = get_ocean_biomes(),
y_max=water_level-4,
})
--rare beached variant
minetest.register_decoration({
decoration = "mcl_shipwrecks:structblock",
deco_type = "simple",
place_on = {"group:sand","mcl_core:gravel","group:dirt"},
spawn_by = {"group:water","air"},
num_spawn_by = 4,
sidelen = 80,
fill_ratio=0.000001,
flags = "place_center_x, place_center_z, force_placement",
biomes = get_beach_biomes(),
y_max = water_level + 4,
y_min = water_level - 1,
})
minetest.register_lbm({
name = "mcl_shipwrecks:struct_lbm",
run_at_every_load = true,
nodenames = {"mcl_shipwrecks:structblock"},
action = function(pos, node)
minetest.set_node(pos,{name="air"})
local file = modpath.."/schematics/"..schems[pr:next(1,#schems)]..".mts"
local pp = vector.offset(pos,0,pr:next(-4,-2),0)
mcl_structures.place_schematic(pp, file, "random", nil, true, "place_center_x,place_center_z", function()
noise_params = {
offset = 0,
scale = 0.000022,
spread = {x = 250, y = 250, z = 250},
seed = 3,
octaves = 3,
persist = 0.001,
flags = "absvalue",
},
flags = "force_placement",
biomes = ocean_biomes,
y_max = water_level-4,
y_min = mcl_vars.mg_overworld_min,
filenames = schems,
y_offset = function(pr) return pr:next(-4,-2) end,
after_place = function(pos)
fill_chests(vector.offset(pos,-20,-5,-20),vector.offset(pos,20,15,20))
end,pr)
end
})

View File

@ -61,7 +61,7 @@ local function init_strongholds()
end
end
mcl_structures.register_structures("stronghold", table.copy(strongholds))
mcl_structures.register_structure_data("stronghold", table.copy(strongholds))
strongholds_inited = true
end

View File

@ -0,0 +1,29 @@
# mcl_structures
Structure placement API for MCL2.
## mcl_structures.register_structure(name,structure definition,nospawn)
If nospawn is truthy the structure will not be placed by mapgen and the decoration parameters can be omitted. This is intended for secondary structures the placement of which gets triggered by the placement of other structures. It can also be used to register testing structures so they can be used with /spawnstruct.
### structure definition
{
fill_ratio = OR noise = {},
biomes = {},
y_min =,
y_max =,
place_on = {},
spawn_by = {},
num_spawn_by =
flags = (default: "place_center_x, place_center_z, force_placement")
(same as decoration def)
y_offset =, --can be a number or a function returning a number
filenames = {} OR place_func = function(pos,def,pr)
-- filenames can be a list of any schematics accepted by mcl_structures.place_schematic / minetest.place_schematic
after_place = function(pos,def,pr)
}
## mcl_structures.registered_structures
Table of the registered structure defintions indexed by name.
## mcl_structures.place_structure(pos, def, pr)
Places a structure using the mapgen placement function
## mcl_structures.place_schematic(pos, schematic, rotation, replacements, force_placement, flags, after_placement_callback, pr, callback_param)

View File

@ -0,0 +1,81 @@
mcl_structures.registered_structures = {}
function mcl_structures.place_structure(pos, def, pr)
if not def then return end
local y_offset = 0
if type(def.y_offset) == "function" then
y_offset = def.y_offset(pr)
elseif def.y_offset then
y_offset = def.y_offset
end
if def.filenames then
local file = def.filenames[pr:next(1,#def.filenames)]
local pp = vector.offset(pos,0,y_offset,0)
mcl_structures.place_schematic(pp, file, "random", nil, true, "place_center_x,place_center_z",def.after_place,pr,{pos,def})
minetest.log("action","[mcl_structures] "..def.name.." placed at "..minetest.pos_to_string(pos))
return true
elseif def.place_func and def.place_func(pos,def,pr) then
if not def.after_place or ( def.after_place and def.after_place(pos,def,pr) ) then
minetest.log("action","[mcl_structures] "..def.name.." placed at "..minetest.pos_to_string(pos))
return true
end
end
minetest.log("warning","[mcl_structures] placing "..def.name.." failed at "..minetest.pos_to_string(pos))
end
function mcl_structures.register_structure(name,def,nospawn) --nospawn means it will be placed by another (non-nospawn) structure that contains it's structblock i.e. it will not be placed by mapgen directly
local structblock = "mcl_structures:structblock_"..name
local flags = "place_center_x, place_center_z, force_placement"
local y_offset = 0
local sbgroups = { structblock = 1, not_in_creative_inventory=1 }
if def.flags then flags = def.flags end
def.name = name
if nospawn then
sbgroups.structblock = nil
sbgroups.structblock_lbm = 1
else
def.deco = minetest.register_decoration({
name = "mcl_structures:deco_"..name,
decoration = structblock,
deco_type = "simple",
place_on = def.place_on,
spawn_by = def.spawn_by,
num_spawn_by = def.num_spawn_by,
sidelen = 80,
fill_ratio = def.fill_ratio,
noise_params = def.noise_params,
flags = flags,
biomes = def.biomes,
y_max = def.y_max,
y_min = def.y_min
})
local deco_id = minetest.get_decoration_id("mcl_structures:deco_"..name)
minetest.set_gen_notify({decoration=true}, { deco_id })
minetest.register_on_generated(function(minp, maxp, blockseed)
local gennotify = minetest.get_mapgen_object("gennotify")
local pr = PseudoRandom(blockseed + 42)
for _, pos in pairs(gennotify["decoration#"..deco_id] or {}) do
local realpos = vector.offset(pos,0,-1,0)
minetest.remove_node(realpos)
mcl_structures.place_structure(realpos,def,pr)
end
end)
end
minetest.register_node(":"..structblock, {drawtype="airlike", walkable = false, pointable = false,groups = sbgroups})
def.structblock = structblock
mcl_structures.registered_structures[name] = def
end
--lbm for secondary structures (structblock included in base structure)
minetest.register_lbm({
name = "mcl_structures:struct_lbm",
run_at_every_load = true,
nodenames = {"group:structblock_lbm"},
action = function(pos, node)
local name = node.name:gsub("mcl_structures:structblock_","")
local def = mcl_structures.registered_structures[name]
if not def then return end
minetest.remove_node(pos)
mcl_structures.place_structure(pos)
end
})

View File

@ -530,7 +530,7 @@ function mcl_structures.generate_desert_temple(pos, rotation, pr)
mcl_structures.place_schematic(newpos, path, rotation or "random", nil, true, nil, temple_placement_callback, pr)
end
local registered_structures = {}
local structure_data = {}
--[[ Returns a table of structure of the specified type.
Currently the only valid parameter is "stronghold".
@ -543,18 +543,18 @@ Format of return value:
TODO: Implement this function for all other structure types as well.
]]
function mcl_structures.get_registered_structures(structure_type)
if registered_structures[structure_type] then
return table.copy(registered_structures[structure_type])
function mcl_structures.get_structure_data(structure_type)
if structure_data[structure_type] then
return table.copy(structure_data[structure_type])
else
return {}
end
end
-- Register a structures table for the given type. The table format is the same as for
-- mcl_structures.get_registered_structures.
function mcl_structures.register_structures(structure_type, structures)
registered_structures[structure_type] = structures
-- mcl_structures.get_structure_data.
function mcl_structures.register_structure_data(structure_type, structures)
structure_data[structure_type] = structures
end
local function dir_to_rotation(dir)
@ -571,9 +571,18 @@ local function dir_to_rotation(dir)
return "0"
end
-- Debug command
minetest.register_chatcommand("spawnstruct", {
params = "desert_temple | desert_well | igloo | witch_hut | boulder | ice_spike_small | ice_spike_large | fossil | end_exit_portal | end_exit_portal_open | end_gateway_portal | end_portal_shrine | nether_portal | dungeon",
dofile(modpath.."/api.lua")
minetest.register_on_mods_loaded(function()
-- Debug command
local chatcommand_params = "desert_temple | desert_well | igloo | witch_hut | boulder | ice_spike_small | ice_spike_large | fossil | end_exit_portal | end_exit_portal_open | end_gateway_portal | end_portal_shrine | nether_portal | dungeon"
for n,_ in pairs(mcl_structures.registered_structures) do
chatcommand_params = chatcommand_params .. " | "..n
end
minetest.register_chatcommand("spawnstruct", {
params = chatcommand_params,
description = S("Generate a pre-defined structure near your position."),
privs = {debug = true},
func = function(name, param)
@ -619,6 +628,12 @@ minetest.register_chatcommand("spawnstruct", {
message = S("Error: No structure type given. Please use “/spawnstruct <type>”.")
errord = true
else
for n,d in pairs(mcl_structures.registered_structures) do
if n == param then
mcl_structures.place_structure(pos,d,pr)
return true,message
end
end
message = S("Error: Unknown structure type. Please use “/spawnstruct <type>”.")
errord = true
end
@ -627,4 +642,5 @@ minetest.register_chatcommand("spawnstruct", {
minetest.chat_send_player(name, S("Use /help spawnstruct to see a list of avaiable types."))
end
end
})
})
end)

View File

@ -1,4 +1,4 @@
name = mcl_structures
author = Wuzzy
description = Structures for MCL2
author = Wuzzy, cora
description = Structure placement for MCL2
depends = mcl_loot

View File

@ -0,0 +1,106 @@
local adjacents = {
vector.new(1,0,0),
vector.new(1,0,1),
vector.new(1,0,-1),
vector.new(-1,0,0),
vector.new(-1,0,1),
vector.new(-1,0,-1),
vector.new(0,0,1),
vector.new(0,0,-1),
vector.new(0,-1,0)
}
local function set_node_no_bedrock(pos,node)
local n = minetest.get_node(pos)
if n.name == "mcl_core:bedrock" then return end
return minetest.set_node(pos,node)
end
local function airtower(pos)
for i=0,55 do
set_node_no_bedrock(vector.offset(pos,0,i,0),{name="air"})
end
end
local function makelake(pos,size,liquid,border,pr)
local node_under = minetest.get_node(vector.offset(pos,0,1,0))
local p1 = vector.offset(pos,-size,-size,-size)
local p2 = vector.offset(pos,size,size,size)
local nn = minetest.find_nodes_in_area(p1,p2,{"group:material_stone", "group:sand", "group:dirt"})
table.sort(nn,function(a, b)
return vector.distance(pos, a) < vector.distance(pos, b)
end)
if not nn[1] then return end
local y = pos.y + 1
local lq = {}
for i=1,pr:next(1,#nn) do
if nn[i].y == y then
set_node_no_bedrock(nn[i],{name=liquid})
airtower(vector.offset(nn[i],0,1,0))
table.insert(lq,nn[i])
end
end
for k,v in pairs(lq) do
for kk,vv in pairs(adjacents) do
local pp = vector.add(v,vv)
local an = minetest.get_node(pp)
local un = minetest.get_node(vector.offset(pp,0,1,0))
if not border then
if minetest.get_item_group(an.name,"solid") > 0 then
border = an.name
elseif minetest.get_item_group(minetest.get_node(nn[1]).name,"solid") > 0 then
border = minetest.get_node(nn[1]).name
else
border = "mcl_core:stone"
end
if border == "mcl_core:dirt" then border = "mcl_core:dirt_with_grass" end
end
if an.name ~= liquid then
set_node_no_bedrock(pp,{name=border})
if un.name ~= liquid then
airtower(vector.offset(pp,0,1,0))
end
end
end
end
return true
end
mcl_structures.register_structure("lavapool",{
place_on = {"group:sand", "group:dirt", "group:stone"},
noise_params = {
offset = 0,
scale = 0.0000022,
spread = {x = 250, y = 250, z = 250},
seed = 78375213,
octaves = 3,
persist = 0.001,
flags = "absvalue",
},
flags = "place_center_x, place_center_z, force_placement",
y_max = mcl_vars.mg_overworld_max,
y_min = minetest.get_mapgen_setting("water_level"),
place_func = function(pos,def,pr)
return makelake(pos,5,"mcl_core:lava_source","mcl_core:stone",pr)
end
})
mcl_structures.register_structure("water_lake",{
place_on = {"group:dirt","group:stone"},
noise_params = {
offset = 0,
scale = 0.000032,
spread = {x = 250, y = 250, z = 250},
seed = 734341353,
octaves = 3,
persist = 0.001,
flags = "absvalue",
},
flags = "place_center_x, place_center_z, force_placement",
y_max = mcl_vars.mg_overworld_max,
y_min = minetest.get_mapgen_setting("water_level"),
place_func = function(pos,def,pr)
return makelake(pos,5,"mcl_core:water_source",nil,pr)
end
})

View File

@ -0,0 +1,3 @@
name = mcl_surface_pools
author = cora
depends = mcl_init, mcl_structures

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 94 KiB