LuckPerms

LuckPerms

41.4k Downloads

ExtraContext for wg-regions doesn't work in 1.16+

TheoRetisch1 opened this issue ยท 6 comments

commented

If one sets a permission for a worldguard region to false, the permission will still be executed when using the forbidden command in the region. Lp verbose shows true even though the permission for the region is set to false.

How to reproduce:

  1. Create a worldguard region.
  2. lp group permission set false wg-region=test (I tested it with permissions from different plugins)
  3. Execute the command as player in the correct group while lp verbose on & !worldguard is running -> lp verbose will still output a true for the denied permission, a server restart doesn't help

In version 1.15.2 the system worked without problems for me.

PS: I know that I already reported the issue in #2588 and at that time incorrectly traced it back to FAWE. I made a mistake during testing and denied the permission independent of the wg-region. Now I have set up a fresh test server and have the problem with default Worldedit.

LuckPerms 5.1.98 - 1155
ExtraContexts version 2.0-SNAPSHOT - 14
Paper 1.16.2 - 141
WorldEdit version 7.2.0-SNAPSHOT+5314-3996998
WorldGuard version 7.0.4-SNAPSHOT+2067-91a1494

commented

Confirmed for Paper 1.16.3 build 198 + LuckPerms 5.1.107 + ExtraContext 2.0-SNAPSHOT.

commented

That's because the WorldGuard region contexts keys are worldguard:region (to check in which region a user is in) and worldguard:in-region (to check if a user is in any region), which is info you can get by doing /lp user <user> info.
https://github.com/LuckPerms/ExtraContexts/blob/master/src/main/java/me/lucko/extracontexts/calculators/WorldGuardRegionCalculator.java#L17-L18

commented

I am irritated? The mentioned keys do not work when assigning permissions, they are neither completed ingame nor in the web editor and do not exist in the Wiki (https://github.com/LuckPerms/ExtraContexts). There is only the context wg-region. Furthermore lp <user> info does not throw out any extra context information: https://imgur.com/a/L28HXNT? I currently have the following loaded ExtraContext version on the server and can't find any other download/version: https://ci.lucko.me/job/ExtraContexts/
What am I doing wrong?

commented

Did you enable the WorldGuard region contexts in the LuckPerms ExtraContexts config?

To use it, just add it to your plugins folder and enable the contexts you want to use.

https://github.com/LuckPerms/ExtraContexts/blob/master/src/main/resources/config.yml#L14

commented

Yeah I did, my config looks like this:

# ExtraContexts
# made with <3 by Luck


# Set a provider to true to enable it.
# Contexts are explained in more detail here:
# https://github.com/lucko/LuckPerms/wiki/Context


# Provides the 'wg-region' context.
# Returns the name of each WorldGuard region the player is currently in.
#
# e.g. wg-region=spawn
worldguard: true

# Provides the 'gamemode' context.
# Returns the players current gamemode.
#
# e.g. gamemode=creative
gamemode: true

# Provides the 'dimension' context.
# Returns the type of the players current world.
#
# e.g. dimension=nether
dimension: false

placeholderapi: false
placeholderapi-placeholders:
  allowflight: "%player_allow_flight%"

commented

It worked after resetting the config. Thank you for your help!