diff --git a/mods/ENTITIES/mcl_mobs/init.lua b/mods/ENTITIES/mcl_mobs/init.lua index fb39fa151..85e31b665 100644 --- a/mods/ENTITIES/mcl_mobs/init.lua +++ b/mods/ENTITIES/mcl_mobs/init.lua @@ -325,12 +325,19 @@ function mcl_mobs.register_mob(name, def) _spawner = def._spawner, } - minetest.register_entity(name, setmetatable(final_def,mcl_mobs.mob_class_meta)) if minetest.get_modpath("doc_identifier") ~= nil then doc.sub.identifier.register_object(name, "basics", "mobs") + + if def.unused ~= true then + doc.add_entry("mobs", name, { + name = def.description or name, + data = final_def, + }) + end end + minetest.register_entity(name, setmetatable(final_def,mcl_mobs.mob_class_meta)) end -- END mcl_mobs.register_mob function diff --git a/mods/ENTITIES/mobs_mc/axolotl.lua b/mods/ENTITIES/mobs_mc/axolotl.lua index f3f423c01..a30f8ffe1 100644 --- a/mods/ENTITIES/mobs_mc/axolotl.lua +++ b/mods/ENTITIES/mobs_mc/axolotl.lua @@ -1,6 +1,7 @@ local S = minetest.get_translator(minetest.get_current_modname()) local axolotl = { + description = S("Axolotl"), type = "animal", spawn_class = "axolotl", can_despawn = true, diff --git a/mods/ENTITIES/mobs_mc/cod.lua b/mods/ENTITIES/mobs_mc/cod.lua index 4f41f763d..a2aa2eadf 100644 --- a/mods/ENTITIES/mobs_mc/cod.lua +++ b/mods/ENTITIES/mobs_mc/cod.lua @@ -30,6 +30,7 @@ local S = minetest.get_translator(minetest.get_current_modname()) --################### local cod = { + description = S("Cod"), type = "animal", spawn_class = "water_ambient", can_despawn = true, diff --git a/mods/ENTITIES/mobs_mc/creeper.lua b/mods/ENTITIES/mobs_mc/creeper.lua index 0b3d41c28..2c95407c8 100644 --- a/mods/ENTITIES/mobs_mc/creeper.lua +++ b/mods/ENTITIES/mobs_mc/creeper.lua @@ -136,7 +136,7 @@ mcl_mobs.register_mob("mobs_mc:creeper", { }) mcl_mobs.register_mob("mobs_mc:creeper_charged", { - description = S("Creeper"), + description = S("Charged Creeper"), type = "monster", spawn_class = "hostile", hp_min = 20, diff --git a/mods/ENTITIES/mobs_mc/dolphin.lua b/mods/ENTITIES/mobs_mc/dolphin.lua index 5469feb23..0db7647b9 100644 --- a/mods/ENTITIES/mobs_mc/dolphin.lua +++ b/mods/ENTITIES/mobs_mc/dolphin.lua @@ -30,6 +30,7 @@ local S = minetest.get_translator(minetest.get_current_modname()) --################### local dolphin = { + description = S("Dolphin"), type = "animal", spawn_class = "water", can_despawn = true, diff --git a/mods/ENTITIES/mobs_mc/glow_squid.lua b/mods/ENTITIES/mobs_mc/glow_squid.lua index 679bb4cfe..4cf4e5986 100644 --- a/mods/ENTITIES/mobs_mc/glow_squid.lua +++ b/mods/ENTITIES/mobs_mc/glow_squid.lua @@ -30,6 +30,7 @@ for i=1,4 do end mcl_mobs.register_mob("mobs_mc:glow_squid", { + description = S("Glow Squid"), type = "animal", spawn_class = "water_underground", can_despawn = true, diff --git a/mods/ENTITIES/mobs_mc/piglin.lua b/mods/ENTITIES/mobs_mc/piglin.lua index 55abdd0f6..e81782b1c 100644 --- a/mods/ENTITIES/mobs_mc/piglin.lua +++ b/mods/ENTITIES/mobs_mc/piglin.lua @@ -343,8 +343,13 @@ mcl_mobs.register_mob("mobs_mc:baby_zombified_piglin", baby_zombified_piglin) -- Compatibility code. These were removed, and now are called zombie piglins. They don't spawn. -- This is only to catch old cases. Maybe could be an alias? -mcl_mobs.register_mob("mobs_mc:pigman", zombified_piglin) -mcl_mobs.register_mob("mobs_mc:baby_pigman", baby_zombified_piglin) +local pigman_unused = table.copy(zombified_piglin) +pigman_unused.unused = true +local baby_pigman_unused = table.copy(baby_zombified_piglin) +baby_pigman_unused.unused = true + +mcl_mobs.register_mob("mobs_mc:pigman", pigman_unused) +mcl_mobs.register_mob("mobs_mc:baby_pigman", baby_pigman_unused) -- Piglin Brute -- diff --git a/mods/ENTITIES/mobs_mc/salmon.lua b/mods/ENTITIES/mobs_mc/salmon.lua index 80adbd2c1..47a1a5028 100644 --- a/mods/ENTITIES/mobs_mc/salmon.lua +++ b/mods/ENTITIES/mobs_mc/salmon.lua @@ -10,6 +10,7 @@ local S = minetest.get_translator(minetest.get_current_modname()) --################### local salmon = { + description = S("Salmon"), type = "animal", spawn_class = "water_ambient", can_despawn = true, diff --git a/mods/ENTITIES/mobs_mc/slime+magma_cube.lua b/mods/ENTITIES/mobs_mc/slime+magma_cube.lua index 743f37cee..d56b6e2a2 100644 --- a/mods/ENTITIES/mobs_mc/slime+magma_cube.lua +++ b/mods/ENTITIES/mobs_mc/slime+magma_cube.lua @@ -176,7 +176,7 @@ end -- Slime local slime_big = { - description = S("Slime"), + description = S("Slime - big"), type = "monster", spawn_class = "hostile", group_attack = { "mobs_mc:slime_big", "mobs_mc:slime_small", "mobs_mc:slime_tiny" }, @@ -231,6 +231,7 @@ local slime_big = { mcl_mobs.register_mob("mobs_mc:slime_big", slime_big) local slime_small = table.copy(slime_big) +slime_small.description = S("Slime - small") slime_small.sounds.base_pitch = 1.15 slime_small.hp_min = 4 slime_small.hp_max = 4 @@ -248,6 +249,7 @@ slime_small.on_die = spawn_children_on_die("mobs_mc:slime_tiny", 0.6, 1.0) mcl_mobs.register_mob("mobs_mc:slime_small", slime_small) local slime_tiny = table.copy(slime_big) +slime_tiny.description = S("Slime - tiny") slime_tiny.sounds.base_pitch = 1.3 slime_tiny.hp_min = 1 slime_tiny.hp_max = 1 @@ -397,7 +399,7 @@ swamp_max) -- Magma cube local magma_cube_big = { - description = S("Magma Cube"), + description = S("Magma Cube - big"), type = "monster", spawn_class = "hostile", hp_min = 16, @@ -458,6 +460,7 @@ local magma_cube_big = { mcl_mobs.register_mob("mobs_mc:magma_cube_big", magma_cube_big) local magma_cube_small = table.copy(magma_cube_big) +magma_cube_small.description = S("Magma Cube - small") magma_cube_small.sounds.jump = "mobs_mc_magma_cube_small" magma_cube_small.sounds.death = "mobs_mc_magma_cube_small" magma_cube_small.hp_min = 4 @@ -479,6 +482,7 @@ magma_cube_small.on_die = spawn_children_on_die("mobs_mc:magma_cube_tiny", 0.6, mcl_mobs.register_mob("mobs_mc:magma_cube_small", magma_cube_small) local magma_cube_tiny = table.copy(magma_cube_big) +magma_cube_tiny.description = S("Magma Cube - tiny") magma_cube_tiny.sounds.jump = "mobs_mc_magma_cube_small" magma_cube_tiny.sounds.death = "mobs_mc_magma_cube_small" magma_cube_tiny.sounds.base_pitch = 1.25 diff --git a/mods/ENTITIES/mobs_mc/strider.lua b/mods/ENTITIES/mobs_mc/strider.lua index c5a129717..ea4fc393f 100644 --- a/mods/ENTITIES/mobs_mc/strider.lua +++ b/mods/ENTITIES/mobs_mc/strider.lua @@ -11,6 +11,7 @@ local S = minetest.get_translator("mobs_mc") local strider = { + description = S("Strider"), type = "animal", passive = true, spawn_class = "passive", @@ -205,6 +206,7 @@ mcl_mobs.register_mob("mobs_mc:strider", strider) -- Baby strider. local baby_strider = table.copy(strider) +baby_strider.description = S("Baby Strider") baby_strider.collisionbox = {-.3, -0.01, -.3, .3, 0.94, .3} baby_strider.xp_min = 13 baby_strider.xp_max = 13 diff --git a/mods/ENTITIES/mobs_mc/tropical_fish.lua b/mods/ENTITIES/mobs_mc/tropical_fish.lua index f5de8ecdd..6f0c4b43b 100644 --- a/mods/ENTITIES/mobs_mc/tropical_fish.lua +++ b/mods/ENTITIES/mobs_mc/tropical_fish.lua @@ -58,6 +58,7 @@ local function set_textures(self) end local tropical_fish = { + description = S("Tropical Fish"), type = "animal", spawn_class = "water_ambient", can_despawn = true, diff --git a/mods/ENTITIES/mobs_mc/wolf.lua b/mods/ENTITIES/mobs_mc/wolf.lua index e2cb206b1..13e76a602 100644 --- a/mods/ENTITIES/mobs_mc/wolf.lua +++ b/mods/ENTITIES/mobs_mc/wolf.lua @@ -135,6 +135,7 @@ end -- Tamed wolf (aka “dog”) local dog = table.copy(wolf) +dog.description = S("Dog") dog.can_despawn = false dog.passive = true dog.hp_min = 20 diff --git a/mods/HELP/doc/doc/init.lua b/mods/HELP/doc/doc/init.lua index 304900753..47b5e18dd 100644 --- a/mods/HELP/doc/doc/init.lua +++ b/mods/HELP/doc/doc/init.lua @@ -53,7 +53,7 @@ doc.data = {} doc.data.categories = {} doc.data.aliases = {} -- Default order (includes categories of other mods from the Docuentation System modpack) -doc.data.category_order = {"basics", "nodes", "tools", "craftitems", "advanced"} +doc.data.category_order = {"basics", "nodes", "tools", "craftitems", "advanced", "mobs"} doc.data.category_count = 0 doc.data.players = {} diff --git a/mods/HELP/doc/doc_identifier/init.lua b/mods/HELP/doc/doc_identifier/init.lua index c1c2043d3..483970a5f 100644 --- a/mods/HELP/doc/doc_identifier/init.lua +++ b/mods/HELP/doc/doc_identifier/init.lua @@ -116,7 +116,11 @@ function doc_identifier.identify(itemstack, user, pointed_thing) end -- A known registered object elseif ro then - doc.show_entry(username, ro.category, ro.entry, true) + if doc.entry_exists("mobs", le.name) then + doc.show_entry(username, "mobs", le.name, true) + else + doc.show_entry(username, ro.category, ro.entry, true) + end -- Undefined object (error) elseif minetest.registered_entities[le.name] == nil then show_message(username, "error_unknown", le.name) diff --git a/mods/HELP/doc/doc_items/init.lua b/mods/HELP/doc/doc_items/init.lua index 325ad9abb..d0106c847 100644 --- a/mods/HELP/doc/doc_items/init.lua +++ b/mods/HELP/doc/doc_items/init.lua @@ -1136,6 +1136,86 @@ doc.add_category("craftitems", { end }) +doc.add_category("mobs", { + name = S("Mobs"), + description = S("different mobs"), + build_formspec = function(data, playername) + if data then + local datastring = "" + + if data.description then + datastring = datastring .. S("Description: @1", data.description) + datastring = newline2(datastring) + end + + if data.type then + datastring = datastring .. S("Type: @1", data.type) + datastring = newline2(datastring) + end + + if data.spawn_class then + datastring = datastring .. S("spawn class: @1", data.spawn_class) + datastring = newline2(datastring) + end + + if data.jump then + datastring = datastring .. S("Can Jump") + datastring = newline2(datastring) + end + + if data.fly then + datastring = datastring .. S("Can Fly") + datastring = newline2(datastring) + end + + if data.drops then + count = 0 + for _,item in ipairs(data.drops) do + count = count + 1 + end + + if count > 0 then + datastring = datastring .. S("drops: ") + datastring = newline(datastring) + + for _,item in ipairs(data.drops) do + local itemDescription = ItemStack(item.name):get_short_description() + datastring = datastring .. itemDescription + datastring = newline(datastring) + end + + datastring = newline2(datastring) + end + end + + if data.follow then + datastring = datastring .. S("follows player when these items are held:") + datastring = newline(datastring) + + if type(data.follow) == "string" then + datastring = datastring .. data.follow + datastring = newline(datastring) + else + for i=1, #data.follow do + local itemstring = data.follow[i] + local itemDescription = ItemStack(itemstring):get_short_description() + datastring = datastring .. itemDescription + datastring = newline(datastring) + end + end + + datastring = newline2(datastring) + end + + local formstring = doc.widgets.text(datastring, nil, nil, doc.FORMSPEC.ENTRY_WIDTH - 1.2) + + return formstring + else + return "label[0,1;NO DATA AVALIABLE!]" + end + end +}) + -- Register group definition stuff -- More (user-)friendly group names to replace the rather technical names -- for better understanding