Skip to content

Commit

Permalink
persist whitelist
Browse files Browse the repository at this point in the history
  • Loading branch information
BuckarooBanzay committed May 4, 2020
1 parent 6b54a59 commit 2966cfc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions chatcommands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ minetest.register_chatcommand("mesecons_whitelist_add", {
local blockpos = mesecons_debug.get_blockpos(ppos)
local hash = minetest.hash_node_position(blockpos)

mesecons_debug[hash] = true
mesecons_debug.whitelist[hash] = true
mesecons_debug.save_whitelist()

return true, "mapblock whitlisted"
end
Expand All @@ -79,7 +80,8 @@ minetest.register_chatcommand("mesecons_whitelist_remove", {
local blockpos = mesecons_debug.get_blockpos(ppos)
local hash = minetest.hash_node_position(blockpos)

mesecons_debug[hash] = true
mesecons_debug.whitelist[hash] = true
mesecons_debug.save_whitelist()

return true, "mapblock removed from whitelist"
end
Expand Down
3 changes: 3 additions & 0 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ mesecons_debug = {
}

dofile(MP.."/functions.lua")
dofile(MP.."/whitelist.lua")
dofile(MP.."/privs.lua")
dofile(MP.."/flush.lua")
dofile(MP.."/context.lua")
Expand All @@ -22,4 +23,6 @@ dofile(MP.."/luacontroller.lua")
dofile(MP.."/chatcommands.lua")
dofile(MP.."/hud.lua")

mesecons_debug.load_whitelist()

print("[OK] mesecons_debug loaded")

0 comments on commit 2966cfc

Please sign in to comment.