mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-06-01 03:20:03 -04:00
Add enable_locking setting
This commit is contained in:
parent
a2c9523bce
commit
3e6631990e
4 changed files with 13 additions and 1 deletions
|
@ -64,3 +64,6 @@ default:torch 99,default:cobble 99
|
|||
# starting biome, is used.
|
||||
# Default value is false.
|
||||
#engine_spawn = false
|
||||
|
||||
# Wheather locked chests and doors are enabled
|
||||
#enable_locking = true
|
||||
|
|
|
@ -81,6 +81,10 @@ function default.chest.register_chest(name, d)
|
|||
def.legacy_facedir_simple = true
|
||||
def.is_ground_content = false
|
||||
|
||||
if minetest.settings:get_bool("enable_locking") == false and def.protected then
|
||||
return -- Locking is disabled quit registration
|
||||
end
|
||||
|
||||
if def.protected then
|
||||
def.on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
|
|
@ -511,7 +511,9 @@ function doors.register_door(name, def)
|
|||
def.protected = true
|
||||
end
|
||||
def.only_placer_can_open = nil
|
||||
|
||||
if minetest.settings:get_bool("enable_locking") == false and def.protected then
|
||||
return -- Locking is disabled quit registration
|
||||
end
|
||||
local i = name:find(":")
|
||||
local modname = name:sub(1, i - 1)
|
||||
if not def.tiles then
|
||||
|
|
|
@ -64,3 +64,6 @@ enable_stairs_replace_abm (Replace old stairs) bool false
|
|||
# If enabled, use the engine's spawn search which does not check for a
|
||||
# suitable starting biome.
|
||||
engine_spawn (Use engine spawn search) bool false
|
||||
|
||||
# Enable locked chests/doors
|
||||
enable_locking (Enable locked chests/doors) bool true
|
||||
|
|
Loading…
Add table
Reference in a new issue