From 16b625d963107c4f05958ace4afcfde9c743c92a Mon Sep 17 00:00:00 2001
From: Sfan5 <sfan5@live.de>
Date: Tue, 15 Apr 2014 21:04:34 +0200
Subject: [PATCH] Add fancy inventory for bookshelves

---
 mods/default/nodes.lua | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/mods/default/nodes.lua b/mods/default/nodes.lua
index 89fc74b..5423e08 100644
--- a/mods/default/nodes.lua
+++ b/mods/default/nodes.lua
@@ -376,6 +376,16 @@ minetest.register_node("default:papyrus", {
 	end,
 })
 
+default.bookshelf_formspec =
+	"size[8,7;]"..
+	gui_bg..
+	gui_bg_img..
+	gui_slots..
+	"list[context;books;0,0.3;8,2;]"..
+	"list[current_player;main;0,2.85;8,1;]"..
+	"list[current_player;main;0,4.08;8,3;8]"..
+	default.get_hotbar_bg(0,2.85)
+
 minetest.register_node("default:bookshelf", {
 	description = "Bookshelf",
 	tiles = {"default_wood.png", "default_wood.png", "default_bookshelf.png"},
@@ -384,7 +394,7 @@ minetest.register_node("default:bookshelf", {
 	sounds = default.node_sound_wood_defaults(),
 	on_construct = function(pos)
 		local meta = minetest.env:get_meta(pos)
-		meta:set_string("formspec","size[8,7;]list[context;books;0,0;8,2;]list[current_player;main;0,3;8,4;]")
+		meta:set_string("formspec", default.bookshelf_formspec)
 		local inv = meta:get_inventory()
 		inv:set_size("books", 8*2)
 	end,