Existing group meta is not properly inherited
Closed this issue ยท 2 comments
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:
- Create a group with
/lp creategroup <group>
- Set a meta item onto the group with
/lp group <group> meta set <key> <value>
- Add the player to the group with
/lp user <user> parent add <group>
- Run
/lp user <user> meta info
, and verify that the meta added in step 2 is shown as inherited. - Call
player.getOption(player.getActiveContexts(), "<key>")
from a SpongeAPI plugin, and note that return value isOptional.empty()
. - Re-run the exact command from step 2.
- Call
player.getOption(player.getActiveContexts(), "<key>")
again from a SpongeAPI plugin, and note that the proper value is now returned.
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]