diff options
author | Wuzzy <almikes@aol.com> | 2016-12-28 18:40:52 +0100 |
---|---|---|
committer | Wuzzy <almikes@aol.com> | 2016-12-28 18:40:52 +0100 |
commit | 3b5106a198a2e13943a4ef4c3f9f756e2262c631 (patch) | |
tree | f98d244864cdd8378c9cd9203894a74036ee553b /init.lua | |
parent | 9827030610f50159391808d430063c577ccc9096 (diff) |
Finally make default doors work
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 56 |
1 files changed, 51 insertions, 5 deletions
@@ -69,6 +69,14 @@ local suppressed_items = { "doors:door_steel", "doors:door_glass", "doors:door_obsidian_glass", + "doors:door_wood_a", + "doors:door_steel_a", + "doors:door_glass_a", + "doors:door_obsidian_glass_a", + "doors:door_wood_b", + "doors:door_steel_b", + "doors:door_glass_b", + "doors:door_obsidian_glass_b", "doors:gate_wood_open", "doors:gate_junglewood_open", "doors:gate_acacia_wood_open", @@ -275,10 +283,18 @@ doc.add_entry_alias("nodes", "default:river_water_source", "nodes", "default:riv doc.add_entry_alias("nodes", "default:furnace", "nodes", "default:furnace_active") doc.add_entry_alias("nodes", "default:torch", "nodes", "default:torch_wall") doc.add_entry_alias("nodes", "default:torch", "nodes", "default:torch_ceiling") -doc.add_entry_alias("nodes", "doors:door_wood_a", "craftitems", "doors:door_wood") -doc.add_entry_alias("nodes", "doors:door_steel_a", "craftitems", "doors:door_steel") -doc.add_entry_alias("nodes", "doors:door_glass_a", "craftitems", "doors:door_glass") -doc.add_entry_alias("nodes", "doors:door_obsidian_glass_a", "craftitems", "doors:door_obsidian_glass") +doc.add_entry_alias("nodes", "doors:door_wood_fake", "craftitems", "doors:door_wood") +doc.add_entry_alias("nodes", "doors:door_steel_fake", "craftitems", "doors:door_steel") +doc.add_entry_alias("nodes", "doors:door_glass_fake", "craftitems", "doors:door_glass") +doc.add_entry_alias("nodes", "doors:door_obsidian_glass_fake", "craftitems", "doors:door_obsidian_glass") +doc.add_entry_alias("nodes", "doors:door_wood_fake", "nodes", "doors:door_wood_a") +doc.add_entry_alias("nodes", "doors:door_steel_fake", "nodes", "doors:door_steel_a") +doc.add_entry_alias("nodes", "doors:door_glass_fake", "nodes", "doors:door_glass_a") +doc.add_entry_alias("nodes", "doors:door_obsidian_glass_fake", "nodes", "doors:door_obsidian_glass_a") +doc.add_entry_alias("nodes", "doors:door_wood_fake", "nodes", "doors:door_wood_b") +doc.add_entry_alias("nodes", "doors:door_steel_fake", "nodes", "doors:door_steel_b") +doc.add_entry_alias("nodes", "doors:door_glass_fake", "nodes", "doors:door_glass_b") +doc.add_entry_alias("nodes", "doors:door_obsidian_glass_fake", "nodes", "doors:door_obsidian_glass_b") doc.add_entry_alias("nodes", "doors:gate_wood_closed", "nodes", "doors:gate_wood_open") doc.add_entry_alias("nodes", "doors:gate_junglewood_closed", "nodes", "doors:gate_junglewood_open") doc.add_entry_alias("nodes", "doors:gate_acacia_wood_closed", "nodes", "doors:gate_acacia_wood_open") @@ -290,7 +306,6 @@ doc.add_entry_alias("nodes", "tnt:tnt", "nodes", "tnt:tnt_burning") doc.add_entry_alias("nodes", "tnt:gunpowder", "nodes", "tnt:gunpowder_burning") doc.add_entry_alias("nodes", "xpanes:pane_flat", "nodes", "xpanes:pane") doc.add_entry_alias("nodes", "xpanes:bar_flat", "nodes", "xpanes:bar") --- FIXME: Remove duplicate door node entries -- Gather help texts dofile(minetest.get_modpath("doc_minetest_game") .. "/helptexts.lua") @@ -302,6 +317,37 @@ if minetest.get_modpath("doc_identifier") ~= nil then end +--[[ Completely create door entries from scratch. We suppressed all normal door entries +before. This is quite a hack, but required because of the weird way how door items are +implemented in Minetest Game. +CHECKME: As doors are sensitive, check this entire section after each Minetest Game release. +]] + +local doors = { "doors:door_wood", "doors:door_steel", "doors:door_glass", "doors:door_obsidian_glass" } + +for d=1, #doors do + local door = doors[d] + local def1 = table.copy(minetest.registered_items[door]) + local def2 = table.copy(minetest.registered_items[door.."_a"]) + + def2._doc_items_image = def1.inventory_image + def2.drop = nil + def2.stack_max = def1.stack_max or minetest.nodedef_default.stack_max + def2.liquidtype = "none" + def2._doc_items_longdesc = def1._doc_items_longdesc + def2._doc_items_usagehelp = def1._doc_items_usagehelp + + doc.add_entry("nodes", door.."_fake", { + name = def2.description, + hidden = def2._doc_items_hidden == true, + data = { + itemstring = door, + longdesc = def2._doc_items_longdesc, + usagehelp = def2._doc_items_usagehelp, + def = def2 + } + }) +end -- Remove the superficial “help” comment from screwdriver and cart description as redundant minetest.override_item("screwdriver:screwdriver", {description = item_name_overrides["screwdriver:screwdriver"]}) |