mirror of
https://github.com/kakalak-lumberJack/creative_areas.git
synced 2024-11-15 07:00:21 +01:00
Add list command
This commit is contained in:
parent
def4993593
commit
e85796249f
14
TODO.md
14
TODO.md
|
@ -1,14 +1,14 @@
|
||||||
# To Do
|
# To Do
|
||||||
|
|
||||||
_Note: Please use submit "New Issue" for each future feature requests as this will be easier to track and close as features are added. This list should be reserved for currently planned major features and phased out eventually._
|
_Note: Please submit "New Issue" for each future feature requests as this will be easier to track and close as features are added. This list should be reserved for currently planned major features and phased out asap._
|
||||||
* Add command to remove areas from creative area list.
|
* ~~Add command to remove areas from creative area list.~~ Done
|
||||||
* Add support to automatically check for and remove areas from creative list which are no long defined by areas mod.
|
* ~~Add support to automatically check for and remove areas from creative list which are no long defined by areas mod.~~ Done
|
||||||
* Show list of created Areas (each area with unique ID)
|
* ~~Show list of created Areas (each area with unique ID)~~
|
||||||
* Give/take more than one priv (fly, interact, ...)
|
* Give/take more than one priv (fly, interact, ...) * This feature request needs more explanation
|
||||||
* ~~delete Areas~~ This is handled by the Areas mod.
|
* ~~delete Areas~~ This is handled by the Areas mod.
|
||||||
* ~~edit Areas (change size / position? / change privs given-taken)~~ First 2 handled by Areas. 3rd already listed
|
* ~~edit Areas (change size / position? / change privs given-taken)~~ First 2 handled by Areas. 3rd already listed
|
||||||
* clear inventory once leaving a "creative area"
|
* ~~clear inventory once leaving a "creative area"~~
|
||||||
* save inventory entering an area and restore it once leaving this area
|
* ~~save inventory entering an area and restore it once leaving this area~~
|
||||||
|
|
||||||
~~Connection to different Mods~~
|
~~Connection to different Mods~~
|
||||||
~~connect to World-Edit Areas~~
|
~~connect to World-Edit Areas~~
|
||||||
|
|
19
init.lua
19
init.lua
|
@ -37,7 +37,7 @@ function check_cr_area(player)
|
||||||
local pos = player:get_pos()
|
local pos = player:get_pos()
|
||||||
local area_at_pos = areas:getAreasAtPos(pos)
|
local area_at_pos = areas:getAreasAtPos(pos)
|
||||||
local status = false
|
local status = false
|
||||||
if #cr_areas >= 1 then
|
if cr_areas ~= {} then
|
||||||
for i = 1, #cr_areas do
|
for i = 1, #cr_areas do
|
||||||
local areaID = cr_areas[i]
|
local areaID = cr_areas[i]
|
||||||
-- Clean up creative areas which are have been deleted from Areas mod
|
-- Clean up creative areas which are have been deleted from Areas mod
|
||||||
|
@ -76,6 +76,23 @@ minetest.register_chatcommand("rm_creative_area", {
|
||||||
rm_cr_area(name, param)
|
rm_cr_area(name, param)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_chatcommand("ls_creative_areas", {
|
||||||
|
description = "List creative areas and IDs",
|
||||||
|
params = "",
|
||||||
|
func = function(name, params)
|
||||||
|
local list = ""
|
||||||
|
if cr_areas ~= {} then
|
||||||
|
for i = 1, #cr_areas do
|
||||||
|
local id = tonumber(cr_areas[i])
|
||||||
|
local area_name = areas.areas[ id ]["name"]
|
||||||
|
list = list .. " " .. area_name .. " (ID="..id..")"
|
||||||
|
end
|
||||||
|
minetest.chat_send_player(name, "Creative Area (ID): "..list)
|
||||||
|
else minetest.chat_send_player(name, "No creative areas found")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
})
|
||||||
-------------------------------------------------
|
-------------------------------------------------
|
||||||
-- Check location and Grant/revoke creative priv
|
-- Check location and Grant/revoke creative priv
|
||||||
-------------------------------------------------
|
-------------------------------------------------
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
# Creative_areas
|
# Creative_areas
|
||||||
|
|
||||||
Creative Areas is a minetest mod allowing areas defined by the Areas mod to be designated as creative/sandbox areas adjusting players privliges and inventory formspecs appropriately as they leave or enter these areas.
|
Creative Areas is a minetest mod allowing areas defined by the Areas mod to be designated as creative/sandbox areas adjusting players privliges and inventory formspecs appropriately as they leave or enter these areas. Items mined or taken from creative inventory inside creative area will be removed from players inventories upon leaving creative areas.
|
||||||
|
|
||||||
|
Players with the 'privs' priv will not have privileges or inventories affected moving in and out of these areas.
|
||||||
|
|
||||||
* Use /creative_area <area ID number> to add area to list of areas where creative mode is enabled.
|
* Use /creative_area <area ID number> to add area to list of areas where creative mode is enabled.
|
||||||
* Use /rm_creative_areas <area ID number> to remove an area from the list.
|
* Use /rm_creative_areas <area ID number> to remove an area from the list.
|
||||||
|
* Use /ls_creative_areas to see a list of creative areas and respective area IDs.
|
||||||
|
|
||||||
Depends on Advanced Areas Mod by Shadow Ninja and the Creative mod included in Minetest Game.
|
Depends on [Advanced Areas Mod](https://github.com/ShadowNinja/areas) by Shadow Ninja and the [Creative](https://github.com/minetest/minetest_game/tree/master/mods/creative) mod included in Minetest Game.
|
||||||
|
|
||||||
|
This mod is compatible with Minetest 0.4.16 and up.
|
||||||
|
|
||||||
MIT License:
|
MIT License:
|
||||||
Copyright 2018 kakalak-lumberJack
|
Copyright 2018 kakalak-lumberJack
|
||||||
|
|
Loading…
Reference in New Issue
Block a user