mirror of
https://repo.or.cz/minetest_wateringcan.git
synced 2024-10-06 09:53:06 +02:00
Initial commit
This commit is contained in:
commit
3106b6de5e
2
depends.txt
Normal file
2
depends.txt
Normal file
@ -0,0 +1,2 @@
|
||||
farming?
|
||||
pedology?
|
1
description.txt
Normal file
1
description.txt
Normal file
@ -0,0 +1 @@
|
||||
A watering can to wetten soil.
|
28
init.lua
Normal file
28
init.lua
Normal file
@ -0,0 +1,28 @@
|
||||
minetest.register_tool("wateringcan:wateringcan_water", {
|
||||
description = "watering can with water",
|
||||
inventory_image = "wateringcan_wateringcan_water.png",
|
||||
wield_image = "wateringcan_wateringcan_wield.png",
|
||||
on_place = function(itemstack, user, pointed_thing)
|
||||
if(pointed_thing.type == "node") then
|
||||
local node = minetest.get_node_or_nil(pointed_thing.under)
|
||||
if node ~= nil then
|
||||
local name = node.name
|
||||
local nodedef = minetest.registered_nodes[name]
|
||||
if name == "farming:soil" and minetest.get_modpath("farming") ~= nil then
|
||||
minetest.set_node(pointed_thing.under, { name = "farming:soil_wet" })
|
||||
elseif minetest.get_item_group(name, "sucky") > 0 and minetest.get_modpath("pedology") ~= nil then
|
||||
pedology.wetten(pointed_thing.under)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
}
|
||||
)
|
||||
|
||||
minetest.register_craftitem("wateringcan:wateringcan_empty", {
|
||||
description = "empty watering can",
|
||||
inventory_image = "wateringcan_wateringcan_empty.png",
|
||||
wield_image = "wateringcan_wateringcan_wield.png",
|
||||
}
|
||||
)
|
BIN
textures/wateringcan_wateringcan_empty.png
Normal file
BIN
textures/wateringcan_wateringcan_empty.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 351 B |
BIN
textures/wateringcan_wateringcan_water.png
Normal file
BIN
textures/wateringcan_wateringcan_water.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 360 B |
BIN
textures/wateringcan_wateringcan_wield.png
Normal file
BIN
textures/wateringcan_wateringcan_wield.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 355 B |
Loading…
Reference in New Issue
Block a user