Use new vars in mcl_debrisgen

This commit is contained in:
kay27 2021-07-25 04:34:55 +04:00
parent 2f8e30b1bb
commit 67248afe58
2 changed files with 5 additions and 4 deletions

View File

@ -11,8 +11,10 @@ local facedir = {
vector.new(-1, 0, 0), vector.new(-1, 0, 0),
} }
local min, max = mcl_mapgen.nether.min, mcl_mapgen.nether.max
minetest.register_on_generated(function(minp, maxp) minetest.register_on_generated(function(minp, maxp)
if maxp.y < mcl_vars.mg_nether_min or minp.y > mcl_vars.mg_nether_max then if maxp.y < min or minp.y > max then
return return
end end
@ -20,7 +22,7 @@ minetest.register_on_generated(function(minp, maxp)
local data = vm:get_data() local data = vm:get_data()
local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax}) local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax})
for idx in area:iter(minp.x, math.max(minp.y, mcl_vars.mg_nether_min), minp.z, maxp.x, math.min(maxp.y, mcl_vars.mg_nether_max), maxp.z) do for idx in area:iter(minp.x, math.max(minp.y, min), minp.z, maxp.x, math.min(maxp.y, max), maxp.z) do
if data[idx] == c_debris then if data[idx] == c_debris then
local pos = area:position(idx) local pos = area:position(idx)
local exposed = false local exposed = false
@ -41,4 +43,3 @@ minetest.register_on_generated(function(minp, maxp)
vm:update_liquids() vm:update_liquids()
vm:write_to_map() vm:write_to_map()
end) end)

View File

@ -1,4 +1,4 @@
name = mcl_debrisgen name = mcl_debrisgen
author = Fleckenstein author = Fleckenstein
description = Make sure ancient debris is not generated exposed to air description = Make sure ancient debris is not generated exposed to air
depends = mcl_mapgen_core, mcl_nether depends = mcl_mapgen, mcl_mapgen_core, mcl_nether