1 minetest
.register_tool("wateringcan:wateringcan_water", {
2 description
= "watering can with water",
3 inventory_image
= "wateringcan_wateringcan_water.png",
4 wield_image
= "wateringcan_wateringcan_wield.png",
5 liquids_pointable
= true,
8 full_punch_interval
= 2.0,
10 on_place
= function(itemstack
, user
, pointed_thing
)
11 if(pointed_thing
.type == "node") then
12 local node
= minetest
.get_node_or_nil(pointed_thing
.under
)
14 local name
= node
.name
15 local nodedef
= minetest
.registered_nodes
[name
]
18 if name
== "farming:soil" and minetest
.get_modpath("farming") ~= nil then
19 minetest
.set_node(pointed_thing
.under
, { name
= "farming:soil_wet" })
21 elseif minetest
.get_item_group(name
, "sucky") > 0 and minetest
.get_modpath("pedology") ~= nil then
22 pedology
.wetten(pointed_thing
.under
)
26 wear
= itemstack
:get_wear()
27 wear
= wear
+ 2849 -- 24 uses
29 newtool
= { name
= "wateringcan:wateringcan_empty" }
31 newtool
= { name
= "wateringcan:wateringcan_water", wear
= wear
}
42 minetest
.register_tool("wateringcan:wateringcan_empty", {
43 description
= "empty watering can",
44 inventory_image
= "wateringcan_wateringcan_empty.png",
45 wield_image
= "wateringcan_wateringcan_wield.png",
46 liquids_pointable
= true,
49 full_punch_interval
= 2.0,