LuckPerms

LuckPerms

41.4k Downloads

Document/guarantee that group weights default to 0

A248 opened this issue ยท 0 comments

commented

Description

The group weights feature allows groups to have unconfigured weight. For sorting purposes, LuckPerms defaults the group weight to 0 if it is undefined.

Proposed Behaviour

This behavior, to my knowledge, is not documented either on the wiki or javadocs. Therefore I am proposing that it be documented as a guarantee of the API. The getWeight() method would be an ideal place to locate this documentation.

Extra Details

Documenting this feature allows other plugins to rely on it, which may be useful in a few scenarios.

  • A plugin may hook into LuckPerms and use group weights to order players by hierarchy. Since group weights sometimes indicate a player's social status within the society on a particular server, relying on group weights can be a useful tool for other plugins.
  • Suppose another permissions plugin creates an importer for LuckPerms. It has its own group weights feature, with its own, possibly different default group weight. To transport permission data correctly in a way that preserves behavior, the other permission plugin must know the default group weight LuckPerms uses.