diff --git a/mapgen.lua b/mapgen.lua index c70ad1b..9d5afbc 100644 --- a/mapgen.lua +++ b/mapgen.lua @@ -1,6 +1,7 @@ local node = loud_walking.node local bevel = 40 +local glass = "default:glass" local data = {} @@ -236,16 +237,18 @@ function loud_walking.generate(p_minp, p_maxp, seed) local px = math.floor((minp.x + 32) / csize.x) local pz = math.floor((minp.z + 32) / csize.z) 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_filler = biomes[biome].depth_filler or 1 local node_stone = biomes[biome].node_stone or "default:stone" local ocean = string.find(biome, "ocean") 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 dunes = string.find(biome, "dunes") and true or false local half = math.floor(csize.y / 2 + 0.5) local ground = half + beach = beach or dunes if ocean then ground = ground - 15 elseif swamp or beach then @@ -283,7 +286,7 @@ function loud_walking.generate(p_minp, p_maxp, seed) data[ivm] = node("loud_walking:scrith") lightmap[ivm] = 0 else - data[ivm] = node("default:glass") + data[ivm] = node(glass) end in_cave = false write = true @@ -295,17 +298,24 @@ function loud_walking.generate(p_minp, p_maxp, seed) data[ivm] = node("loud_walking:scrith") lightmap[ivm] = 0 else - data[ivm] = node("default:glass") + data[ivm] = node(glass) end write = true end 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) if deco then data[ivm] = node(deco) end 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 data[ivm] = node("default:water_source") in_cave = false @@ -314,8 +324,17 @@ function loud_walking.generate(p_minp, p_maxp, seed) in_cave = false elseif cave[index3d] ^ 2 > 0.1 + dy / half then if terr + ground >= dy and not in_cave and dy > terr + ground - 10 then - data[ivm] = node(biomes[biome].node_filler) - elseif ocean or swamp then + data[ivm] = node(node_filler) + 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") else data[ivm] = node("air")