parent
9b3607c282
commit
3e0311b61d
|
@ -31,7 +31,11 @@
|
|||
---
|
||||
### **Requirements:**
|
||||
|
||||
- **Depends:** none
|
||||
- **Dependencies:**
|
||||
- Required: ***none***
|
||||
- Optional:
|
||||
- ***[intllib][]***
|
||||
- ***[mobs_redo][]*** *(optionally adds "listmobs" chat command)*
|
||||
- **Privileges:** none
|
||||
|
||||
|
||||
|
@ -48,3 +52,5 @@
|
|||
|
||||
|
||||
[Minetest]: http://www.minetest.net/
|
||||
[intllib]: https://forum.minetest.net/viewtopic.php?t=4929
|
||||
[mobs_redo]: https://forum.minetest.net/viewtopic.php?t=9917
|
||||
|
|
8
api.lua
8
api.lua
|
@ -42,6 +42,10 @@ local known_lists = {
|
|||
'ores',
|
||||
}
|
||||
|
||||
if listitems.enable_mobs then
|
||||
table.insert(known_lists, 'mobs')
|
||||
end
|
||||
|
||||
|
||||
--- Checks if a parameter is a switch beginning with "-".
|
||||
--
|
||||
|
@ -95,6 +99,8 @@ local function getRegistered(r_type)
|
|||
o_temp = core.registered_entities
|
||||
elseif r_type == 'ores' then
|
||||
o_temp = core.registered_ores
|
||||
elseif r_type == 'mobs' then
|
||||
o_temp = mobs.spawning_mobs
|
||||
else
|
||||
o_temp = core.registered_items
|
||||
end
|
||||
|
@ -103,6 +109,8 @@ local function getRegistered(r_type)
|
|||
-- Ore names are located in the 'ore' field of the table
|
||||
if r_type == 'ores' then
|
||||
name = def.ore
|
||||
elseif r_type == 'mobs' then
|
||||
def = {}
|
||||
end
|
||||
|
||||
table.insert(objects, {name=name, descr=def.description,})
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
intllib?
|
||||
mobs?
|
||||
|
|
14
settings.lua
14
settings.lua
|
@ -18,3 +18,17 @@ listitems.debug = core.settings:get_bool('enable_debug_mods') or false
|
|||
-- @settype boolean
|
||||
-- @default false
|
||||
listitems.enable_generic = core.settings:get_bool('listitems.enable_generic') or false
|
||||
|
||||
--- Enables/Disables "listmobs" chat command.
|
||||
--
|
||||
-- Requires "mobs".
|
||||
--
|
||||
-- @setting listitems.enable_mobs
|
||||
-- @settype boolean
|
||||
-- @default true
|
||||
listitems.enable_mobs = false
|
||||
if core.global_exists('mobs') then
|
||||
listitems.enable_mobs = core.settings:get_bool('listitems.enable_mobs')
|
||||
-- Default: enabled
|
||||
listitems.enable_mobs = listitems.enable_mobs == nil or listitems.enable_mobs == true
|
||||
end
|
||||
|
|
|
@ -4,3 +4,6 @@ listitems.bullet_list (Bulleted list) bool true
|
|||
|
||||
# Enables/Disables generic "list" chat command.
|
||||
listitems.enable_generic (Enable generic "list" command) bool false
|
||||
|
||||
# Enables/Disables "listmobs" chat command (requires "mobs").
|
||||
listitems.enable_mobs (Enable "listmobs" command) bool true
|
||||
|
|
Loading…
Reference in New Issue