From 9449cdfd88023a492f589dfabec1a4c5b9fd97eb Mon Sep 17 00:00:00 2001 From: cora Date: Wed, 7 Sep 2022 11:53:22 +0200 Subject: [PATCH] Don't spawn illagers in cabins in peaceful --- mods/MAPGEN/mcl_structures/woodland_mansion.lua | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/mods/MAPGEN/mcl_structures/woodland_mansion.lua b/mods/MAPGEN/mcl_structures/woodland_mansion.lua index 6a4cfebe03..8b492c186a 100644 --- a/mods/MAPGEN/mcl_structures/woodland_mansion.lua +++ b/mods/MAPGEN/mcl_structures/woodland_mansion.lua @@ -1,6 +1,7 @@ local modname = minetest.get_current_modname() local S = minetest.get_translator(modname) local modpath = minetest.get_modpath(modname) +local peaceful = minetest.settings:get_bool("only_peaceful_mobs", false) mcl_structures.register_structure("woodland_cabin",{ place_on = {"group:grass_block","group:dirt","mcl_core:dirt_with_grass"}, @@ -22,17 +23,19 @@ mcl_structures.register_structure("woodland_cabin",{ local p1=vector.offset(p,-def.sidelen,-1,-def.sidelen) local p2=vector.offset(p,def.sidelen,def.sidelen,def.sidelen) local sp = minetest.find_nodes_in_area_under_air(p1,p2,spawnon) - if sp and #sp > 0 then - for i=1,5 do + if not peaceful then + 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:vindicator") + end + end local pos = sp[pr:next(1,#sp)] if pos then - minetest.add_entity(pos,"mobs_mc:vindicator") + minetest.add_entity(pos,"mobs_mc:evoker") end end - local pos = sp[pr:next(1,#sp)] - if pos then - minetest.add_entity(pos,"mobs_mc:evoker") - end end local parrot = minetest.find_node_near(p,25,{"mcl_heads:wither_skeleton"}) if parrot then