From 20f938e44a731c620d2333d8e126974d0213a1c5 Mon Sep 17 00:00:00 2001 From: PilzAdam Date: Sat, 6 Dec 2014 11:46:04 +0100 Subject: [PATCH] Allow the group book to be placed into bookshelfs --- mods/default/craftitems.lua | 1 + mods/default/nodes.lua | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mods/default/craftitems.lua b/mods/default/craftitems.lua index 3d2cb11..539f6b4 100644 --- a/mods/default/craftitems.lua +++ b/mods/default/craftitems.lua @@ -14,6 +14,7 @@ minetest.register_craftitem("default:paper", { minetest.register_craftitem("default:book", { description = "Book", inventory_image = "default_book.png", + groups = {book=1}, }) minetest.register_craftitem("default:coal_lump", { diff --git a/mods/default/nodes.lua b/mods/default/nodes.lua index 3fe0fe8..7e7977c 100644 --- a/mods/default/nodes.lua +++ b/mods/default/nodes.lua @@ -409,7 +409,8 @@ minetest.register_node("default:bookshelf", { local inv = meta:get_inventory() local to_stack = inv:get_stack(listname, index) if listname == "books" then - if stack:get_name() == "default:book" and to_stack:is_empty() then + if minetest.get_item_group(stack:get_name(), "book") ~= 0 + and to_stack:is_empty() then return 1 else return 0