Skip to content
Snippets Groups Projects
Commit df93cfe3 authored by Duane Robertson's avatar Duane Robertson
Browse files

Add lava.

parent 0734ca73
Branches
No related tags found
No related merge requests found
local node = loud_walking.node local node = loud_walking.node
local bevel = 40 local bevel = 40
local glass = "default:glass"
local data = {} local data = {}
...@@ -236,16 +237,18 @@ function loud_walking.generate(p_minp, p_maxp, seed) ...@@ -236,16 +237,18 @@ function loud_walking.generate(p_minp, p_maxp, seed)
local px = math.floor((minp.x + 32) / csize.x) local px = math.floor((minp.x + 32) / csize.x)
local pz = math.floor((minp.z + 32) / csize.z) local pz = math.floor((minp.z + 32) / csize.z)
local top = biomes[biome].node_top or "default:dirt_with_grass" local top = biomes[biome].node_top or "default:dirt_with_grass"
local filler = biomes[biome].node_filler or "default:dirt" local node_filler = biomes[biome].node_filler or "default:dirt"
local depth_top = biomes[biome].depth_top or 1 local depth_top = biomes[biome].depth_top or 1
local depth_filler = biomes[biome].depth_filler or 1 local depth_filler = biomes[biome].depth_filler or 1
local node_stone = biomes[biome].node_stone or "default:stone" local node_stone = biomes[biome].node_stone or "default:stone"
local ocean = string.find(biome, "ocean") and true or false local ocean = string.find(biome, "ocean") and true or false
local swamp = string.find(biome, "swamp") and true or false local swamp = string.find(biome, "swamp") and true or false
local beach = string.find(biome, "beach") and true or false local beach = string.find(biome, "beach") and true or false
local dunes = string.find(biome, "dunes") and true or false
local half = math.floor(csize.y / 2 + 0.5) local half = math.floor(csize.y / 2 + 0.5)
local ground = half local ground = half
beach = beach or dunes
if ocean then if ocean then
ground = ground - 15 ground = ground - 15
elseif swamp or beach then elseif swamp or beach then
...@@ -283,7 +286,7 @@ function loud_walking.generate(p_minp, p_maxp, seed) ...@@ -283,7 +286,7 @@ function loud_walking.generate(p_minp, p_maxp, seed)
data[ivm] = node("loud_walking:scrith") data[ivm] = node("loud_walking:scrith")
lightmap[ivm] = 0 lightmap[ivm] = 0
else else
data[ivm] = node("default:glass") data[ivm] = node(glass)
end end
in_cave = false in_cave = false
write = true write = true
...@@ -295,17 +298,24 @@ function loud_walking.generate(p_minp, p_maxp, seed) ...@@ -295,17 +298,24 @@ function loud_walking.generate(p_minp, p_maxp, seed)
data[ivm] = node("loud_walking:scrith") data[ivm] = node("loud_walking:scrith")
lightmap[ivm] = 0 lightmap[ivm] = 0
else else
data[ivm] = node("default:glass") data[ivm] = node(glass)
end end
write = true write = true
end end
in_cave = false in_cave = false
elseif not in_cave and dy == terr + ground + 1 then elseif not in_cave and dy == terr + ground + 1 and dy > half then
local deco = get_decoration(biome) local deco = get_decoration(biome)
if deco then if deco then
data[ivm] = node(deco) data[ivm] = node(deco)
end end
write = true write = true
elseif not in_cave and dy == terr + ground + 1 then
-- ** water decorations **
--local deco = get_decoration(biome)
--if deco then
-- data[ivm] = node(deco)
--end
--write = true
elseif (ocean or swamp or beach) and dy > terr + ground and dy <= half then elseif (ocean or swamp or beach) and dy > terr + ground and dy <= half then
data[ivm] = node("default:water_source") data[ivm] = node("default:water_source")
in_cave = false in_cave = false
...@@ -314,8 +324,17 @@ function loud_walking.generate(p_minp, p_maxp, seed) ...@@ -314,8 +324,17 @@ function loud_walking.generate(p_minp, p_maxp, seed)
in_cave = false in_cave = false
elseif cave[index3d] ^ 2 > 0.1 + dy / half then elseif cave[index3d] ^ 2 > 0.1 + dy / half then
if terr + ground >= dy and not in_cave and dy > terr + ground - 10 then if terr + ground >= dy and not in_cave and dy > terr + ground - 10 then
data[ivm] = node(biomes[biome].node_filler) data[ivm] = node(node_filler)
elseif ocean or swamp then elseif dy == 1 then
local sr = math.random(9)
if not ocean and not swamp and not beach and sr == 1 then
data[ivm] = node("default:lava_source")
elseif sr > 6 then
data[ivm] = node(node_stone)
elseif ocean or swamp or beach then
data[ivm] = node(node_filler)
end
elseif ocean or swamp or beach then
data[ivm] = node("default:water_source") data[ivm] = node("default:water_source")
else else
data[ivm] = node("air") data[ivm] = node("air")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment