mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-25 02:42:25 +01:00
Add some global spawn restrictions
- no monsters on mycelium - nothing on non-opaque blocks, except air
This commit is contained in:
parent
f022b747b0
commit
2dbda44a93
10
mods/ENTITIES/mobs_mc/5_spawn_abm_check.lua
Normal file
10
mods/ENTITIES/mobs_mc/5_spawn_abm_check.lua
Normal file
@ -0,0 +1,10 @@
|
||||
function mobs:spawn_abm_check(pos, node, name)
|
||||
if (node.name == "air") then
|
||||
return true
|
||||
elseif (node.name == "mcl_core:mycelium" or node.name == "mcl_core:mycelium_snow") and minetest.registered_entities[name].type == "monster" then
|
||||
return false
|
||||
elseif minetest.get_item_group(node.name, "opaque") ~= 0 then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
@ -38,6 +38,8 @@ dofile(path .. "/3_shared.lua")
|
||||
--Mob heads
|
||||
dofile(path .. "/4_heads.lua")
|
||||
|
||||
dofile(path .. "/5_spawn_abm_check.lua")
|
||||
|
||||
-- Animals
|
||||
dofile(path .. "/bat.lua") -- Mesh and animation by toby109tt / https://github.com/22i
|
||||
dofile(path .. "/rabbit.lua") -- Mesh and animation byExeterDad
|
||||
|
Loading…
Reference in New Issue
Block a user