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",
nodenames = {ore},
neighbours = {"group:lava"},
interval = 10,
chance = 10,
interval = 20,
chance = 20,
action = function(pos,node)
local vdirs = {}
for _,off in pairs(growdirs) do

View File

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