properly detect and use sounds from default/mcl

This commit is contained in:
tenplus1 2024-08-11 08:47:26 +01:00
parent a74a29c849
commit cdac09a8f4
44 changed files with 119 additions and 91 deletions

21
api.txt
View File

@ -70,3 +70,24 @@ A handy function that starts a crops timer with a randomly selected time set by
stage_length setting. This is mostly used for special functions or 3rd party mods. stage_length setting. This is mostly used for special functions or 3rd party mods.
farming.start_seed_timer(pos) farming.start_seed_timer(pos)
Node Sounds
-----------
Farming Redo will detect wether the Default mod or MineClone/VoxeLibre mod is active and
store whichever sound set is available inside the following to save any other farming
mods from having to detect it themselves:
farming.node_sound_defaults()
farming.node_sound_stone_defaults()
farming.node_sound_dirt_defaults()
farming.node_sound_sand_defaults()
farming.node_sound_gravel_defaults()
farming.node_sound_wood_defaults()
farming.node_sound_leaves_defaults()
farming.node_sound_ice_defaults()
farming.node_sound_metal_defaults()
farming.node_sound_water_defaults()
farming.node_sound_snow_defaults()
farming.node_sound_glass_defaults()

View File

@ -41,7 +41,7 @@ else
}, },
is_ground_content = false, is_ground_content = false,
on_use = minetest.item_eat(2), on_use = minetest.item_eat(2),
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
}) })
farming.add_eatable("ethereal:banana", 2) farming.add_eatable("ethereal:banana", 2)
@ -55,7 +55,7 @@ else
waving = 1, waving = 1,
groups = {snappy = 3, leafdecay = 3, leaves = 1, flammable = 2}, groups = {snappy = 3, leafdecay = 3, leaves = 1, flammable = 2},
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
}) })
alias("farming_plus:banana_sapling", "default:sapling") alias("farming_plus:banana_sapling", "default:sapling")
@ -105,7 +105,7 @@ else
}, },
is_ground_content = false, is_ground_content = false,
on_use = minetest.item_eat(4), on_use = minetest.item_eat(4),
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
}) })
farming.add_eatable("ethereal:orange", 4) farming.add_eatable("ethereal:orange", 4)

View File

@ -33,7 +33,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -35,7 +35,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -65,7 +65,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -102,7 +102,7 @@ minetest.register_node("farming:beanpole", {
selection_box = farming.select, selection_box = farming.select,
groups = {handy = 1, snappy = 3, flammable = 2, attached_node = 1}, groups = {handy = 1, snappy = 3, flammable = 2, attached_node = 1},
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults(), sounds = farming.node_sound_leaves_defaults(),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
@ -195,7 +195,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1
@ -259,7 +259,7 @@ minetest.register_node("farming:beanbush", {
compostability = 35, not_in_creative_inventory = 1 compostability = 35, not_in_creative_inventory = 1
}, },
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
}) })
-- mapgen -- mapgen

View File

@ -56,7 +56,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -32,7 +32,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -76,7 +76,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -32,7 +32,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -75,7 +75,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }

View File

@ -75,7 +75,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -130,7 +130,7 @@ minetest.register_node("farming:chocolate_block", {
tiles = {"farming_chocolate_block.png"}, tiles = {"farming_chocolate_block.png"},
is_ground_content = false, is_ground_content = false,
groups = {cracky = 2, oddly_breakable_by_hand = 2}, groups = {cracky = 2, oddly_breakable_by_hand = 2},
sounds = farming.sounds.node_sound_stone_defaults() sounds = farming.node_sound_stone_defaults()
}) })
minetest.register_craft({ minetest.register_craft({
@ -164,7 +164,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults(), sounds = farming.node_sound_leaves_defaults(),
-- custom function to check for growing conditions, returning True when found -- custom function to check for growing conditions, returning True when found
growth_check = function(pos, node_name) growth_check = function(pos, node_name)

View File

@ -28,7 +28,7 @@ minetest.register_node("farming:coffee_cup", {
groups = {vessel = 1, dig_immediate = 3, attached_node = 1, drink = 1}, groups = {vessel = 1, dig_immediate = 3, attached_node = 1, drink = 1},
is_ground_content = false, is_ground_content = false,
on_use = minetest.item_eat(2, "vessels:drinking_glass"), on_use = minetest.item_eat(2, "vessels:drinking_glass"),
sounds = farming.sounds.node_sound_glass_defaults() sounds = farming.node_sound_glass_defaults()
}) })
farming.add_eatable("farming:coffee_cup", 2) farming.add_eatable("farming:coffee_cup", 2)
@ -64,7 +64,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -94,7 +94,7 @@ minetest.register_node("farming:bottle_ethanol", {
fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
}, },
groups = {vessel = 1, dig_immediate = 3, attached_node = 1}, groups = {vessel = 1, dig_immediate = 3, attached_node = 1},
sounds = farming.sounds.node_sound_glass_defaults() sounds = farming.node_sound_glass_defaults()
}) })
minetest.register_craft( { minetest.register_craft( {
@ -130,7 +130,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -25,7 +25,7 @@ minetest.register_node("farming:cotton_wild", {
{items = {"farming:seed_cotton"}, rarity = 1} {items = {"farming:seed_cotton"}, rarity = 1}
} }
}, },
sounds = farming.sounds.node_sound_leaves_defaults(), sounds = farming.node_sound_leaves_defaults(),
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {-6 / 16, -8 / 16, -6 / 16, 6 / 16, 5 / 16, 6 / 16} fixed = {-6 / 16, -8 / 16, -6 / 16, 6 / 16, 5 / 16, 6 / 16}
@ -124,7 +124,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -36,7 +36,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -34,7 +34,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -54,7 +54,7 @@ minetest.register_node("farming:garlic_braid", {
}, },
groups = {vessel = 1, dig_immediate = 3, flammable = 3, compostability = 65}, groups = {vessel = 1, dig_immediate = 3, flammable = 3, compostability = 65},
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults(), sounds = farming.node_sound_leaves_defaults(),
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
@ -97,7 +97,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -33,7 +33,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -99,7 +99,7 @@ minetest.register_node("farming:trellis", {
selection_box = farming.select, selection_box = farming.select,
groups = {handy = 1, snappy = 3, flammable = 2, attached_node = 1}, groups = {handy = 1, snappy = 3, flammable = 2, attached_node = 1},
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults(), sounds = farming.node_sound_leaves_defaults(),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
@ -192,7 +192,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1
@ -268,7 +268,7 @@ minetest.register_node("farming:grapebush", {
not_in_creative_inventory = 1, compostability = 35 not_in_creative_inventory = 1, compostability = 35
}, },
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
}) })
-- mapgen -- mapgen

View File

@ -54,7 +54,7 @@ minetest.register_node("farming:hemp_oil", {
food_oil = 1, vessel = 1, dig_immediate = 3, attached_node = 1, food_oil = 1, vessel = 1, dig_immediate = 3, attached_node = 1,
compostability = 45 compostability = 45
}, },
sounds = farming.sounds.node_sound_glass_defaults() sounds = farming.node_sound_glass_defaults()
}) })
minetest.register_craft( { minetest.register_craft( {
@ -121,7 +121,7 @@ minetest.register_node("farming:hemp_block", {
compostability = 85 compostability = 85
}, },
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults(), sounds = farming.node_sound_leaves_defaults(),
_mcl_hardness = 0.8, _mcl_hardness = 0.8,
_mcl_blast_resistance = 1 _mcl_blast_resistance = 1
}) })
@ -144,7 +144,7 @@ if minetest.global_exists("stairs") then
{snappy = 2, oddly_breakable_by_hand = 1, flammable = 2}, {snappy = 2, oddly_breakable_by_hand = 1, flammable = 2},
{"farming_hemp_block.png"}, {"farming_hemp_block.png"},
"Hemp Block", "Hemp Block",
farming.sounds.node_sound_leaves_defaults()) farming.node_sound_leaves_defaults())
else else
stairs.register_stair_and_slab("hemp_block", "farming:hemp_block", stairs.register_stair_and_slab("hemp_block", "farming:hemp_block",
@ -152,7 +152,7 @@ if minetest.global_exists("stairs") then
{"farming_hemp_block.png"}, {"farming_hemp_block.png"},
"Hemp Block Stair", "Hemp Block Stair",
"Hemp Block Slab", "Hemp Block Slab",
farming.sounds.node_sound_leaves_defaults()) farming.node_sound_leaves_defaults())
end end
end end
@ -190,7 +190,7 @@ minetest.register_node("farming:hemp_rope", {
oddly_breakable_by_hand = 3, compostability = 55 oddly_breakable_by_hand = 3, compostability = 55
}, },
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults(), sounds = farming.node_sound_leaves_defaults(),
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7} fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7}
@ -226,7 +226,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -31,7 +31,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -47,7 +47,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1
@ -91,7 +91,7 @@ minetest.register_node("farming:melon_8", {
}, },
is_ground_content = false, is_ground_content = false,
drop = "farming:melon_8", drop = "farming:melon_8",
sounds = farming.sounds.node_sound_wood_defaults(), sounds = farming.node_sound_wood_defaults(),
paramtype2 = "facedir", paramtype2 = "facedir",
on_place = minetest.rotate_node, on_place = minetest.rotate_node,
_mcl_hardness = 0.8, _mcl_hardness = 0.8,

View File

@ -73,7 +73,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -69,7 +69,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -33,7 +33,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -59,7 +59,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -67,7 +67,7 @@ minetest.register_node("farming:pepper_ground", {
dig_immediate = 3, attached_node = 1, compostability = 30 dig_immediate = 3, attached_node = 1, compostability = 30
}, },
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_defaults(), sounds = farming.node_sound_defaults(),
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
@ -103,7 +103,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -102,7 +102,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -79,7 +79,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -48,7 +48,7 @@ minetest.register_node("farming:jackolantern", {
handy = 1, snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2 handy = 1, snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2
}, },
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_wood_defaults(), sounds = farming.node_sound_wood_defaults(),
on_punch = function(pos, node, puncher) on_punch = function(pos, node, puncher)
local name = puncher:get_player_name() or "" local name = puncher:get_player_name() or ""
if minetest.is_protected(pos, name) then return end if minetest.is_protected(pos, name) then return end
@ -75,7 +75,7 @@ minetest.register_node("farming:jackolantern_on", {
not_in_creative_inventory = 1 not_in_creative_inventory = 1
}, },
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_wood_defaults(), sounds = farming.node_sound_wood_defaults(),
drop = "farming:jackolantern", drop = "farming:jackolantern",
on_punch = function(pos, node, puncher) on_punch = function(pos, node, puncher)
local name = puncher:get_player_name() or "" local name = puncher:get_player_name() or ""
@ -171,7 +171,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1
@ -215,7 +215,7 @@ minetest.register_node("farming:pumpkin_8", {
}, },
is_ground_content = false, is_ground_content = false,
drop = "farming:pumpkin_8", drop = "farming:pumpkin_8",
sounds = farming.sounds.node_sound_wood_defaults(), sounds = farming.node_sound_wood_defaults(),
paramtype2 = "facedir", paramtype2 = "facedir",
on_place = minetest.rotate_node, on_place = minetest.rotate_node,
_mcl_hardness = 0.8, _mcl_hardness = 0.8,

View File

@ -53,7 +53,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -54,7 +54,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults(), sounds = farming.node_sound_leaves_defaults(),
minlight = 10, minlight = 10,
maxlight = 12 maxlight = 12
} }

View File

@ -95,7 +95,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -33,7 +33,7 @@ minetest.register_node("farming:soy_sauce", {
compostability = 65 compostability = 65
}, },
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_glass_defaults() sounds = farming.node_sound_glass_defaults()
}) })
-- soy sauce recipe -- soy sauce recipe
@ -68,7 +68,7 @@ minetest.register_node("farming:soy_milk", {
attached_node = 1, drink = 1, compostability = 65 attached_node = 1, drink = 1, compostability = 65
}, },
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_glass_defaults() sounds = farming.node_sound_glass_defaults()
}) })
farming.add_eatable("farming:soy_milk", 2) farming.add_eatable("farming:soy_milk", 2)
@ -143,7 +143,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -33,7 +33,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -36,7 +36,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
--stage 1 --stage 1

View File

@ -80,7 +80,7 @@ minetest.register_node("farming:sunflower_oil", {
food_oil = 1, vessel = 1, dig_immediate = 3, attached_node = 1, food_oil = 1, vessel = 1, dig_immediate = 3, attached_node = 1,
flammable = 2, compostability = 65 flammable = 2, compostability = 65
}, },
sounds = farming.sounds.node_sound_glass_defaults() sounds = farming.node_sound_glass_defaults()
}) })
minetest.register_craft( { minetest.register_craft( {
@ -137,7 +137,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -55,7 +55,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -34,7 +34,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- vanilla extract -- vanilla extract
@ -52,7 +52,7 @@ minetest.register_node("farming:vanilla_extract", {
fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
}, },
groups = {vessel = 1, dig_immediate = 3, attached_node = 1}, groups = {vessel = 1, dig_immediate = 3, attached_node = 1},
sounds = farming.sounds.node_sound_glass_defaults(), sounds = farming.node_sound_glass_defaults(),
}) })
minetest.register_craft( { minetest.register_craft( {

View File

@ -41,7 +41,7 @@ minetest.register_node("farming:straw", {
tiles = {"farming_straw.png"}, tiles = {"farming_straw.png"},
is_ground_content = false, is_ground_content = false,
groups = {handy = 1, snappy = 3, flammable = 4, fall_damage_add_percent = -30}, groups = {handy = 1, snappy = 3, flammable = 4, fall_damage_add_percent = -30},
sounds = farming.sounds.node_sound_leaves_defaults(), sounds = farming.node_sound_leaves_defaults(),
_mcl_hardness = 0.8, _mcl_hardness = 0.8,
_mcl_blast_resistance = 1 _mcl_blast_resistance = 1
}) })
@ -69,7 +69,7 @@ if minetest.global_exists("stairs") then
{snappy = 3, flammable = 4}, {snappy = 3, flammable = 4},
{"farming_straw.png"}, {"farming_straw.png"},
"Straw", "Straw",
farming.sounds.node_sound_leaves_defaults()) farming.node_sound_leaves_defaults())
else else
stairs.register_stair_and_slab("straw", "farming:straw", stairs.register_stair_and_slab("straw", "farming:straw",
@ -77,7 +77,7 @@ if minetest.global_exists("stairs") then
{"farming_straw.png"}, {"farming_straw.png"},
"Straw Stair", "Straw Stair",
"Straw Slab", "Straw Slab",
farming.sounds.node_sound_leaves_defaults()) farming.node_sound_leaves_defaults())
end end
end end
@ -133,7 +133,7 @@ local def = {
}, },
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults() sounds = farming.node_sound_leaves_defaults()
} }
-- stage 1 -- stage 1

View File

@ -144,7 +144,7 @@ minetest.register_node("farming:sugar_cube", {
groups = {shovely = 1, handy = 1, crumbly = 2}, groups = {shovely = 1, handy = 1, crumbly = 2},
is_ground_content = false, is_ground_content = false,
floodable = true, floodable = true,
sounds = farming.sounds.node_sound_gravel_defaults(), sounds = farming.node_sound_gravel_defaults(),
_mcl_hardness = 0.8, _mcl_hardness = 0.8,
_mcl_blast_resistance = 1 _mcl_blast_resistance = 1
}) })
@ -190,7 +190,7 @@ minetest.register_node("farming:salt", {
tiles = {"farming_salt.png"}, tiles = {"farming_salt.png"},
groups = {food_salt = 1, vessel = 1, dig_immediate = 3, attached_node = 1}, groups = {food_salt = 1, vessel = 1, dig_immediate = 3, attached_node = 1},
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_defaults(), sounds = farming.node_sound_defaults(),
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
@ -259,7 +259,7 @@ minetest.register_node("farming:salt_crystal", {
tiles = {"farming_salt_crystal.png"}, tiles = {"farming_salt_crystal.png"},
groups = {dig_immediate = 3, attached_node = 1}, groups = {dig_immediate = 3, attached_node = 1},
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_defaults(), sounds = farming.node_sound_defaults(),
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
@ -305,7 +305,7 @@ minetest.register_node("farming:mayonnaise", {
compostability = 65, food_mayonnaise = 1, vessel = 1, dig_immediate = 3, compostability = 65, food_mayonnaise = 1, vessel = 1, dig_immediate = 3,
attached_node = 1 attached_node = 1
}, },
sounds = farming.sounds.node_sound_glass_defaults() sounds = farming.node_sound_glass_defaults()
}) })
farming.add_eatable("farming:mayonnaise", 3) farming.add_eatable("farming:mayonnaise", 3)
@ -333,7 +333,7 @@ minetest.register_node("farming:rose_water", {
food_rose_water = 1, vessel = 1, dig_immediate = 3, attached_node = 1 food_rose_water = 1, vessel = 1, dig_immediate = 3, attached_node = 1
}, },
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_defaults(), sounds = farming.node_sound_defaults(),
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}

View File

@ -7,15 +7,13 @@
farming = { farming = {
mod = "redo", mod = "redo",
version = "20240803", version = "20240811",
path = minetest.get_modpath("farming"), path = minetest.get_modpath("farming"),
select = { select = {
type = "fixed", type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}
}, },
select_final = { select_final = {
type = "fixed", type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, -2.5/16, 0.5}
fixed = {-0.5, -0.5, -0.5, 0.5, -2.5/16, 0.5}
}, },
registered_plants = {}, registered_plants = {},
min_light = 12, min_light = 12,
@ -24,21 +22,30 @@ farming = {
use_utensils = minetest.settings:get_bool("farming_use_utensils") ~= false, use_utensils = minetest.settings:get_bool("farming_use_utensils") ~= false,
mtg = minetest.get_modpath("default"), mtg = minetest.get_modpath("default"),
mcl = minetest.get_modpath("mcl_core"), mcl = minetest.get_modpath("mcl_core"),
sounds = {},
mcl_hardness = 0.01 mcl_hardness = 0.01
} }
-- default sound functions just incase -- determine which sounds to use, default or mcl_sounds
function farming.sounds.node_sound_defaults() end
function farming.sounds.node_sound_glass_defaults() end local function sound_helper(snd)
function farming.sounds.node_sound_gravel_defaults() end
function farming.sounds.node_sound_leaves_defaults() end farming[snd] = (farming.mtg and default[snd]) or (farming.mcl and mcl_sounds[snd])
function farming.sounds.node_sound_stone_defaults() end or function() return {} end
function farming.sounds.node_sound_wood_defaults() end end
sound_helper("node_sound_defaults")
sound_helper("node_sound_stone_defaults")
sound_helper("node_sound_dirt_defaults")
sound_helper("node_sound_sand_defaults")
sound_helper("node_sound_gravel_defaults")
sound_helper("node_sound_wood_defaults")
sound_helper("node_sound_leaves_defaults")
sound_helper("node_sound_ice_defaults")
sound_helper("node_sound_metal_defaults")
sound_helper("node_sound_water_defaults")
sound_helper("node_sound_snow_defaults")
sound_helper("node_sound_glass_defaults")
-- sounds check
if farming.mtg then farming.sounds = default end
if farming.mcl then farming.sounds = mcl_sounds end
-- check for creative mode or priv -- check for creative mode or priv
local creative_mode_cache = minetest.settings:get_bool("creative_mode") local creative_mode_cache = minetest.settings:get_bool("creative_mode")
@ -689,7 +696,7 @@ farming.register_plant = function(name, def)
groups = g, groups = g,
_mcl_hardness = farming.mcl_hardness, _mcl_hardness = farming.mcl_hardness,
is_ground_content = false, is_ground_content = false,
sounds = farming.sounds.node_sound_leaves_defaults(), sounds = farming.node_sound_leaves_defaults(),
minlight = def.minlight, minlight = def.minlight,
maxlight = def.maxlight, maxlight = def.maxlight,
next_plant = next_plant next_plant = next_plant