mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-26 04:21:07 +01:00
Add Pillager and Evoker Spawning to Pillager Outpost
This commit is contained in:
parent
24939326c4
commit
092b746b0b
1 changed files with 14 additions and 0 deletions
|
@ -57,11 +57,25 @@ 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)
|
||||||
|
local spawnon = {"mcl_core:stripped_oak"}
|
||||||
|
local sp = minetest.find_nodes_in_area_under_air(p1,p2,spawnon)
|
||||||
for _,n in pairs(minetest.find_nodes_in_area(p1,p2,{"group:wall"})) do
|
for _,n in pairs(minetest.find_nodes_in_area(p1,p2,{"group:wall"})) do
|
||||||
local def = minetest.registered_nodes[minetest.get_node(n).name:gsub("_%d+$","")]
|
local def = minetest.registered_nodes[minetest.get_node(n).name:gsub("_%d+$","")]
|
||||||
if def and def.on_construct then
|
if def and def.on_construct then
|
||||||
def.on_construct(n)
|
def.on_construct(n)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if sp and #sp > 0 then
|
||||||
|
for i=1,5 do
|
||||||
|
local pos = sp[pr:next(1,#sp)]
|
||||||
|
if pos then
|
||||||
|
minetest.add_entity(pos,"mobs_mc:pillager")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local pos = sp[pr:next(1,#sp)]
|
||||||
|
if pos then
|
||||||
|
minetest.add_entity(pos,"mobs_mc:evoker")
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue