add toolranks support to shears and battleaxe

fixes https://github.com/pandorabox-io/in-game/issues/228
This commit is contained in:
OgelGames 2021-12-13 01:54:54 +11:00
parent eea43a7833
commit 8f099edee0
4 changed files with 33 additions and 2 deletions

View File

@ -38,5 +38,6 @@ read_globals = {
"advtrains",
"letters", "player_monoids",
"pipeworks", "planetoidgen",
"xban", "beerchat", "drawers"
"xban", "beerchat", "drawers",
"toolranks",
}

View File

@ -219,4 +219,9 @@ end
if minetest.get_modpath("drawers") then
dofile(MP.."/chat/drawers_fix.lua")
end
end
-- extra toolranks support
if minetest.get_modpath("toolranks") then
dofile(MP.."/toolranks.lua")
end

View File

@ -46,8 +46,10 @@ stamina,
technic,
technic_cnc,
telemosaic,
toolranks,
travelnet,
unified_inventory,
vacuum,
vines,
xp_redo
"""

23
toolranks.lua Normal file
View File

@ -0,0 +1,23 @@
-- Battleaxe
if minetest.get_modpath("castle_weapons") then
local desc = minetest.registered_tools["castle_weapons:battleaxe"].description
minetest.override_item("castle_weapons:battleaxe", {
description = toolranks.create_description(desc, 0, 1),
original_description = desc,
after_use = toolranks.new_afteruse
})
end
-- Vine shears
if minetest.get_modpath("vines") then
local desc = minetest.registered_tools["vines:shears"].description
minetest.override_item("vines:shears", {
description = toolranks.create_description(desc, 0, 1),
original_description = desc,
after_use = toolranks.new_afteruse
})
end