diff --git a/mods/nc_terrain/dungeon.lua b/mods/nc_terrain/dungeon.lua index 3d527d8e..6645b757 100644 --- a/mods/nc_terrain/dungeon.lua +++ b/mods/nc_terrain/dungeon.lua @@ -1,6 +1,6 @@ -- LUALOCALS < --------------------------------------------------------- -local ipairs, math, minetest, next, nodecore, pairs, table - = ipairs, math, minetest, next, nodecore, pairs, table +local ipairs, math, minetest, nodecore, table + = ipairs, math, minetest, nodecore, table local math_floor, table_insert = math.floor, table.insert -- LUALOCALS > --------------------------------------------------------- @@ -58,7 +58,6 @@ local function regdungeon(name) local def = nodecore.underride({groups = {dungeon_mapgen = 1}}, minetest.registered_nodes[cobble]) def.description = "Dungeon Cobble" - def.tiles = {modname .. "_stone.png^" .. modname .. "_cobble.png"} def.mapgen = nil return minetest.register_node(modname .. ":" .. name, def) end @@ -79,13 +78,6 @@ end ------------------------------------------------------------------------ -- DUNGEON MODIFIER HOOKS -nodecore.register_lbm({ - name = modname .. ":dungeons", - run_at_every_load = true, - nodenames = {"group:dungeon_mapgen"}, - action = dungeonprocess - }) - minetest.register_abm({ label = modname .. " dungeon cleanup", interval = 1, @@ -93,45 +85,3 @@ minetest.register_abm({ nodenames = {"group:dungeon_mapgen"}, action = dungeonprocess }) - -local queue = {} -minetest.register_globalstep(function() - if not next(queue) then return end - local batch = queue - queue = {} - for _, pos in pairs(batch) do - local node = minetest.get_node(pos) - local cid = minetest.get_content_id(node.name) - if cid == node.cid then dungeonprocess(pos, node) end - end - end) - -local hash = minetest.hash_node_position - -local cid_cobble = minetest.get_content_id(modname .. ":dungeon_cobble") -local cid_cobble_alt = minetest.get_content_id(modname .. ":dungeon_cobble_alt") -local cid_cobble_stair = minetest.get_content_id(modname .. ":dungeon_cobble_stair") - -nodecore.register_mapgen_shared({ - label = "dungeon loot", - func = function(minp, maxp, area, data) - local ai = area.index - for z = minp.z, maxp.z do - for y = minp.y, maxp.y - 1 do - local offs = ai(area, 0, y, z) - for x = minp.x, maxp.x do - local i = offs + x - local d = data[i] - if d == cid_cobble - or d == cid_cobble_alt - or d == cid_cobble_stair then - local pos = {x = x, y = y, z = z} - pos.cid = d - queue[hash(pos)] = pos - end - end - end - end - end, - priority = -100 - })