From 767d7cbc3e6cf27a69af0ac1a57de0ef4fca1058 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 21 Mar 2017 04:56:16 +0100 Subject: [PATCH] Add Help aliases for premature farming plants --- mods/ITEMS/mcl_farming/beetroot.lua | 6 ++++++ mods/ITEMS/mcl_farming/carrots.lua | 6 ++++++ mods/ITEMS/mcl_farming/depends.txt | 1 + mods/ITEMS/mcl_farming/melon.lua | 6 +++++- mods/ITEMS/mcl_farming/potatoes.lua | 4 ++++ mods/ITEMS/mcl_farming/pumpkin.lua | 6 ++++++ mods/ITEMS/mcl_farming/shared_functions.lua | 4 ++++ mods/ITEMS/mcl_farming/wheat.lua | 5 +++++ 8 files changed, 37 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_farming/beetroot.lua b/mods/ITEMS/mcl_farming/beetroot.lua index 38081e07f..6030ec8f6 100644 --- a/mods/ITEMS/mcl_farming/beetroot.lua +++ b/mods/ITEMS/mcl_farming/beetroot.lua @@ -140,3 +140,9 @@ minetest.register_craft({ }) mcl_farming:add_plant("mcl_farming:beetroot", {"mcl_farming:beetroot_0", "mcl_farming:beetroot_1", "mcl_farming:beetroot_2"}, 68, 3) + +if minetest.get_modpath("doc") then + for i=1,2 do + doc.add_entry_alias("nodes", "mcl_farming:beetroot_0", "nodes", "mcl_farming:beetroot_"..i) + end +end diff --git a/mods/ITEMS/mcl_farming/carrots.lua b/mods/ITEMS/mcl_farming/carrots.lua index 91a99bfea..1aba1ec10 100644 --- a/mods/ITEMS/mcl_farming/carrots.lua +++ b/mods/ITEMS/mcl_farming/carrots.lua @@ -125,3 +125,9 @@ minetest.register_craft({ }) mcl_farming:add_plant("mcl_farming:carrot", {"mcl_farming:carrot_1", "mcl_farming:carrot_2", "mcl_farming:carrot_3"}, 50, 20) + +if minetest.get_modpath("doc") then + for i=2,3 do + doc.add_entry_alias("nodes", "mcl_farming:carrot_1", "nodes", "mcl_farming:carrot_"..i) + end +end diff --git a/mods/ITEMS/mcl_farming/depends.txt b/mods/ITEMS/mcl_farming/depends.txt index 262714295..9fb1f89ab 100644 --- a/mods/ITEMS/mcl_farming/depends.txt +++ b/mods/ITEMS/mcl_farming/depends.txt @@ -3,3 +3,4 @@ mcl_sounds bucket mcl_wool mcl_torches +doc? diff --git a/mods/ITEMS/mcl_farming/melon.lua b/mods/ITEMS/mcl_farming/melon.lua index be14b8b16..1a9a9faf8 100644 --- a/mods/ITEMS/mcl_farming/melon.lua +++ b/mods/ITEMS/mcl_farming/melon.lua @@ -130,4 +130,8 @@ minetest.register_craft({ } }) - +if minetest.get_modpath("doc") then + for i=2,8 do + doc.add_entry_alias("nodes", "mcl_farming:melontige_1", "nodes", "mcl_farming:melontige_"..i) + end +end diff --git a/mods/ITEMS/mcl_farming/potatoes.lua b/mods/ITEMS/mcl_farming/potatoes.lua index 2c846c84e..4486dba4a 100644 --- a/mods/ITEMS/mcl_farming/potatoes.lua +++ b/mods/ITEMS/mcl_farming/potatoes.lua @@ -115,3 +115,7 @@ minetest.register_craft({ }) mcl_farming:add_plant("mcl_farming:potato", {"mcl_farming:potato_1", "mcl_farming:potato_2"}, 50, 20) + +if minetest.get_modpath("doc") then + doc.add_entry_alias("nodes", "mcl_farming:potato_1", "nodes", "mcl_farming:potato_2") +end diff --git a/mods/ITEMS/mcl_farming/pumpkin.lua b/mods/ITEMS/mcl_farming/pumpkin.lua index 4e89d49de..26eb214b2 100644 --- a/mods/ITEMS/mcl_farming/pumpkin.lua +++ b/mods/ITEMS/mcl_farming/pumpkin.lua @@ -138,3 +138,9 @@ minetest.register_craft({ output = "mcl_farming:pumpkin_pie", recipe = {"mcl_farming:pumpkin_face", "mcl_core:sugar", "mcl_throwing:egg"}, }) + +if minetest.get_modpath("doc") then + for i=2,8 do + doc.add_entry_alias("nodes", "mcl_farming:pumpkin_1", "nodes", "mcl_farming:pumpkin_"..i) + end +end diff --git a/mods/ITEMS/mcl_farming/shared_functions.lua b/mods/ITEMS/mcl_farming/shared_functions.lua index a143d9612..2e90f5fb6 100644 --- a/mods/ITEMS/mcl_farming/shared_functions.lua +++ b/mods/ITEMS/mcl_farming/shared_functions.lua @@ -262,6 +262,10 @@ function mcl_farming:add_gourd(full_unconnected_stem, connected_stem_basename, s sounds = mcl_sounds.node_sound_leaves_defaults(), _mcl_blast_resistance = 0, }) + + if minetest.get_modpath("doc") then + doc.add_entry_alias("nodes", full_unconnected_stem, "nodes", connected_stem_names[i]) + end end minetest.register_abm({ diff --git a/mods/ITEMS/mcl_farming/wheat.lua b/mods/ITEMS/mcl_farming/wheat.lua index 7309a87ba..e04a5a666 100644 --- a/mods/ITEMS/mcl_farming/wheat.lua +++ b/mods/ITEMS/mcl_farming/wheat.lua @@ -189,3 +189,8 @@ minetest.register_craft({ } }) +if minetest.get_modpath("doc") then + for i=2,3 do + doc.add_entry_alias("nodes", "mcl_farming:wheat_1", "nodes", "mcl_farming:wheat_"..i) + end +end