LuckPerms

LuckPerms

41.4k Downloads

Existing group meta is not properly inherited

Aaron1011 opened this issue ยท 2 comments

commented

When adding a player to a group, existing metadata will not be exposed to plugins, despite appearing as inherited in /lp user <user> meta info.

Steps to reproduce:

  1. Create a group with /lp creategroup <group>
  2. Set a meta item onto the group with /lp group <group> meta set <key> <value>
  3. Add the player to the group with /lp user <user> parent add <group>
  4. Run /lp user <user> meta info, and verify that the meta added in step 2 is shown as inherited.
  5. Call player.getOption(player.getActiveContexts(), "<key>") from a SpongeAPI plugin, and note that return value is Optional.empty().
  6. Re-run the exact command from step 2.
  7. Call player.getOption(player.getActiveContexts(), "<key>") again from a SpongeAPI plugin, and note that the proper value is now returned.
commented

I can't reproduce this.

Test code:

var command = {
    "process": function(source, arguments) {
        var result = source.getOption(source.getActiveContexts(), "test");
        logger.info("meta lookup result for 'test': " + result);
        return CommandResult.success();
    }
}

registerCommand(command, "testmeta");

Outcome:

In step 5 - the correct result is being returned for me. (see 3 lines up in the screenshot above)

[19:43:46 INFO] [tapir]: [init] meta lookup result for 'test': Optional[textvalue]
commented

p.s. sorry for the really rate reply to this issue - I've been super busy with other work recently and haven't had a chance to work on stuff as much. :]