Play sound when planting crops

This commit is contained in:
TenPlus1 2016-04-01 11:02:18 +01:00
parent a084ab464e
commit 2a62120208
3 changed files with 11 additions and 5 deletions

View File

@ -19,7 +19,9 @@ minetest.register_craftitem("farming:beans", {
local nodename = minetest.get_node(pointed_thing.under).name
if nodename == "farming:beanpole" then
minetest.set_node(pointed_thing.under, {name="farming:beanpole_1"})
minetest.set_node(pointed_thing.under, {name = "farming:beanpole_1"})
minetest.sound_play("default_place_node", {gain = 1.0})
else
return
end

View File

@ -14,7 +14,9 @@ minetest.register_craftitem("farming:grapes", {
local nodename = minetest.get_node(pointed_thing.under).name
if nodename == "farming:trellis" then
minetest.set_node(pointed_thing.under, {name="farming:grapes_1"})
minetest.set_node(pointed_thing.under, {name = "farming:grapes_1"})
minetest.sound_play("default_place_node", {gain = 1.0})
else
return
end

View File

@ -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
@ -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