mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2026-11-14 01:24:05 +00:00
Fix grammar/spelling in API javadocs
This commit is contained in:
60 files changed
+104
-108
No files matched your search
@@ -89,7 +89,7 @@ public interface LuckPerms {
|
||||
* Gets the {@link UserManager}, responsible for managing
|
||||
* {@link User} instances.
|
||||
*
|
||||
* <p>This manager can be used to retrieve instances of {@link User} by uuid
|
||||
* <p>This manager can be used to retrieve instances of {@link User} by UUID
|
||||
* or name, or query all loaded users.</p>
|
||||
*
|
||||
* @return the user manager
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
package net.luckperms.api;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import static org.jetbrains.annotations.ApiStatus.Internal;
|
||||
|
||||
@@ -35,7 +36,7 @@ import static org.jetbrains.annotations.ApiStatus.Internal;
|
||||
* instance, however, this provider can be used if this is not viable.</p>
|
||||
*/
|
||||
public final class LuckPermsProvider {
|
||||
private static LuckPerms instance = null;
|
||||
private static @Nullable LuckPerms instance = null;
|
||||
|
||||
/**
|
||||
* Gets an instance of the {@link LuckPerms} API,
|
||||
|
||||
@@ -57,7 +57,7 @@ public interface ActionLog {
|
||||
/**
|
||||
* Gets the entries in the log performed by the given actor.
|
||||
*
|
||||
* @param actor the uuid of the actor to filter by
|
||||
* @param actor the UUID of the actor to filter by
|
||||
* @return the content for the given actor
|
||||
*/
|
||||
@Unmodifiable SortedSet<Action> getContent(UUID actor);
|
||||
@@ -65,8 +65,8 @@ public interface ActionLog {
|
||||
/**
|
||||
* Gets the log content for a given user
|
||||
*
|
||||
* @param uniqueId the uuid to filter by
|
||||
* @return all content in this log where the user = uuid
|
||||
* @param uniqueId the UUID to filter by
|
||||
* @return all content in this log where the user = UUID
|
||||
*/
|
||||
@Unmodifiable SortedSet<Action> getUserHistory(UUID uniqueId);
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* {@link net.luckperms.api.actionlog.ActionLog} related functionality.
|
||||
* {@link net.luckperms.api.actionlog.ActionLogger} related functionality.
|
||||
*/
|
||||
@org.jspecify.annotations.NullMarked
|
||||
package net.luckperms.api.actionlog;
|
||||
@@ -78,7 +78,7 @@ public interface CachedDataManager {
|
||||
*
|
||||
* <p>For {@link User}s, the most appropriate query options will be their
|
||||
* {@link ContextManager#getQueryOptions(User) current active query options} if the
|
||||
* corresponding player is online, and otherwise, will fallback to
|
||||
* corresponding player is online, and otherwise, will fall back to
|
||||
* {@link ContextManager#getStaticQueryOptions() the current static query options}.</p>
|
||||
*
|
||||
* <p>For {@link Group}s, the most appropriate query options will always be
|
||||
@@ -95,7 +95,7 @@ public interface CachedDataManager {
|
||||
*
|
||||
* <p>For {@link User}s, the most appropriate query options will be their
|
||||
* {@link ContextManager#getQueryOptions(User) current active query options} if the
|
||||
* corresponding player is online, and otherwise, will fallback to
|
||||
* corresponding player is online, and otherwise, will fall back to
|
||||
* {@link ContextManager#getStaticQueryOptions() the current static query options}.</p>
|
||||
*
|
||||
* <p>For {@link Group}s, the most appropriate query options will always be
|
||||
|
||||
@@ -117,7 +117,7 @@ public interface CachedMetaData extends CachedData {
|
||||
*
|
||||
* <p>This method will always return a {@link Result}, but the
|
||||
* {@link Result#result() inner result} {@link String} will be null if
|
||||
* a the resultant prefix stack contained no elements.</p>
|
||||
* the resultant prefix stack contained no elements.</p>
|
||||
*
|
||||
* @return a result containing the prefix
|
||||
* @since 5.4
|
||||
@@ -152,7 +152,7 @@ public interface CachedMetaData extends CachedData {
|
||||
*
|
||||
* <p>This method will always return a {@link Result}, but the
|
||||
* {@link Result#result() inner result} {@link String} will be null if
|
||||
* a the resultant suffix stack contained no elements.</p>
|
||||
* the resultant suffix stack contained no elements.</p>
|
||||
*
|
||||
* @return a result containing the suffix
|
||||
* @since 5.4
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
package net.luckperms.api.context;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.function.Function;
|
||||
@@ -37,8 +38,8 @@ import java.util.function.Function;
|
||||
* <ul>
|
||||
* <li>Context lookups should be <i>fast</i>: lookup methods are likely to
|
||||
* be invoked frequently, and should therefore be fast to execute. If
|
||||
* determining the current contexts involves a particularly time consuming
|
||||
* lookup (database queries, network requests, etc), then such results
|
||||
* determining the current contexts involves a particularly time-consuming
|
||||
* lookup (database queries, network requests, etc.), then such results
|
||||
* should be cached ahead of time.</li>
|
||||
*
|
||||
* <li>Context lookups should be <i>thread-safe</i>: lookups will sometimes
|
||||
@@ -69,7 +70,7 @@ public interface ContextCalculator<T> {
|
||||
* @param <T> the contextual type
|
||||
* @return the resultant calculator
|
||||
*/
|
||||
static <T> ContextCalculator<T> forSingleContext(String key, Function<T, String> valueFunction) {
|
||||
static <T> ContextCalculator<T> forSingleContext(String key, Function<T, @Nullable String> valueFunction) {
|
||||
Objects.requireNonNull(key, "key");
|
||||
Objects.requireNonNull(valueFunction, "valueFunction");
|
||||
return (target, consumer) -> {
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
package net.luckperms.api.context;
|
||||
|
||||
|
||||
/**
|
||||
* Functional interface that accepts context key value pairs.
|
||||
*/
|
||||
|
||||
@@ -64,7 +64,7 @@ import java.util.Set;
|
||||
* the '{@code :}' character. (e.g. "{@code worldguard:region}" for WorldGuard
|
||||
* regions)</p>
|
||||
*
|
||||
* <p>Contexts can be combined with each other to form so called
|
||||
* <p>Contexts can be combined with each other to form so-called
|
||||
* "context sets" - simply a collection of context pairs.</p>
|
||||
*
|
||||
* <p>Two default ContextSet implementations are provided.
|
||||
|
||||
@@ -39,7 +39,7 @@ public interface ContextSetFactory {
|
||||
/**
|
||||
* Prefer using {@link ImmutableContextSet#builder()}.
|
||||
*
|
||||
* @return a immutable context set builder
|
||||
* @return an immutable context set builder
|
||||
* @see ImmutableContextSet#builder()
|
||||
*/
|
||||
ImmutableContextSet.Builder immutableBuilder();
|
||||
|
||||
@@ -34,17 +34,17 @@ public final class DefaultContextKeys {
|
||||
}
|
||||
|
||||
/**
|
||||
* The context key used to denote the name of the subjects server.
|
||||
* The context key used to denote the name of the subject's server.
|
||||
*/
|
||||
public static final String SERVER_KEY = "server";
|
||||
|
||||
/**
|
||||
* The context key used to denote the name of the subjects world.
|
||||
* The context key used to denote the name of the subject's world.
|
||||
*/
|
||||
public static final String WORLD_KEY = "world";
|
||||
|
||||
/**
|
||||
* The context key used to denote the dimension type of the subjects world.
|
||||
* The context key used to denote the dimension type of the subject's world.
|
||||
*
|
||||
* <p>Possible values: overworld, the_nether, the_end</p>
|
||||
*
|
||||
@@ -53,7 +53,7 @@ public final class DefaultContextKeys {
|
||||
public static final String DIMENSION_TYPE_KEY = "dimension-type";
|
||||
|
||||
/**
|
||||
* The context key used to denote the subjects gamemode.
|
||||
* The context key used to denote the subject's gamemode.
|
||||
*
|
||||
* <p>Possible values: survival, creative, adventure, spectator</p>
|
||||
*
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
package net.luckperms.api.context;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.function.Supplier;
|
||||
@@ -45,7 +46,7 @@ public interface StaticContextCalculator extends ContextCalculator<Object> {
|
||||
* if the value returned is null.
|
||||
* @return the resultant calculator
|
||||
*/
|
||||
static StaticContextCalculator forSingleContext(String key, Supplier<String> valueFunction) {
|
||||
static StaticContextCalculator forSingleContext(String key, Supplier<@Nullable String> valueFunction) {
|
||||
Objects.requireNonNull(key, "key");
|
||||
Objects.requireNonNull(valueFunction, "valueFunction");
|
||||
return consumer -> {
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
package net.luckperms.api.event;
|
||||
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
|
||||
@@ -60,11 +60,11 @@ public interface ContextUpdateEvent extends LuckPermsEvent {
|
||||
Object getSubject();
|
||||
|
||||
/**
|
||||
* Gets the subject whose contexts were updated, casted to a given type.
|
||||
* Gets the subject whose contexts were updated, cast to a given type.
|
||||
*
|
||||
* @param subjectClass the type to cast to
|
||||
* @param <T> the subject type
|
||||
* @return the casted subject
|
||||
* @return the cast subject
|
||||
*/
|
||||
default <T> Optional<T> getSubject(Class<T> subjectClass) {
|
||||
Object subject = getSubject();
|
||||
|
||||
@@ -32,7 +32,7 @@ import net.luckperms.api.model.group.Group;
|
||||
/**
|
||||
* Called when a group is loaded into memory from the storage.
|
||||
*
|
||||
* Note that this event is not the same as {@link GroupCreateEvent}
|
||||
* <p>Note that this event is not the same as {@link GroupCreateEvent}.</p>
|
||||
*/
|
||||
public interface GroupLoadEvent extends LuckPermsEvent {
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Events relating to the {@link net.luckperms.api.actionlog.ActionLog}.
|
||||
* Events relating to the {@link net.luckperms.api.actionlog.ActionLogger}.
|
||||
*/
|
||||
@org.jspecify.annotations.NullMarked
|
||||
package net.luckperms.api.event.log;
|
||||
@@ -42,7 +42,7 @@ public interface PlayerDataSaveEvent extends LuckPermsEvent {
|
||||
/**
|
||||
* Gets the unique ID that was saved.
|
||||
*
|
||||
* @return the uuid
|
||||
* @return the UUID
|
||||
*/
|
||||
@Param(0)
|
||||
UUID getUniqueId();
|
||||
|
||||
@@ -54,7 +54,7 @@ public interface PlayerLoginProcessEvent extends LuckPermsEvent, Result {
|
||||
/**
|
||||
* Gets the UUID of the connection which was processed
|
||||
*
|
||||
* @return the uuid of the connection which was processed
|
||||
* @return the UUID of the connection which was processed
|
||||
*/
|
||||
@Param(0)
|
||||
UUID getUniqueId();
|
||||
|
||||
+4
-4
@@ -33,21 +33,21 @@ import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Called when the platform needs to determine the type of a player's {@link UUID unique id}.
|
||||
* Called when the platform needs to determine a player's {@link UUID unique id} type.
|
||||
*
|
||||
* @since 5.3
|
||||
*/
|
||||
public interface UniqueIdDetermineTypeEvent extends LuckPermsEvent, ResultEvent<String> {
|
||||
|
||||
/**
|
||||
* The players UUID has been obtained by authenticating with the Mojang session servers.
|
||||
* The player's UUID has been obtained by authenticating with the Mojang session servers.
|
||||
*
|
||||
* <p>Usually indicated by the UUID being {@link UUID#version() version} 4.</p>
|
||||
*/
|
||||
String TYPE_AUTHENTICATED = "authenticated";
|
||||
|
||||
/**
|
||||
* The players UUID has not been obtained through authentication, and instead is likely based
|
||||
* The player's UUID has not been obtained through authentication, and instead is likely based
|
||||
* on the username they connected with.
|
||||
*
|
||||
* <p>Usually indicated by the UUID being {@link UUID#version() version} 3.</p>
|
||||
@@ -55,7 +55,7 @@ public interface UniqueIdDetermineTypeEvent extends LuckPermsEvent, ResultEvent<
|
||||
String TYPE_UNAUTHENTICATED = "unauthenticated";
|
||||
|
||||
/**
|
||||
* The players UUID most likely belongs to a NPC (non-player character).
|
||||
* The player's UUID most likely belongs to a NPC (non-player character).
|
||||
*
|
||||
* <p>Usually indicated by the UUID being {@link UUID#version() version} 2.</p>
|
||||
*
|
||||
|
||||
@@ -37,7 +37,7 @@ import java.util.UUID;
|
||||
*
|
||||
* @since 5.3
|
||||
*/
|
||||
public interface UniqueIdLookupEvent extends LuckPermsEvent, ResultEvent<UUID> {
|
||||
public interface UniqueIdLookupEvent extends LuckPermsEvent, ResultEvent<@Nullable UUID> {
|
||||
|
||||
/**
|
||||
* Gets the username being looked up.
|
||||
|
||||
@@ -37,7 +37,7 @@ import java.util.UUID;
|
||||
*
|
||||
* @since 5.3
|
||||
*/
|
||||
public interface UsernameLookupEvent extends LuckPermsEvent, ResultEvent<String> {
|
||||
public interface UsernameLookupEvent extends LuckPermsEvent, ResultEvent<@Nullable String> {
|
||||
|
||||
/**
|
||||
* Gets the {@link UUID unique id} being looked up.
|
||||
|
||||
@@ -32,7 +32,7 @@ import net.luckperms.api.track.Track;
|
||||
/**
|
||||
* Called when a track is loaded into memory from the storage.
|
||||
*
|
||||
* Note that this event is not the same as {@link TrackCreateEvent}
|
||||
* <p>Note that this event is not the same as {@link TrackCreateEvent}.</p>
|
||||
*/
|
||||
public interface TrackLoadEvent extends LuckPermsEvent {
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
package net.luckperms.api.event.type;
|
||||
|
||||
import net.luckperms.api.event.util.Param;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
@@ -35,7 +36,7 @@ import java.util.concurrent.atomic.AtomicReference;
|
||||
* @param <T> the type of the result
|
||||
* @since 5.3
|
||||
*/
|
||||
public interface ResultEvent<T> {
|
||||
public interface ResultEvent<T extends @Nullable Object> {
|
||||
|
||||
/**
|
||||
* Gets an {@link AtomicReference} containing the result.
|
||||
|
||||
@@ -46,7 +46,7 @@ public interface UserFirstLoginEvent extends LuckPermsEvent {
|
||||
/**
|
||||
* Gets the UUID of the user
|
||||
*
|
||||
* @return the uuid of the user
|
||||
* @return the UUID of the user
|
||||
*/
|
||||
@Param(0)
|
||||
UUID getUniqueId();
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
package net.luckperms.api.event.user.track;
|
||||
|
||||
|
||||
/**
|
||||
* Called when a user is demoted down a track.
|
||||
*
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
package net.luckperms.api.event.user.track;
|
||||
|
||||
|
||||
/**
|
||||
* Called when a user is promoted up a track.
|
||||
*
|
||||
|
||||
@@ -45,7 +45,7 @@ public interface MessagingService {
|
||||
* Uses the messaging service to inform other servers about a general
|
||||
* change.
|
||||
*
|
||||
* <p>The standard response by other servers will be to execute a overall
|
||||
* <p>The standard response by other servers will be to execute an overall
|
||||
* sync of all live data, equivalent to calling
|
||||
* {@link LuckPerms#runUpdateTask()}.</p>
|
||||
*
|
||||
@@ -76,7 +76,7 @@ public interface MessagingService {
|
||||
*
|
||||
* <p>The intended use case of this functionality is to allow plugins/mods
|
||||
* to send <b>lightweight</b> and <b>permissions-related</b> custom messages
|
||||
* between instances, piggy-backing on top of the messenger abstraction
|
||||
* between instances, piggybacking on top of the messenger abstraction
|
||||
* already built into LuckPerms.</p>
|
||||
*
|
||||
* <p>It is <b>not</b> intended as a full message broker replacement/abstraction.
|
||||
|
||||
@@ -53,7 +53,7 @@ public interface Messenger extends AutoCloseable {
|
||||
void sendOutgoingMessage(OutgoingMessage outgoingMessage);
|
||||
|
||||
/**
|
||||
* Performs the necessary action to gracefully shutdown the messenger.
|
||||
* Performs the necessary action to gracefully shut down the messenger.
|
||||
*/
|
||||
@Override
|
||||
default void close() {
|
||||
|
||||
@@ -30,7 +30,7 @@ import net.luckperms.api.messenger.message.Message;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Represents an "user update" message.
|
||||
* Represents a "user update" message.
|
||||
*
|
||||
* <p>Used to notify other servers of a change to a specific user.</p>
|
||||
*/
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
package net.luckperms.api.metastacking;
|
||||
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
@@ -78,7 +78,7 @@ public interface PermissionHolder {
|
||||
* <p>The {@link User#getUniqueId()}, {@link User#getUsername()} and {@link Group#getName()} methods
|
||||
* define a "tighter" specification for obtaining object identifiers.</p>
|
||||
*
|
||||
* @return the identifier for this object. Either a uuid string or name.
|
||||
* @return the identifier for this object. Either a UUID string or name.
|
||||
*/
|
||||
String getName();
|
||||
|
||||
@@ -119,7 +119,7 @@ public interface PermissionHolder {
|
||||
*
|
||||
* <p>For {@link User}s, the most appropriate query options will be their
|
||||
* {@link ContextManager#getQueryOptions(User) current active query options} if the
|
||||
* corresponding player is online, and otherwise, will fallback to
|
||||
* corresponding player is online, and otherwise, will fall back to
|
||||
* {@link ContextManager#getStaticQueryOptions() the current static query options}
|
||||
* if they are offline.</p>
|
||||
*
|
||||
|
||||
@@ -34,7 +34,7 @@ import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Encapsulates the result of an operation to save uuid data about a player.
|
||||
* Encapsulates the result of an operation to save UUID data about a player.
|
||||
*
|
||||
* <p>The corresponding method can be found at
|
||||
* {@link UserManager#savePlayerData(UUID, String)}.</p>
|
||||
@@ -71,12 +71,12 @@ public interface PlayerSaveResult {
|
||||
@Nullable String getPreviousUsername();
|
||||
|
||||
/**
|
||||
* Gets the other uuids involved in the result.
|
||||
* Gets the other UUIDs involved in the result.
|
||||
*
|
||||
* <p>Returns null when the result doesn't {@link #includes(Outcome) include} the
|
||||
* {@link Outcome#OTHER_UNIQUE_IDS_PRESENT_FOR_USERNAME} status.</p>
|
||||
*
|
||||
* @return the other uuids
|
||||
* @return the other UUIDs
|
||||
* @see Outcome#OTHER_UNIQUE_IDS_PRESENT_FOR_USERNAME
|
||||
*/
|
||||
@Nullable @Unmodifiable Set<UUID> getOtherUniqueIds();
|
||||
@@ -87,7 +87,7 @@ public interface PlayerSaveResult {
|
||||
enum Outcome {
|
||||
|
||||
/**
|
||||
* There was no existing data saved for either the uuid or username
|
||||
* There was no existing data saved for either the UUID or username
|
||||
*/
|
||||
CLEAN_INSERT,
|
||||
|
||||
@@ -104,7 +104,7 @@ public interface PlayerSaveResult {
|
||||
USERNAME_UPDATED,
|
||||
|
||||
/**
|
||||
* There was already a record for the username saved, but it was under a different uuid.
|
||||
* There was already a record for the username saved, but it was under a different UUID.
|
||||
*
|
||||
* <p>This is a bit of a cause for concern. It's possible that "player1" has changed
|
||||
* their username to "player2", and "player3" has changed their username to "player1".
|
||||
|
||||
@@ -93,7 +93,7 @@ public interface NodeMap {
|
||||
/**
|
||||
* Adds a node.
|
||||
*
|
||||
* @param node the node to be add
|
||||
* @param node the node to be added
|
||||
* @return the result of the operation
|
||||
*/
|
||||
DataMutateResult add(Node node);
|
||||
|
||||
@@ -44,11 +44,11 @@ public interface Group extends PermissionHolder {
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Gets the groups "display name", if it has one that differs from it's actual name.
|
||||
* Gets the groups "display name", if it has one that differs from its actual name.
|
||||
*
|
||||
* <p>The lookup is made using the current servers active context.</p>
|
||||
*
|
||||
* <p>Will return <code>null</code> if the groups display name is equal to it's
|
||||
* <p>Will return <code>null</code> if the groups display name is equal to its
|
||||
* {@link #getName() actual name}.</p>
|
||||
*
|
||||
* @return the display name
|
||||
@@ -56,9 +56,9 @@ public interface Group extends PermissionHolder {
|
||||
@Nullable String getDisplayName();
|
||||
|
||||
/**
|
||||
* Gets the groups "display name", if it has one that differs from it's actual name.
|
||||
* Gets the groups "display name", if it has one that differs from its actual name.
|
||||
*
|
||||
* <p>Will return <code>null</code> if the groups display name is equal to it's
|
||||
* <p>Will return <code>null</code> if the groups display name is equal to its
|
||||
* {@link #getName() actual name}.</p>
|
||||
*
|
||||
* @param queryOptions the query options to lookup in
|
||||
|
||||
@@ -45,7 +45,7 @@ import java.util.function.Consumer;
|
||||
* Represents the object responsible for managing {@link User} instances.
|
||||
*
|
||||
* <p>Note that User instances are automatically loaded for online players.
|
||||
* It's likely that offline players will not have an instance pre-loaded.</p>
|
||||
* It's likely that offline players will not have an instance preloaded.</p>
|
||||
*
|
||||
* <p>All blocking methods return {@link CompletableFuture}s, which will be
|
||||
* populated with the result once the data has been loaded/saved asynchronously.
|
||||
@@ -62,19 +62,19 @@ public interface UserManager {
|
||||
/**
|
||||
* Loads a user from the plugin's storage provider into memory.
|
||||
*
|
||||
* @param uniqueId the uuid of the user
|
||||
* @param uniqueId the UUID of the user
|
||||
* @param username the username, if known
|
||||
* @return the resultant user
|
||||
* @throws NullPointerException if the uuid is null
|
||||
* @throws NullPointerException if the UUID is null
|
||||
*/
|
||||
CompletableFuture<User> loadUser(UUID uniqueId, @Nullable String username);
|
||||
|
||||
/**
|
||||
* Loads a user from the plugin's storage provider into memory.
|
||||
*
|
||||
* @param uniqueId the uuid of the user
|
||||
* @param uniqueId the UUID of the user
|
||||
* @return the resultant user
|
||||
* @throws NullPointerException if the uuid is null
|
||||
* @throws NullPointerException if the UUID is null
|
||||
*/
|
||||
default CompletableFuture<User> loadUser(UUID uniqueId) {
|
||||
return loadUser(uniqueId, null);
|
||||
@@ -83,29 +83,29 @@ public interface UserManager {
|
||||
/**
|
||||
* Loads multiple users from the plugin's storage provider into memory.
|
||||
*
|
||||
* @param uniqueIds the uuids of the users to load
|
||||
* @param uniqueIds the UUIDs of the users to load
|
||||
* @return a future for an unmodifiable map of loaded users
|
||||
* @throws NullPointerException if the uuid set is null
|
||||
* @throws NullPointerException if the UUID set is null
|
||||
* @since 5.6
|
||||
*/
|
||||
CompletableFuture<@Unmodifiable Map<UUID, User>> loadUsers(Set<UUID> uniqueIds);
|
||||
|
||||
/**
|
||||
* Uses the LuckPerms cache to find a uuid for the given username.
|
||||
* Uses the LuckPerms cache to find a UUID for the given username.
|
||||
*
|
||||
* <p>This lookup is case insensitive.</p>
|
||||
* <p>This lookup is case-insensitive.</p>
|
||||
*
|
||||
* @param username the username
|
||||
* @return a uuid, could be null
|
||||
* @return a UUID, could be null
|
||||
* @throws NullPointerException if either parameters are null
|
||||
* @throws IllegalArgumentException if the username is invalid
|
||||
*/
|
||||
CompletableFuture<UUID> lookupUniqueId(String username);
|
||||
|
||||
/**
|
||||
* Uses the LuckPerms cache to find a username for the given uuid.
|
||||
* Uses the LuckPerms cache to find a username for the given UUID.
|
||||
*
|
||||
* @param uniqueId the uuid
|
||||
* @param uniqueId the UUID
|
||||
* @return a username, could be null
|
||||
* @throws NullPointerException if either parameters are null
|
||||
* @throws IllegalArgumentException if the username is invalid
|
||||
@@ -132,7 +132,7 @@ public interface UserManager {
|
||||
* then {@link #saveUser(User)}, and returns an encapsulation of the whole process as a
|
||||
* {@link CompletableFuture}. </p>
|
||||
*
|
||||
* @param uniqueId the uuid of the user
|
||||
* @param uniqueId the UUID of the user
|
||||
* @param action the action to apply to the user
|
||||
* @return a future to encapsulate the operation
|
||||
* @since 5.1
|
||||
@@ -146,7 +146,7 @@ public interface UserManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves data about a player to the uuid caching system.
|
||||
* Saves data about a player to the UUID caching system.
|
||||
*
|
||||
* @param uniqueId the users mojang unique id
|
||||
* @param username the users username
|
||||
@@ -157,7 +157,7 @@ public interface UserManager {
|
||||
CompletableFuture<PlayerSaveResult> savePlayerData(UUID uniqueId, String username);
|
||||
|
||||
/**
|
||||
* Deletes any data about a given player from the uuid caching system.
|
||||
* Deletes any data about a given player from the UUID caching system.
|
||||
*
|
||||
* <p>Note that this method does not affect any saved user/permissions data.</p>
|
||||
*
|
||||
@@ -172,7 +172,7 @@ public interface UserManager {
|
||||
*
|
||||
* <p>"Unique" meaning the user isn't just a member of the "default" group.</p>
|
||||
*
|
||||
* @return a set of uuids
|
||||
* @return a set of UUIDs
|
||||
*/
|
||||
CompletableFuture<@Unmodifiable Set<UUID>> getUniqueUsers();
|
||||
|
||||
@@ -200,9 +200,9 @@ public interface UserManager {
|
||||
/**
|
||||
* Gets a loaded user.
|
||||
*
|
||||
* @param uniqueId the uuid of the user to get
|
||||
* @return a {@link User} object, if one matching the uuid is loaded, or null if not
|
||||
* @throws NullPointerException if the uuid is null
|
||||
* @param uniqueId the UUID of the user to get
|
||||
* @return a {@link User} object, if one matching the UUID is loaded, or null if not
|
||||
* @throws NullPointerException if the UUID is null
|
||||
*/
|
||||
@Nullable User getUser(UUID uniqueId);
|
||||
|
||||
@@ -210,7 +210,7 @@ public interface UserManager {
|
||||
* Gets a loaded user.
|
||||
*
|
||||
* @param username the username of the user to get
|
||||
* @return a {@link User} object, if one matching the uuid is loaded, or null if not
|
||||
* @return a {@link User} object, if one matching the UUID is loaded, or null if not
|
||||
* @throws NullPointerException if the name is null
|
||||
*/
|
||||
@Nullable User getUser(String username);
|
||||
@@ -225,9 +225,9 @@ public interface UserManager {
|
||||
/**
|
||||
* Check if a user is loaded in memory
|
||||
*
|
||||
* @param uniqueId the uuid to check for
|
||||
* @param uniqueId the UUID to check for
|
||||
* @return true if the user is loaded
|
||||
* @throws NullPointerException if the uuid is null
|
||||
* @throws NullPointerException if the UUID is null
|
||||
*/
|
||||
boolean isLoaded(UUID uniqueId);
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
package net.luckperms.api.node;
|
||||
|
||||
|
||||
/**
|
||||
* Dummy implementation of {@link NodeEqualityPredicate}, used for the given constant
|
||||
* implementations.
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
package net.luckperms.api.node;
|
||||
|
||||
|
||||
import java.util.function.Predicate;
|
||||
|
||||
/**
|
||||
@@ -141,7 +140,7 @@ public interface NodeEqualityPredicate {
|
||||
NodeEqualityPredicate IGNORE_EXPIRY_TIME_AND_VALUE = new DummyNodeEqualityPredicate("IGNORE_EXPIRY_TIME_AND_VALUE");
|
||||
|
||||
/**
|
||||
* All attributes must match, except for {@link Node#getValue() value} and the if the node
|
||||
* All attributes must match, except for {@link Node#getValue() value} and if the node
|
||||
* {@link Node#hasExpiry() has an expiry}, which are ignored.
|
||||
*
|
||||
* <p>Effectively only considers the key and the context.</p>
|
||||
|
||||
@@ -173,7 +173,7 @@ public interface NodeType<T extends Node> {
|
||||
* not {@link #matches(Node) match} the type.</p>
|
||||
*
|
||||
* @param node the node to cast
|
||||
* @return the casted node
|
||||
* @return the cast node
|
||||
* @throws IllegalArgumentException if the node to cast does not match the type
|
||||
*/
|
||||
T cast(Node node);
|
||||
@@ -186,7 +186,7 @@ public interface NodeType<T extends Node> {
|
||||
* does not {@link #matches(Node) match} the type.</p>
|
||||
*
|
||||
* @param node the node to cast
|
||||
* @return an optional, possibly containing a casted node
|
||||
* @return an optional, possibly containing a cast node
|
||||
*/
|
||||
default Optional<T> tryCast(Node node) {
|
||||
Objects.requireNonNull(node, "node");
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
package net.luckperms.api.node;
|
||||
|
||||
|
||||
/**
|
||||
* A {@link Node}, with its own type and the type of its associated builder
|
||||
* defined as a type parameter.
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
package net.luckperms.api.node;
|
||||
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
package net.luckperms.api.node.metadata;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
@@ -54,7 +55,7 @@ final class SimpleNodeMetadataKey<T> implements NodeMetadataKey<T> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
public boolean equals(@Nullable Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
SimpleNodeMetadataKey<?> that = (SimpleNodeMetadataKey<?>) o;
|
||||
|
||||
@@ -32,7 +32,7 @@ import net.luckperms.api.node.NodeType;
|
||||
import net.luckperms.api.node.ScopedNode;
|
||||
|
||||
/**
|
||||
* A sub-type of {@link Node} used to mark the display name of the node's holder.
|
||||
* A subtype of {@link Node} used to mark the display name of the node's holder.
|
||||
*/
|
||||
public interface DisplayNameNode extends ScopedNode<DisplayNameNode, DisplayNameNode.Builder> {
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ import net.luckperms.api.node.NodeType;
|
||||
import net.luckperms.api.node.ScopedNode;
|
||||
|
||||
/**
|
||||
* A sub-type of {@link Node} used to mark that the holder of the node should inherit
|
||||
* A subtype of {@link Node} used to mark that the holder of the node should inherit
|
||||
* from another group.
|
||||
*/
|
||||
public interface InheritanceNode extends ScopedNode<InheritanceNode, InheritanceNode.Builder> {
|
||||
|
||||
@@ -32,7 +32,7 @@ import net.luckperms.api.node.NodeType;
|
||||
import net.luckperms.api.node.ScopedNode;
|
||||
|
||||
/**
|
||||
* A sub-type of {@link Node} used to store meta assignments.
|
||||
* A subtype of {@link Node} used to store meta assignments.
|
||||
*/
|
||||
public interface MetaNode extends ScopedNode<MetaNode, MetaNode.Builder> {
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ import net.luckperms.api.node.ScopedNode;
|
||||
import java.util.OptionalInt;
|
||||
|
||||
/**
|
||||
* A sub-type of {@link Node} representing basic permissions.
|
||||
* A subtype of {@link Node} representing basic permissions.
|
||||
*/
|
||||
public interface PermissionNode extends ScopedNode<PermissionNode, PermissionNode.Builder> {
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import net.luckperms.api.node.Node;
|
||||
import net.luckperms.api.node.NodeType;
|
||||
|
||||
/**
|
||||
* A sub-type of {@link Node} used to store prefix assignments.
|
||||
* A subtype of {@link Node} used to store prefix assignments.
|
||||
*/
|
||||
public interface PrefixNode extends ChatMetaNode<PrefixNode, PrefixNode.Builder> {
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ import java.util.Optional;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* A sub-type of {@link Node} used to store regex permissions.
|
||||
* A subtype of {@link Node} used to store regex permissions.
|
||||
*/
|
||||
public interface RegexPermissionNode extends ScopedNode<RegexPermissionNode, RegexPermissionNode.Builder> {
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import net.luckperms.api.node.Node;
|
||||
import net.luckperms.api.node.NodeType;
|
||||
|
||||
/**
|
||||
* A sub-type of {@link Node} used to store suffix assignments.
|
||||
* A subtype of {@link Node} used to store suffix assignments.
|
||||
*/
|
||||
public interface SuffixNode extends ChatMetaNode<SuffixNode, SuffixNode.Builder> {
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ import net.luckperms.api.node.NodeType;
|
||||
import net.luckperms.api.node.ScopedNode;
|
||||
|
||||
/**
|
||||
* A sub-type of {@link Node} used to mark the weight of the node's holder.
|
||||
* A subtype of {@link Node} used to mark the weight of the node's holder.
|
||||
*/
|
||||
public interface WeightNode extends ScopedNode<WeightNode, WeightNode.Builder> {
|
||||
|
||||
|
||||
@@ -42,9 +42,9 @@ public interface Health {
|
||||
boolean isHealthy();
|
||||
|
||||
/**
|
||||
* Gets extra metadata/details about the healthcheck result.
|
||||
* Gets extra metadata/details about the health check result.
|
||||
*
|
||||
* @return details about the healthcheck status
|
||||
* @return details about the health check status
|
||||
*/
|
||||
Map<String, Object> getDetails();
|
||||
|
||||
|
||||
@@ -42,9 +42,9 @@ public interface PlatformEntity {
|
||||
/**
|
||||
* Gets the unique id of the entity, if it has one.
|
||||
*
|
||||
* <p>For players, this returns their uuid assigned by the server.</p>
|
||||
* <p>For players, this returns their UUID assigned by the server.</p>
|
||||
*
|
||||
* @return the uuid of the object, if available
|
||||
* @return the UUID of the object, if available
|
||||
*/
|
||||
@Nullable UUID getUniqueId();
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ public interface PlayerAdapter<T> {
|
||||
* using their {@link #getQueryOptions(Object) active query options}.
|
||||
*
|
||||
* @param player the player
|
||||
* @return the cached meta data for the player
|
||||
* @return the cached metadata for the player
|
||||
* @see CachedDataManager#getMetaData()
|
||||
*/
|
||||
default CachedMetaData getMetaData(T player) {
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
package net.luckperms.api.platform;
|
||||
|
||||
|
||||
/**
|
||||
* Provides information about the LuckPerms plugin.
|
||||
*/
|
||||
|
||||
@@ -28,8 +28,8 @@ package net.luckperms.api.query;
|
||||
/**
|
||||
* The flags which can be set for a query.
|
||||
*
|
||||
* <p>By default (in places like new instances of {@link QueryOptions.Builder} and
|
||||
* {@link QueryOptions#defaultContextualOptions()}), all {@link Flag}s are set to true.</p>
|
||||
* <p>By default, (in places like new instances of {@link QueryOptions.Builder} and
|
||||
* {@link QueryOptions#defaultContextualOptions()}) all {@link Flag}s are set to true.</p>
|
||||
*/
|
||||
public enum Flag {
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ public interface QueryOptions {
|
||||
*
|
||||
* <p>This instance has the default set of flags.</p>
|
||||
*
|
||||
* @return the default non contextual query options
|
||||
* @return the default non-contextual query options
|
||||
*/
|
||||
static QueryOptions nonContextual() {
|
||||
return LuckPermsProvider.get().getQueryOptionsRegistry().defaultNonContextualOptions();
|
||||
|
||||
@@ -52,7 +52,7 @@ public interface QueryOptionsRegistry {
|
||||
*
|
||||
* <p>Prefer using the {@link QueryOptions#nonContextual()} accessor.</p>
|
||||
*
|
||||
* @return the default non contextual query options
|
||||
* @return the default non-contextual query options
|
||||
* @see QueryOptions#nonContextual()
|
||||
*/
|
||||
QueryOptions defaultNonContextualOptions();
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
package net.luckperms.api.query;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
@@ -56,7 +57,7 @@ final class SimpleOptionKey<T> implements OptionKey<T> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
public boolean equals(@Nullable Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
SimpleOptionKey<?> that = (SimpleOptionKey<?>) o;
|
||||
|
||||
@@ -49,7 +49,7 @@ public interface Track {
|
||||
/**
|
||||
* Gets a list of the groups on this track
|
||||
*
|
||||
* <p>Index 0 is the first/lowest group in (or start of) the track.</p>
|
||||
* <p>The group at index 0 is the first/lowest/starting group in the track.</p>
|
||||
*
|
||||
* <p>The returned collection is immutable, and cannot be modified.</p>
|
||||
*
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
package net.luckperms.api.util;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
package net.luckperms.api.util;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* Represents three different states of a setting.
|
||||
@@ -74,7 +75,7 @@ public enum Tristate {
|
||||
* @return {@link #UNDEFINED}, {@link #TRUE} or {@link #FALSE}, if the value
|
||||
* is <code>null</code>, <code>true</code> or <code>false</code>, respectively.
|
||||
*/
|
||||
public static Tristate of(Boolean val) {
|
||||
public static Tristate of(@Nullable Boolean val) {
|
||||
return val == null ? UNDEFINED : val ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user