SmallJoker / simple_protection

Minetest fixed-grid quadratic area protection mod with graphical area "minimap"
11 stars 6 forks source link

List of mods that have player grouping features #25

Open SmallJoker opened 4 years ago

SmallJoker commented 4 years ago

I'm currently thinking of adding an API to register groups support. If two players share the same group, the can access each other's areas.

Potential mods to provide support:

For example: /area shareall #classroom. is_protected would then run a callback to check whether another player may access this area.

BrunoMine commented 4 years ago

Sounds nice. This feature can bring new ways of dividing land between clans. I was already thinking about something like this, because this mod allows you to look at the map of territories. This is currently the main issue I see on my server.

SmallJoker commented 4 years ago

@BrunoMine Added a basic API function: d7171b8 and fad4c15

Your territory mod could register a callback as follows:

s_protect.register_on_access(function(pos, player_name, owner_name)
    if pos.z > 100 and pos.x < -5000 then
        return false -- Only the owner may access
    end
    if mymod.check_party(player_name, owner_name) and pos.y > 0 then
        return true -- Can access this position
    end
    -- Else: nil. No protection change
end)