mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2025-07-28 21:10:18 +02:00
Compare commits
3 Commits
e50d04a6aa
...
db3831dccf
Author | SHA1 | Date | |
---|---|---|---|
db3831dccf | |||
29b2204f7c | |||
7fbfd9d59c |
11
api.lua
11
api.lua
@ -8,7 +8,7 @@ local use_cmi = minetest.global_exists("cmi")
|
|||||||
|
|
||||||
mobs = {
|
mobs = {
|
||||||
mod = "redo",
|
mod = "redo",
|
||||||
version = "20210614",
|
version = "20210714",
|
||||||
intllib = S,
|
intllib = S,
|
||||||
invis = minetest.global_exists("invisibility") and invisibility or {}
|
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_drop_items = settings:get_bool("mobs_drop_items") ~= false
|
||||||
local mobs_griefing = settings:get_bool("mobs_griefing") ~= false
|
local mobs_griefing = settings:get_bool("mobs_griefing") ~= false
|
||||||
local spawn_protected = settings:get_bool("mobs_spawn_protected") ~= 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 remove_far = settings:get_bool("remove_far_mobs") ~= false
|
||||||
local mob_area_spawn = settings:get_bool("mob_area_spawn")
|
local mob_area_spawn = settings:get_bool("mob_area_spawn")
|
||||||
local difficulty = tonumber(settings:get("mob_difficulty")) or 1.0
|
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
|
-- halt mob if it has been ordered to stay
|
||||||
if self.order == "stand" then
|
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
|
return
|
||||||
end
|
end
|
||||||
@ -3956,8 +3957,10 @@ function mobs:spawn_specific(name, nodes, neighbors, min_light, max_light, inter
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- mobs cannot spawn in protected areas when enabled
|
-- check if mob can spawn inside protected areas
|
||||||
if not spawn_protected
|
if (spawn_protected == false
|
||||||
|
or (spawn_monster_protected == false
|
||||||
|
and minetest.registered_entities[name].type == "monster"))
|
||||||
and minetest.is_protected(pos, "") then
|
and minetest.is_protected(pos, "") then
|
||||||
--print("--- inside protected area", name)
|
--print("--- inside protected area", name)
|
||||||
return
|
return
|
||||||
|
2
api.txt
2
api.txt
@ -699,6 +699,8 @@ External Settings for "minetest.conf"
|
|||||||
is false)
|
is false)
|
||||||
'mobs_spawn_protected' if set to false then mobs will not spawn in protected
|
'mobs_spawn_protected' if set to false then mobs will not spawn in protected
|
||||||
areas (default is true)
|
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
|
'remove_far_mobs' if true then untamed mobs that are outside players
|
||||||
visual range will be removed (default is true)
|
visual range will be removed (default is true)
|
||||||
'mobname' can change specific mob chance rate (0 to disable) and
|
'mobname' can change specific mob chance rate (0 to disable) and
|
||||||
|
@ -13,6 +13,9 @@ mobs_griefing (Griefing Mobs) bool true
|
|||||||
# If false then Mobs no longer spawn inside player protected areas
|
# If false then Mobs no longer spawn inside player protected areas
|
||||||
mobs_spawn_protected (Spawn Mobs in protected areas) bool true
|
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
|
# If true Mobs will be removed once a map chunk is out of view
|
||||||
remove_far_mobs (Remove far Mobs) bool true
|
remove_far_mobs (Remove far Mobs) bool true
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user