3 heights of grass in 2 biomes, clay and flowers in forest
parent
846a1c5014
commit
5c5d6b7c8d
|
@ -1,4 +1,4 @@
|
|||
flexrealm 0.2.12 by paramat
|
||||
flexrealm 0.2.13 by paramat
|
||||
For latest stable Minetest and back to 0.4.8
|
||||
Depends default
|
||||
Licenses: code WTFPL, textures CC BY-SA
|
|
@ -554,23 +554,37 @@ function flexrealm_jungletree(x, y, z, treedir, area, data, c_juntree, c_flrjunl
|
|||
end
|
||||
end
|
||||
|
||||
function flexrealm_grass(x, y, z, treedir, area, data, c_grass, vi)
|
||||
|
||||
function flexrealm_randgrass(data, c_grass1, c_grass3, c_grass5, via)
|
||||
local rand = math.random(3)
|
||||
if rand == 1 then
|
||||
data[via] = c_grass1
|
||||
elseif rand == 2 then
|
||||
data[via] = c_grass3
|
||||
else
|
||||
data[via] = c_grass5
|
||||
end
|
||||
end
|
||||
|
||||
function flexrealm_grass(x, y, z, treedir, area, data, c_grass1, c_grass3, c_grass5, vi)
|
||||
if treedir == 1 then
|
||||
data[vi + 1] = c_grass
|
||||
local via = vi + 1
|
||||
flexrealm_randgrass(data, c_grass1, c_grass3, c_grass5, via)
|
||||
elseif treedir == 2 then
|
||||
data[vi - 1] = c_grass
|
||||
local via = vi - 1
|
||||
flexrealm_randgrass(data, c_grass1, c_grass3, c_grass5, via)
|
||||
elseif treedir == 3 then
|
||||
local via = area:index(x , y + 1, z)
|
||||
data[via] = c_grass
|
||||
flexrealm_randgrass(data, c_grass1, c_grass3, c_grass5, via)
|
||||
elseif treedir == 4 then
|
||||
local via = area:index(x , y - 1, z)
|
||||
data[via] = c_grass
|
||||
flexrealm_randgrass(data, c_grass1, c_grass3, c_grass5, via)
|
||||
elseif treedir == 5 then
|
||||
local via = area:index(x , y , z + 1)
|
||||
data[via] = c_grass
|
||||
flexrealm_randgrass(data, c_grass1, c_grass3, c_grass5, via)
|
||||
elseif treedir == 6 then
|
||||
local via = area:index(x , y , z - 1)
|
||||
data[via] = c_grass
|
||||
flexrealm_randgrass(data, c_grass1, c_grass3, c_grass5, via)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -633,4 +647,43 @@ function flexrealm_papyrus(x, y, z, treedir, area, data, c_papyrus, vi)
|
|||
local via = area:index(x , y , z - 1)
|
||||
data[via] = c_papyrus
|
||||
end
|
||||
end
|
||||
|
||||
function flexrealm_randflower(data, c_danwhi, c_rose, c_tulip, c_danyel, c_geranium, c_viola, via)
|
||||
local rand = math.random(6)
|
||||
if rand == 1 then
|
||||
data[via] = c_danwhi
|
||||
elseif rand == 2 then
|
||||
data[via] = c_rose
|
||||
elseif rand == 3 then
|
||||
data[via] = c_tulip
|
||||
elseif rand == 4 then
|
||||
data[via] = c_danyel
|
||||
elseif rand == 5 then
|
||||
data[via] = c_geranium
|
||||
else
|
||||
data[via] = c_viola
|
||||
end
|
||||
end
|
||||
|
||||
function flexrealm_flower(x, y, z, treedir, area, data, c_danwhi, c_rose, c_tulip, c_danyel, c_geranium, c_viola, vi)
|
||||
if treedir == 1 then
|
||||
local via = vi + 1
|
||||
flexrealm_randflower(data, c_danwhi, c_rose, c_tulip, c_danyel, c_geranium, c_viola, via)
|
||||
elseif treedir == 2 then
|
||||
local via = vi - 1
|
||||
flexrealm_randflower(data, c_danwhi, c_rose, c_tulip, c_danyel, c_geranium, c_viola, via)
|
||||
elseif treedir == 3 then
|
||||
local via = area:index(x , y + 1, z)
|
||||
flexrealm_randflower(data, c_danwhi, c_rose, c_tulip, c_danyel, c_geranium, c_viola, via)
|
||||
elseif treedir == 4 then
|
||||
local via = area:index(x , y - 1, z)
|
||||
flexrealm_randflower(data, c_danwhi, c_rose, c_tulip, c_danyel, c_geranium, c_viola, via)
|
||||
elseif treedir == 5 then
|
||||
local via = area:index(x , y , z + 1)
|
||||
flexrealm_randflower(data, c_danwhi, c_rose, c_tulip, c_danyel, c_geranium, c_viola, via)
|
||||
elseif treedir == 6 then
|
||||
local via = area:index(x , y , z - 1)
|
||||
flexrealm_randflower(data, c_danwhi, c_rose, c_tulip, c_danyel, c_geranium, c_viola, via)
|
||||
end
|
||||
end
|
33
init.lua
33
init.lua
|
@ -1,4 +1,4 @@
|
|||
-- flexrealm 0.2.12 by paramat
|
||||
-- flexrealm 0.2.13 by paramat
|
||||
-- For latest stable Minetest and back to 0.4.8
|
||||
-- Depends default
|
||||
-- Licenses: code WTFPL, textures CC BY-SA
|
||||
|
@ -46,7 +46,7 @@ local CYLR = 1000 -- Surface radius
|
|||
-- Large scale density field 'grad'
|
||||
local ICET = 0.05 -- -- Ice density threshold
|
||||
local SAAV = 0 -- -- Sandline average density threshold
|
||||
local SAAM = 0.06 -- -- Sandline density threshold amplitude
|
||||
local SAAM = 0.08 -- -- Sandline density threshold amplitude
|
||||
local SARA = 0.02 -- -- Sandline density threshold randomness
|
||||
local DUGT = -0.03 -- -- Dune grass density threshold
|
||||
local ROCK = -0.6 -- -- Rocky terrain density threshold
|
||||
|
@ -75,7 +75,7 @@ local HTET = 0.1 -- -- Desert / savanna / rainforest temperature noise threshol
|
|||
local LTET = -0.5 -- -- Tundra / taiga temperature noise threshold.
|
||||
local HWET = 0.1 -- -- Wet grassland / rainforest wetness noise threshold.
|
||||
local LWET = -0.5 -- -- Tundra / dry grassland / desert wetness noise threshold.
|
||||
local BIOR = 0.03 -- -- Biome noise randomness for blend dithering
|
||||
local BIOR = 0.05 -- -- Biome noise randomness for blend dithering
|
||||
|
||||
local flora = {
|
||||
ATCHA = 49, -- -- Apple tree maximum 1/x chance per surface node
|
||||
|
@ -88,6 +88,7 @@ local flora = {
|
|||
WEGCHA = 3, -- -- Wet grassland grass 1/x chance per surface node
|
||||
DUGCHA = 5, -- -- Dune grass 1/x chance per surface node
|
||||
PAPCHA = 3, -- -- Papyrus 1/x chance per surface swamp water node
|
||||
DEFCHA = 25, -- -- Flower 1/x chance per surface node
|
||||
}
|
||||
|
||||
local LINT = 17 -- -- LEAN abm interval
|
||||
|
@ -253,11 +254,20 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||
local c_needles = minetest.get_content_id("default:needles")
|
||||
local c_juntree = minetest.get_content_id("default:jungletree")
|
||||
local c_jungrass = minetest.get_content_id("default:junglegrass")
|
||||
local c_grass = minetest.get_content_id("default:grass_3")
|
||||
local c_grass1 = minetest.get_content_id("default:grass_1")
|
||||
local c_grass3 = minetest.get_content_id("default:grass_3")
|
||||
local c_grass5 = minetest.get_content_id("default:grass_5")
|
||||
local c_dryshrub = minetest.get_content_id("default:dry_shrub")
|
||||
local c_watsour = minetest.get_content_id("default:water_source")
|
||||
local c_papyrus = minetest.get_content_id("default:papyrus")
|
||||
local c_dirt = minetest.get_content_id("default:dirt")
|
||||
local c_clay = minetest.get_content_id("default:clay")
|
||||
local c_danwhi = minetest.get_content_id("flowers:dandelion_white")
|
||||
local c_danyel = minetest.get_content_id("flowers:dandelion_yellow")
|
||||
local c_rose = minetest.get_content_id("flowers:rose")
|
||||
local c_tulip = minetest.get_content_id("flowers:tulip")
|
||||
local c_geranium = minetest.get_content_id("flowers:geranium")
|
||||
local c_viola = minetest.get_content_id("flowers:viola")
|
||||
|
||||
local c_flrdirt = minetest.get_content_id("flexrealm:dirt")
|
||||
local c_flrgrass = minetest.get_content_id("flexrealm:grass")
|
||||
|
@ -501,9 +511,11 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||
data[vi] = c_flrstone
|
||||
end
|
||||
elseif density > 0 and density < stot then -- fine materials
|
||||
if grad >= SAAV + noise8 * SAAM + (math.random() - 0.5) * SARA then -- sand, beach, dunes
|
||||
if grad >= SAAV + noise8 * SAAM + (math.random() - 0.5) * SARA then -- clay, sand, beach, dunes
|
||||
if taiga and density < DIRT and grad <= 0 then -- snowy beach
|
||||
data[vi] = c_snowblock
|
||||
elseif deforest and grad > 0.05 and grad < 0.06 then
|
||||
data[vi] = c_clay
|
||||
else
|
||||
data[vi] = c_flrsand
|
||||
if tree and grad < DUGT and math.random(flora.DUGCHA) == 2 then
|
||||
|
@ -532,8 +544,11 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||
data[vi] = c_flrgrass
|
||||
if tree and math.random(flora.ATCHA) == 2 then
|
||||
flexrealm_appletree(x, y, z, treedir, area, data, c_tree, c_leaves, c_apple)
|
||||
elseif tree and math.random(flora.DEFCHA) == 2 then
|
||||
flexrealm_flower(x, y, z, treedir, area, data,
|
||||
c_danwhi, c_rose, c_tulip, c_danyel, c_geranium, c_viola, vi)
|
||||
elseif tree and grad <= 0 and math.random(flora.DEGCHA) == 2 then
|
||||
flexrealm_grass(x, y, z, treedir, area, data, c_grass, vi)
|
||||
flexrealm_grass(x, y, z, treedir, area, data, c_grass1, c_grass3, c_grass5, vi)
|
||||
end
|
||||
elseif savanna then
|
||||
data[vi] = c_flrdrygrass
|
||||
|
@ -556,7 +571,11 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||
elseif wetgrass then
|
||||
data[vi] = c_flrgrass
|
||||
if tree and grad <= 0 and math.random(flora.WEGCHA) == 2 then
|
||||
flexrealm_jungrass(x, y, z, treedir, area, data, c_jungrass, vi)
|
||||
if math.random(3) == 2 then
|
||||
flexrealm_grass(x, y, z, treedir, area, data, c_grass1, c_grass3, c_grass5, vi)
|
||||
else
|
||||
flexrealm_jungrass(x, y, z, treedir, area, data, c_jungrass, vi)
|
||||
end
|
||||
end
|
||||
elseif tundra then
|
||||
data[vi] = c_flrfrograss
|
||||
|
|
|
@ -185,7 +185,7 @@ minetest.register_node("flexrealm:watfour", {
|
|||
liquid_alternative_source = "flexrealm:watfour",
|
||||
liquid_viscosity = WATER_VISC,
|
||||
liquid_renewable = false,
|
||||
liquid_range = 3,
|
||||
liquid_range = 2,
|
||||
post_effect_color = {a=64, r=100, g=100, b=200},
|
||||
groups = {water=3, liquid=3, puts_out_fire=1},
|
||||
})
|
||||
|
@ -220,7 +220,7 @@ minetest.register_node("flexrealm:watflow", {
|
|||
liquid_alternative_flowing = "flexrealm:watflow",
|
||||
liquid_alternative_source = "flexrealm:watfour",
|
||||
liquid_viscosity = WATER_VISC,
|
||||
liquid_range = 3,
|
||||
liquid_range = 2,
|
||||
post_effect_color = {a=64, r=100, g=100, b=200},
|
||||
groups = {water=3, liquid=3, puts_out_fire=1, not_in_creative_inventory=1},
|
||||
})
|
||||
|
@ -258,7 +258,7 @@ minetest.register_node("flexrealm:swatfour", {
|
|||
liquid_alternative_source = "flexrealm:swatfour",
|
||||
liquid_viscosity = 2,
|
||||
liquid_renewable = false,
|
||||
liquid_range = 3,
|
||||
liquid_range = 2,
|
||||
post_effect_color = {a=128, r=31, g=56, b=8},
|
||||
groups = {water=3, liquid=3, puts_out_fire=1},
|
||||
})
|
||||
|
@ -292,7 +292,7 @@ minetest.register_node("flexrealm:swatflow", {
|
|||
liquid_alternative_flowing = "flexrealm:swatflow",
|
||||
liquid_alternative_source = "flexrealm:swatfour",
|
||||
liquid_viscosity = 2,
|
||||
liquid_range = 3,
|
||||
liquid_range = 2,
|
||||
post_effect_color = {a=128, r=31, g=56, b=8},
|
||||
groups = {water=3, liquid=3, puts_out_fire=1, not_in_creative_inventory=1},
|
||||
})
|
Loading…
Reference in New Issue