Add garnet and zoisite functions.
This commit is contained in:
parent
f438090899
commit
e6f482c9d5
4 changed files with 91 additions and 15 deletions
12
cavegen.lua
12
cavegen.lua
|
@ -1,9 +1,9 @@
|
|||
local cave_width = 0.05 -- figurative width
|
||||
fun_caves.cave_width = 0.05 -- figurative width
|
||||
local max_depth = 31000
|
||||
|
||||
|
||||
local cave_noise_1 = {offset = 0, scale = 1, seed = 3901, spread = {x = 40, y = 10, z = 40}, octaves = 3, persist = 1, lacunarity = 2}
|
||||
local cave_noise_2 = {offset = 0, scale = 1, seed = -8402, spread = {x = 40, y = 20, z = 40}, octaves = 3, persist = 1, lacunarity = 2}
|
||||
fun_caves.cave_noise_1 = {offset = 0, scale = 1, seed = 3901, spread = {x = 40, y = 10, z = 40}, octaves = 3, persist = 1, lacunarity = 2}
|
||||
fun_caves.cave_noise_2 = {offset = 0, scale = 1, seed = -8402, spread = {x = 40, y = 20, z = 40}, octaves = 3, persist = 1, lacunarity = 2}
|
||||
local cave_noise_3 = {offset = 15, scale = 10, seed = 3721, spread = {x = 40, y = 40, z = 40}, octaves = 3, persist = 1, lacunarity = 2}
|
||||
|
||||
|
||||
|
@ -13,8 +13,8 @@ fun_caves.cavegen = function(minp, maxp, data, area, node, heightmap, underzone)
|
|||
local map_min = {x = minp.x, y = minp.y - 1, z = minp.z}
|
||||
--local noise_area = VoxelArea:new({MinEdge=map_min, MaxEdge={x=maxp.x,y=maxp.y+1,z=maxp.z}})
|
||||
|
||||
local cave_1 = minetest.get_perlin_map(cave_noise_1, map_max):get3dMap_flat(map_min)
|
||||
local cave_2 = minetest.get_perlin_map(cave_noise_2, map_max):get3dMap_flat(map_min)
|
||||
local cave_1 = minetest.get_perlin_map(fun_caves.cave_noise_1, map_max):get3dMap_flat(map_min)
|
||||
local cave_2 = minetest.get_perlin_map(fun_caves.cave_noise_2, map_max):get3dMap_flat(map_min)
|
||||
local cave_3 = minetest.get_perlin_map(cave_noise_3, {x=csize.x, y=csize.z}):get2dMap_flat({x=minp.x, y=minp.z})
|
||||
|
||||
local write = false
|
||||
|
@ -66,7 +66,7 @@ fun_caves.cavegen = function(minp, maxp, data, area, node, heightmap, underzone)
|
|||
write = true
|
||||
elseif underzone and (y < underzone.ceiling + 10 - (underzone.vary and cave_3[index] or 0) and y > underzone.floor - 10 + (underzone.vary and cave_3[index] or 0)) then
|
||||
-- nop
|
||||
elseif ((y <= maxp.y and y >= minp.y) or (data[ivm] == node['default:stone'])) and y < height - cave_3[index] and cave_1[index3d] * cave_2[index3d] > cave_width then
|
||||
elseif ((y <= maxp.y and y >= minp.y) or (data[ivm] == node['default:stone'])) and y < height - cave_3[index] and cave_1[index3d] * cave_2[index3d] > fun_caves.cave_width then
|
||||
if y <= fun_caves.underzones['Styx'].sealevel then
|
||||
data[ivm] = node["default:water_source"]
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue