Skip to content
This repository was archived by the owner on Apr 7, 2024. It is now read-only.

Commit 13ba249

Browse files
authored
add cockle
1 parent 51b5a2c commit 13ba249

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

node_defs.lua

+50
Original file line numberDiff line numberDiff line change
@@ -871,3 +871,53 @@ minetest.register_node("aotearoa:iron_sand_with_pipi", {
871871
minetest.set_node(pos, {name = "aotearoa:iron_sand"})
872872
end,
873873
})
874+
875+
-----------------------------
876+
-- Cockle (shellfish)
877+
878+
minetest.register_node("aotearoa:cockle", {
879+
description = "Cockle (Austrovenus stutchburyi)",
880+
drawtype = "plantlike",
881+
paramtype = "light",
882+
visual_scale = 0.6,
883+
tiles = {"aotearoa_cockle.png"},
884+
inventory_image = "aotearoa_cockle.png",
885+
sunlight_propagates = true,
886+
walkable = false,
887+
selection_box = {
888+
type = "fixed",
889+
fixed = {-0.1, -0.5, -0.1, 0.1, -0.2, 0.1}
890+
},
891+
groups = {fleshy = 3, dig_immediate = 3},
892+
893+
sounds = default.node_sound_gravel_defaults(),
894+
--rebury shellfish
895+
on_timer = function(pos)
896+
local below = {x = pos.x, y = pos.y - 1, z = pos.z}
897+
if minetest.get_node(below).name == "aotearoa:mud" then
898+
minetest.set_node(pos, {name = "air"})
899+
minetest.set_node(below, {name = "aotearoa:mud_with_cockles"})
900+
end
901+
end,
902+
on_construct = function(pos)
903+
minetest.get_node_timer(pos):start(math.random(3, 5))
904+
end,
905+
--eat and get shells
906+
on_use = minetest.item_eat(3,"aotearoa:seashells")
907+
})
908+
909+
--cockle in mud
910+
minetest.register_node("aotearoa:mud_with_cockles", {
911+
description = "Mud with Cockles",
912+
tiles = {"aotearoa_mud_with_cockles.png"},
913+
groups = {crumbly = 3, puts_out_fire = 1},
914+
sounds = default.node_sound_dirt_defaults({
915+
footstep = {name = "aotearoa_mud", gain = 0.4},
916+
dug = {name = "aotearoa_mud", gain = 0.4},
917+
}),
918+
--dig up the shellfish
919+
on_punch = function(pos, node, puncher)
920+
puncher:get_inventory():add_item('main', "aotearoa:cockle")
921+
minetest.set_node(pos, {name = "aotearoa:mud"})
922+
end,
923+
})

0 commit comments

Comments
 (0)