diff --git a/mods/README.md b/mods/README.md index a4e9398..15d2aa9 100644 --- a/mods/README.md +++ b/mods/README.md @@ -41,7 +41,7 @@ For information check [../README.md](../README.md) | weather | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | | | wool | https://codeberg.org/minenux/minetest-mod-wool | https://codeberg.org/minenux/minetest-mod-wool/commit/de642a08e80bfd7a4a1e5629e50458a609dbda3a | [wool/README.md](wool/README.md) | | xpanes | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 | | -| xdecor | https://codeberg.org/minenux/minetest-game-xdecor | https://codeberg.org/minenux/minetest-game-xdecor/commit/f6d0f0b2a5c1d435217bb3409a76da9eb36fe889 | [xdecor/README.md](xdecor/README.md) | +| xdecor | https://codeberg.org/minenux/minetest-game-xdecor | https://codeberg.org/minenux/minetest-game-xdecor/commit/cd0c35b8c58153f7c353b5dbfac35e524fa0ea18 | [xdecor/README.md](xdecor/README.md) | The default mod was splitted now sethome and player_api are mods, binoculars from v5 are just separate privilegies for zoom, butterflies and fireflies from v5 can be set diff --git a/mods/xdecor/init.lua b/mods/xdecor/init.lua index b2c333d..f41b9ce 100644 --- a/mods/xdecor/init.lua +++ b/mods/xdecor/init.lua @@ -2,6 +2,7 @@ xdecor = {} local modpath = minetest.get_modpath("xdecor") +local ar_api = minetest.get_modpath("3d_armor") -- Intllib local S @@ -27,7 +28,7 @@ else end xdecor.S = S -xdecor.reparaible_tools = {"pick", "axe", "shovel", "sword"} +xdecor.reparaible_tools = {"pick", "axe", "shovel", "hoe"} dofile(modpath .. "/handlers/animations.lua") dofile(modpath .. "/handlers/helpers.lua") diff --git a/mods/xdecor/src/enchanting.lua b/mods/xdecor/src/enchanting.lua index 5a76ce8..8323357 100644 --- a/mods/xdecor/src/enchanting.lua +++ b/mods/xdecor/src/enchanting.lua @@ -108,20 +108,23 @@ function enchanting.fields(pos, _, fields, sender) local tool = inv:get_stack("tool", 1) local mese = inv:get_stack("mese", 1) local orig_wear = tool:get_wear() - local mod, name = tool:get_name():match("(.*):(.*)") - local enchanted_tool = (mod or "") .. ":enchanted_" .. (name or "") .. "_" .. next(fields) + if tool and tool:get_name() and allowed_tools[tool:get_name()] then + local mod, name = tool:get_name():match("(.*):(.*)") + local enchanted_tool = (mod or "") .. ":enchanted_" .. (name or "") .. "_" .. next(fields) - if mese:get_count() >= mese_cost and reg_tools[enchanted_tool] then - minetest.sound_play("xdecor_enchanting", { - to_player = sender:get_player_name(), - gain = 0.8 - }) + if mese:get_count() >= mese_cost and reg_tools[enchanted_tool] then + minetest.sound_play("xdecor_enchanting", { + to_player = sender:get_player_name(), + gain = 0.8 + }) - tool:replace(enchanted_tool) - tool:add_wear(orig_wear) - mese:take_item(mese_cost) - inv:set_stack("mese", 1, mese) - inv:set_stack("tool", 1, tool) + tool:replace(enchanted_tool) + tool:add_wear(orig_wear) + mese:take_item(mese_cost) + inv:set_stack("mese", 1, mese) + inv:set_stack("tool", 1, tool) + end + enchanting.formspec(pos) end end diff --git a/mods/xdecor/src/workbench.lua b/mods/xdecor/src/workbench.lua index bc12333..3da902d 100644 --- a/mods/xdecor/src/workbench.lua +++ b/mods/xdecor/src/workbench.lua @@ -46,6 +46,18 @@ end function workbench:repairable(stack) if custom_repairable[stack] then return true end + if ar_api then + for _, t in ipairs({ + "armor_head", + "armor_torso", + "armor_legs", + "armor_feet", + "armor_shield", + }) do + if minetest.get_item_group(stack, t) then return true end + end + end + for _, t in ipairs(repairable_tools) do if stack:find(t) then return true