-- =================================================================== local cmdtab_add_feature = { params = "" , description = "Add a feature to /eregion_pos1,2 region" , privs = { eregions = true } , func = function (name, param) if param == "" then return false, "Invalid usage, see /help add_feature" end local pos1, pos2 = eregions:getPos (name) if not (pos1 and pos2) then return false, "You need to select a region first." end local id = eregions:add (param, pos1, pos2) eregions:save() return true, "ERegion added. ID: " .. id end } minetest.register_chatcommand ("add_feature" , cmdtab_add_feature) minetest.register_chatcommand ("addfeature" , cmdtab_add_feature) minetest.register_chatcommand ("feature" , cmdtab_add_feature) minetest.register_chatcommand ("/add_feature" , cmdtab_add_feature) minetest.register_chatcommand ("/addfeature" , cmdtab_add_feature) minetest.register_chatcommand ("/feature" , cmdtab_add_feature) -- =================================================================== local cmdtab_delete_feature = { params = "", description = "Remove feature based on eregion ID", func = function(name, param) local id = tonumber(param) if not id then return false, "Invalid usage, see /help delete_feature" end if eregions:remove (id) == false then return false, "ERegion " .. id .. " doesn't exist" end eregions:save() return true, "Removed eregion " .. id end } minetest.register_chatcommand ("delete_feature" , cmdtab_delete_feature) minetest.register_chatcommand ("deletefeature" , cmdtab_delete_feature) minetest.register_chatcommand ("delfeature" , cmdtab_delete_feature) minetest.register_chatcommand ("remove_feature" , cmdtab_delete_feature) minetest.register_chatcommand ("removefeature" , cmdtab_delete_feature) minetest.register_chatcommand ("/delete_feature" , cmdtab_delete_feature) minetest.register_chatcommand ("/deletefeature" , cmdtab_delete_feature) minetest.register_chatcommand ("/delfeature" , cmdtab_delete_feature) minetest.register_chatcommand ("/remove_feature" , cmdtab_delete_feature) minetest.register_chatcommand ("/removefeature" , cmdtab_delete_feature)