Allow the group book to be placed into bookshelfs 369/head
authorPilzAdam <pilzadam@minetest.net>
Sat, 6 Dec 2014 10:46:04 +0000 (11:46 +0100)
committerPilzAdam <pilzadam@minetest.net>
Sat, 6 Dec 2014 10:46:04 +0000 (11:46 +0100)
mods/default/craftitems.lua
mods/default/nodes.lua

index 3d2cb1130ebe9d07a1b1e4c72b179813aa6b5bb6..539f6b430583ce0411b1a76ea642fccc1bcc7162 100644 (file)
@@ -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", {
index 3fe0fe801ca603a9d235cb54b317c63f375989a5..7e7977c6b51a6d76618826d5f38c2e3a659bbcb6 100644 (file)
@@ -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