mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-28 20:27:30 +01:00
Add setting to selectively disable strucutres
This commit is contained in:
parent
4f96b38fa3
commit
b7f26e2ddc
@ -1,5 +1,12 @@
|
||||
mcl_structures.registered_structures = {}
|
||||
|
||||
local disabled_structures = minetest.settings:get("mcl_disabled_structures")
|
||||
if disabled_structures then disabled_structures = disabled_structures:split(",")
|
||||
else disabled_structures = {} end
|
||||
|
||||
function mcl_structures.is_disabled(structname)
|
||||
if table.indexof(disabled_structures,structname) ~= -1 then return true end
|
||||
end
|
||||
|
||||
function mcl_structures.fill_chests(p1,p2,loot,pr)
|
||||
for it,lt in pairs(loot) do
|
||||
@ -168,6 +175,7 @@ function mcl_structures.place_structure(pos, def, pr, blockseed)
|
||||
end
|
||||
|
||||
function mcl_structures.register_structure(name,def,nospawn) --nospawn means it will be placed by another (non-nospawn) structure that contains it's structblock i.e. it will not be placed by mapgen directly
|
||||
if mcl_structures.is_disabled(name) then return end
|
||||
local structblock = "mcl_structures:structblock_"..name
|
||||
local flags = "place_center_x, place_center_z, force_placement"
|
||||
local y_offset = 0
|
||||
|
@ -39,6 +39,9 @@ mcl_doTileDrops (Blocks have drops) bool true
|
||||
# If enabled, TNT explosions destroy blocks.
|
||||
mcl_tnt_griefing (TNT destroys blocks) bool true
|
||||
|
||||
# Comma separated list of disabled structure names
|
||||
mcl_disabled_structures (Disabled structures) string
|
||||
|
||||
[Players]
|
||||
# If enabled, players respawn at the bed they last lay on instead of normal
|
||||
# spawn.
|
||||
|
Loading…
Reference in New Issue
Block a user