Add biome

This commit is contained in:
cora 2022-06-06 11:17:24 +02:00
parent 3cdc56ce9b
commit 81cc114a0f
2 changed files with 157 additions and 90 deletions

View File

@ -127,6 +127,7 @@ local function register_biomes()
"MesaBryce",
"MesaPlateauF",
"MesaPlateauFM",
"LushCaves",
}
-- Ice Plains Spikes (rare)
@ -1442,6 +1443,42 @@ 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 = 4,
y_max = 5,
vertical_blend = 1,
humidity_point = 83,
heat_point = 55,
_mcl_biome_type = "medium",
_mcl_palette_index = 28,
})
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 = -6,
vertical_blend = 1,
humidity_point = 83,
heat_point = 57,
_mcl_biome_type = "medium",
_mcl_palette_index = 28,
})
-- Add deep ocean and underground biomes automatically.
for i=1, #overworld_biomes do
local biome = overworld_biomes[i]
@ -4323,6 +4360,113 @@ local function register_decorations()
register_flower("allium", nil, 0) -- flower Forest only
register_flower("blue_orchid", {"Swampland"}, 64500, false)
--Lush Caves
local 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 = 4,
sidelen = 80,
y_max = 1,
biomes = lushcaves,
fill_ratio = 10,
flags = "place_center_x, place_center_z, force_placement, 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 = 10,
biomes = lushcaves,
fill_ratio = 8,
flags = "place_center_x, place_center_z, force_placement, all_floors",
})
minetest.register_decoration({
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 = 4,
sidelen = 16,
fill_ratio = 10,
flags = "place_center_x, place_center_z, force_placement, all_floors",
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 = 1,
flags = "place_center_x, place_center_z, force_placement, all_ceilings",
biomes = lushcaves,
})
minetest.register_decoration({
decoration = "mcl_lush_caves:rooted_dirt",
deco_type = "simple",
place_on = {"group:material_stone"},
spawn_by = {"air"},
num_spawn_by = 4,
sidelen = 16,
fill_ratio = 10,
flags = "place_center_x, place_center_z, force_placement, all_ceilings",
biomes = lushcaves,
})
minetest.register_decoration({
decoration = "mcl_lush_caves:hanging_roots",
deco_type = "simple",
sidelen = 16,
fill_ratio = 10,
flags = "place_center_x, place_center_z, force_placement, 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.01,
flags = "place_center_x, place_center_z, force_placement, 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 = "place_center_x, place_center_z, force_placement, all_floors",
})
--]]
end
-- Decorations in non-Overworld dimensions

View File

@ -16,18 +16,15 @@ local vector_distance_xz = function(a, b)
end
local function makelake(pos)
local p1 = vector.offset(pos,-5,-10,-5)
local p2 = vector.offset(pos,5,10,5)
local nn = minetest.find_nodes_in_area_under_air(p1,p2,{"group:stone","mcl_lush_caves:moss"})
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 y = nn[1].y
for i=1,math.random(#nn) do
if nn[i].y == y then
minetest.set_node(nn[i],{name="mcl_core:water_source"})
end
minetest.set_node(nn[i],{name="mcl_core:water_source"})
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
@ -36,8 +33,8 @@ local function makelake(pos)
local an = minetest.get_node(pp)
if an.name ~= "mcl_core:water_source" then
minetest.set_node(pp,{name="mcl_core:clay"})
if pr:next(1,10) == 1 then
minetest.set_node(vector.offset(pp,0,1,0),{name="mcl_lush_caves:moss_carpet"})
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
@ -53,7 +50,7 @@ minetest.register_node("mcl_lush_caves: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},
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,
@ -68,7 +65,7 @@ minetest.register_node("mcl_lush_caves:moss_carpet", {
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,
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,
@ -302,9 +299,9 @@ minetest.register_node("mcl_lush_caves:spore_blossom", {
description = S("Spore blossom"),
_doc_items_longdesc = S("Spore blossom"),
_doc_items_hidden = false,
tiles = {"mcl_lush_caves_spore_blossom.png","mcl_lush_caves_spore_blossom.png"},
drawtype = "plantlike_rooted",
param2type = "wallmounted",
tiles = {"mcl_lush_caves_spore_blossom.png"},
drawtype = "plantlike",
param2type = "light",
is_ground_content = true,
stack_max = 64,
groups = {handy = 1, plant = 1},
@ -324,86 +321,13 @@ minetest.register_craftitem("mcl_lush_caves:glow_berry", {
_mcl_saturation = 1.2,
})
minetest.register_decoration({
decoration = "mcl_lush_caves:moss",
deco_type = "simple",
place_on = {"group:stone","mcl_core:gravel"},
sidelen = 80,
fill_ratio = 0.5,
flags = "place_center_x, place_center_z, force_placement, all_floors, all_ceilings",
--biomes = get_ocean_biomes(),
y_max=-10,
})
minetest.register_decoration({
decoration = "mcl_lush_caves:moss_carpet",
deco_type = "simple",
place_on = {"group:stone","mcl_core:gravel"},
sidelen = 80,
fill_ratio = 0.5,
flags = "place_center_x, place_center_z, force_placement, all_floors",
--biomes = get_ocean_biomes(),
y_max=-10,
})
minetest.register_decoration({
decoration = "mcl_lush_caves:rooted_dirt",
deco_type = "simple",
place_on = {"group:stone","mcl_core:gravel"},
sidelen = 80,
fill_ratio = 0.3,
flags = "place_center_x, place_center_z, force_placement, all_ceilings",
--biomes = get_ocean_biomes(),
y_max=-10,
})
minetest.register_decoration({
decoration = "mcl_lush_caves:hanging_roots",
deco_type = "simple",
place_on = {"mcl_lush_caves:rooted_dirt",},
sidelen = 80,
fill_ratio = 0.1,
flags = "place_center_x, place_center_z, force_placement, all_ceilings",
--biomes = get_ocean_biomes(),
y_max=-10,
})
minetest.register_decoration({
decoration = "mcl_lush_caves:spore_blossom",
deco_type = "simple",
place_on = {"mcl_lush_caves:moss","group:material_stone"},
sidelen = 80,
fill_ratio = 0.1,
flags = "place_center_x, place_center_z, force_placement, all_ceilings",
--biomes = get_ocean_biomes(),
y_max=-10,
})
minetest.register_decoration({
decoration = "mcl_lush_caves:cave_vines",
deco_type = "simple",
place_on = {"mcl_lush_caves:moss"},
sidelen = 80,
fill_ratio = 0.1,
flags = "place_center_x, place_center_z, force_placement, all_ceilings",
--biomes = get_ocean_biomes(),
y_max=-10,
})
minetest.register_decoration({
decoration = "mcl_lush_caves:lake_structblock",
deco_type = "simple",
place_on = {"group:stone","mcl_core:gravel","mcl_lush_caves:moss"},
sidelen = 80,
fill_ratio = 0.1,
flags = "place_center_x, place_center_z, force_placement, all_floors",
--biomes = get_ocean_biomes(),
y_max=-10,
})
minetest.register_abm({
label = "Cave vines grow",
nodenames = {"mcl_lush_caves:cave_vines_lit","mcl_lush_caves:cave_vines"},
interval = 5,
chance = 2,
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
@ -422,7 +346,6 @@ minetest.register_abm({
else
minetest.set_node(pos,{name="mcl_lush_caves:cave_vines_lit"})
end
end
})