Update tools.lua

adding toolranls optional
This commit is contained in:
Diablosxm 2023-05-20 01:06:25 -04:00 committed by GitHub
parent f0e825f542
commit 86af687576
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -18,9 +18,11 @@
]]--
local S = nether.get_translator
local toolranks_loaded = minetest.get_modpath("toolranks")
local pickaxe_desc = S("Nether Pickaxe\nWell suited for mining netherrack")
minetest.register_tool("nether:pick_nether", {
description = S("Nether Pickaxe\nWell suited for mining netherrack"),
description = toolranks_loaded and toolranks.create_description(pickaxe_desc) or pickaxe_desc,
_doc_items_longdesc = S("Uniquely suited for mining netherrack, with minimal wear when doing so. Blunts quickly on other materials."),
inventory_image = "nether_tool_netherpick.png",
tool_capabilities = {
@ -34,7 +36,9 @@ minetest.register_tool("nether:pick_nether", {
sound = {breaks = "default_tool_breaks"},
groups = {pickaxe = 1},
after_use = function(itemstack, user, node, digparams)
original_description = toolranks_loaded and pickaxe_desc or nil,
after_use = toolranks_loaded and toolranks.new_afteruse or nil,
function(itemstack, user, node, digparams)
local wearDivisor = 1
local nodeDef = minetest.registered_nodes[node.name]
if nodeDef ~= nil and nodeDef.groups ~= nil then