xdecor - crash avoiting: Added further sanity check and update formspecs
* update xdecir minenux up to 20230611 * backporting https://notabug.org/minenux/minetest-mod-xdecor/commit/3e0ca1304d454297739d6f8> * backporting https://github.com/0siribix/xdecor/commit/c7e756afc7d246817209c415c6e9a9dda533> * backporting https://github.com/0siribix/xdecor/commit/3823fce1e05a9472e7cf798c8346ba95ead1> * backporting https://notabug.org/minenux/minetest-mod-xdecor/commit/9f4002b749920a6aa906ce7>
This commit is contained in:
parent
dab09dfd32
commit
13a6891758
@ -33,7 +33,7 @@ Most of those mods have mirror at http://git.mirror.org
|
||||
| walls | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/c7cb79422ba19c696966472942db6177c934838d | |
|
||||
| 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/c7cb79422ba19c696966472942db6177c934838d | |
|
||||
| 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 provides sethome and player_api call ones, binoculars from v5 are
|
||||
just separate privilegies for zoom, butterflies and fireflies from v5 can be set
|
||||
|
@ -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")
|
||||
|
@ -108,6 +108,7 @@ 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()
|
||||
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)
|
||||
|
||||
@ -123,6 +124,8 @@ function enchanting.fields(pos, _, fields, sender)
|
||||
inv:set_stack("mese", 1, mese)
|
||||
inv:set_stack("tool", 1, tool)
|
||||
end
|
||||
enchanting.formspec(pos)
|
||||
end
|
||||
end
|
||||
|
||||
function enchanting.dig(pos)
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user