]> git.lizzy.rs Git - mcl_enchanting.git/commitdiff
Import changes from xdecor
authorkilbith <jeanpatrick.guerrero@gmail.com>
Sun, 17 Apr 2016 09:56:00 +0000 (11:56 +0200)
committerkilbith <jeanpatrick.guerrero@gmail.com>
Sun, 17 Apr 2016 09:56:00 +0000 (11:56 +0200)
LICENSE
init.lua
sounds/xdecor_enchanting.ogg [new file with mode: 0644]

diff --git a/LICENSE b/LICENSE
index 46696106b874bc65065f08b1a08068ca1e748b7b..c36855e0cb2ed853d8dc71a345d4590837479ac6 100644 (file)
--- 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/                  |
 +----------------------------------------------------------------------+
 
 
index 4b13ad675bf817657c0f93830f2657c38c74ddd2..086c457fd14bcea87343b3cfbd311e8152124358 100644 (file)
--- 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 (file)
index 0000000..882e9ee
Binary files /dev/null and b/sounds/xdecor_enchanting.ogg differ