diff --git a/LICENSE b/LICENSE index 4669610..c36855e 100644 --- a/LICENSE +++ b/LICENSE @@ -3,6 +3,9 @@ | | | Code: GPL version 3 | | Textures: WTFPL (credits: Gambit) | +| Sounds: | +| - xdecor_enchanting.ogg - by Timbre - CC BY-SA-NC | +| freesound.org/people/Timbre/sounds/221683/ | +----------------------------------------------------------------------+ diff --git a/init.lua b/init.lua index 4b13ad6..086c457 100644 --- a/init.lua +++ b/init.lua @@ -58,7 +58,7 @@ function enchanting.on_put(pos, listname, _, stack) end end -function enchanting.fields(pos, _, fields) +function enchanting.fields(pos, _, fields, sender) if fields.quit then return end local inv = minetest.get_meta(pos):get_inventory() local tool = inv:get_stack("tool", 1) @@ -68,6 +68,7 @@ function enchanting.fields(pos, _, fields) local enchanted_tool = (mod or "")..":enchanted_"..(name or "").."_"..next(fields) if mese:get_count() >= mese_cost and minetest.registered_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) @@ -209,7 +210,7 @@ function enchanting:register_tools(mod, def) for material in def.materials:gmatch("[%w_]+") do for enchant in def.tools[tool].enchants:gmatch("[%w_]+") do local original_tool = minetest.registered_tools[mod..":"..tool.."_"..material] - if not original_tool then return end + if not original_tool then break end if original_tool.tool_capabilities then local original_damage_groups = original_tool.tool_capabilities.damage_groups diff --git a/sounds/xdecor_enchanting.ogg b/sounds/xdecor_enchanting.ogg new file mode 100644 index 0000000..882e9ee Binary files /dev/null and b/sounds/xdecor_enchanting.ogg differ