mirror of
https://github.com/minetest-mods/technic.git
synced 2024-12-22 05:42:33 +01:00
parent
f3828c1943
commit
4a9ad94bf9
@ -159,6 +159,16 @@ local function get_receive_fields(name, data)
|
|||||||
return function(pos, formname, fields, sender)
|
return function(pos, formname, fields, sender)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local page = "main"
|
local page = "main"
|
||||||
|
|
||||||
|
local owner = meta:get_string("owner")
|
||||||
|
if owner ~= "" then
|
||||||
|
-- prevent modification of locked chests
|
||||||
|
if owner ~= sender:get_player_name() then return end
|
||||||
|
elseif not fields.quit then
|
||||||
|
-- prevent modification of protected chests
|
||||||
|
if minetest.is_protected(pos, sender:get_player_name()) then return end
|
||||||
|
end
|
||||||
|
|
||||||
if fields.sort or (data.autosort and fields.quit and meta:get_int("autosort") == 1) then
|
if fields.sort or (data.autosort and fields.quit and meta:get_int("autosort") == 1) then
|
||||||
sort_inventory(meta:get_inventory())
|
sort_inventory(meta:get_inventory())
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user