From bafae00bede8be2744900bd79908c716560a0423 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 6 Jan 2017 01:50:15 +0100 Subject: [PATCH] Move tool break sound to default --- mods/default/README.txt | 4 ++++ .../sounds/default_tool_break.ogg} | Bin mods/intweak/README.txt | 7 +----- mods/intweak/init.lua | 21 ------------------ 4 files changed, 5 insertions(+), 27 deletions(-) rename mods/{intweak/sounds/intweak_tool_break.ogg => default/sounds/default_tool_break.ogg} (100%) diff --git a/mods/default/README.txt b/mods/default/README.txt index a53d4be90..6c361e8d4 100644 --- a/mods/default/README.txt +++ b/mods/default/README.txt @@ -17,6 +17,8 @@ License of media (sounds) Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) http://creativecommons.org/licenses/by-sa/3.0/ + default_tool_break.ogg by EdgardEdition (CC BY 3.0), http://www.freesound.org/people/EdgardEdition + Authors of media files ----------------------- MirceaKitsune (WTFPL): @@ -61,3 +63,5 @@ Mito551 (sounds) (CC BY-SA): default_dirt_footstep.1.ogg default_dirt_footstep.2.ogg default_glass_footstep.ogg + + diff --git a/mods/intweak/sounds/intweak_tool_break.ogg b/mods/default/sounds/default_tool_break.ogg similarity index 100% rename from mods/intweak/sounds/intweak_tool_break.ogg rename to mods/default/sounds/default_tool_break.ogg diff --git a/mods/intweak/README.txt b/mods/intweak/README.txt index 85afdcea4..92412935b 100644 --- a/mods/intweak/README.txt +++ b/mods/intweak/README.txt @@ -12,11 +12,6 @@ and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more details. -License of sounds: ------------------- -intweak_break_tool.ogg by EdgardEdition (CC BY 3.0), http://www.freesound.org/people/EdgardEdition - - --USING the mod-- ------------------ @@ -26,4 +21,4 @@ that is played when a tool breakes after the specific number of uses. The second new function is Auto-refill. This function replaces broken tools or emptied stacks with others from your inventory. -You can disable the auto-refill by changing first line of init.lua to "local auto_refill = false" \ No newline at end of file +You can disable the auto-refill by changing first line of init.lua to "local auto_refill = false" diff --git a/mods/intweak/init.lua b/mods/intweak/init.lua index 236db288d..54a6ba53d 100644 --- a/mods/intweak/init.lua +++ b/mods/intweak/init.lua @@ -22,24 +22,3 @@ if auto_refill == true then end) end -local typ = "" -local tname = "" -minetest.register_on_punchnode(function(pos, node, puncher) - if not puncher then return end - tname = puncher:get_wielded_item():get_name() - typ = minetest.registered_items[tname].type - if typ == "tool" and puncher:get_wielded_item():get_wear() == 65535 then - minetest.sound_play("intweak_tool_break", {gain = 1.5, max_hear_distance = 5}) - if auto_refill == true then minetest.after(0.01, refill, puncher, tname, puncher:get_wield_index()) end - end -end) - -minetest.register_on_dignode(function(pos, oldnode, digger) - if not digger then return end - local num = digger:get_wielded_item():get_wear() - local index = digger:get_wield_index() - if num == 0 and typ == "tool" then - minetest.sound_play("intweak_tool_break", {gain = 1.5, max_hear_distance = 5}) - if auto_refill == true then minetest.after(0.01, refill, digger, tname, index) end - end -end) \ No newline at end of file