Skip to content

Commit

Permalink
add toolranks support to shears and battleaxe
Browse files Browse the repository at this point in the history
  • Loading branch information
OgelGames committed Dec 12, 2021
1 parent eea43a7 commit 8f099ed
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@ read_globals = {
"advtrains",
"letters", "player_monoids",
"pipeworks", "planetoidgen",
"xban", "beerchat", "drawers"
"xban", "beerchat", "drawers",
"toolranks",
}
7 changes: 6 additions & 1 deletion init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions mod.conf
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ stamina,
technic,
technic_cnc,
telemosaic,
toolranks,
travelnet,
unified_inventory,
vacuum,
vines,
xp_redo
"""
23 changes: 23 additions & 0 deletions toolranks.lua
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8f099ed

Please sign in to comment.