mirror of
https://github.com/minetest-mods/areas.git
synced 2025-06-30 23:20:27 +02:00
Ajoute certaines modifications venant de MFF + ajustement HUD
* Aires openfarming * Privilège megabuilder * HUD légèrement modifié pour laisser de la place à celui de factions
This commit is contained in:
@ -286,6 +286,28 @@ minetest.register_chatcommand("area_open", {
|
||||
})
|
||||
|
||||
|
||||
minetest.register_chatcommand(
|
||||
"area_openfarming", {
|
||||
params = "<ID>",
|
||||
description = "Toggle an area as open farming (anyone can harvest and plant) or closed",
|
||||
func = function(name, param)
|
||||
local id = tonumber(param)
|
||||
if not id then
|
||||
return false, "Invalid usage, see /help area_openfarming."
|
||||
end
|
||||
|
||||
if not areas:isAreaOwner(id, name) then
|
||||
return false, "Area "..id.." does not exist"
|
||||
.." or is not owned by you."
|
||||
end
|
||||
local open = not areas.areas[id].openfarming
|
||||
-- Save false as nil to avoid inflating the DB.
|
||||
areas.areas[id].openfarming = open or nil
|
||||
areas:save()
|
||||
return true, ("Area %s to farming."):format(open and "opened" or "closed")
|
||||
end
|
||||
})
|
||||
|
||||
if areas.factions_available then
|
||||
minetest.register_chatcommand("area_faction_open", {
|
||||
params = "<ID>",
|
||||
|
Reference in New Issue
Block a user