mirror of
https://repo.or.cz/minetest_wateringcan.git
synced 2024-10-06 09:53:06 +02:00
Use new doc_items interface
This commit is contained in:
parent
f031763f9b
commit
ddbe7c42bc
@ -3,4 +3,4 @@ bucket?
|
||||
farming?
|
||||
pedology?
|
||||
intllib?
|
||||
doc_items?
|
||||
doc?
|
||||
|
12
init.lua
12
init.lua
@ -8,6 +8,7 @@ end
|
||||
|
||||
minetest.register_tool("wateringcan:wateringcan_water", {
|
||||
description = S("Watering can with water"),
|
||||
x_doc_items_create_entry = false,
|
||||
inventory_image = "wateringcan_wateringcan_water.png",
|
||||
wield_image = "wateringcan_wateringcan_wield.png",
|
||||
liquids_pointable = true,
|
||||
@ -63,12 +64,14 @@ minetest.register_tool("wateringcan:wateringcan_water", {
|
||||
end
|
||||
end
|
||||
end,
|
||||
groups = { not_in_doc = 1 },
|
||||
}
|
||||
)
|
||||
|
||||
minetest.register_tool("wateringcan:wateringcan_empty", {
|
||||
description = S("Empty watering can"),
|
||||
x_doc_items_entry_name = S("Watering can"),
|
||||
x_doc_items_longdesc = S("Watering cans are used to collect a small amount of water in order to pour it on dry blocks. One filled watering can can be used 24 times, after which it has to be refilled. Watering cans don't wear out."),
|
||||
x_doc_items_usagehelp = S("Rightclick on water (or any other block belonging to the “Water” group) to fill or refill the watering can. Rightclick with the filled can on an appropriate block (or a plant above it) to wetten it. Soil, desert sand soil, and other blocks capable of becoming wet can be wettened. The tool wear indicator of the watering can indicates the amount of water left."),
|
||||
inventory_image = "wateringcan_wateringcan_empty.png",
|
||||
wield_image = "wateringcan_wateringcan_wield.png",
|
||||
liquids_pointable = true,
|
||||
@ -115,11 +118,6 @@ if minetest.get_modpath("bucket") ~= nil then
|
||||
})
|
||||
end
|
||||
|
||||
if minetest.get_modpath("doc_items") ~= nil then
|
||||
local d = S("Watering cans are used to collect a small amount of water in order to pour it on dry blocks. One filled watering can can be used 24 times, after which it has to be refilled. Watering cans don't wear out.")
|
||||
local u = S("Rightclick on water (or any other block belonging to the “Water” group) to fill or refill the watering can. Rightclick with the filled can on an appropriate block (or a plant above it) to wetten it. Soil, desert sand soil, and other blocks capable of becoming wet can be wettened. The tool wear indicator of the watering can indicates the amount of water left.")
|
||||
doc.sub.items.add_item_name_overrides({["wateringcan:wateringcan_empty"] = S("Watering can")})
|
||||
if minetest.get_modpath("doc") ~= nil then
|
||||
doc.add_entry_alias("tools", "wateringcan:wateringcan_empty", "wateringcan:wateringcan_water")
|
||||
doc.sub.items.set_items_longdesc({["wateringcan:wateringcan_empty"] = d, ["wateringcan:wateringcan_water"] = d})
|
||||
doc.sub.items.set_items_usagehelp({["wateringcan:wateringcan_empty"] = u, ["wateringcan:wateringcan_water"] = u})
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user