1
0
Fork 0

Squash help entries of beds

This commit is contained in:
Wuzzy 2019-03-24 09:06:35 +01:00
parent 8636b94c74
commit 423d5f8ab8
5 changed files with 22 additions and 0 deletions

View File

@ -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",

View File

@ -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

View File

@ -6,3 +6,4 @@ mcl_dye?
mcl_tnt?
mcl_weather?
mcl_spawn?
doc?

View File

@ -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

View File

@ -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=