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:
2019-12-28 02:43:12 +01:00
parent aca830fd22
commit feae9967dc
4 changed files with 77 additions and 24 deletions

View File

@ -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>",