From b5e30c432d1432b5ace1fce7a55e265e051cacef Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Tue, 31 Jan 2017 19:26:51 -0700 Subject: [PATCH] Add documentation for vines too --- doc.lua | 7 +++++++ functions.lua | 7 +++++++ shear.lua | 2 ++ vines.lua | 10 ++++++++++ 4 files changed, 26 insertions(+) diff --git a/doc.lua b/doc.lua index fb7fa10..378f640 100644 --- a/doc.lua +++ b/doc.lua @@ -4,6 +4,13 @@ if not minetest.get_modpath("doc") then return end +vines.doc.vines_longdesc = "Sinuous plants that grows on other plants for support." +vines.doc.roots_longdesc = "Plant structures that provide structural support and draw nutrients from the soil." +vines.doc.vines_usage = "These grow over time. When harvested with shears they provide useful crafting materials." + +vines.doc.shears_longdesc = "A tool for harvesting vines." +vines.doc.shears_usage = "Using shears to dig vines will give vine materials useful for crafting. Other tools lack the necessary finesse. Shears can also sever hanging ropes." + vines.doc.ropesegment_longdesc = "Rope segments are bundles of fibre twisted into robust cables." vines.doc.ropesegment_usage = "This craft item is useful for creating rope ladders, or for spooling on wooden spindles to hang and climb upon." diff --git a/functions.lua b/functions.lua index 966990f..1050a47 100644 --- a/functions.lua +++ b/functions.lua @@ -25,6 +25,8 @@ vines.register_vine = function( name, defs, biome ) minetest.register_node( vine_name_end, { description = defs.description, + _doc_items_longdesc = defs._doc_items_longdesc, + _doc_items_usagehelp = defs._doc_items_usagehelp, walkable = false, climbable = true, wield_image = vine_image_end, @@ -63,6 +65,7 @@ vines.register_vine = function( name, defs, biome ) minetest.register_node( vine_name_middle, { description = "Matured "..defs.description, + _doc_items_create_entry = false, walkable = false, climbable = true, drop = "", @@ -90,6 +93,10 @@ vines.register_vine = function( name, defs, biome ) end }) + if minetest.get_modpath("doc") then + doc.add_entry_alias("nodes", vine_name_end, "nodes", vine_name_middle) + end + biome_lib:spawn_on_surfaces( biome ) local override_nodes = function( nodes, defs ) diff --git a/shear.lua b/shear.lua index f947b84..15d3ba8 100644 --- a/shear.lua +++ b/shear.lua @@ -2,6 +2,8 @@ local USES = 200 minetest.register_tool("vines:shears", { description = "Shears", + _doc_items_longdesc = vines.doc.shears_longdesc, + _doc_items_usagehelp = vines.doc.shears_usage, inventory_image = "vines_shears.png", wield_image = "vines_shears.png", stack_max = 1, diff --git a/vines.lua b/vines.lua index 6b116b7..8450cdd 100644 --- a/vines.lua +++ b/vines.lua @@ -1,5 +1,7 @@ vines.register_vine( 'root', { description = "Roots", + _doc_items_longdesc = vines.doc.roots_longdesc, + _doc_items_usagehelp = vines.doc.vines_usage, average_length = 9, },{ choose_random_wall = true, @@ -18,6 +20,8 @@ vines.register_vine( 'root', { vines.register_vine( 'vine', { description = "Vines", + _doc_items_longdesc = vines.doc.vines_longdesc, + _doc_items_usagehelp = vines.doc.vines_usage, average_length = 5, },{ choose_random_wall = true, @@ -39,6 +43,8 @@ vines.register_vine( 'vine', { vines.register_vine( 'side', { description = "Vines", + _doc_items_longdesc = vines.doc.vines_longdesc, + _doc_items_usagehelp = vines.doc.vines_usage, average_length = 6, },{ choose_random_wall = true, @@ -61,6 +67,8 @@ vines.register_vine( 'side', { vines.register_vine( "jungle", { description = "Jungle Vines", + _doc_items_longdesc = vines.doc.vines_longdesc, + _doc_items_usagehelp = vines.doc.vines_usage, average_length = 7, },{ choose_random_wall = true, @@ -88,6 +96,8 @@ vines.register_vine( "jungle", { vines.register_vine( 'willow', { description = "Willow Vines", + _doc_items_longdesc = vines.doc.vines_longdesc, + _doc_items_usagehelp = vines.doc.vines_usage, average_length = 9, },{ choose_random_wall = true,