I rechecked with your latest version and can confirm a node-breaker will remove the wetgravel node.
Hope you don't mind, but I jumped into the source to see if I could find it and came up with the following: -
Code: Select all
minetest.register_node("meseingravel:watergravel_1", {
tiles = {"meseingravel_watergravel_1.png"},
groups = {falling_node=1},
diggable = false,
on_punch = function(pos, node, puncher)
-- \check\ If you have a shovel and an empty bucket, your bucket will be replaced by bucket_gravel
local tool = puncher:get_wielded_item():get_name()
if string.find(tool, "shovel") then
diggable = true
for i=0, 32, 1 do
name = puncher:get_inventory():get_stack("main", i):get_name()
if name == "bucket:bucket_empty" then
puncher:get_inventory():remove_item("main", "bucket:bucket_empty 1")
puncher:get_inventory():add_item("main", "meseingravel:bucket_gravel 1")
minetest.remove_node(pos)
return
end
end
minetest.remove_node(pos)
minetest.add_node(pos, {name="default:water_source"})
minetest.add_item(pos, {name="default:gravel"})
-- /check/
else
-- | If you have not shovel the watergravel_ will be replaced by water and drop gravel
minetest.remove_node(pos)
minetest.add_node(pos, {name="default:water_source"})
minetest.add_item(pos, {name="default:gravel"})
end
end,
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_gravel_footstep", gain=0.45},
})
})
made the node diggable = false unless the wielded tool is a shovel, then switches to true.
Also added extra lines to make the gravel drop from the water if using a shovel, but without an available empty bucket. This way, the gravel drops out on all tools or punch ;)
It doesn't allow the node breaker to remove the node with a bucket however, but don't why anyone would if you're putting it out to dry!
No trees or animals were hurt in the production of this message. However, a large number of Electrons were temporarily inconvenienced.