]> git.lizzy.rs Git - xdecor.git/blobdiff - enchanting.lua
Convert cauldrons ABM to nodetimers
[xdecor.git] / enchanting.lua
index 16e0eae67b6b2e5cc8a3a310af2c6c6a2b56f220..38c8a6cd3403db72123c77cf159756949404fa7a 100644 (file)
@@ -83,7 +83,7 @@ function enchanting.fields(pos, _, fields)
        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)
@@ -132,11 +132,9 @@ end
 
 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,