diff --git a/mods/ITEMS/mcl_beds/api.lua b/mods/ITEMS/mcl_beds/api.lua index 7d76b76e..777fa222 100644 --- a/mods/ITEMS/mcl_beds/api.lua +++ b/mods/ITEMS/mcl_beds/api.lua @@ -66,6 +66,8 @@ function mcl_beds.register_bed(name, def) description = def.description, _doc_items_longdesc = def._doc_items_longdesc or beddesc, _doc_items_usagehelp = def._doc_items_usagehelp or beduse, + _doc_items_create_entry = def._doc_items_create_entry, + _doc_items_entry_name = def._doc_items_entry_name, inventory_image = def.inventory_image, wield_image = def.wield_image, drawtype = "nodebox", diff --git a/mods/ITEMS/mcl_beds/beds.lua b/mods/ITEMS/mcl_beds/beds.lua index 6ac2071e..8f41c7a3 100644 --- a/mods/ITEMS/mcl_beds/beds.lua +++ b/mods/ITEMS/mcl_beds/beds.lua @@ -1,4 +1,5 @@ local S = minetest.get_translator("mcl_beds") +local mod_doc = minetest.get_modpath("doc") local nodebox = { bottom = { @@ -32,9 +33,11 @@ local colors = { { "light_blue", S("Light Blue Bed"), "mcl_wool:light_blue", "mcl_dye:lightblue" }, { "white", S("White Bed"), "mcl_wool:white", "mcl_dye:white" }, } +local canonical_color = "red" for c=1, #colors do local colorid = colors[c][1] + local is_canonical = colorid == canonical_color -- Recoloring recipe for white bed if minetest.get_modpath("mcl_dye") then @@ -54,9 +57,19 @@ for c=1, #colors do } end + local entry_name, create_entry + if mod_doc then + if is_canonical then + entry_name = S("Bed") + else + create_entry = false + end + end -- Register bed mcl_beds.register_bed("mcl_beds:bed_"..colorid, { description = colors[c][2], + _doc_items_entry_name = entry_name, + _doc_items_create_entry = create_entry, inventory_image = "mcl_beds_bed_"..colorid..".png", wield_image = "mcl_beds_bed_"..colorid..".png", tiles = { @@ -89,6 +102,10 @@ for c=1, #colors do }, recipe = main_recipe, }) + if mod_doc and not is_canonical then + doc.add_entry_alias("nodes", "mcl_beds:bed_"..canonical_color.."_bottom", "nodes", "mcl_beds:bed_"..colorid.."_bottom") + doc.add_entry_alias("nodes", "mcl_beds:bed_"..canonical_color.."_bottom", "nodes", "mcl_beds:bed_"..colorid.."_top") + end end diff --git a/mods/ITEMS/mcl_beds/depends.txt b/mods/ITEMS/mcl_beds/depends.txt index 3285e591..34e12adc 100644 --- a/mods/ITEMS/mcl_beds/depends.txt +++ b/mods/ITEMS/mcl_beds/depends.txt @@ -6,3 +6,4 @@ mcl_dye? mcl_tnt? mcl_weather? mcl_spawn? +doc? diff --git a/mods/ITEMS/mcl_beds/locale/mcl_beds.de.tr b/mods/ITEMS/mcl_beds/locale/mcl_beds.de.tr index bcf26fc3..079951c8 100644 --- a/mods/ITEMS/mcl_beds/locale/mcl_beds.de.tr +++ b/mods/ITEMS/mcl_beds/locale/mcl_beds.de.tr @@ -5,6 +5,7 @@ You have heard of other worlds in which a bed would set the start point for your By using a bed, you set the starting point for your next life. If you die, you will start your next life at this bed, unless it is obstructed or destroyed.=Indem Sie ein Bett benutzen, setzen Sie den Startpunkt Ihres nächsten Lebens. Wenn Sie sterben, werden Sie Ihr nächstes Leben auf diesem Bett beginnen, es sei denn, es ist blockiert oder zerstört. In this world, going to bed won't skip the night, but it will skip thunderstorms.=In dieser Welt können mit dem Bett Nächte nicht übersprungen werden, nur Gewitterstürme. Sleeping allows you to skip the night. The night is skipped when all players in this world went to sleep. The night is skipped after sleeping for a few seconds. Thunderstorms can be skipped in the same manner.=Mit Schlaf können Sie die Nacht überspringen. Die Nacht wird übersprungen, wenn alle Spieler in dieser Welt sich schlafen gelegt haben. Die Nacht wird dann nach ein paar Sekunden übersprungen. Gewitterstürme werden auf die gleiche Weise übersprungen. +Bed=Bett Red Bed=Rotes Bett Blue Bed=Blaues Bett Cyan Bed=Türkises Bett diff --git a/mods/ITEMS/mcl_beds/locale/template.txt b/mods/ITEMS/mcl_beds/locale/template.txt index 0cba8424..9664c800 100644 --- a/mods/ITEMS/mcl_beds/locale/template.txt +++ b/mods/ITEMS/mcl_beds/locale/template.txt @@ -5,6 +5,7 @@ You have heard of other worlds in which a bed would set the start point for your By using a bed, you set the starting point for your next life. If you die, you will start your next life at this bed, unless it is obstructed or destroyed.= In this world, going to bed won't skip the night, but it will skip thunderstorms.= Sleeping allows you to skip the night. The night is skipped when all players in this world went to sleep. The night is skipped after sleeping for a few seconds. Thunderstorms can be skipped in the same manner.= +Bed= Red Bed= Blue Bed= Cyan Bed=