Skip to content

Commit

Permalink
Fix screwdriver
Browse files Browse the repository at this point in the history
  • Loading branch information
weqqr authored and alek13 committed Feb 27, 2022
1 parent dc8180c commit 1b65c84
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 33 deletions.
10 changes: 7 additions & 3 deletions mods/lord/_overwrites/MTG/screwdriver/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

-- у нас свои отвертки в `lord/lord_screwdriver`
minetest.clear_craft({output = "screwdriver:screwdriver"})
minetest.unregister_item("screwdriver:screwdriver")

-- для совместимости с другими модами
minetest.register_alias("screwdriver:screwdriver", "lord_screwdriver:screwdriver")
minetest.register_craft({
output = "screwdriver:screwdriver",
recipe = {
{"default:steel_ingot", ""},
{"", "group:stick"}
}
})
36 changes: 6 additions & 30 deletions mods/lord/lord_screwdriver/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,8 @@
-- Load support for MT game translation.
local S = minetest.get_translator("lord_screwdriver")

-- Standard Screwdriver based on MTG
minetest.register_tool("lord_screwdriver:screwdriver", {
description = S("Screwdriver") .. "\n" .. S("(left-click rotates face, right-click rotates axis)"),
inventory_image = "screwdriver.png",
groups = {tool = 1},
on_use = function(itemstack, user, pointed_thing)
screwdriver.handler(itemstack, user, pointed_thing, screwdriver.ROTATE_FACE, 200)
return itemstack
end,
on_place = function(itemstack, user, pointed_thing)
screwdriver.handler(itemstack, user, pointed_thing, screwdriver.ROTATE_AXIS, 200)
return itemstack
end,
})

-- Galvorn Screwdriver
minetest.register_tool("lord_screwdriver:screwdriver_galvorn", {
minetest.register_tool(":screwdriver:screwdriver_galvorn", {
description = S("Galvorn Screwdriver") .. "\n" .. S("(left-click rotates face, right-click rotates axis)"),
inventory_image = "screwdriver_galvorn.png",
groups = {tool = 1, galvorn_item = 1},
Expand All @@ -33,19 +18,10 @@ minetest.register_tool("lord_screwdriver:screwdriver_galvorn", {
end,
})


minetest.register_craft({
output = "lord_screwdriver:screwdriver",
recipe = {
{"default:steel_ingot", ""},
{"", "group:stick"}
}
})

minetest.register_craft({
output = "lord_screwdriver:screwdriver_galvorn",
recipe = {
{"lottores:galvorn_ingot", ""},
{"", "group:stick"}
}
output = "screwdriver:screwdriver_galvorn",
recipe = {
{"lottores:galvorn_ingot", ""},
{"", "group:stick"}
}
})

0 comments on commit 1b65c84

Please sign in to comment.