Add default leaf sounds to all the crops.

Only melon blocks have a different sound at this point.
This commit is contained in:
Auke Kok 2015-04-12 18:56:52 -07:00
parent 6b0ff22e53
commit 5f9a5d7835
3 changed files with 15 additions and 0 deletions

View File

@ -27,6 +27,7 @@ minetest.register_node("crops:corn", {
paramtype = "light",
groups = { snappy=3,flammable=3,flora=1,attached_node=1 },
drop = {},
sounds = default.node_sound_leaves_defaults(),
on_place = function(itemstack, placer, pointed_thing)
local under = minetest.get_node(pointed_thing.under)
@ -76,6 +77,7 @@ minetest.register_node("crops:corn_base_seed", {
paramtype = "light",
groups = { snappy=3,flammable=3,flora=1,attached_node=1,not_in_creative_inventory=1 },
drop = {},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -0.3, 0.5}
@ -107,6 +109,7 @@ minetest.register_node("crops:corn_base_1", {
paramtype = "light",
groups = { snappy=3,flammable=3,flora=1,attached_node=1,not_in_creative_inventory=1 },
drop = {},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_abm({
@ -138,6 +141,7 @@ minetest.register_node("crops:corn_base_2", {
paramtype = "light",
groups = { snappy=3,flammable=3,flora=1,attached_node=1,not_in_creative_inventory=1 },
drop = {},
sounds = default.node_sound_leaves_defaults(),
on_dig = function(pos, node, digger)
local above = {x = pos.x, y = pos.y + 1, z = pos.z}
if minetest.get_node(above).name == "crops:corn_top_1" or minetest.get_node(above).name == "crops:corn_top_2" then
@ -171,6 +175,7 @@ minetest.register_node("crops:corn_base_3", {
paramtype = "light",
groups = { snappy=3,flammable=3,flora=1,attached_node=1,not_in_creative_inventory=1 },
drop = {},
sounds = default.node_sound_leaves_defaults(),
on_dig = function(pos, node, digger)
local above = {x = pos.x, y = pos.y + 1, z = pos.z}
if minetest.get_node(above).name == "crops:corn_top_4" then
@ -192,6 +197,7 @@ minetest.register_node("crops:corn_top_1", {
paramtype = "light",
groups = { snappy=3,flammable=3,flora=1,not_in_creative_inventory=1 },
drop = {},
sounds = default.node_sound_leaves_defaults(),
on_dig = function(pos, node, digger)
local below = {x = pos.x, y = pos.y - 1, z = pos.z}
if not minetest.get_node(below).name == "crops:base_2" then
@ -227,6 +233,7 @@ minetest.register_node("crops:corn_top_2", {
paramtype = "light",
groups = { snappy=3,flammable=3,flora=1,not_in_creative_inventory=1 },
drop = {},
sounds = default.node_sound_leaves_defaults(),
on_dig = function(pos, node, digger)
local below = {x = pos.x, y = pos.y - 1, z = pos.z}
if not minetest.get_node(below).name == "crops:base_2" then
@ -262,6 +269,7 @@ minetest.register_node("crops:corn_top_3", {
paramtype = "light",
groups = { snappy=3,flammable=3,flora=1,not_in_creative_inventory=1 },
drop = {},
sounds = default.node_sound_leaves_defaults(),
on_dig = function(pos, node, digger)
local drops = {}
for i = 1,math.random(2,4) do
@ -285,6 +293,7 @@ minetest.register_node("crops:corn_top_4", {
paramtype = "light",
groups = { snappy=3,flammable=3,flora=1,not_in_creative_inventory=1 },
drop = {},
sounds = default.node_sound_leaves_defaults(),
on_dig = function(pos, node, digger)
local below = {x = pos.x, y = pos.y - 1, z = pos.z}
if minetest.get_node(below).name == "crops:corn_base_3" then

View File

@ -56,6 +56,7 @@ minetest.register_node("crops:melon_plant_" .. stage , {
paramtype = "light",
groups = { snappy=3, flammable=3, flora=1, attached_node=1, not_in_creative_inventory=1 },
drop = "crops:melon_seed",
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -0.5 + (((math.min(stage, 4)) + 1) / 5), 0.5}
@ -76,6 +77,7 @@ minetest.register_node("crops:melon_plant_5_attached", {
paramtype = "light",
groups = { snappy=3, flammable=3, flora=1, attached_node=1, not_in_creative_inventory=1 },
drop = "crops:melon_seed",
sounds = default.node_sound_leaves_defaults(),
})

View File

@ -25,6 +25,7 @@ minetest.register_node("crops:tomato_seed", {
paramtype = "light",
groups = { snappy=3,flammable=3,flora=1,attached_node=1 },
drop = {},
sounds = default.node_sound_leaves_defaults(),
on_place = function(itemstack, placer, pointed_thing)
local under = minetest.get_node(pointed_thing.under)
@ -50,6 +51,7 @@ minetest.register_node("crops:tomato_plant_" .. stage , {
paramtype = "light",
groups = { snappy=3, flammable=3, flora=1, attached_node=1, not_in_creative_inventory=1 },
drop = {},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -0.5 + (((math.min(stage, 4)) + 1) / 5), 0.5}
@ -67,6 +69,7 @@ minetest.register_node("crops:tomato_plant_5" , {
paramtype = "light",
groups = { snappy=3, flammable=3, flora=1, attached_node=1, not_in_creative_inventory=1 },
drop = {},
sounds = default.node_sound_leaves_defaults(),
on_dig = function(pos, node, digger)
local drops = {}
for i = 1, math.random(1, 2) do
@ -96,6 +99,7 @@ minetest.register_node("crops:tomato_plant_6", {
paramtype = "light",
groups = { snappy=3, flammable=3, flora=1, attached_node=1, not_in_creative_inventory=1 },
drop = {},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_craftitem("crops:tomato", {