factions icon indicating copy to clipboard operation
factions copied to clipboard

Configurable claim constraints

Open ickerio opened this issue 4 years ago • 2 comments

Is your feature request related to a problem?

Some users in the discord have described that they would like to limit claims being made on world borders and other areas.

Describe the solution you'd like.

I propose a configurable constraints system in the config file that allows the server moderators to write human readable constraints that the mod will check against before confirming a claim. These constraints can include dimensions and world or chunk coordinates.

This is my current proposal. An admin can create as many constraints as they see fit and a claim must pass each one before it is actually registered. If a claim fails any or multiple constraints then the first constraint to fail's message will be sent to the user in chat.

The following is an example that prevents people from claiming within 3 chunks of 0,0 and past chunk coordinates of 128,128 in any cardinal direction. Note that these are not in block coordinates but chunk coordinates. The final constraint prevents any claims that are in dimensions other than the overworld (where * means all). If

"claimConstraints": [
    {
        "dimensions": { "include": ["minecraft:overworld"] },
        "lessThanX": 3,
        "lessThanY": 3,
        "message": "You cannot claim in world spawn"
    },
    {
        "dimensions": { "include": ["minecraft:overworld"] },
        "greaterThanX": 128,
        "greaterThanY": 128,
        "message": "You cannot claim near the world border"
    },
    {
        "dimensions": { "include": "*", "exclude": ["minecraft:overworld"] },
        "disallowed": true,
        "message": "You cannot claim outside of the overworld"
    },
]

Obviously I'm very open to discussion but I believe this format is able to be implemented and is very human readable.

Describe alternatives you've considered.

I have been experimenting with adding a dimension whitelist / blacklist system for claims but I feel like this is much more powerful and expansive

Agreements

  • [X] I have searched for and ensured there isn't already an open issue regarding this.
  • [X] I have ensured the feature I'm requesting isn't already in the latest supported mod version.

Other

No response

ickerio avatar Jul 27 '21 10:07 ickerio

I've assigned myself this issue and I'll be logging my progress here. My first amendment is quite significant and rather than having a disallowed field I'd like to replace it with a type field. A Claim Constraint type can be claimable, wilderness, admin. Claimable is just like the current existing behavior of the world and will act as wilderness until claimed. Wilderness is neutral territory than can be edited by players but not claimed by anyone. Admin is not claimable or editable by anyone unless they have the requiredBypassLevel (default 2) in the config.

ickerio avatar Aug 02 '21 09:08 ickerio

An alternative could be to add a special admin faction to allow for an admin claim system.

BlueZeeKing avatar May 19 '22 00:05 BlueZeeKing