From 2f39603ec815aa85f438b7b7b766b5d1f58ea768 Mon Sep 17 00:00:00 2001 From: kaadmy Date: Fri, 23 Oct 2015 10:38:24 -0700 Subject: [PATCH] make bookshelfs nameable --- mods/default/nodes.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mods/default/nodes.lua b/mods/default/nodes.lua index d3aa476..c69921f 100644 --- a/mods/default/nodes.lua +++ b/mods/default/nodes.lua @@ -674,6 +674,15 @@ minetest.register_node( local inv = meta:get_inventory() return inv:is_empty("main") end, + write_name = function(pos, text) + local meta = minetest.get_meta(pos) + + if text ~= "" then + meta:set_string("infotext", text) + else + meta:set_string("infotext", "Bookshelf") + end + end, }) minetest.register_node(