From 1649c5347194d7b1a1d3e43ae1197458d28cac47 Mon Sep 17 00:00:00 2001 From: sys4 Date: Sun, 26 Nov 2017 06:39:15 +0100 Subject: [PATCH] Add toolranks mod and add its support for Golden and Nyan tools --- .gitmodules | 3 +++ mods/nalc/depends.txt | 1 + mods/nalc/nyancat.lua | 25 +++++++++++++++++++++++++ mods/nalc/tools.lua | 26 ++++++++++++++++++++++++++ mods/toolranks | 1 + worlds/minetestforfun/world.mt | 1 + 6 files changed, 57 insertions(+) create mode 160000 mods/toolranks diff --git a/.gitmodules b/.gitmodules index f664db7d..351fe0b8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -140,3 +140,6 @@ path = mods/weather_pack url = https://github.com/sys4-fr/weather_pack.git branch = nalc +[submodule "mods/toolranks"] + path = mods/toolranks + url = https://github.com/lisacvuk/minetest-toolranks.git diff --git a/mods/nalc/depends.txt b/mods/nalc/depends.txt index 979bc530..e7b07d0f 100644 --- a/mods/nalc/depends.txt +++ b/mods/nalc/depends.txt @@ -14,3 +14,4 @@ nyancat? moreores? moreblocks? carts? +toolranks? diff --git a/mods/nalc/nyancat.lua b/mods/nalc/nyancat.lua index a37909a3..88ac89ac 100644 --- a/mods/nalc/nyancat.lua +++ b/mods/nalc/nyancat.lua @@ -124,3 +124,28 @@ minetest.register_alias("default:pick_nyan", "nalc:pick_nyan") minetest.register_alias("default:axe_nyan", "nalc:axe_nyan") minetest.register_alias("default:shovel_nyan", "nalc:shovel_nyan") minetest.register_alias("default:sword_nyan", "nalc:sword_nyan") + +-- Toolranks +if minetest.get_modpath("toolranks") then + minetest.override_item( + "nalc:pick_nyan", + { + original_description = "Nyan Pickaxe", + description = toolranks.create_description("Nyan Pickaxe", 0, 1), + after_use = toolranks.new_afteruse + }) + minetest.override_item( + "nalc:axe_nyan", + { + original_description = "Nyan Axe", + description = toolranks.create_description("Nyan Axe", 0, 1), + after_use = toolranks.new_afteruse + }) + minetest.override_item( + "nalc:shovel_nya", + { + original_description = "Nyan Shovel", + description = toolranks.create_description("Nyan Shovel", 0, 1), + after_use = toolranks.new_afteruse + }) +end diff --git a/mods/nalc/tools.lua b/mods/nalc/tools.lua index c97e494c..da928e56 100644 --- a/mods/nalc/tools.lua +++ b/mods/nalc/tools.lua @@ -75,3 +75,29 @@ minetest.register_tool( damage_groups = {fleshy = 10}, } }) + +-- Toolranks +if minetest.get_modpath("toolranks") then + + minetest.override_item( + "nalc:pick_gold", + { + original_description = "Golden Pickaxe", + description = toolranks.create_description("Golden Pickaxe", 0, 1), + after_use = toolranks.new_afteruse + }) + minetest.override_item( + "nalc:axe_gold", + { + original_description = "Golden Axe", + description = toolranks.create_description("Golden Axe", 0, 1), + after_use = toolranks.new_afteruse + }) + minetest.override_item( + "nalc:shovel_gold", + { + original_description = "Golden Shovel", + description = toolranks.create_description("Golden Shovel", 0, 1), + after_use = toolranks.new_afteruse + }) +end diff --git a/mods/toolranks b/mods/toolranks new file mode 160000 index 00000000..3f94d76e --- /dev/null +++ b/mods/toolranks @@ -0,0 +1 @@ +Subproject commit 3f94d76e53608cf7cc0a48faf9a0cccbb74a1eb3 diff --git a/worlds/minetestforfun/world.mt b/worlds/minetestforfun/world.mt index 20e68f6f..e80a8877 100644 --- a/worlds/minetestforfun/world.mt +++ b/worlds/minetestforfun/world.mt @@ -283,5 +283,6 @@ load_mod_claycrafter = true load_mod_weather_pack = true load_mod_nyancat = true load_mod_cherry_tree = true +load_mod_toolranks = true player_backend = files