From 67248afe5850ef7c6c0bacc9a365067ed9522cb2 Mon Sep 17 00:00:00 2001 From: kay27 Date: Sun, 25 Jul 2021 04:34:55 +0400 Subject: [PATCH] Use new vars in mcl_debrisgen --- mods/MAPGEN/mcl_debrisgen/init.lua | 7 ++++--- mods/MAPGEN/mcl_debrisgen/mod.conf | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mods/MAPGEN/mcl_debrisgen/init.lua b/mods/MAPGEN/mcl_debrisgen/init.lua index 4e80c2504..28af327cd 100644 --- a/mods/MAPGEN/mcl_debrisgen/init.lua +++ b/mods/MAPGEN/mcl_debrisgen/init.lua @@ -11,8 +11,10 @@ local facedir = { vector.new(-1, 0, 0), } +local min, max = mcl_mapgen.nether.min, mcl_mapgen.nether.max + 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 end @@ -20,7 +22,7 @@ minetest.register_on_generated(function(minp, maxp) local data = vm:get_data() 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 local pos = area:position(idx) local exposed = false @@ -41,4 +43,3 @@ minetest.register_on_generated(function(minp, maxp) vm:update_liquids() vm:write_to_map() end) - diff --git a/mods/MAPGEN/mcl_debrisgen/mod.conf b/mods/MAPGEN/mcl_debrisgen/mod.conf index cc5455208..270f40f71 100644 --- a/mods/MAPGEN/mcl_debrisgen/mod.conf +++ b/mods/MAPGEN/mcl_debrisgen/mod.conf @@ -1,4 +1,4 @@ name = mcl_debrisgen author = Fleckenstein 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