1
0
mirror of https://codeberg.org/tenplus1/mobs_redo.git synced 2025-07-28 04:50:18 +02:00

Compare commits

...

3 Commits

Author SHA1 Message Date
db3831dccf update api.txt 2021-07-14 15:53:20 +01:00
29b2204f7c add 'mobs_spawn_monster_protected' switch (thanks 0siribix) 2021-07-14 15:43:02 +01:00
7fbfd9d59c fix "stand" mobs fall jitter 2021-07-13 16:56:53 +01:00
3 changed files with 12 additions and 4 deletions

11
api.lua
View File

@ -8,7 +8,7 @@ local use_cmi = minetest.global_exists("cmi")
mobs = {
mod = "redo",
version = "20210614",
version = "20210714",
intllib = S,
invis = minetest.global_exists("invisibility") and invisibility or {}
}
@ -56,6 +56,7 @@ local disable_blood = settings:get_bool("mobs_disable_blood")
local mobs_drop_items = settings:get_bool("mobs_drop_items") ~= false
local mobs_griefing = settings:get_bool("mobs_griefing") ~= false
local spawn_protected = settings:get_bool("mobs_spawn_protected") ~= false
local spawn_monster_protected = settings:get_bool("mobs_spawn_monster_protected") ~= false
local remove_far = settings:get_bool("remove_far_mobs") ~= false
local mob_area_spawn = settings:get_bool("mob_area_spawn")
local difficulty = tonumber(settings:get("mob_difficulty")) or 1.0
@ -273,7 +274,7 @@ function mob_class:set_velocity(v)
-- halt mob if it has been ordered to stay
if self.order == "stand" then
self.object:set_velocity({x = 0, y = 0, z = 0})
self.object:set_velocity({x = 0, y = self.fall_speed, z = 0})
return
end
@ -3956,8 +3957,10 @@ function mobs:spawn_specific(name, nodes, neighbors, min_light, max_light, inter
return
end
-- mobs cannot spawn in protected areas when enabled
if not spawn_protected
-- check if mob can spawn inside protected areas
if (spawn_protected == false
or (spawn_monster_protected == false
and minetest.registered_entities[name].type == "monster"))
and minetest.is_protected(pos, "") then
--print("--- inside protected area", name)
return

View File

@ -699,6 +699,8 @@ External Settings for "minetest.conf"
is false)
'mobs_spawn_protected' if set to false then mobs will not spawn in protected
areas (default is true)
'mobs_spawn_monster_protected' if set to false then monsters will not spawn in
protected areas (default is true)
'remove_far_mobs' if true then untamed mobs that are outside players
visual range will be removed (default is true)
'mobname' can change specific mob chance rate (0 to disable) and

View File

@ -13,6 +13,9 @@ mobs_griefing (Griefing Mobs) bool true
# If false then Mobs no longer spawn inside player protected areas
mobs_spawn_protected (Spawn Mobs in protected areas) bool true
# If false then Monsters no longer spawn inside player protected areas
mobs_spawn_monster_protected (Spawn Monsters in protected areas) bool true
# If true Mobs will be removed once a map chunk is out of view
remove_far_mobs (Remove far Mobs) bool true