Tweak coral sounds and placement

This commit is contained in:
Wuzzy 2019-12-17 16:50:32 +01:00
parent 39670e1f79
commit c7aaf49e22

View file

@ -145,10 +145,12 @@ local function coral_on_place(itemstack, placer, pointed_thing)
local g_species_plant = minetest.get_item_group(itemstack:get_name(), "coral_species") local g_species_plant = minetest.get_item_group(itemstack:get_name(), "coral_species")
-- Placement rules: -- Placement rules:
-- Coral plant can only be placed on top of a matching coral block inside a water source. -- Coral plant can only be placed on top of a matching coral block.
-- Note: It's intentional only for normal water (not river water) -- If alive, it must also be inside a water source.
-- Note: It's intentional that it works only for normal water (not river water). Corals are
-- for the ocean, after all.
if g_block == 0 or (g_coral ~= g_block) or (g_species_block ~= g_species_plant) or if g_block == 0 or (g_coral ~= g_block) or (g_species_block ~= g_species_plant) or
minetest.get_node(pos_above).name ~= "mcl_core:water_source" then (g_coral == 1 and minetest.get_node(pos_above).name ~= "mcl_core:water_source") then
return itemstack return itemstack
end end
@ -176,6 +178,9 @@ local function coral_on_place(itemstack, placer, pointed_thing)
return itemstack return itemstack
end end
-- Sound for non-block corals
local sounds_coral_plant = mcl_sounds.node_sound_leaves_defaults({footstep = mcl_sounds.node_sound_dirt_defaults().footstep})
for c=1, #corals do for c=1, #corals do
local id = corals[c][1] local id = corals[c][1]
-- Coral Block -- Coral Block
@ -208,7 +213,7 @@ for c=1, #corals do
special_tiles = { { name = "mcl_ocean_"..id.."_coral.png" } }, special_tiles = { { name = "mcl_ocean_"..id.."_coral.png" } },
inventory_image = "mcl_ocean_"..id.."_coral.png", inventory_image = "mcl_ocean_"..id.."_coral.png",
groups = { dig_immediate = 3, deco_block = 1, coral=1, coral_plant=1, coral_species=c, }, groups = { dig_immediate = 3, deco_block = 1, coral=1, coral_plant=1, coral_species=c, },
sounds = mcl_sounds.node_sound_leaves_defaults(), sounds = sounds_coral_plant,
drop = "mcl_ocean:dead_"..id.."_coral", drop = "mcl_ocean:dead_"..id.."_coral",
node_placement_prediction = "", node_placement_prediction = "",
node_dig_prediction = "mcl_ocean:"..id.."_coral_block", node_dig_prediction = "mcl_ocean:"..id.."_coral_block",
@ -229,7 +234,7 @@ for c=1, #corals do
special_tiles = { { name = "mcl_ocean_dead_"..id.."_coral.png" } }, special_tiles = { { name = "mcl_ocean_dead_"..id.."_coral.png" } },
inventory_image = "mcl_ocean_dead_"..id.."_coral.png", inventory_image = "mcl_ocean_dead_"..id.."_coral.png",
groups = { dig_immediate = 3, deco_block = 1, coral=2, coral_plant=2, coral_species=c, }, groups = { dig_immediate = 3, deco_block = 1, coral=2, coral_plant=2, coral_species=c, },
sounds = mcl_sounds.node_sound_leaves_defaults(), sounds = sounds_coral_plant,
node_placement_prediction = "", node_placement_prediction = "",
node_dig_prediction = "mcl_ocean:dead_"..id.."_coral_block", node_dig_prediction = "mcl_ocean:dead_"..id.."_coral_block",
on_place = coral_on_place, on_place = coral_on_place,
@ -251,7 +256,7 @@ for c=1, #corals do
special_tiles = { { name = "mcl_ocean_"..id.."_coral_fan.png" } }, special_tiles = { { name = "mcl_ocean_"..id.."_coral_fan.png" } },
inventory_image = "mcl_ocean_"..id.."_coral_fan.png", inventory_image = "mcl_ocean_"..id.."_coral_fan.png",
groups = { dig_immediate = 3, deco_block = 1, coral=1, coral_fan=1, coral_species=c, }, groups = { dig_immediate = 3, deco_block = 1, coral=1, coral_fan=1, coral_species=c, },
sounds = mcl_sounds.node_sound_leaves_defaults(), sounds = sounds_coral_plant,
drop = "mcl_ocean:dead_"..id.."_coral_fan", drop = "mcl_ocean:dead_"..id.."_coral_fan",
node_placement_prediction = "", node_placement_prediction = "",
node_dig_prediction = "mcl_ocean:"..id.."_coral_block", node_dig_prediction = "mcl_ocean:"..id.."_coral_block",
@ -272,7 +277,7 @@ for c=1, #corals do
special_tiles = { { name = "mcl_ocean_dead_"..id.."_coral_fan.png" } }, special_tiles = { { name = "mcl_ocean_dead_"..id.."_coral_fan.png" } },
inventory_image = "mcl_ocean_dead_"..id.."_coral_fan.png", inventory_image = "mcl_ocean_dead_"..id.."_coral_fan.png",
groups = { dig_immediate = 3, deco_block = 1, coral=2, coral_fan=2, coral_species=c, }, groups = { dig_immediate = 3, deco_block = 1, coral=2, coral_fan=2, coral_species=c, },
sounds = mcl_sounds.node_sound_leaves_defaults(), sounds = sounds_coral_plant,
node_placement_prediction = "", node_placement_prediction = "",
node_dig_prediction = "mcl_ocean:dead_"..id.."_coral_block", node_dig_prediction = "mcl_ocean:dead_"..id.."_coral_block",
on_place = coral_on_place, on_place = coral_on_place,