summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2016-10-30 19:53:05 +0100
committerWuzzy <almikes@aol.com>2016-10-30 19:53:05 +0100
commita11ae852625a6f0cb3c12c4dc44fe787e58f425a (patch)
treeb15c263ef665c03eb9df8c17356cf90594ec1959
parentdfd6ebc314910c6a8f03f9dfebc29929e1bb7689 (diff)
Use new doc_items fields interface
-rw-r--r--depends.txt16
-rw-r--r--helptexts.lua14
-rw-r--r--init.lua33
3 files changed, 55 insertions, 8 deletions
diff --git a/depends.txt b/depends.txt
index 832f709..0256ff1 100644
--- a/depends.txt
+++ b/depends.txt
@@ -1,4 +1,20 @@
+beds
+boats
+bones
+bucket
+default
doors
+dye
+farming
+flowers
+fire
+screwdriver
+stairs
+tnt
+vessels
+walls
+wool
+xpanes
doc_items
doc_identifier?
intllib?
diff --git a/helptexts.lua b/helptexts.lua
index 4e298c2..7c80a6e 100644
--- a/helptexts.lua
+++ b/helptexts.lua
@@ -437,7 +437,7 @@ local export_usagehelp = {
["bucket:bucket_river_water"] = S("Rightclick on any block to empty the bucket and put a river water source on this spot."),
["bucket:bucket_lava"] = S("Choose a place where you want to empty the bucket, then get in a safe spot somewhere above it. Be prepared to run away when something goes wrong as the lava will soon start to flow after placing. To empty the bucket (which places a lava source), rightclick on your chosen place."),
- ["bones:bones"] = S("Point to the bones to see to whom they belong to. If nothing is displayed, they belong to nobody and are empty; they behave any other block in this case. Otherwise, rightclick on the bones to access the inventory, punch it to obtain all items and the bones immediately, or at least as many items as you can carry. ")..bonesstring..bonesstring2..S("It is only possible to take from this inventory, nothing can be stored into it."),
+ ["bones:bones"] = S("Point to the bones to see to whom they belong to. If nothing is displayed, they belong to nobody and are empty; they behave any other block in this case. Otherwise, rightclick on the bones to access the inventory, punch it to obtain all items and the bones immediately, or at least as many items as you can carry. ") .. bonesstring .. bonesstring2 .. S("It is only possible to take from this inventory, nothing can be stored into it."),
["tnt:gunpowder"] = S("Place gunpowder on the ground to create gunpowder trails. Punch it with a torch to light the gunpowder. Lit gunpowder will ignite all neighbor (including diagonals) gunpowder tiles and TNTs."),
["tnt:tnt"] = S("Place the TNT on the ground and punch it with a torch to light it and quickly get in a safe distance before it explodes. Burning gunpowder trails and blocks which set nearby blocks on fire will also ignite the TNT."),
@@ -474,5 +474,13 @@ local export_generation = {
["default:nyancat_rainbow"] = S("These blocks are extremely rare. They only appear behind a Nyan Cat, which itself can appear randomly anywhere."),
}
-doc.sub.items.set_items_longdesc(export_longdesc)
-doc.sub.items.set_items_usagehelp(export_usagehelp)
+for itemstring, longdesc in pairs(export_longdesc) do
+ if minetest.registered_items[itemstring] ~= nil then
+ minetest.override_item(itemstring, { x_doc_items_longdesc = longdesc } )
+ end
+end
+for itemstring, usagehelp in pairs(export_usagehelp) do
+ if minetest.registered_items[itemstring] ~= nil then
+ minetest.override_item(itemstring, { x_doc_items_usagehelp = usagehelp} )
+ end
+end
diff --git a/init.lua b/init.lua
index e7a8b0c..0989dfd 100644
--- a/init.lua
+++ b/init.lua
@@ -115,12 +115,35 @@ local image_overrides = {
doc.sub.items.add_real_group_names(groupdefs)
doc.sub.items.add_notable_groups(miscgroups)
-doc.sub.items.add_forced_item_entries(forced_items)
-doc.sub.items.add_suppressed_item_entries(suppressed_items)
-doc.sub.items.add_hidden_item_entries(hidden_items)
-doc.sub.items.add_item_name_overrides(item_name_overrides)
-doc.sub.items.add_item_image_overrides(image_overrides)
+for i=1, #hidden_items do
+ local item = minetest.registered_items[hidden_items[i]]
+ if item then
+ minetest.override_item(hidden_items[i], { x_doc_items_hidden = true } )
+ end
+end
+for i=1, #forced_items do
+ local item = minetest.registered_items[forced_items[i]]
+ if item then
+ minetest.override_item(forced_items[i], { x_doc_items_create_entry = true} )
+ end
+end
+for i=1, #suppressed_items do
+ local item = minetest.registered_items[suppressed_items[i]]
+ if item then
+ minetest.override_item(suppressed_items[i], { x_doc_items_create_entry = false} )
+ end
+end
+for itemstring, data in pairs(item_name_overrides) do
+ if minetest.registered_items[itemstring] ~= nil then
+ minetest.override_item(itemstring, { x_doc_items_entry_name = data} )
+ end
+end
+for itemstring, data in pairs(image_overrides) do
+ if minetest.registered_items[itemstring] ~= nil then
+ minetest.override_item(itemstring, { x_doc_items_image = data} )
+ end
+end
-- Minetest Game Factoids