Merge pull request #34 from minetest-mods/master

[pull] master from minetest-mods:master
This commit is contained in:
pull[bot] 2020-04-26 11:22:46 +00:00 committed by GitHub
commit a034b7a518
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 0 deletions

View File

@ -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'},

View File

@ -29,6 +29,7 @@ end
minetest.register_craft({
output = 'technic:gold_locked_chest',
type = "shapeless",
recipe = {
{'basic_materials:padlock'},
{'technic:gold_chest'},

View File

@ -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'},

View File

@ -20,6 +20,7 @@ end
minetest.register_craft({
output = 'technic:mithril_locked_chest 1',
type = "shapeless",
recipe = {
{'basic_materials:padlock'},
{'technic:mithril_chest'},

View File

@ -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

View File

@ -20,6 +20,7 @@ end
minetest.register_craft({
output = 'technic:silver_locked_chest',
type = "shapeless",
recipe = {
{'basic_materials:padlock'},
{'technic:silver_chest'},