Allow the group book to be placed into bookshelfs
This commit is contained in:
parent
fd34872de8
commit
20f938e44a
@ -14,6 +14,7 @@ minetest.register_craftitem("default:paper", {
|
|||||||
minetest.register_craftitem("default:book", {
|
minetest.register_craftitem("default:book", {
|
||||||
description = "Book",
|
description = "Book",
|
||||||
inventory_image = "default_book.png",
|
inventory_image = "default_book.png",
|
||||||
|
groups = {book=1},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("default:coal_lump", {
|
minetest.register_craftitem("default:coal_lump", {
|
||||||
|
@ -409,7 +409,8 @@ minetest.register_node("default:bookshelf", {
|
|||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
local to_stack = inv:get_stack(listname, index)
|
local to_stack = inv:get_stack(listname, index)
|
||||||
if listname == "books" then
|
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
|
return 1
|
||||||
else
|
else
|
||||||
return 0
|
return 0
|
||||||
|
Loading…
Reference in New Issue
Block a user