diff --git a/technic_chests/copper_chest.lua b/technic_chests/copper_chest.lua index fda1db0..6445d46 100644 --- a/technic_chests/copper_chest.lua +++ b/technic_chests/copper_chest.lua @@ -18,6 +18,7 @@ minetest.register_craft({ minetest.register_craft({ output = 'technic:copper_locked_chest 1', + type = "shapeless", recipe = { {'basic_materials:padlock'}, {'technic:copper_chest'}, diff --git a/technic_chests/gold_chest.lua b/technic_chests/gold_chest.lua index 7a50b70..9497646 100644 --- a/technic_chests/gold_chest.lua +++ b/technic_chests/gold_chest.lua @@ -29,6 +29,7 @@ end minetest.register_craft({ output = 'technic:gold_locked_chest', + type = "shapeless", recipe = { {'basic_materials:padlock'}, {'technic:gold_chest'}, diff --git a/technic_chests/iron_chest.lua b/technic_chests/iron_chest.lua index 237067b..d522240 100644 --- a/technic_chests/iron_chest.lua +++ b/technic_chests/iron_chest.lua @@ -25,6 +25,7 @@ minetest.register_craft({ minetest.register_craft({ output = 'technic:iron_locked_chest 1', + type = "shapeless", recipe = { {'basic_materials:padlock'}, {'technic:iron_chest'}, diff --git a/technic_chests/mithril_chest.lua b/technic_chests/mithril_chest.lua index fb7917a..52c1ad0 100644 --- a/technic_chests/mithril_chest.lua +++ b/technic_chests/mithril_chest.lua @@ -20,6 +20,7 @@ end minetest.register_craft({ output = 'technic:mithril_locked_chest 1', + type = "shapeless", recipe = { {'basic_materials:padlock'}, {'technic:mithril_chest'}, diff --git a/technic_chests/register.lua b/technic_chests/register.lua index 9fe6749..9cb5ce8 100644 --- a/technic_chests/register.lua +++ b/technic_chests/register.lua @@ -171,6 +171,16 @@ local function get_receive_fields(name, data, locked) end 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 sort_inventory(meta:get_inventory()) end diff --git a/technic_chests/silver_chest.lua b/technic_chests/silver_chest.lua index 4de196d..8bc8423 100644 --- a/technic_chests/silver_chest.lua +++ b/technic_chests/silver_chest.lua @@ -20,6 +20,7 @@ end minetest.register_craft({ output = 'technic:silver_locked_chest', + type = "shapeless", recipe = { {'basic_materials:padlock'}, {'technic:silver_chest'},