#1 Add toolranks support.

Open
lazerbeak12345 wants to merge 1 commits from lazerbeak12345/add_toolranks into Piezo_/master
2 changed files with 12 additions and 1 deletions
  1. 2 1
      depends.txt
  2. 10 0
      init.lua

+ 2 - 1
depends.txt

@@ -1,3 +1,4 @@
 default
 farming?
-3d_armor?
+3d_armor?
+toolranks?

+ 10 - 0
init.lua

@@ -381,6 +381,13 @@ instant_ores.register_toolset = function(mod, name, desc, color, level, ingredie
 		}	
 	})
 
+	if minetest.get_modpath("toolranks") then
+		toolranks.add_tool(mod..":pick_"..name)
+		toolranks.add_tool(mod..":shovel_"..name)
+		toolranks.add_tool(mod..":axe_"..name)
+		toolranks.add_tool(mod..":sword_"..name)
+	end
+
 	if farming then
 		farming.register_hoe(mod..":hoe_"..name, {
 			description = desc.." Hoe",
@@ -390,6 +397,9 @@ instant_ores.register_toolset = function(mod, name, desc, color, level, ingredie
 			groups = {hoe=1},
 			after_use = afteruse,
 		})
+		if minetest.get_modpath("toolranks") then
+			toolranks.add_tool(mod..":hoe_"..name)
+		end
 	end
 
 end