mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-06-07 06:06:10 -04:00
Allow non-players to dig bones
This will fix https://github.com/minetest-technic/technic/pull/257. And probably any future problems involving Technic/Pipeworks Machines.
This commit is contained in:
parent
62dbf29301
commit
6b41c32f44
1 changed files with 7 additions and 1 deletions
|
@ -43,7 +43,13 @@ minetest.register_node("bones:bones", {
|
||||||
|
|
||||||
can_dig = function(pos, player)
|
can_dig = function(pos, player)
|
||||||
local inv = minetest.get_meta(pos):get_inventory()
|
local inv = minetest.get_meta(pos):get_inventory()
|
||||||
return is_owner(pos, player:get_player_name()) and inv:is_empty("main")
|
local name
|
||||||
|
if not player then
|
||||||
|
name = ""
|
||||||
|
else
|
||||||
|
name = player:get_player_name()
|
||||||
|
end
|
||||||
|
return is_owner(pos, name) and inv:is_empty("main")
|
||||||
end,
|
end,
|
||||||
|
|
||||||
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue