diff --git a/abms.lua b/abms.lua index 90e86ec..2d634ee 100644 --- a/abms.lua +++ b/abms.lua @@ -298,6 +298,29 @@ minetest.register_abm({ end }) +minetest.register_abm({ + nodenames = {"fun_caves:casket"}, + interval = 2, + chance = 10, + action = function(pos, node) + local objs = minetest.get_objects_inside_radius(pos, 7) + for i = 1, #objs do + if objs[i]:is_player() then + local p1 = vector.subtract(pos, 3) + local p2 = vector.add(pos, 3) + local nodes = minetest.find_nodes_in_area_under_air(p1, p2, {'fun_caves:pyramid_1'}) + if nodes and #nodes > 0 then + if math.random(3) == 1 then + minetest.add_entity(nodes[math.random(#nodes)], 'mobs_monster:stone_monster') + else + minetest.add_entity(nodes[math.random(#nodes)], 'fun_caves:sand_monster') + end + end + end + end + end +}) + local no_tree_grow = {'fun_caves:bark', 'fun_caves:leaves'} local wood_nodes = {{name = 'fun_caves:diamondwood'}, {name = 'fun_caves:ironwood'}, {name = 'fun_caves:sap'}, {name = 'fun_caves:tree'}} minetest.register_abm({ diff --git a/mobs.lua b/mobs.lua index 6007872..c00d9af 100644 --- a/mobs.lua +++ b/mobs.lua @@ -637,7 +637,6 @@ if minetest.registered_entities["mobs_monster:sand_monster"] then mobs.spawning_mobs["fun_caves:sand_monster"] = true mobs:register_spawn("fun_caves:sand_monster", {"default:sand"}, 20, 0, 4000, 3, -50) - mobs:register_spawn("fun_caves:sand_monster", {"fun_caves:pyramid_1"}, default.LIGHT_MAX - 1, 0, 200, 5, 31000) mobs:register_egg("fun_caves:sand_monster", "Deep Sand Monster", "default_sand.png", 1) end diff --git a/pyramid.lua b/pyramid.lua index 0a5a1a3..d2b091c 100644 --- a/pyramid.lua +++ b/pyramid.lua @@ -127,8 +127,10 @@ fun_caves.pyramid = function(minp, maxp, data, p2data, area, biomemap, biome_ids else data[ivm] = node['air'] end - elseif dy >= base_height and dy <= base_height + 40 - math.max(math.abs(dx - 40), math.abs(dz - 40)) then + elseif dy >= base_height + 3 and dy <= base_height + 37 - math.max(math.abs(dx - 40), math.abs(dz - 40)) then data[ivm] = node['fun_caves:pyramid_1'] + elseif dy >= base_height and dy <= base_height + 40 - math.max(math.abs(dx - 40), math.abs(dz - 40)) then + data[ivm] = node['default:sandstone_block'] end ivm = ivm + area.ystride