Fix island distribution again

This commit is contained in:
Kimapr 2019-12-21 14:53:02 +05:00
parent b08277126c
commit 4c647d9495
2 changed files with 7 additions and 7 deletions

View File

@ -74,8 +74,8 @@ nodecore.register_limited_abm({
label = "Lode Crystal growing", label = "Lode Crystal growing",
nodenames = {ore}, nodenames = {ore},
neighbours = {"group:lava"}, neighbours = {"group:lava"},
interval = 10, interval = 20,
chance = 10, chance = 20,
action = function(pos,node) action = function(pos,node)
local vdirs = {} local vdirs = {}
for _,off in pairs(growdirs) do for _,off in pairs(growdirs) do

View File

@ -229,9 +229,8 @@ end
local function gen_island_pos(name) local function gen_island_pos(name)
local x,y,z = 0,0,0 local x,y,z = 0,0,0
x,z = x+math.random(-32,32),z+math.random(-32,32) x,z = x+math.random(-64,64),z+math.random(-64,64)
y=256+math.random(-64,64) y=256+math.random(-32,32)
local ok = checkpos(x,y,z)
for k,isl in ipairs(cells) do for k,isl in ipairs(cells) do
if isl and isl.valid then if isl and isl.valid then
table.remove(cells,k) table.remove(cells,k)
@ -245,9 +244,10 @@ local function gen_island_pos(name)
return return
end end
end end
local ok = checkpos(x,y,z)
while not ok do while not ok do
x,z = x+math.random(-32,32),z+math.random(-32,32) x,z = x+math.random(-64,64),z+math.random(-64,64)
y=256+math.random(-64,64) y=256+math.random(-32,32)
ok = checkpos(x,y,z) ok = checkpos(x,y,z)
end end
local ip = {x=x,y=y,z=z} local ip = {x=x,y=y,z=z}