Remove generation limits, rivers/river noise, swampwater, papyrus. Noise buffer optimisation. Improve code style. Add flowers to grassland. Remove non-rotatable plantlike mod nodes, use default nodes instead. Tune parameters
This commit is contained in:
parent
3af6b663b9
commit
859ca47ab4
18
README.txt
18
README.txt
@ -1,4 +1,18 @@
|
|||||||
flexrealm 0.4.7 by paramat
|
flexrealm 0.5.0 by paramat
|
||||||
For Minetest 0.4.12 and later
|
For Minetest 0.4.14 and later
|
||||||
Depends default
|
Depends default
|
||||||
Licenses: code WTFPL, textures CC BY-SA
|
Licenses: code WTFPL, textures CC BY-SA
|
||||||
|
|
||||||
|
Version changes:
|
||||||
|
|
||||||
|
Make nodes not attached to avoid falling grasses.
|
||||||
|
Fewer octaves for heat/humidity.
|
||||||
|
Remove rivers.
|
||||||
|
Noise buffer optimisation.
|
||||||
|
Improve code style.
|
||||||
|
Reduce number of upvalues.
|
||||||
|
Remove generation limits.
|
||||||
|
Add flowers to grassland.
|
||||||
|
Remove non-rotatable plantlike nodes, use defualt nodes.
|
||||||
|
Remove swampwater/papyrus.
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
function flexrealm_appletree(x, y, z, nodrot, area, data, p2data)
|
function flexrealm_appletree(x, y, z, nodrot, area, data, p2data)
|
||||||
local c_tree = minetest.get_content_id("default:tree")
|
local c_tree = minetest.get_content_id("default:tree")
|
||||||
local c_apple = minetest.get_content_id("flexrealm:apple")
|
local c_apple = minetest.get_content_id("default:apple")
|
||||||
local c_leaves = minetest.get_content_id("flexrealm:leaves")
|
local c_leaves = minetest.get_content_id("flexrealm:leaves")
|
||||||
if nodrot == 12 then
|
if nodrot == 12 then
|
||||||
for i = -1, 5 do
|
for i = -1, 5 do
|
||||||
@ -10,7 +10,6 @@ function flexrealm_appletree(x, y, z, nodrot, area, data, p2data)
|
|||||||
local vil = area:index(x + i + 1, y + j, z + k)
|
local vil = area:index(x + i + 1, y + j, z + k)
|
||||||
if math.random(48) == 2 then
|
if math.random(48) == 2 then
|
||||||
data[vil] = c_apple
|
data[vil] = c_apple
|
||||||
p2data[vil] = nodrot
|
|
||||||
elseif math.random(5) ~= 2 then
|
elseif math.random(5) ~= 2 then
|
||||||
data[vil] = c_leaves
|
data[vil] = c_leaves
|
||||||
p2data[vil] = nodrot
|
p2data[vil] = nodrot
|
||||||
@ -30,7 +29,6 @@ function flexrealm_appletree(x, y, z, nodrot, area, data, p2data)
|
|||||||
local vil = area:index(x - i - 1, y + j, z + k)
|
local vil = area:index(x - i - 1, y + j, z + k)
|
||||||
if math.random(48) == 2 then
|
if math.random(48) == 2 then
|
||||||
data[vil] = c_apple
|
data[vil] = c_apple
|
||||||
p2data[vil] = nodrot
|
|
||||||
elseif math.random(5) ~= 2 then
|
elseif math.random(5) ~= 2 then
|
||||||
data[vil] = c_leaves
|
data[vil] = c_leaves
|
||||||
p2data[vil] = nodrot
|
p2data[vil] = nodrot
|
||||||
@ -50,7 +48,6 @@ function flexrealm_appletree(x, y, z, nodrot, area, data, p2data)
|
|||||||
local vil = area:index(x + i, y + j + 1, z + k)
|
local vil = area:index(x + i, y + j + 1, z + k)
|
||||||
if math.random(48) == 2 then
|
if math.random(48) == 2 then
|
||||||
data[vil] = c_apple
|
data[vil] = c_apple
|
||||||
p2data[vil] = nodrot
|
|
||||||
elseif math.random(5) ~= 2 then
|
elseif math.random(5) ~= 2 then
|
||||||
data[vil] = c_leaves
|
data[vil] = c_leaves
|
||||||
p2data[vil] = nodrot
|
p2data[vil] = nodrot
|
||||||
@ -70,7 +67,6 @@ function flexrealm_appletree(x, y, z, nodrot, area, data, p2data)
|
|||||||
local vil = area:index(x + i, y - j - 1, z + k)
|
local vil = area:index(x + i, y - j - 1, z + k)
|
||||||
if math.random(48) == 2 then
|
if math.random(48) == 2 then
|
||||||
data[vil] = c_apple
|
data[vil] = c_apple
|
||||||
p2data[vil] = nodrot
|
|
||||||
elseif math.random(5) ~= 2 then
|
elseif math.random(5) ~= 2 then
|
||||||
data[vil] = c_leaves
|
data[vil] = c_leaves
|
||||||
p2data[vil] = nodrot
|
p2data[vil] = nodrot
|
||||||
@ -90,7 +86,6 @@ function flexrealm_appletree(x, y, z, nodrot, area, data, p2data)
|
|||||||
local vil = area:index(x + i, y + j, z + k + 1)
|
local vil = area:index(x + i, y + j, z + k + 1)
|
||||||
if math.random(48) == 2 then
|
if math.random(48) == 2 then
|
||||||
data[vil] = c_apple
|
data[vil] = c_apple
|
||||||
p2data[vil] = nodrot
|
|
||||||
elseif math.random(5) ~= 2 then
|
elseif math.random(5) ~= 2 then
|
||||||
data[vil] = c_leaves
|
data[vil] = c_leaves
|
||||||
p2data[vil] = nodrot
|
p2data[vil] = nodrot
|
||||||
@ -110,7 +105,6 @@ function flexrealm_appletree(x, y, z, nodrot, area, data, p2data)
|
|||||||
local vil = area:index(x + i, y + j, z - k - 1)
|
local vil = area:index(x + i, y + j, z - k - 1)
|
||||||
if math.random(48) == 2 then
|
if math.random(48) == 2 then
|
||||||
data[vil] = c_apple
|
data[vil] = c_apple
|
||||||
p2data[vil] = nodrot
|
|
||||||
elseif math.random(5) ~= 2 then
|
elseif math.random(5) ~= 2 then
|
||||||
data[vil] = c_leaves
|
data[vil] = c_leaves
|
||||||
p2data[vil] = nodrot
|
p2data[vil] = nodrot
|
||||||
@ -243,11 +237,11 @@ end
|
|||||||
|
|
||||||
|
|
||||||
function flexrealm_grass(x, y, z, nodrot, area, data, p2data)
|
function flexrealm_grass(x, y, z, nodrot, area, data, p2data)
|
||||||
local c_grass1 = minetest.get_content_id("flexrealm:grass_1")
|
local c_grass1 = minetest.get_content_id("default:grass_1")
|
||||||
local c_grass2 = minetest.get_content_id("flexrealm:grass_2")
|
local c_grass2 = minetest.get_content_id("default:grass_2")
|
||||||
local c_grass3 = minetest.get_content_id("flexrealm:grass_3")
|
local c_grass3 = minetest.get_content_id("default:grass_3")
|
||||||
local c_grass4 = minetest.get_content_id("flexrealm:grass_4")
|
local c_grass4 = minetest.get_content_id("default:grass_4")
|
||||||
local c_grass5 = minetest.get_content_id("flexrealm:grass_5")
|
local c_grass5 = minetest.get_content_id("default:grass_5")
|
||||||
local via
|
local via
|
||||||
if nodrot == 12 then
|
if nodrot == 12 then
|
||||||
via = area:index(x + 1, y, z)
|
via = area:index(x + 1, y, z)
|
||||||
@ -274,12 +268,11 @@ function flexrealm_grass(x, y, z, nodrot, area, data, p2data)
|
|||||||
else
|
else
|
||||||
data[via] = c_grass5
|
data[via] = c_grass5
|
||||||
end
|
end
|
||||||
p2data[via] = nodrot
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function flexrealm_dryshrub(x, y, z, nodrot, area, data, p2data)
|
function flexrealm_dryshrub(x, y, z, nodrot, area, data, p2data)
|
||||||
local c_dryshrub = minetest.get_content_id("flexrealm:dry_shrub")
|
local c_dryshrub = minetest.get_content_id("default:dry_shrub")
|
||||||
local via
|
local via
|
||||||
if nodrot == 12 then
|
if nodrot == 12 then
|
||||||
via = area:index(x + 1, y, z)
|
via = area:index(x + 1, y, z)
|
||||||
@ -295,12 +288,11 @@ function flexrealm_dryshrub(x, y, z, nodrot, area, data, p2data)
|
|||||||
via = area:index(x , y , z - 1)
|
via = area:index(x , y , z - 1)
|
||||||
end
|
end
|
||||||
data[via] = c_dryshrub
|
data[via] = c_dryshrub
|
||||||
p2data[via] = nodrot
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function flexrealm_jungrass(x, y, z, nodrot, area, data, p2data)
|
function flexrealm_jungrass(x, y, z, nodrot, area, data, p2data)
|
||||||
local c_jungrass = minetest.get_content_id("flexrealm:junglegrass")
|
local c_jungrass = minetest.get_content_id("default:junglegrass")
|
||||||
local via
|
local via
|
||||||
if nodrot == 12 then
|
if nodrot == 12 then
|
||||||
via = area:index(x + 1, y, z)
|
via = area:index(x + 1, y, z)
|
||||||
@ -316,60 +308,53 @@ function flexrealm_jungrass(x, y, z, nodrot, area, data, p2data)
|
|||||||
via = area:index(x , y , z - 1)
|
via = area:index(x , y , z - 1)
|
||||||
end
|
end
|
||||||
data[via] = c_jungrass
|
data[via] = c_jungrass
|
||||||
p2data[via] = nodrot
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function flexrealm_papyrus(x, y, z, nodrot, area, data, p2data)
|
function flexrealm_papyrus(x, y, z, nodrot, area, data, p2data)
|
||||||
local c_papyrus = minetest.get_content_id("flexrealm:papyrus")
|
local c_papyrus = minetest.get_content_id("default:papyrus")
|
||||||
local ph = math.random(2, 5)
|
local ph = math.random(2, 5)
|
||||||
if nodrot == 12 then
|
if nodrot == 12 then
|
||||||
for i = 1, ph do
|
for i = 1, ph do
|
||||||
local vip = area:index(x + i, y, z)
|
local vip = area:index(x + i, y, z)
|
||||||
data[vip] = c_papyrus
|
data[vip] = c_papyrus
|
||||||
p2data[vip] = nodrot
|
|
||||||
end
|
end
|
||||||
elseif nodrot == 16 then
|
elseif nodrot == 16 then
|
||||||
for i = 1, ph do
|
for i = 1, ph do
|
||||||
local vip = area:index(x - i, y, z)
|
local vip = area:index(x - i, y, z)
|
||||||
data[vip] = c_papyrus
|
data[vip] = c_papyrus
|
||||||
p2data[vip] = nodrot
|
|
||||||
end
|
end
|
||||||
elseif nodrot == 0 then
|
elseif nodrot == 0 then
|
||||||
for j = 1, ph do
|
for j = 1, ph do
|
||||||
local vip = area:index(x, y + j, z)
|
local vip = area:index(x, y + j, z)
|
||||||
data[vip] = c_papyrus
|
data[vip] = c_papyrus
|
||||||
p2data[vip] = nodrot
|
|
||||||
end
|
end
|
||||||
elseif nodrot == 20 then
|
elseif nodrot == 20 then
|
||||||
for j = 1, ph do
|
for j = 1, ph do
|
||||||
local vip = area:index(x, y - j, z)
|
local vip = area:index(x, y - j, z)
|
||||||
data[vip] = c_papyrus
|
data[vip] = c_papyrus
|
||||||
p2data[vip] = nodrot
|
|
||||||
end
|
end
|
||||||
elseif nodrot == 4 then
|
elseif nodrot == 4 then
|
||||||
for k = 1, ph do
|
for k = 1, ph do
|
||||||
local vip = area:index(x, y, z + k)
|
local vip = area:index(x, y, z + k)
|
||||||
data[vip] = c_papyrus
|
data[vip] = c_papyrus
|
||||||
p2data[vip] = nodrot
|
|
||||||
end
|
end
|
||||||
elseif nodrot == 8 then
|
elseif nodrot == 8 then
|
||||||
for k = 1, ph do
|
for k = 1, ph do
|
||||||
local vip = area:index(x, y, z - k)
|
local vip = area:index(x, y, z - k)
|
||||||
data[vip] = c_papyrus
|
data[vip] = c_papyrus
|
||||||
p2data[vip] = nodrot
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function flexrealm_flower(x, y, z, nodrot, area, data, p2data)
|
function flexrealm_flower(x, y, z, nodrot, area, data, p2data)
|
||||||
local c_danwhi = minetest.get_content_id("flexrealm:dandelion_white")
|
local c_danwhi = minetest.get_content_id("flowers:dandelion_white")
|
||||||
local c_danyel = minetest.get_content_id("flexrealm:dandelion_yellow")
|
local c_danyel = minetest.get_content_id("flowers:dandelion_yellow")
|
||||||
local c_rose = minetest.get_content_id("flexrealm:rose")
|
local c_rose = minetest.get_content_id("flowers:rose")
|
||||||
local c_tulip = minetest.get_content_id("flexrealm:tulip")
|
local c_tulip = minetest.get_content_id("flowers:tulip")
|
||||||
local c_geranium = minetest.get_content_id("flexrealm:geranium")
|
local c_geranium = minetest.get_content_id("flowers:geranium")
|
||||||
local c_viola = minetest.get_content_id("flexrealm:viola")
|
local c_viola = minetest.get_content_id("flowers:viola")
|
||||||
local via
|
local via
|
||||||
if nodrot == 12 then
|
if nodrot == 12 then
|
||||||
via = area:index(x + 1, y, z)
|
via = area:index(x + 1, y, z)
|
||||||
@ -398,7 +383,6 @@ function flexrealm_flower(x, y, z, nodrot, area, data, p2data)
|
|||||||
else
|
else
|
||||||
data[via] = c_viola
|
data[via] = c_viola
|
||||||
end
|
end
|
||||||
p2data[via] = nodrot
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -466,4 +450,3 @@ function flexrealm_cactus(x, y, z, nodrot, area, data, p2data)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
231
init.lua
231
init.lua
@ -1,24 +1,17 @@
|
|||||||
-- Variables
|
-- Variables
|
||||||
|
|
||||||
local flat = false -- Normal flat realm
|
local realm = {
|
||||||
local vertical = false -- Vertical flat realm facing south
|
flat = false, -- Normal flat realm
|
||||||
local invert = false -- Inverted flat realm
|
vertical = false, -- Vertical flat realm facing south
|
||||||
local planet = false -- Planet sphere
|
invert = false, -- Inverted flat realm
|
||||||
local dysonsphere = false -- Dyson sphere
|
planet = true, -- Planet sphere
|
||||||
local tube = true -- East-West tube world / O'Neill space colony
|
dysonsphere = false, -- Dyson sphere
|
||||||
local cube = false -- Planet cube
|
tube = false, -- East-West tube world / O'Neill space colony
|
||||||
local dysoncube = false -- Dyson cube
|
cube = false, -- Planet cube
|
||||||
|
dysoncube = false, -- Dyson cube
|
||||||
local limit = {
|
|
||||||
XMIN = -33000, -- Limits for all realm types
|
|
||||||
XMAX = 33000,
|
|
||||||
YMIN = -33000,
|
|
||||||
YMAX = 33000,
|
|
||||||
ZMIN = -33000,
|
|
||||||
ZMAX = 33000,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
local TERRS = 32 -- Terrain scale for all realms below
|
local TERRS = 64 -- Terrain scale for all realms below
|
||||||
-- Normal and inverted flat realms
|
-- Normal and inverted flat realms
|
||||||
local FLATY = 0 -- Surface y
|
local FLATY = 0 -- Surface y
|
||||||
-- Vertical flat realm facing south
|
-- Vertical flat realm facing south
|
||||||
@ -27,7 +20,7 @@ local VERTZ = 0 -- Surface z
|
|||||||
local SPHEX = 0 -- Centre x
|
local SPHEX = 0 -- Centre x
|
||||||
local SPHEZ = 0 -- ..z
|
local SPHEZ = 0 -- ..z
|
||||||
local SPHEY = 0 -- ..y
|
local SPHEY = 0 -- ..y
|
||||||
local SPHER = 128 -- Surface radius
|
local SPHER = 2048 -- Surface radius
|
||||||
-- Tube world
|
-- Tube world
|
||||||
local TUBEZ = 0 -- Axis z
|
local TUBEZ = 0 -- Axis z
|
||||||
local TUBEY = 0 -- ..y
|
local TUBEY = 0 -- ..y
|
||||||
@ -45,30 +38,26 @@ local DEPT = 2 -- Realm +-depth density threshold
|
|||||||
local ROCK = -1 -- Rocky terrain density threshold
|
local ROCK = -1 -- Rocky terrain density threshold
|
||||||
local CLOLOT = -0.9 -- Cloud low density threshold
|
local CLOLOT = -0.9 -- Cloud low density threshold
|
||||||
local CLOHIT = -0.89 -- Cloud high density threshold
|
local CLOHIT = -0.89 -- Cloud high density threshold
|
||||||
-- Noise thresholds for density field 'density'
|
-- Noise thresholds for density field 'density' TODO (auto?) tune these
|
||||||
local TSAND = -0.04 -- Sand density threshold
|
local TSAND = -0.04 -- Sand density threshold
|
||||||
local TSTONE = 0.1 -- Stone density threshold at sea level
|
local TSTONE = 0.1 -- Stone density threshold at sea level
|
||||||
local TDIRT = 0.05 -- Dirt density threshold
|
local TDIRT = 0.05 -- Dirt density threshold
|
||||||
local TSURF = 0.1 -- Surface density threshold for flora generation
|
local TSURF = 0.1 -- Surface density threshold for flora generation
|
||||||
|
|
||||||
-- Other parameters
|
-- Other parameters
|
||||||
local TFIS = 0.04 -- Fissure width noise threshold
|
local TFIS = 0.01 -- Fissure width noise threshold
|
||||||
local OCHA = 7*7*7 -- Ore 1/x chance per stone node
|
local OCHA = 7 * 7 * 7 -- Ore 1/x chance per stone node
|
||||||
local TCLOUD = 0.5 -- Cloud threshold, -2 = overcast, 2 = no cloud
|
local TCLOUD = 0.5 -- Cloud threshold, -2 = overcast, 2 = no cloud
|
||||||
local HITET = 0.4 -- High temperature noise threshold
|
|
||||||
local LOTET = -0.4 -- Low temperature noise threshold
|
|
||||||
local ICETET = -0.8 -- Icesheet / glacier temperature threshold
|
|
||||||
local HUT = 0 -- -- Humidity noise threshold
|
|
||||||
|
|
||||||
local flora = {
|
local flora = {
|
||||||
APPCHA = 49, -- Apple tree maximum 1/x chance per surface node
|
APPCHA = 128, -- Apple tree maximum 1/x chance per surface node
|
||||||
FLOCHA = 47 ^ 2, -- Flower 1/x chance per surface node
|
FLOCHA = 64, -- Flower 1/x chance per surface node
|
||||||
GRACHA = 9, -- Grass 1/x chance per surface node
|
GRACHA = 8, -- Grass 1/x chance per surface node
|
||||||
PINCHA = 49, -- Pine tree maximum 1/x chance per surface node
|
PINCHA = 128, -- Pine tree maximum 1/x chance per surface node
|
||||||
JUTCHA = 16, -- Jungle tree maximum 1/x chance per surface node
|
JUTCHA = 32, -- Jungle tree maximum 1/x chance per surface node
|
||||||
JUGCHA = 16, -- Jungle tree maximum 1/x chance per surface node
|
JUGCHA = 8, -- Jungle grass maximum 1/x chance per surface node
|
||||||
PAPCHA = 3, -- Papyrus 1/x chance per surface swamp water node
|
PAPCHA = 8, -- Papyrus 1/x chance per surface swamp water node
|
||||||
CACCHA = 361, -- Cactus 1/x chance per surface node
|
CACCHA = 256, -- Cactus 1/x chance per surface node
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Noise parameters
|
-- Noise parameters
|
||||||
@ -78,10 +67,10 @@ local flora = {
|
|||||||
local np_terrain = {
|
local np_terrain = {
|
||||||
offset = 0,
|
offset = 0,
|
||||||
scale = 1,
|
scale = 1,
|
||||||
spread = {x=48, y=48, z=48},
|
spread = {x = 96, y = 96, z = 96},
|
||||||
seed = 92,
|
seed = 92,
|
||||||
octaves = 2,
|
octaves = 3,
|
||||||
persist = 0.63
|
persist = 0.6
|
||||||
}
|
}
|
||||||
|
|
||||||
-- 3D noise for smooth terrain
|
-- 3D noise for smooth terrain
|
||||||
@ -89,9 +78,9 @@ local np_terrain = {
|
|||||||
local np_smooth = {
|
local np_smooth = {
|
||||||
offset = 0,
|
offset = 0,
|
||||||
scale = 1,
|
scale = 1,
|
||||||
spread = {x=78, y=78, z=78},
|
spread = {x = 192, y = 192, z = 192},
|
||||||
seed = 800911,
|
seed = 800911,
|
||||||
octaves = 1,
|
octaves = 3,
|
||||||
persist = 0.4
|
persist = 0.4
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,31 +89,20 @@ local np_smooth = {
|
|||||||
local np_terblen = {
|
local np_terblen = {
|
||||||
offset = 0,
|
offset = 0,
|
||||||
scale = 1,
|
scale = 1,
|
||||||
spread = {x=64, y=64, z=64},
|
spread = {x = 192, y = 192, z = 192},
|
||||||
seed = -440002,
|
seed = -440002,
|
||||||
octaves = 3,
|
octaves = 1,
|
||||||
persist = 0.4
|
persist = 0.4
|
||||||
}
|
}
|
||||||
|
|
||||||
-- 3D noise for rivers
|
|
||||||
|
|
||||||
local np_river = {
|
|
||||||
offset = 0,
|
|
||||||
scale = 1,
|
|
||||||
spread = {x=384, y=384, z=384},
|
|
||||||
seed = 14440002,
|
|
||||||
octaves = 4,
|
|
||||||
persist = 0.5
|
|
||||||
}
|
|
||||||
|
|
||||||
-- 3D noise for temperature
|
-- 3D noise for temperature
|
||||||
|
|
||||||
local np_temp = {
|
local np_temp = {
|
||||||
offset = 0,
|
offset = 0,
|
||||||
scale = 1,
|
scale = 1,
|
||||||
spread = {x=48, y=48, z=48},
|
spread = {x = 384, y = 384, z = 384},
|
||||||
seed = 9130,
|
seed = 9130,
|
||||||
octaves = 3,
|
octaves = 2,
|
||||||
persist = 0.4
|
persist = 0.4
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,9 +111,9 @@ local np_temp = {
|
|||||||
local np_humid = {
|
local np_humid = {
|
||||||
offset = 0,
|
offset = 0,
|
||||||
scale = 1,
|
scale = 1,
|
||||||
spread = {x=48, y=48, z=48},
|
spread = {x = 384, y = 384, z = 384},
|
||||||
seed = -55500,
|
seed = -55500,
|
||||||
octaves = 3,
|
octaves = 2,
|
||||||
persist = 0.4
|
persist = 0.4
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,9 +122,9 @@ local np_humid = {
|
|||||||
local np_fissure = {
|
local np_fissure = {
|
||||||
offset = 0,
|
offset = 0,
|
||||||
scale = 1,
|
scale = 1,
|
||||||
spread = {x=48, y=48, z=48},
|
spread = {x = 192, y = 192, z = 192},
|
||||||
seed = 108881,
|
seed = 108881,
|
||||||
octaves = 2,
|
octaves = 3,
|
||||||
persist = 0.5
|
persist = 0.5
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,41 +133,45 @@ local np_fissure = {
|
|||||||
local np_cloud = {
|
local np_cloud = {
|
||||||
offset = 0,
|
offset = 0,
|
||||||
scale = 1,
|
scale = 1,
|
||||||
spread = {x=104, y=104, z=104},
|
spread = {x = 96, y = 96, z = 96},
|
||||||
seed = 2113,
|
seed = 2113,
|
||||||
octaves = 4,
|
octaves = 3,
|
||||||
persist = 0.7
|
persist = 0.7
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Stuff
|
-- Do files
|
||||||
|
|
||||||
dofile(minetest.get_modpath("flexrealm").."/nodes.lua")
|
dofile(minetest.get_modpath("flexrealm") .. "/nodes.lua")
|
||||||
dofile(minetest.get_modpath("flexrealm").."/functions.lua")
|
dofile(minetest.get_modpath("flexrealm") .. "/functions.lua")
|
||||||
|
|
||||||
minetest.register_on_mapgen_init(function(mgparams)
|
-- Mapgen parameters
|
||||||
minetest.set_mapgen_params({mgname="singlenode", flags="nolight", water_level=-31000})
|
|
||||||
end)
|
minetest.set_mapgen_params({mgname = "singlenode",
|
||||||
|
flags = "nolight", water_level = -31000})
|
||||||
|
|
||||||
-- Initialize noise objects to nil
|
-- Initialize noise objects to nil
|
||||||
|
|
||||||
local nobj_terrain = nil
|
local nobj_terrain = nil
|
||||||
local nobj_smooth = nil
|
local nobj_smooth = nil
|
||||||
local nobj_terblen = nil
|
local nobj_terblen = nil
|
||||||
local nobj_river = nil
|
|
||||||
local nobj_fissure = nil
|
local nobj_fissure = nil
|
||||||
local nobj_temp = nil
|
local nobj_temp = nil
|
||||||
local nobj_humid = nil
|
local nobj_humid = nil
|
||||||
local nobj_cloud = nil
|
local nobj_cloud = nil
|
||||||
|
|
||||||
|
-- Localise noise buffers
|
||||||
|
|
||||||
|
local nbuf_terrain
|
||||||
|
local nbuf_smooth
|
||||||
|
local nbuf_terblen
|
||||||
|
local nbuf_fissure
|
||||||
|
local nbuf_temp
|
||||||
|
local nbuf_humid
|
||||||
|
local nbuf_cloud
|
||||||
|
|
||||||
-- On generated function
|
-- On generated function
|
||||||
|
|
||||||
minetest.register_on_generated(function(minp, maxp, seed)
|
minetest.register_on_generated(function(minp, maxp, seed)
|
||||||
if minp.x < limit.XMIN or maxp.x > limit.XMAX
|
|
||||||
or minp.y < limit.YMIN or maxp.y > limit.YMAX
|
|
||||||
or minp.z < limit.ZMIN or maxp.z > limit.ZMAX then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local t0 = os.clock()
|
local t0 = os.clock()
|
||||||
local x0 = minp.x
|
local x0 = minp.x
|
||||||
local y0 = minp.y
|
local y0 = minp.y
|
||||||
@ -218,36 +200,33 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
local c_flrcloud = minetest.get_content_id("flexrealm:cloud")
|
local c_flrcloud = minetest.get_content_id("flexrealm:cloud")
|
||||||
local c_flrperfrost = minetest.get_content_id("flexrealm:perfrost")
|
local c_flrperfrost = minetest.get_content_id("flexrealm:perfrost")
|
||||||
local c_flrwatzero = minetest.get_content_id("flexrealm:watzero")
|
local c_flrwatzero = minetest.get_content_id("flexrealm:watzero")
|
||||||
local c_flrswatzero = minetest.get_content_id("flexrealm:swatzero")
|
|
||||||
local c_flrlavazero = minetest.get_content_id("flexrealm:lavazero")
|
local c_flrlavazero = minetest.get_content_id("flexrealm:lavazero")
|
||||||
|
|
||||||
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
|
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
|
||||||
local area = VoxelArea:new{MinEdge=emin, MaxEdge=emax}
|
local area = VoxelArea:new{MinEdge = emin, MaxEdge = emax}
|
||||||
local data = vm:get_data()
|
local data = vm:get_data()
|
||||||
local p2data = vm:get_param2_data()
|
local p2data = vm:get_param2_data()
|
||||||
|
|
||||||
local sidelen = x1 - x0 + 1
|
local sidelen = x1 - x0 + 1
|
||||||
local facearea = sidelen ^ 2
|
local facearea = sidelen ^ 2
|
||||||
local chulens = {x=sidelen, y=sidelen, z=sidelen}
|
local chulens = {x = sidelen, y = sidelen, z = sidelen}
|
||||||
local minpos = {x=x0, y=y0, z=z0}
|
local minpos = {x = x0, y = y0, z = z0}
|
||||||
|
|
||||||
nobj_terrain = nobj_terrain or minetest.get_perlin_map(np_terrain, chulens)
|
nobj_terrain = nobj_terrain or minetest.get_perlin_map(np_terrain, chulens)
|
||||||
nobj_smooth = nobj_smooth or minetest.get_perlin_map(np_smooth, chulens)
|
nobj_smooth = nobj_smooth or minetest.get_perlin_map(np_smooth, chulens)
|
||||||
nobj_terblen = nobj_terblen or minetest.get_perlin_map(np_terblen, chulens)
|
nobj_terblen = nobj_terblen or minetest.get_perlin_map(np_terblen, chulens)
|
||||||
nobj_river = nobj_river or minetest.get_perlin_map(np_river, chulens)
|
|
||||||
nobj_fissure = nobj_fissure or minetest.get_perlin_map(np_fissure, chulens)
|
nobj_fissure = nobj_fissure or minetest.get_perlin_map(np_fissure, chulens)
|
||||||
nobj_temp = nobj_temp or minetest.get_perlin_map(np_temp, chulens)
|
nobj_temp = nobj_temp or minetest.get_perlin_map(np_temp, chulens)
|
||||||
nobj_humid = nobj_humid or minetest.get_perlin_map(np_humid, chulens)
|
nobj_humid = nobj_humid or minetest.get_perlin_map(np_humid, chulens)
|
||||||
nobj_cloud = nobj_cloud or minetest.get_perlin_map(np_cloud, chulens)
|
nobj_cloud = nobj_cloud or minetest.get_perlin_map(np_cloud, chulens)
|
||||||
|
|
||||||
local nvals_terrain = nobj_terrain:get3dMap_flat(minpos)
|
local nvals_terrain = nobj_terrain:get3dMap_flat(minpos, nbuf_terrain)
|
||||||
local nvals_smooth = nobj_smooth:get3dMap_flat(minpos)
|
local nvals_smooth = nobj_smooth:get3dMap_flat(minpos, nbuf_smooth)
|
||||||
local nvals_terblen = nobj_terblen:get3dMap_flat(minpos)
|
local nvals_terblen = nobj_terblen:get3dMap_flat(minpos, nbuf_terblen)
|
||||||
local nvals_river = nobj_river:get3dMap_flat(minpos)
|
local nvals_fissure = nobj_fissure:get3dMap_flat(minpos, nbuf_fissure)
|
||||||
local nvals_fissure = nobj_fissure:get3dMap_flat(minpos)
|
local nvals_temp = nobj_temp:get3dMap_flat(minpos, nbuf_temp)
|
||||||
local nvals_temp = nobj_temp:get3dMap_flat(minpos)
|
local nvals_humid = nobj_humid:get3dMap_flat(minpos, nbuf_humid)
|
||||||
local nvals_humid = nobj_humid:get3dMap_flat(minpos)
|
local nvals_cloud = nobj_cloud:get3dMap_flat(minpos, nbuf_cloud)
|
||||||
local nvals_cloud = nobj_cloud:get3dMap_flat(minpos)
|
|
||||||
|
|
||||||
local ni = 1
|
local ni = 1
|
||||||
for z = z0, z1 do
|
for z = z0, z1 do
|
||||||
@ -261,33 +240,34 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
local terno = nvals_terrain[ni] * (1 - terblen) + nvals_smooth[ni] * terblen
|
local terno = nvals_terrain[ni] * (1 - terblen) + nvals_smooth[ni] * terblen
|
||||||
-- noise gradient
|
-- noise gradient
|
||||||
local grad, sphexr, spheyr, sphezr, tubeyr, tubezr, cubexr, cubeyr, cubezr
|
local grad, sphexr, spheyr, sphezr, tubeyr, tubezr, cubexr, cubeyr, cubezr
|
||||||
if flat then
|
if realm.flat then
|
||||||
grad = (FLATY - y) / TERRS
|
grad = (FLATY - y) / TERRS
|
||||||
elseif vertical then
|
elseif realm.vertical then
|
||||||
grad = (z - VERTZ) / TERRS
|
grad = (z - VERTZ) / TERRS
|
||||||
elseif invert then
|
elseif realm.invert then
|
||||||
grad = (y - FLATY) / TERRS
|
grad = (y - FLATY) / TERRS
|
||||||
elseif planet or dysonsphere then
|
elseif realm.planet or realm.dysonsphere then
|
||||||
sphexr = x - SPHEX
|
sphexr = x - SPHEX
|
||||||
spheyr = y - SPHEY
|
spheyr = y - SPHEY
|
||||||
sphezr = z - SPHEZ
|
sphezr = z - SPHEZ
|
||||||
local nodrad = math.sqrt(sphexr ^ 2 + spheyr ^ 2 + sphezr ^ 2)
|
local nodrad = math.sqrt(sphexr ^ 2 + spheyr ^ 2 + sphezr ^ 2)
|
||||||
if dysonsphere then
|
if realm.dysonsphere then
|
||||||
grad = (nodrad - SPHER) / TERRS
|
grad = (nodrad - SPHER) / TERRS
|
||||||
else
|
else
|
||||||
grad = (SPHER - nodrad) / TERRS
|
grad = (SPHER - nodrad) / TERRS
|
||||||
end
|
end
|
||||||
elseif tube then
|
elseif realm.tube then
|
||||||
tubeyr = y - TUBEY
|
tubeyr = y - TUBEY
|
||||||
tubezr = z - TUBEZ
|
tubezr = z - TUBEZ
|
||||||
local nodrad = math.sqrt(tubeyr ^ 2 + tubezr ^ 2)
|
local nodrad = math.sqrt(tubeyr ^ 2 + tubezr ^ 2)
|
||||||
grad = (nodrad - TUBER) / TERRS
|
grad = (nodrad - TUBER) / TERRS
|
||||||
elseif cube or dysoncube then
|
elseif realm.cube or realm.dysoncube then
|
||||||
cubexr = x - CUBEX
|
cubexr = x - CUBEX
|
||||||
cubeyr = y - CUBEY
|
cubeyr = y - CUBEY
|
||||||
cubezr = z - CUBEZ
|
cubezr = z - CUBEZ
|
||||||
local noddis = math.max(math.abs(cubexr), math.abs(cubeyr), math.abs(cubezr))
|
local noddis = math.max(math.abs(cubexr),
|
||||||
if dysoncube then
|
math.abs(cubeyr), math.abs(cubezr))
|
||||||
|
if realm.dysoncube then
|
||||||
grad = (noddis - CUBER) / TERRS
|
grad = (noddis - CUBER) / TERRS
|
||||||
else
|
else
|
||||||
grad = (CUBER - noddis) / TERRS
|
grad = (CUBER - noddis) / TERRS
|
||||||
@ -295,7 +275,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
end
|
end
|
||||||
-- density field
|
-- density field
|
||||||
local density
|
local density
|
||||||
if tube then
|
if realm.tube then
|
||||||
if math.abs(x) > TUBEX then -- endcaps
|
if math.abs(x) > TUBEX then -- endcaps
|
||||||
local wall = ((math.abs(x) - TUBEX) / TUBED) ^ 2 * TUBER / TERRS
|
local wall = ((math.abs(x) - TUBEX) / TUBED) ^ 2 * TUBER / TERRS
|
||||||
density = terno + grad + wall
|
density = terno + grad + wall
|
||||||
@ -319,19 +299,19 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
local n_humid = nvals_humid[ni]
|
local n_humid = nvals_humid[ni]
|
||||||
local humid = n_humid + grad
|
local humid = n_humid + grad
|
||||||
if density > 0 or grad > 0 then -- if terrain or water calculate biome
|
if density > 0 or grad > 0 then -- if terrain or water calculate biome
|
||||||
if temp > HITET then
|
if temp > 0.3 then
|
||||||
if humid > HUT then
|
if humid > 0.0 then
|
||||||
rainforest = true
|
rainforest = true
|
||||||
else
|
else
|
||||||
desert = true
|
desert = true
|
||||||
end
|
end
|
||||||
elseif temp < LOTET then
|
elseif temp < -0.3 then
|
||||||
if humid < HUT then
|
if humid < 0.0 then
|
||||||
tundra = true
|
tundra = true
|
||||||
else
|
else
|
||||||
taiga = true
|
taiga = true
|
||||||
end
|
end
|
||||||
elseif humid > HUT then
|
elseif humid > 0.0 then
|
||||||
forest = true
|
forest = true
|
||||||
else
|
else
|
||||||
grassland = true
|
grassland = true
|
||||||
@ -350,13 +330,13 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
-- nodrot 0 = y+, 12 = x+, 16 = x-, 4 = z+, 8 = z-, 20 = y-
|
-- nodrot 0 = y+, 12 = x+, 16 = x-, 4 = z+, 8 = z-, 20 = y-
|
||||||
local nodrot = 0
|
local nodrot = 0
|
||||||
if surf then
|
if surf then
|
||||||
if flat then
|
if realm.flat then
|
||||||
nodrot = 0
|
nodrot = 0
|
||||||
elseif vertical then
|
elseif realm.vertical then
|
||||||
nodrot = 8
|
nodrot = 8
|
||||||
elseif invert then
|
elseif realm.invert then
|
||||||
nodrot = 20
|
nodrot = 20
|
||||||
elseif planet then
|
elseif realm.planet then
|
||||||
if spheyr > math.abs(sphexr)
|
if spheyr > math.abs(sphexr)
|
||||||
and spheyr > math.abs(sphezr) then
|
and spheyr > math.abs(sphezr) then
|
||||||
nodrot = 0
|
nodrot = 0
|
||||||
@ -376,7 +356,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
and sphezr < -math.abs(spheyr) then
|
and sphezr < -math.abs(spheyr) then
|
||||||
nodrot = 8
|
nodrot = 8
|
||||||
end
|
end
|
||||||
elseif dysonsphere then
|
elseif realm.dysonsphere then
|
||||||
if spheyr > math.abs(sphexr)
|
if spheyr > math.abs(sphexr)
|
||||||
and spheyr > math.abs(sphezr) then
|
and spheyr > math.abs(sphezr) then
|
||||||
nodrot = 20
|
nodrot = 20
|
||||||
@ -396,7 +376,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
and sphezr < -math.abs(spheyr) then
|
and sphezr < -math.abs(spheyr) then
|
||||||
nodrot = 4
|
nodrot = 4
|
||||||
end
|
end
|
||||||
elseif tube then
|
elseif realm.tube then
|
||||||
if tubeyr > math.abs(tubezr) then
|
if tubeyr > math.abs(tubezr) then
|
||||||
nodrot = 20
|
nodrot = 20
|
||||||
elseif tubeyr < -math.abs(tubezr) then
|
elseif tubeyr < -math.abs(tubezr) then
|
||||||
@ -406,7 +386,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
elseif tubezr < -math.abs(tubeyr) then
|
elseif tubezr < -math.abs(tubeyr) then
|
||||||
nodrot = 4
|
nodrot = 4
|
||||||
end
|
end
|
||||||
elseif cube then
|
elseif realm.cube then
|
||||||
if cubeyr > math.abs(cubexr)
|
if cubeyr > math.abs(cubexr)
|
||||||
and cubeyr > math.abs(cubezr) then
|
and cubeyr > math.abs(cubezr) then
|
||||||
nodrot = 0
|
nodrot = 0
|
||||||
@ -426,7 +406,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
and cubezr < -math.abs(cubeyr) then
|
and cubezr < -math.abs(cubeyr) then
|
||||||
nodrot = 8
|
nodrot = 8
|
||||||
end
|
end
|
||||||
elseif dysoncube then
|
elseif realm.dysoncube then
|
||||||
if cubeyr > math.abs(cubexr)
|
if cubeyr > math.abs(cubexr)
|
||||||
and cubeyr > math.abs(cubezr) then
|
and cubeyr > math.abs(cubezr) then
|
||||||
nodrot = 20
|
nodrot = 20
|
||||||
@ -449,23 +429,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- mapgen
|
-- mapgen
|
||||||
local n_riverabs = math.abs(nvals_river[ni]) -- river water / glacier
|
if (density >= tstone and grad <= DEPT and nofis) then -- stone
|
||||||
if n_riverabs <= 0.03 * (1 - (density / 0.25) ^ 2) * altprop
|
|
||||||
and grad <= 0.12 and (density > 0 or grad > 0) then
|
|
||||||
if grad > 0.1 and density > 0 then
|
|
||||||
data[vi] = c_flrsand
|
|
||||||
elseif density >= 0.1 or grad > 0 then
|
|
||||||
if temp < ICETET then
|
|
||||||
data[vi] = c_ice
|
|
||||||
else
|
|
||||||
data[vi] = c_flrwatzero
|
|
||||||
end
|
|
||||||
end
|
|
||||||
elseif n_riverabs > 0.03 * (1 - (density / 0.25) ^ 2) * altprop -- river sand
|
|
||||||
and n_riverabs <= 0.04 * (1 - (density / 0.3) ^ 2) * altprop
|
|
||||||
and grad < 0.12 and density >= 0.1 then
|
|
||||||
data[vi] = c_flrsand
|
|
||||||
elseif (density >= tstone and grad <= DEPT and nofis) then -- stone
|
|
||||||
if (density >= 0.5 and density <= 0.55)
|
if (density >= 0.5 and density <= 0.55)
|
||||||
or (density >= 0.3 and density <= 0.4)
|
or (density >= 0.3 and density <= 0.4)
|
||||||
or (density >= 0.2 and density <= 0.25) then
|
or (density >= 0.2 and density <= 0.25) then
|
||||||
@ -524,6 +488,8 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
data[vi] = c_flrgrass
|
data[vi] = c_flrgrass
|
||||||
if surf and math.random(flora.GRACHA) == 2 then
|
if surf and math.random(flora.GRACHA) == 2 then
|
||||||
flexrealm_grass(x, y, z, nodrot, area, data, p2data)
|
flexrealm_grass(x, y, z, nodrot, area, data, p2data)
|
||||||
|
elseif surf and math.random(flora.FLOCHA) == 2 then
|
||||||
|
flexrealm_flower(x, y, z, nodrot, area, data, p2data)
|
||||||
end
|
end
|
||||||
elseif rainforest then
|
elseif rainforest then
|
||||||
data[vi] = c_flrgrass
|
data[vi] = c_flrgrass
|
||||||
@ -541,22 +507,14 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif temp < ICETET and grad > 0 and grad <= 0.05 and density <= 0 then -- sea ice
|
elseif temp < -0.6 and grad > 0 and grad <= 0.05 and density <= 0 then -- sea ice
|
||||||
if nodid == c_air then
|
if nodid == c_air then
|
||||||
data[vi] = c_ice
|
data[vi] = c_ice
|
||||||
end
|
end
|
||||||
elseif grad > 0 and density <= 0 then -- sea water / swamp water
|
elseif grad > 0 and density <= 0 then -- sea water
|
||||||
if nodid == c_air then
|
if nodid == c_air then
|
||||||
if n_terblen > 0.2 and density > -0.01 + (math.random() - 0.5) * 0.005
|
|
||||||
and grad < 0.02 and (desert or rainforest) then
|
|
||||||
data[vi] = c_flrswatzero
|
|
||||||
if math.random(flora.PAPCHA) == 2 then -- papyrus
|
|
||||||
flexrealm_papyrus(x, y, z, nodrot, area, data, p2data)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
data[vi] = c_flrwatzero
|
data[vi] = c_flrwatzero
|
||||||
end
|
end
|
||||||
end
|
|
||||||
elseif grad >= CLOLOT and grad <= CLOHIT then -- clouds
|
elseif grad >= CLOLOT and grad <= CLOHIT then -- clouds
|
||||||
local xrq = 16 * math.floor((x - x0) / 16)
|
local xrq = 16 * math.floor((x - x0) / 16)
|
||||||
local yrq = 16 * math.floor((y - y0) / 16)
|
local yrq = 16 * math.floor((y - y0) / 16)
|
||||||
@ -580,6 +538,5 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
vm:update_liquids()
|
vm:update_liquids()
|
||||||
|
|
||||||
local chugent = math.ceil((os.clock() - t0) * 1000)
|
local chugent = math.ceil((os.clock() - t0) * 1000)
|
||||||
print ("[flexrealm] "..chugent.." ms minp ("..x0.." "..y0.." "..z0..")")
|
print ("[flexrealm] " .. chugent)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
252
nodes.lua
252
nodes.lua
@ -1,37 +1,37 @@
|
|||||||
minetest.register_node("flexrealm:dirt", {
|
minetest.register_node("flexrealm:dirt", {
|
||||||
description = "Flexrealm Dirt",
|
description = "Flexrealm Dirt",
|
||||||
tiles = {"default_dirt.png"},
|
tiles = {"default_dirt.png"},
|
||||||
groups = {crumbly=3,soil=1},
|
groups = {crumbly = 3, soil = 1},
|
||||||
sounds = default.node_sound_dirt_defaults(),
|
sounds = default.node_sound_dirt_defaults(),
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("flexrealm:grass", {
|
minetest.register_node("flexrealm:grass", {
|
||||||
description = "Flexrealm Grass",
|
description = "Flexrealm Grass",
|
||||||
tiles = {"default_grass.png"},
|
tiles = {"default_grass.png"},
|
||||||
groups = {crumbly=3,soil=1},
|
groups = {crumbly = 3, soil = 1},
|
||||||
sounds = default.node_sound_dirt_defaults({
|
sounds = default.node_sound_dirt_defaults({
|
||||||
footstep = {name="default_grass_footstep", gain=0.4},
|
footstep = {name = "default_grass_footstep", gain = 0.4},
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("flexrealm:sand", {
|
minetest.register_node("flexrealm:sand", {
|
||||||
description = "Flexrealm Sand",
|
description = "Flexrealm Sand",
|
||||||
tiles = {"default_sand.png"},
|
tiles = {"default_sand.png"},
|
||||||
groups = {crumbly=3, sand=1},
|
groups = {crumbly = 3, sand = 1},
|
||||||
sounds = default.node_sound_sand_defaults(),
|
sounds = default.node_sound_sand_defaults(),
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("flexrealm:desand", {
|
minetest.register_node("flexrealm:desand", {
|
||||||
description = "Flexrealm Desert Sand",
|
description = "Flexrealm Desert Sand",
|
||||||
tiles = {"default_desert_sand.png"},
|
tiles = {"default_desert_sand.png"},
|
||||||
groups = {crumbly=3, sand=1},
|
groups = {crumbly = 3, sand = 1},
|
||||||
sounds = default.node_sound_sand_defaults(),
|
sounds = default.node_sound_sand_defaults(),
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("flexrealm:stone", {
|
minetest.register_node("flexrealm:stone", {
|
||||||
description = "Flexrealm Stone",
|
description = "Flexrealm Stone",
|
||||||
tiles = {"default_stone.png"},
|
tiles = {"default_stone.png"},
|
||||||
groups = {cracky=3, stone=1},
|
groups = {cracky = 3, stone = 1},
|
||||||
drop = "default:cobble",
|
drop = "default:cobble",
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
})
|
})
|
||||||
@ -39,7 +39,7 @@ minetest.register_node("flexrealm:stone", {
|
|||||||
minetest.register_node("flexrealm:destone", {
|
minetest.register_node("flexrealm:destone", {
|
||||||
description = "Flexrealm Desert Stone",
|
description = "Flexrealm Desert Stone",
|
||||||
tiles = {"default_desert_stone.png"},
|
tiles = {"default_desert_stone.png"},
|
||||||
groups = {cracky=3, stone=1},
|
groups = {cracky = 3, stone = 1},
|
||||||
drop = "default:desert_stone",
|
drop = "default:desert_stone",
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
})
|
})
|
||||||
@ -47,7 +47,7 @@ minetest.register_node("flexrealm:destone", {
|
|||||||
minetest.register_node("flexrealm:perfrost", {
|
minetest.register_node("flexrealm:perfrost", {
|
||||||
description = "Flexrealm Permafrost",
|
description = "Flexrealm Permafrost",
|
||||||
tiles = {"flexrealm_perfrost.png"},
|
tiles = {"flexrealm_perfrost.png"},
|
||||||
groups = {crumbly=1},
|
groups = {crumbly = 1},
|
||||||
drop = "default:dirt",
|
drop = "default:dirt",
|
||||||
sounds = default.node_sound_dirt_defaults(),
|
sounds = default.node_sound_dirt_defaults(),
|
||||||
})
|
})
|
||||||
@ -62,12 +62,10 @@ minetest.register_node("flexrealm:cloud", {
|
|||||||
pointable = false,
|
pointable = false,
|
||||||
diggable = false,
|
diggable = false,
|
||||||
buildable_to = true,
|
buildable_to = true,
|
||||||
post_effect_color = {a=23, r=241, g=248, b=255},
|
post_effect_color = {a = 23, r = 241, g = 248, b = 255},
|
||||||
groups = {not_in_creative_inventory=1},
|
groups = {not_in_creative_inventory = 1},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Rotated nodes
|
|
||||||
|
|
||||||
minetest.register_node("flexrealm:leaves", {
|
minetest.register_node("flexrealm:leaves", {
|
||||||
description = "Flexrealm Leaves",
|
description = "Flexrealm Leaves",
|
||||||
drawtype = "allfaces_optional",
|
drawtype = "allfaces_optional",
|
||||||
@ -76,22 +74,7 @@ minetest.register_node("flexrealm:leaves", {
|
|||||||
tiles = {"default_leaves.png"},
|
tiles = {"default_leaves.png"},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
groups = {snappy=3, flammable=2, leaves=1},
|
groups = {snappy = 3, flammable = 2, leaves = 1},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_node("flexrealm:apple", {
|
|
||||||
description = "Flexrealm Apple",
|
|
||||||
drawtype = "plantlike",
|
|
||||||
visual_scale = 1.0,
|
|
||||||
tiles = {"default_apple.png"},
|
|
||||||
inventory_image = "default_apple.png",
|
|
||||||
paramtype = "light",
|
|
||||||
paramtype2 = "facedir",
|
|
||||||
sunlight_propagates = true,
|
|
||||||
walkable = false,
|
|
||||||
groups = {fleshy=3,dig_immediate=3,flammable=2},
|
|
||||||
drop = "default:apple",
|
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -103,7 +86,7 @@ minetest.register_node("flexrealm:jungleleaves", {
|
|||||||
tiles = {"default_jungleleaves.png"},
|
tiles = {"default_jungleleaves.png"},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
groups = {snappy=3, flammable=2, leaves=1},
|
groups = {snappy = 3, flammable = 2, leaves = 1},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -115,7 +98,7 @@ minetest.register_node("flexrealm:pine_needles",{
|
|||||||
waving = 1,
|
waving = 1,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
groups = {snappy=3, flammable=2, leaves=1},
|
groups = {snappy = 3, flammable = 2, leaves = 1},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -123,165 +106,12 @@ minetest.register_node("flexrealm:cactus", {
|
|||||||
description = "Flexrealm Cactus",
|
description = "Flexrealm Cactus",
|
||||||
tiles = {"default_cactus_top.png", "default_cactus_top.png", "default_cactus_side.png"},
|
tiles = {"default_cactus_top.png", "default_cactus_top.png", "default_cactus_side.png"},
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
groups = {snappy=1,choppy=3,flammable=2},
|
groups = {snappy = 1, choppy = 3, flammable = 2},
|
||||||
drop = "default:cactus",
|
drop = "default:cactus",
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
on_place = minetest.rotate_node
|
on_place = minetest.rotate_node
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("flexrealm:papyrus", {
|
|
||||||
description = "Flexrealm Papyrus",
|
|
||||||
drawtype = "plantlike",
|
|
||||||
tiles = {"default_papyrus.png"},
|
|
||||||
inventory_image = "default_papyrus.png",
|
|
||||||
wield_image = "default_papyrus.png",
|
|
||||||
paramtype = "light",
|
|
||||||
paramtype2 = "facedir",
|
|
||||||
walkable = false,
|
|
||||||
groups = {snappy=3,flammable=2},
|
|
||||||
drop = "default:papyrus",
|
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
|
||||||
})
|
|
||||||
|
|
||||||
for i=1,5 do
|
|
||||||
minetest.register_node("flexrealm:grass_"..i, {
|
|
||||||
description = "Flexrealm Grass",
|
|
||||||
drawtype = "plantlike",
|
|
||||||
waving = 1,
|
|
||||||
tiles = {"default_grass_"..i..".png"},
|
|
||||||
inventory_image = "default_grass_"..i..".png",
|
|
||||||
wield_image = "default_grass_"..i..".png",
|
|
||||||
paramtype = "light",
|
|
||||||
paramtype2 = "facedir",
|
|
||||||
walkable = false,
|
|
||||||
buildable_to = true,
|
|
||||||
groups = {snappy=3,flammable=3,flora=1,attached_node=1,not_in_creative_inventory=1},
|
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
minetest.register_node("flexrealm:dry_shrub", {
|
|
||||||
description = "Flexrealm Dry Shrub",
|
|
||||||
drawtype = "plantlike",
|
|
||||||
waving = 1,
|
|
||||||
visual_scale = 1.0,
|
|
||||||
tiles = {"default_dry_shrub.png"},
|
|
||||||
inventory_image = "default_dry_shrub.png",
|
|
||||||
wield_image = "default_dry_shrub.png",
|
|
||||||
paramtype = "light",
|
|
||||||
paramtype2 = "facedir",
|
|
||||||
walkable = false,
|
|
||||||
buildable_to = true,
|
|
||||||
groups = {snappy=3,flammable=3,attached_node=1},
|
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_node("flexrealm:junglegrass", {
|
|
||||||
description = "Flexrealm Jungle Grass",
|
|
||||||
drawtype = "plantlike",
|
|
||||||
waving = 1,
|
|
||||||
visual_scale = 1.3,
|
|
||||||
tiles = {"default_junglegrass.png"},
|
|
||||||
inventory_image = "default_junglegrass.png",
|
|
||||||
wield_image = "default_junglegrass.png",
|
|
||||||
paramtype = "light",
|
|
||||||
paramtype2 = "facedir",
|
|
||||||
walkable = false,
|
|
||||||
buildable_to = true,
|
|
||||||
groups = {snappy=3,flammable=2,flora=1,attached_node=1},
|
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_node("flexrealm:rose", {
|
|
||||||
description = "Flexrealm Rose",
|
|
||||||
drawtype = "plantlike",
|
|
||||||
tiles = { "flowers_rose.png" },
|
|
||||||
inventory_image = "flowers_rose.png",
|
|
||||||
wield_image = "flowers_rose.png",
|
|
||||||
sunlight_propagates = true,
|
|
||||||
paramtype = "light",
|
|
||||||
paramtype2 = "facedir",
|
|
||||||
walkable = false,
|
|
||||||
buildable_to = true,
|
|
||||||
groups = {snappy=3,flammable=2,flower=1,flora=1,attached_node=1,color_red=1},
|
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_node("flexrealm:tulip", {
|
|
||||||
description = "Flexrealm Tulip",
|
|
||||||
drawtype = "plantlike",
|
|
||||||
tiles = { "flowers_tulip.png" },
|
|
||||||
inventory_image = "flowers_tulip.png",
|
|
||||||
wield_image = "flowers_tulip.png",
|
|
||||||
sunlight_propagates = true,
|
|
||||||
paramtype = "light",
|
|
||||||
paramtype2 = "facedir",
|
|
||||||
walkable = false,
|
|
||||||
buildable_to = true,
|
|
||||||
groups = {snappy=3,flammable=2,flower=1,flora=1,attached_node=1,color_orange=1},
|
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_node("flexrealm:dandelion_yellow", {
|
|
||||||
description = "Flexrealm Yellow Dandelion",
|
|
||||||
drawtype = "plantlike",
|
|
||||||
tiles = { "flowers_dandelion_yellow.png" },
|
|
||||||
inventory_image = "flowers_dandelion_yellow.png",
|
|
||||||
wield_image = "flowers_dandelion_yellow.png",
|
|
||||||
sunlight_propagates = true,
|
|
||||||
paramtype = "light",
|
|
||||||
paramtype2 = "facedir",
|
|
||||||
walkable = false,
|
|
||||||
buildable_to = true,
|
|
||||||
groups = {snappy=3,flammable=2,flower=1,flora=1,attached_node=1,color_yellow=1},
|
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_node("flexrealm:geranium", {
|
|
||||||
description = "Flexrealm Blue Geranium",
|
|
||||||
drawtype = "plantlike",
|
|
||||||
tiles = { "flowers_geranium.png" },
|
|
||||||
inventory_image = "flowers_geranium.png",
|
|
||||||
wield_image = "flowers_geranium.png",
|
|
||||||
sunlight_propagates = true,
|
|
||||||
paramtype = "light",
|
|
||||||
paramtype2 = "facedir",
|
|
||||||
walkable = false,
|
|
||||||
buildable_to = true,
|
|
||||||
groups = {snappy=3,flammable=2,flower=1,flora=1,attached_node=1,color_blue=1},
|
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_node("flexrealm:viola", {
|
|
||||||
description = "Flexrealm Viola",
|
|
||||||
drawtype = "plantlike",
|
|
||||||
tiles = { "flowers_viola.png" },
|
|
||||||
inventory_image = "flowers_viola.png",
|
|
||||||
wield_image = "flowers_viola.png",
|
|
||||||
sunlight_propagates = true,
|
|
||||||
paramtype = "light",
|
|
||||||
paramtype2 = "facedir",
|
|
||||||
walkable = false,
|
|
||||||
buildable_to = true,
|
|
||||||
groups = {snappy=3,flammable=2,flower=1,flora=1,attached_node=1,color_violet=1},
|
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_node("flexrealm:dandelion_white", {
|
|
||||||
description = "Flexrealm White Dandelion",
|
|
||||||
drawtype = "plantlike",
|
|
||||||
tiles = { "flowers_dandelion_white.png" },
|
|
||||||
inventory_image = "flowers_dandelion_white.png",
|
|
||||||
wield_image = "flowers_dandelion_white.png",
|
|
||||||
sunlight_propagates = true,
|
|
||||||
paramtype = "light",
|
|
||||||
paramtype2 = "facedir",
|
|
||||||
walkable = false,
|
|
||||||
buildable_to = true,
|
|
||||||
groups = {snappy=3,flammable=2,flower=1,flora=1,attached_node=1,color_white=1},
|
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Zero range liquids
|
-- Zero range liquids
|
||||||
|
|
||||||
minetest.register_node("flexrealm:watzero", {
|
minetest.register_node("flexrealm:watzero", {
|
||||||
@ -290,12 +120,12 @@ minetest.register_node("flexrealm:watzero", {
|
|||||||
drawtype = "liquid",
|
drawtype = "liquid",
|
||||||
tiles = {
|
tiles = {
|
||||||
{
|
{
|
||||||
name="default_water_source_animated.png",
|
name = "default_water_source_animated.png",
|
||||||
animation={
|
animation = {
|
||||||
type="vertical_frames",
|
type = "vertical_frames",
|
||||||
aspect_w=16,
|
aspect_w = 16,
|
||||||
aspect_h=16,
|
aspect_h = 16,
|
||||||
length=2.0,
|
length = 2.0,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -313,27 +143,8 @@ minetest.register_node("flexrealm:watzero", {
|
|||||||
liquid_viscosity = WATER_VISC,
|
liquid_viscosity = WATER_VISC,
|
||||||
liquid_renewable = false,
|
liquid_renewable = false,
|
||||||
liquid_range = 0,
|
liquid_range = 0,
|
||||||
post_effect_color = {a=64, r=100, g=100, b=200},
|
post_effect_color = {a = 64, r = 100, g = 100, b = 200},
|
||||||
groups = {water=3, liquid=3, puts_out_fire=1},
|
groups = {water = 3, liquid = 3, puts_out_fire = 1},
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_node("flexrealm:swatzero", {
|
|
||||||
description = "Flexrealm Swamp Water Source",
|
|
||||||
inventory_image = minetest.inventorycube("flexrealm_swatzero.png"),
|
|
||||||
tiles = {"flexrealm_swatzero.png"},
|
|
||||||
paramtype = "light",
|
|
||||||
walkable = false,
|
|
||||||
pointable = false,
|
|
||||||
diggable = false,
|
|
||||||
buildable_to = true,
|
|
||||||
liquidtype = "source",
|
|
||||||
liquid_alternative_flowing = "flexrealm:swatzero",
|
|
||||||
liquid_alternative_source = "flexrealm:swatzero",
|
|
||||||
liquid_viscosity = 2,
|
|
||||||
liquid_renewable = false,
|
|
||||||
liquid_range = 0,
|
|
||||||
post_effect_color = {a=128, r=31, g=56, b=8},
|
|
||||||
groups = {water=3, liquid=3, puts_out_fire=1},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("flexrealm:lavazero", {
|
minetest.register_node("flexrealm:lavazero", {
|
||||||
@ -342,12 +153,12 @@ minetest.register_node("flexrealm:lavazero", {
|
|||||||
drawtype = "liquid",
|
drawtype = "liquid",
|
||||||
tiles = {
|
tiles = {
|
||||||
{
|
{
|
||||||
name="default_lava_source_animated.png",
|
name = "default_lava_source_animated.png",
|
||||||
animation={
|
animation = {
|
||||||
type="vertical_frames",
|
type = "vertical_frames",
|
||||||
aspect_w=16,
|
aspect_w = 16,
|
||||||
aspect_h=16,
|
aspect_h = 16,
|
||||||
length=3.0,
|
length = 3.0,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -365,8 +176,7 @@ minetest.register_node("flexrealm:lavazero", {
|
|||||||
liquid_viscosity = LAVA_VISC,
|
liquid_viscosity = LAVA_VISC,
|
||||||
liquid_renewable = false,
|
liquid_renewable = false,
|
||||||
liquid_range = 0,
|
liquid_range = 0,
|
||||||
damage_per_second = 4*2,
|
damage_per_second = 8,
|
||||||
post_effect_color = {a=192, r=255, g=64, b=0},
|
post_effect_color = {a = 192, r = 255, g = 64, b = 0},
|
||||||
groups = {lava=3, liquid=2, hot=3, igniter=1},
|
groups = {lava = 3, liquid = 2, hot = 3, igniter = 1},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 3.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 401 B |
Loading…
x
Reference in New Issue
Block a user