LuckPerms

LuckPerms

41.4k Downloads

regex for worldname context

david-bla opened this issue ยท 3 comments

commented

Hi lucko,

thank you for this awesome project!
I just tried to use regular expressions in the context of worldnames.
Should this work? This repo is well structured but also sophisticated and I was not able to find this in the code.
I am used to give worldnames some suffix like world_001 but things like R=world_\d{3} or similar are not working.

Thank you in advance

commented

Duplicate of

commented

@BrainStone thank you for your opinion.

  • #1870

    This request is about using multiple "world" keys for each permission rule.
  • #1792

    Is about adding a context based filter for permission info command - for ingame text output.
    This is a duplicate of #819
  • #819

    Includes the filter from #1792 and for the search command.

My request is different. It is about using the supported regex syntax R=<expr> with the world.

Specified in https://github.com/lucko/LuckPerms/wiki/Advanced-Setup#regex

Regex
LuckPerms has support for regex when defining permission nodes and server/world names.
[...]
commented

Apologies, the wiki is incorrect there. This was previously a supported feature but was since removed to make way for the contexts system. (https://github.com/lucko/LuckPerms/wiki/Context)

Now, instead of having "world specific" or "server specific" assignments, we just have context specific assignments.

Currently context specific assignments work only on case insensitive matching.

https://github.com/lucko/LuckPerms/blob/7e8402b542b0a1eb2f5e072b6c3864a8e255f46c/common/src/main/java/me/lucko/luckperms/common/context/contextset/ImmutableContextSetImpl.java#L136-L161

This isn't something I'm keen to change -- adding regex into the mix here really complicates things.

So, the other options you have to implement similar behaviour is:

  1. World rewrite rules (see the config file for this)
  2. Implement / define your own context (see here)