|
@ -17,8 +17,8 @@ minetest.register_chatcommand("creative_region", { |
|
|
local data = region_name |
|
|
local data = region_name |
|
|
local astore_id = creative_regions.astore:insert_area(edge1, edge2, tostring(data)) |
|
|
local astore_id = creative_regions.astore:insert_area(edge1, edge2, tostring(data)) |
|
|
if astore_id then |
|
|
if astore_id then |
|
|
creative_regions:set_region_privs(tostring(astore_id), nil) |
|
|
creative_regions:set_region_privs("r"..tostring(astore_id), nil) |
|
|
minetest.chat_send_player(name, "[creative_regions] New region set. ID: " .. astore_id) |
|
|
minetest.chat_send_player(name, "[creative_regions] New region set. ID: " .. "r"..astore_id) |
|
|
creative_regions:save_regions() |
|
|
creative_regions:save_regions() |
|
|
return true, "Done" |
|
|
return true, "Done" |
|
|
else |
|
|
else |
|
@ -36,7 +36,7 @@ minetest.register_chatcommand("creative_region_privs", { |
|
|
if not player then |
|
|
if not player then |
|
|
return false, "Player not found" |
|
|
return false, "Player not found" |
|
|
end |
|
|
end |
|
|
local found, _, region_id, privstring = param:find("^([+-]?%a?%d+)%s*,%s*(.+)$") |
|
|
local found, _, region_id, privstring = param:find("^([ra]%d+)%s*,%s*(.+)$") |
|
|
if not found or not region_id or not privstring then |
|
|
if not found or not region_id or not privstring then |
|
|
return false, "Syntax error" |
|
|
return false, "Syntax error" |
|
|
end |
|
|
end |
|
@ -57,11 +57,12 @@ minetest.register_chatcommand("creative_region_rm", { |
|
|
if not player then |
|
|
if not player then |
|
|
return false, "Player not found" |
|
|
return false, "Player not found" |
|
|
end |
|
|
end |
|
|
local found, _, region_id = param:find("^([+-]?%d+)%s*$") |
|
|
local found, _, region_id = param:find("^(r%d+)%s*$") |
|
|
if not found or not region_id then |
|
|
if not found or not region_id then |
|
|
return false, "Syntax error" |
|
|
return false, "Syntax error" |
|
|
end |
|
|
end |
|
|
local success = creative_regions.astore:remove_area(tonumber(region_id)) |
|
|
local astore_id = tonumber(string.sub(region_id, 2)) |
|
|
|
|
|
local success = creative_regions.astore:remove_area(astore_id) |
|
|
if success then |
|
|
if success then |
|
|
minetest.chat_send_player(name, "[creative_regions] Region " .. region_id .. "removed") |
|
|
minetest.chat_send_player(name, "[creative_regions] Region " .. region_id .. "removed") |
|
|
creative_regions:set_region_privs(tostring(region_id), nil) |
|
|
creative_regions:set_region_privs(tostring(region_id), nil) |
|
|