1
0
mirror of https://github.com/mt-mods/homedecor_modpack.git synced 2025-07-17 05:10:25 +02:00

Always return the ItemStack for on_rightclick to comply with the API.

This commit is contained in:
Tim
2016-07-31 01:17:23 +02:00
parent b33428b907
commit 337dc05e70
19 changed files with 78 additions and 40 deletions

View File

@ -112,7 +112,7 @@ for c in ipairs(bookcolors) do
drop = "homedecor:book_"..color,
walkable = false,
on_dig = book_dig,
on_rightclick = function(pos, node, clicker)
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local meta = minetest.get_meta(pos)
local player_name = clicker:get_player_name()
local title = meta:get_string("title") or ""
@ -136,6 +136,7 @@ for c in ipairs(bookcolors) do
end
player_current_book[player_name] = pos
minetest.show_formspec(player_name, BOOK_FORMNAME, formspec)
return itemstack
end,
on_punch = function(pos, node, puncher, pointed_thing)
local fdir = node.param2