diff options
author | TenPlus1 <kinsellaja@yahoo.com> | 2016-04-01 11:02:18 +0100 |
---|---|---|
committer | TenPlus1 <kinsellaja@yahoo.com> | 2016-04-01 11:02:18 +0100 |
commit | 2a6212020815e53540e0df28946e09a81546ff2b (patch) | |
tree | dc3ea6bcf5e4304eea4ad31df0bafd2f725cca0b /init.lua | |
parent | a084ab464eb332ca8c11b475cb625fbb8dc30d88 (diff) |
Play sound when planting crops
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -1,5 +1,5 @@ --[[ - Minetest Farming Redo Mod 1.22 (10th March 2016) + Minetest Farming Redo Mod 1.22 (31st March 2016) by TenPlus1 NEW growing routine by prestidigitator auto-refill by crabman77 @@ -567,7 +567,7 @@ function farming.place_seed(itemstack, placer, pointed_thing, plantname) -- can I replace above node, and am I pointing at soil if not minetest.registered_nodes[above.name].buildable_to - or minetest.get_item_group(under.name, "soil") < 2 + or minetest.get_item_group(under.name, "soil") < 2 -- avoid multiple seed placement bug or minetest.get_item_group(above.name, "plant") ~= 0 then return @@ -578,6 +578,8 @@ function farming.place_seed(itemstack, placer, pointed_thing, plantname) minetest.set_node(pt.above, {name = plantname, param2 = 1}) + minetest.sound_play("default_place_node", {gain = 1.0}) + if not minetest.setting_getbool("creative_mode") then itemstack:take_item() @@ -636,7 +638,7 @@ farming.register_plant = function(name, def) on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, mname .. ":"..pname.."_1") - end + end, }) -- Register harvest |