local mese = inv:get_stack("mese", 1)
local orig_wear = tool:get_wear()
local mod, name = tool:get_name():match("(.*):(.*)")
- local enchanted_tool = mod..":enchanted_"..name.."_"..next(fields)
+ local enchanted_tool = (mod or "")..":enchanted_"..(name or "").."_"..next(fields)
if mese:get_count() >= mese_cost and minetest.registered_tools[enchanted_tool] then
tool:replace(enchanted_tool)
xdecor.register("enchantment_table", {
description = "Enchantment Table",
- tiles = {
- "xdecor_enchantment_top.png", "xdecor_enchantment_bottom.png",
- "xdecor_enchantment_side.png", "xdecor_enchantment_side.png",
- "xdecor_enchantment_side.png", "xdecor_enchantment_side.png"
- },
+ tiles = {"xdecor_enchantment_top.png", "xdecor_enchantment_bottom.png",
+ "xdecor_enchantment_side.png", "xdecor_enchantment_side.png",
+ "xdecor_enchantment_side.png", "xdecor_enchantment_side.png"},
groups = {cracky=1, oddly_breakable_by_hand=1, level=1},
sounds = default.node_sound_stone_defaults(),
on_rotate = screwdriver.rotate_simple,