mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-05-28 09:36:27 -04:00
Alter mintest_game/mods/default/nodes.lua
Locked chests are checked for ownership when right-clicking to enter and trying to destroy, it is not needed in inventory_move, inventory_put and inventory_take so will save a little server time checking...
This commit is contained in:
parent
a192f9fc78
commit
30a73a6f5c
1 changed files with 0 additions and 12 deletions
|
@ -1196,24 +1196,12 @@ minetest.register_node("default:chest_locked", {
|
|||
return inv:is_empty("main") and has_locked_chest_privilege(meta, player)
|
||||
end,
|
||||
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not has_locked_chest_privilege(meta, player) then
|
||||
return 0
|
||||
end
|
||||
return count
|
||||
end,
|
||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not has_locked_chest_privilege(meta, player) then
|
||||
return 0
|
||||
end
|
||||
return stack:get_count()
|
||||
end,
|
||||
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not has_locked_chest_privilege(meta, player) then
|
||||
return 0
|
||||
end
|
||||
return stack:get_count()
|
||||
end,
|
||||
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
|
|
Loading…
Add table
Reference in a new issue