forked from MineClone5/MineClone5
Add more complex temple spawn conditions
This commit is contained in:
parent
d3265a2f72
commit
8caf8c91dd
|
@ -121,8 +121,7 @@ mcl_structures.register_structure({
|
||||||
deco_type = "simple",
|
deco_type = "simple",
|
||||||
place_on = node_list,
|
place_on = node_list,
|
||||||
flags = "all_floors",
|
flags = "all_floors",
|
||||||
--fill_ratio = 0.00003,
|
fill_ratio = 0.00003,
|
||||||
fill_ratio = 0.003,
|
|
||||||
y_min = 3,
|
y_min = 3,
|
||||||
y_max = mcl_mapgen.overworld.max,
|
y_max = mcl_mapgen.overworld.max,
|
||||||
height = 1,
|
height = 1,
|
||||||
|
@ -149,6 +148,9 @@ mcl_structures.register_structure({
|
||||||
local b = (math.floor(seed / 39) + 4) % 12
|
local b = (math.floor(seed / 39) + 4) % 12
|
||||||
minetest.chat_send_all("seed=" .. tostring(seed) .. ", a=" .. tostring(a) .. ", b=" ..tostring(b))
|
minetest.chat_send_all("seed=" .. tostring(seed) .. ", a=" .. tostring(a) .. ", b=" ..tostring(b))
|
||||||
if a ~= b then return end
|
if a ~= b then return end
|
||||||
|
mcl_structures.perlin_noise = mcl_structures.perlin_noise or minetest.get_perlin(329, 3, 0.6, 100)
|
||||||
|
local current_noise_level = mcl_structures.perlin_noise:get_3d(minp)
|
||||||
|
if current_noise_level > -0.3 then return end
|
||||||
local pos = pos_list[1]
|
local pos = pos_list[1]
|
||||||
if #pos_list > 1 then
|
if #pos_list > 1 then
|
||||||
local count = get_place_rank(pos)
|
local count = get_place_rank(pos)
|
||||||
|
|
|
@ -135,9 +135,8 @@ mcl_structures.register_structure({
|
||||||
deco_type = "simple",
|
deco_type = "simple",
|
||||||
place_on = node_list,
|
place_on = node_list,
|
||||||
flags = "all_floors",
|
flags = "all_floors",
|
||||||
--fill_ratio = 0.00003,
|
fill_ratio = 0.0003,
|
||||||
fill_ratio = 0.003,
|
y_min = -13,
|
||||||
y_min = 3,
|
|
||||||
y_max = mcl_mapgen.overworld.max,
|
y_max = mcl_mapgen.overworld.max,
|
||||||
height = 1,
|
height = 1,
|
||||||
biomes =
|
biomes =
|
||||||
|
@ -157,10 +156,13 @@ mcl_structures.register_structure({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
on_finished_chunk = function(minp, maxp, seed, vm_context, pos_list)
|
on_finished_chunk = function(minp, maxp, seed, vm_context, pos_list)
|
||||||
-- local a = seed % 14
|
local a = seed % 17
|
||||||
-- local b = (math.floor(seed / 39) + 4) % 12
|
local b = (math.ceil(seed / 123) - 4) % 17
|
||||||
-- minetest.chat_send_all("seed=" .. tostring(seed) .. ", a=" .. tostring(a) .. ", b=" ..tostring(b))
|
minetest.chat_send_all("seed=" .. tostring(seed) .. ", a=" .. tostring(a) .. ", b=" ..tostring(b))
|
||||||
-- if a ~= b then return end
|
if a ~= b then return end
|
||||||
|
mcl_structures.perlin_noise = mcl_structures.perlin_noise or minetest.get_perlin(329, 3, 0.6, 100)
|
||||||
|
local current_noise_level = mcl_structures.perlin_noise:get_3d(maxp)
|
||||||
|
if current_noise_level < 0.8 then return end
|
||||||
local pos
|
local pos
|
||||||
local count = -1
|
local count = -1
|
||||||
for i = 1, #pos_list do
|
for i = 1, #pos_list do
|
||||||
|
|
|
@ -26,9 +26,10 @@ local math_floor, math_ceil = math.floor, math.ceil
|
||||||
mcl_mapgen.register_mapgen(function(minp, maxp, seed, vm_context)
|
mcl_mapgen.register_mapgen(function(minp, maxp, seed, vm_context)
|
||||||
mcl_structures.perlin_noise = mcl_structures.perlin_noise or minetest.get_perlin(329, 3, 0.6, 100)
|
mcl_structures.perlin_noise = mcl_structures.perlin_noise or minetest.get_perlin(329, 3, 0.6, 100)
|
||||||
local perlin_noise = mcl_structures.perlin_noise
|
local perlin_noise = mcl_structures.perlin_noise
|
||||||
|
local y0 = minp.y
|
||||||
for x0 = minp.x, maxp.x do
|
for x0 = minp.x, maxp.x do
|
||||||
for z0 = minp.z, maxp.z do
|
for z0 = minp.z, maxp.z do
|
||||||
local current_noise_level = perlin_noise:get_2d({x=x0, y=z0})
|
local current_noise_level = perlin_noise:get_3d({x=x0, y=y0, z=z0})
|
||||||
local amount
|
local amount
|
||||||
if current_noise_level < 0 then
|
if current_noise_level < 0 then
|
||||||
amount = math_max(math_ceil(current_noise_level * 9), -9)
|
amount = math_max(math_ceil(current_noise_level * 9), -9)
|
||||||
|
|
Loading…
Reference in New Issue