From 329d4dc7834636da4ea3e22e90e7e8c600549a7e Mon Sep 17 00:00:00 2001 From: Thomas Rudin Date: Fri, 16 Nov 2018 07:52:24 +0100 Subject: [PATCH] restrict field receive to owner only on locked chests --- technic_chests/register.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/technic_chests/register.lua b/technic_chests/register.lua index 98f01eb..7d11148 100644 --- a/technic_chests/register.lua +++ b/technic_chests/register.lua @@ -157,6 +157,16 @@ local function get_receive_fields(name, data) local lname = name:lower() return function(pos, formname, fields, sender) local meta = minetest.get_meta(pos) + local owner = meta:get_string("owner") + + if owner and owner ~= "" and sender then + -- check owner + if owner ~= sender:get_player_name() then + -- not the owner + return + end + end + local page = "main" if fields.sort or (data.autosort and fields.quit and meta:get_int("autosort") == 1) then sort_inventory(meta:get_inventory())