fix single mob spawning and poutpost walls

This commit is contained in:
cora 2022-10-30 01:54:33 +02:00
parent f324e150ea
commit d393e6a181
2 changed files with 3 additions and 2 deletions

View File

@ -232,7 +232,7 @@ function mcl_structures.spawn_mobs(mob,spawnon,p1,p2,pr,n)
local sp = minetest.find_nodes_in_area_under_air(p1,p2,spawnon) local sp = minetest.find_nodes_in_area_under_air(p1,p2,spawnon)
table.shuffle(sp) table.shuffle(sp)
for i,node in pairs(sp) do for i,node in pairs(sp) do
if not peaceful and i < n then if not peaceful and i <= n then
local pos = vector.offset(node,0,1,0) local pos = vector.offset(node,0,1,0)
if pos then if pos then
minetest.add_entity(pos,mob) minetest.add_entity(pos,mob)

View File

@ -60,8 +60,9 @@ mcl_structures.register_structure("pillager_outpost",{
after_place = function(p,def,pr) after_place = function(p,def,pr)
local p1 = vector.offset(p,-7,0,-7) local p1 = vector.offset(p,-7,0,-7)
local p2 = vector.offset(p,7,14,7) local p2 = vector.offset(p,7,14,7)
mcl_structures.spawn_mobs("mobs_mc:pillager",spawnon,p1,p2,pr,5)
mcl_structures.spawn_mobs("mobs_mc:evoker",spawnon,p1,p2,pr,1) mcl_structures.spawn_mobs("mobs_mc:evoker",spawnon,p1,p2,pr,1)
mcl_structures.spawn_mobs("mobs_mc:pillager",spawnon,p1,p2,pr,5)
mcl_structures.construct_nodes(p1,p2,{"group:wall"})
end end
}) })