Add Help entry aliases for many core items

This commit is contained in:
Wuzzy 2017-03-20 18:12:05 +01:00
parent b6426df676
commit b1b45274e4
40 changed files with 169 additions and 16 deletions

View File

@ -3,3 +3,4 @@ mcl_sounds
bucket
mcl_farming
mcl_mobitems
doc?

View File

@ -99,6 +99,10 @@ local register_slice = function(level, nodebox, desc)
_mcl_blast_resistance = 2.5,
_mcl_hardness = 5,
})
if minetest.get_modpath("doc") then
doc.add_entry_alias("nodes", "mcl_cake:cake", "nodes", "mcl_cake:cake_"..level)
end
end
register_slice(6, slice_6, "Cake (6 Slices Left")

View File

@ -1 +1,2 @@
mcl_sounds
doc?

View File

@ -87,6 +87,11 @@ local register_filled_cauldron = function(water_level, description)
_mcl_hardness = 2,
_mcl_blast_resistance = 10,
})
-- Add entry aliases for the Help
if minetest.get_modpath("doc") then
doc.add_entry_alias("nodes", "mcl_cauldrons:cauldron", "nodes", "mcl_cauldrons:cauldron_"..water_level)
end
end
-- Filled crauldrons (3 levels)

View File

@ -3,3 +3,4 @@ mcl_core
mcl_sounds
mcl_end
mesecons
doc?

View File

@ -254,6 +254,12 @@ minetest.register_node("mcl_chests:"..basename.."_right", {
end,
mesecons = mesecons,
})
if minetest.get_modpath("doc") then
doc.add_entry_alias("nodes", "mcl_chests:"..basename, "nodes", "mcl_chests:"..basename.."_left")
doc.add_entry_alias("nodes", "mcl_chests:"..basename, "nodes", "mcl_chests:"..basename.."_right")
end
end
register_chest("chest",

View File

@ -1,2 +1,3 @@
mcl_core
mesecons
doc?

View File

@ -6,6 +6,9 @@
mcl_clock = {}
-- This is the itemstring of the default clock item. It is used for the default inventory image, help entries, and the like
mcl_clock.stereotype = "mcl_clock:clock"
local watch = {}
watch.old_time = -1
@ -26,21 +29,26 @@ function watch.get_clock_frame()
return tostring(t)
end
local doc_mod = minetest.get_modpath("doc") ~= nil
-- Register items
function watch.register_item(name, image, creative)
local g = 1
if creative then
g = 0
end
local doc = name == "mcl_clock:clock"
local use_doc = name == mcl_clock.stereotype
if doc_mod and not use_doc then
doc.add_entry_alias("craftitems", mcl_clock.stereotype, "craftitems", name)
end
local longdesc, usagehelp
if doc then
if use_doc then
longdesc = "Clocks are tools which shows the current time of day in the Overworld."
usagehelp = "The clock contains a rotating disc with a sun symbol (yellow disc) and moon symbol and a little “pointer” which shows the current time of day by estimating the real position of the sun and the moon in the sky. Noon is represented by the sun symbol and midnight is represented by the moon symbol."
end
minetest.register_craftitem(name, {
description = "Clock",
_doc_items_create_entry = doc,
_doc_items_create_entry = use_doc,
_doc_items_longdesc = longdesc,
_doc_items_usagehelp = usagehelp,
inventory_image = image,
@ -69,7 +77,7 @@ minetest.register_globalstep(function(dtime)
for p, player in ipairs(players) do
for s, stack in ipairs(player:get_inventory():get_list("main")) do
local count = stack:get_count()
if stack:get_name() == "mcl_clock:clock" then
if stack:get_name() == mcl_clock.stereotype then
player:get_inventory():set_stack("main", s, "mcl_clock:clock_"..now.." "..count)
elseif string.sub(stack:get_name(), 1, 16) == "mcl_clock:clock_" then
player:get_inventory():set_stack("main", s, "mcl_clock:clock_"..now.." "..count)
@ -80,14 +88,14 @@ end)
-- Immediately set correct clock time after crafting
minetest.register_on_craft(function(itemstack)
if itemstack:get_name() == "mcl_clock:clock" then
if itemstack:get_name() == mcl_clock.stereotype then
itemstack:set_name("mcl_clock:clock_"..watch.get_clock_frame())
end
end)
-- Clock recipe
minetest.register_craft({
output = 'mcl_clock:clock',
output = mcl_clock.stereotype,
recipe = {
{'', 'mcl_core:gold_ingot', ''},
{'mcl_core:gold_ingot', 'mesecons:redstone', 'mcl_core:gold_ingot'},
@ -96,7 +104,7 @@ minetest.register_craft({
})
-- Clock tool
watch.register_item("mcl_clock:clock", watch.images[1], true)
watch.register_item(mcl_clock.stereotype, watch.images[1], true)
-- Faces
for a=0,63,1 do
@ -109,4 +117,3 @@ for a=0,63,1 do
watch.register_item("mcl_clock:clock_"..tostring(a), watch.images[b+1], false)
end
mcl_clock.stereotype = "mcl_clock:clock"

View File

@ -1,2 +1,3 @@
mcl_sounds
mcl_core
doc?

View File

@ -241,3 +241,8 @@ minetest.register_abm({
end
} )
-- Add entry aliases for the Help
if minetest.get_modpath("doc") then
doc.add_entry_alias("nodes", "mcl_cocoas:cocoa_1", "nodes", "mcl_cocoas:cocoa_2")
end

View File

@ -1,2 +1,3 @@
mcl_core
mesecons
doc?

View File

@ -49,20 +49,23 @@ for frame=0,31 do
table.insert(images, "mcl_compass_compass.png^[verticalframe:32:"..frame)
end
local doc_mod = minetest.get_modpath("doc") ~= nil
local stereotype_frame = 18
for i,img in ipairs(images) do
local inv = 1
if i == stereotype_frame then
inv = 0
end
local doc, longdesc, usagehelp
doc = i == stereotype_frame
if doc then
local use_doc, longdesc, usagehelp
use_doc = i == stereotype_frame
if use_doc then
longdesc = "Compasses are tools which point to the world origin (X=0, Z=0) or the spawn point in the Overworld."
end
minetest.register_craftitem("mcl_compass:"..(i-1), {
local itemstring = "mcl_compass:"..(i-1)
minetest.register_craftitem(itemstring, {
description = "Compass",
_doc_items_create_entry = doc,
_doc_items_create_entry = use_doc,
_doc_items_longdesc = longdesc,
_doc_items_usagehelp = usagehelp,
inventory_image = img,
@ -70,6 +73,11 @@ for i,img in ipairs(images) do
stack_max = 64,
groups = {not_in_creative_inventory=inv, compass=i, tool=1}
})
-- Help aliases. Makes sure the lookup tool works correctly
if not use_doc and doc_mod then
doc.add_entry_alias("craftitems", "mcl_compass:"..(stereotype_frame-1), "craftitems", itemstring)
end
end
minetest.register_craft({

View File

@ -2,3 +2,4 @@ mcl_init
mcl_sounds
mcl_util
doc_items
doc?

View File

@ -1772,14 +1772,14 @@ for i=0,3 do
end
end
end
local doc = i == 0
local use_doc = i == 0
local longdesc
if doc then
if use_doc then
longdesc = "Frosted ice is a short-lived solid translucent block. It melts into a water source within a few seconds."
end
minetest.register_node("mcl_core:frosted_ice_"..i, {
description = "Frosted Ice",
_doc_items_create_entry = doc,
_doc_items_create_entry = use_doc,
_doc_items_longdesc = longdesc,
drawtype = "glasslike",
tiles = {"default_frosted_ice_"..i..".png"},
@ -1810,6 +1810,11 @@ for i=0,3 do
_mcl_blast_resistance = 2.5,
_mcl_hardness = 0.5,
})
-- Add entry aliases for the Help
if minetest.get_modpath("doc") and i > 0 then
doc.add_entry_alias("nodes", "mcl_core:frosted_ice_0", "nodes", "mcl_core:frosted_ice_"..i)
end
end
minetest.register_node("mcl_core:snow", {

View File

@ -1,2 +1,3 @@
mcl_core
mcl_sounds
doc?

View File

@ -364,6 +364,14 @@ function mcl_doors:register_door(name, def)
can_dig = check_player_priv,
})
-- Add entry aliases for the Help
if minetest.get_modpath("doc") then
doc.add_entry_alias("craftitems", name, "nodes", name.."_b_1")
doc.add_entry_alias("craftitems", name, "nodes", name.."_b_2")
doc.add_entry_alias("craftitems", name, "nodes", name.."_t_1")
doc.add_entry_alias("craftitems", name, "nodes", name.."_t_2")
end
end
local wood_longdesc = "Wooden doors are 2-block high barriers which can be opened or closed by hand and by a redstone signal."
@ -671,6 +679,9 @@ function mcl_doors:register_trapdoor(name, def)
}},
})
if minetest.get_modpath("doc") then
doc.add_entry_alias("nodes", name, "nodes", name.."_open")
end
end

View File

@ -1,2 +1,3 @@
mcl_core
mcl_sounds
doc?

View File

@ -223,6 +223,10 @@ mcl_fences.register_fence_gate = function(id, fence_gate_name, texture, groups,
_mcl_hardness = hardness,
})
if minetest.get_modpath("doc") then
doc.add_entry_alias("nodes", gate_id, "nodes", open_gate_id)
end
return gate_id, open_gate_id
end

View File

@ -2,3 +2,4 @@ mcl_core
mcl_sounds
mcl_farming
mcl_flowers
doc?

View File

@ -122,6 +122,10 @@ minetest.register_node("mcl_flowerpots:flower_pot_"..flower, {
}
},
})
-- Add entry alias for the Help
if minetest.get_modpath("doc") then
doc.add_entry_alias("nodes", "mcl_flowerpots:flower_pot", "nodes", "mcl_flowerpots:flower_pot_"..flower)
end
end
for _, row in ipairs(cubes) do
@ -159,5 +163,12 @@ minetest.register_node("mcl_flowerpots:flower_pot_"..flower, {
{ items = { "mcl_flowerpots:flower_pot", flower_node } }
}
},
})
-- Add entry alias for the Help
if minetest.get_modpath("doc") then
doc.add_entry_alias("nodes", "mcl_flowerpots:flower_pot", "nodes", "mcl_flowerpots:flower_pot_"..flower)
end
end

View File

@ -1,2 +1,3 @@
mcl_core
mcl_sounds
doc?

View File

@ -183,6 +183,11 @@ local function add_large_plant(name, desc, longdesc, bottom_img, top_img, inv_im
groups = {dig_immediate=3,flammable=2,flower=1, dig_by_water=1, not_in_creative_inventory = 1, double_plant=2},
sounds = mcl_sounds.node_sound_leaves_defaults(),
})
if minetest.get_modpath("doc") then
doc.add_entry_alias("nodes", "mcl_flowers:"..name, "nodes", "mcl_flowers:"..name.."_top")
end
end
add_large_plant("peony", "Peony", "A peony is a large plant which occupies two blocks. It is mainly used in dye protection.", "mcl_flowers_double_plant_paeonia_bottom.png", "mcl_flowers_double_plant_paeonia_top.png")

View File

@ -3,3 +3,4 @@ mcl_core
mcl_sounds
mcl_craftguide
mcl_achievements
doc?

View File

@ -374,3 +374,9 @@ minetest.register_craft({
{ "mcl_core:cobble", "mcl_core:cobble", "mcl_core:cobble" },
}
})
-- Add entry alias for the Help
if minetest.get_modpath("doc") then
doc.add_entry_alias("nodes", "mcl_furnaces:furnace", "nodes", "mcl_furnaces:furnace_active")
end

View File

@ -1,2 +1,3 @@
mcl_core
mcl_sounds
doc?

View File

@ -357,5 +357,10 @@ minetest.register_craft({
}
})
-- Add entry aliases for the Help
if minetest.get_modpath("doc") then
doc.add_entry_alias("nodes", "mcl_hoppers:hopper", "nodes", "mcl_hoppers:hopper_side")
end
-- Legacy
minetest.register_alias("mcl_hoppers:hopper_item", "mcl_hoppers:hopper")

View File

@ -1 +1,2 @@
mcl_sounds
doc?

View File

@ -76,6 +76,16 @@ local register_mushroom = function(color, template, d_cap_top, d_cap_side, d_cap
cap_side.tiles = { "mcl_mushrooms_mushroom_block_skin_"..color..".png", "mcl_mushrooms_mushroom_block_inside.png", "mcl_mushrooms_mushroom_block_inside.png", "mcl_mushrooms_mushroom_block_inside.png", "mcl_mushrooms_mushroom_block_inside.png", "mcl_mushrooms_mushroom_block_skin_"..color..".png" }
minetest.register_node("mcl_mushrooms:"..color.."_mushroom_block_cap_side", cap_side)
-- Add entry aliases for the Help
if minetest.get_modpath("doc") then
doc.add_entry_alias("nodes", "mcl_mushrooms:"..color.."_mushroom_block_pores_full", "nodes", "mcl_mushrooms:"..color.."_mushroom_block_cap_full")
doc.add_entry_alias("nodes", "mcl_mushrooms:"..color.."_mushroom_block_stem_full", "nodes", "mcl_mushrooms:"..color.."_mushroom_block_cap_full")
doc.add_entry_alias("nodes", "mcl_mushrooms:"..color.."_mushroom_block_stem", "nodes", "mcl_mushrooms:"..color.."_mushroom_block_cap_full")
doc.add_entry_alias("nodes", "mcl_mushrooms:"..color.."_mushroom_block_cap_corner", "nodes", "mcl_mushrooms:"..color.."_mushroom_block_cap_full")
doc.add_entry_alias("nodes", "mcl_mushrooms:"..color.."_mushroom_block_cap_top", "nodes", "mcl_mushrooms:"..color.."_mushroom_block_cap_full")
doc.add_entry_alias("nodes", "mcl_mushrooms:"..color.."_mushroom_block_cap_side", "nodes", "mcl_mushrooms:"..color.."_mushroom_block_cap_full")
end
end
local longdesc_red = "Huge red mushroom blocks are the plant parts of huge red mushrooms. This includes caps, pores and stems of huge red mushrooms; and these blocks come in some variants."

View File

@ -1,2 +1,3 @@
mcl_core
mcl_achievements
doc?

View File

@ -197,3 +197,12 @@ minetest.register_craft({
recipe = "mcl_throwing:bow",
burntime = 15,
})
-- Add entry aliases for the Help
if minetest.get_modpath("doc") then
doc.add_entry_alias("tools", "mcl_throwing:bow", "tools", "mcl_throwing:bow_0")
doc.add_entry_alias("tools", "mcl_throwing:bow", "tools", "mcl_throwing:bow_1")
doc.add_entry_alias("tools", "mcl_throwing:bow", "tools", "mcl_throwing:bow_2")
end

View File

@ -1,2 +1,3 @@
mcl_core
mcl_sounds
doc?

View File

@ -156,6 +156,13 @@ mcl_torches.register_torch = function(substring, description, doc_items_longdesc
end
end
minetest.register_node(itemstring_wall, walldef)
-- Add entry alias for the Help
if minetest.get_modpath("doc") then
doc.add_entry_alias("nodes", itemstring, "nodes", itemstring_wall)
end
end
mcl_torches.register_torch("torch",

View File

@ -1,2 +1,3 @@
mcl_core
mcl_sounds
doc?

View File

@ -156,6 +156,11 @@ function mcl_walls.register_wall(nodename, description, craft_material, tiles, i
_mcl_blast_resistance = 30,
_mcl_hardness = 2,
})
-- Add entry alias for the Help
if minetest.get_modpath("doc") then
doc.add_entry_alias("nodes", nodename, "nodes", nodename.."_"..i)
end
end
minetest.register_node(nodename.."_16", {
@ -177,6 +182,10 @@ function mcl_walls.register_wall(nodename, description, craft_material, tiles, i
_mcl_blast_resistance = 30,
_mcl_hardness = 2,
})
-- Add entry alias for the Help
if minetest.get_modpath("doc") then
doc.add_entry_alias("nodes", nodename, "nodes", nodename.."_16")
end
minetest.register_node(nodename.."_21", {
drawtype = "nodebox",
@ -197,6 +206,10 @@ function mcl_walls.register_wall(nodename, description, craft_material, tiles, i
_mcl_blast_resistance = 30,
_mcl_hardness = 2,
})
-- Add entry alias for the Help
if minetest.get_modpath("doc") then
doc.add_entry_alias("nodes", nodename, "nodes", nodename.."_21")
end
-- Inventory item
minetest.register_node(nodename, {

View File

@ -1,2 +1,3 @@
mcl_core
stairs
doc?

View File

@ -642,6 +642,11 @@ function mcstair.add(name, stairtiles)
after_dig_node = function(pos, oldnode) after_dig_node(pos, oldnode) end,
_mcl_hardness = node_def._mcl_hardness,
})
if minetest.get_modpath("doc") then
doc.add_entry_alias("nodes", name, "nodes", name.."_inner")
doc.add_entry_alias("nodes", name, "nodes", name.."_outer")
end
end
for _,v in ipairs({

View File

@ -1,2 +1,3 @@
mcl_sounds
mcl_core
doc?

View File

@ -345,3 +345,6 @@ minetest.register_craft({
}
})
if minetest.get_modpath("doc") then
doc.add_entry_alias("nodes", "signs:sign_wall", "nodes", "signs:sign_yard")
end

View File

@ -1,2 +1,3 @@
mcl_sounds
mcl_core
doc?

View File

@ -160,6 +160,10 @@ function xpanes.register_pane(name, def)
output = "xpanes:" .. name .. "_flat 16",
recipe = def.recipe
})
if minetest.get_modpath("doc") then
doc.add_entry_alias("nodes", "xpanes:" .. name .. "_flat", "nodes", "xpanes:" .. name)
end
end
local pane = function(description, node, append)