mirror of
https://github.com/minetest-mods/crafting_bench.git
synced 2024-11-28 06:13:42 +01:00
Respect all slots upon digging and disallow TNT blasts (#11)
This pull stops players digging a workbench containing items in any inventory, it also stops them being removed with tnt.
This commit is contained in:
parent
9dc6074987
commit
3b3309ea43
3
init.lua
3
init.lua
@ -56,8 +56,9 @@ minetest.register_node("crafting_bench:workbench",{
|
||||
can_dig = function(pos,player)
|
||||
local meta = minetest.get_meta(pos);
|
||||
local inv = meta:get_inventory()
|
||||
return inv:is_empty("main")
|
||||
return inv:is_empty("src") and inv:is_empty("rec") and inv:is_empty("dst")
|
||||
end,
|
||||
on_blast = function(pos) end,
|
||||
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||
minetest.log("action", player:get_player_name().." moves stuff in workbench at "..minetest.pos_to_string(pos))
|
||||
end,
|
||||
|
Loading…
Reference in New Issue
Block a user