summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root@linuxworks.belug.de>2017-10-15 19:58:54 +0200
committerroot <root@linuxworks.belug.de>2017-10-15 19:58:54 +0200
commit6e4b4f82ab2a4e7dc0ed8aebfc0ad63ed2a374b5 (patch)
tree8a20ebd26dadd9a570b004bb8b8ce7e67de8f1e8
parent59cb759ce5e1535d1557dc21a575a69fc26d6ad5 (diff)
parent23a05553bccbd300de889c98d72b89761a93ac5c (diff)
Merge https://github.com/gpcf/drawers
-rwxr-xr-xlua/api.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/lua/api.lua b/lua/api.lua
index 736a8fb..ad32a3f 100755
--- a/lua/api.lua
+++ b/lua/api.lua
@@ -144,6 +144,10 @@ function drawers.drawer_on_dig(pos, node, player)
end
function drawers.drawer_allow_metadata_inventory_put(pos, listname, index, stack, player)
+ if core.is_protected(pos,player:get_player_name()) then
+ core.record_protection_violation(pos,player:get_player_name())
+ return 0
+ end
if listname ~= "upgrades" then
return 0
end
@@ -198,6 +202,7 @@ function drawers.register_drawer(name, def)
def.on_destruct = drawers.drawer_on_destruct
def.on_dig = drawers.drawer_on_dig
def.allow_metadata_inventory_put = drawers.drawer_allow_metadata_inventory_put
+ def.allow_metadata_inventory_take = drawers.drawer_allow_metadata_inventory_put
def.on_metadata_inventory_put = drawers.add_drawer_upgrade
def.on_metadata_inventory_take = drawers.remove_drawer_upgrade