1
0
mirror of https://github.com/lucko/LuckPerms.git synced 2025-09-08 05:10:55 +02:00

Store result of primary group calculation in CachedMetaData

This commit is contained in:
Luck
2020-03-30 14:13:17 +01:00
parent c40ad63291
commit 42e9f43443
15 changed files with 265 additions and 178 deletions

View File

@@ -48,42 +48,52 @@ public interface CachedMetaData extends CachedData {
@Nullable String getMetaValue(String key);
/**
* Gets the user's highest priority prefix, or null if the user has no prefixes
* Gets the holder's highest priority prefix, or null if the holder has no prefixes
*
* @return a prefix string, or null
*/
@Nullable String getPrefix();
/**
* Gets the user's highest priority suffix, or null if the user has no suffixes
* Gets the holder's highest priority suffix, or null if the holder has no suffixes
*
* @return a suffix string, or null
*/
@Nullable String getSuffix();
/**
* Gets an immutable copy of the meta this user has.
* Gets an immutable copy of the meta this holder has.
*
* @return an immutable map of meta
*/
@NonNull Map<String, List<String>> getMeta();
/**
* Gets an immutable sorted map of all of the prefixes the user has, whereby the first value is the highest priority
* prefix.
* Gets an immutable sorted map of all of the prefixes the holder has, whereby the first
* value is the highest priority prefix.
*
* @return a sorted map of prefixes
*/
@NonNull SortedMap<Integer, String> getPrefixes();
/**
* Gets an immutable sorted map of all of the suffixes the user has, whereby the first value is the highest priority
* suffix.
* Gets an immutable sorted map of all of the suffixes the holder has, whereby the first
* value is the highest priority suffix.
*
* @return a sorted map of suffixes
*/
@NonNull SortedMap<Integer, String> getSuffixes();
/**
* Gets the name of the holders primary group.
*
* <p>Will return {@code null} for Group holder types.</p>
*
* @return the name of the primary group
* @since 5.1
*/
@Nullable String getPrimaryGroup();
/**
* Gets the definition used for the prefix stack
*