1
0
mirror of https://github.com/lucko/LuckPerms.git synced 2025-09-09 22:00:40 +02:00

More work

This commit is contained in:
Luck
2019-10-13 15:04:03 +01:00
parent 9438df787a
commit 7764a04d46
15 changed files with 78 additions and 158 deletions

View File

@@ -75,7 +75,7 @@ public interface ContextManager {
* @param user the user
* @return the applicable context for the subject
*/
@NonNull Optional<ImmutableContextSet> lookupContext(@NonNull User user);
@NonNull Optional<ImmutableContextSet> getContext(@NonNull User user);
/**
* Gets the contexts from the static calculators in this manager.
@@ -115,7 +115,7 @@ public interface ContextManager {
* @param user the user
* @return the query options for the subject
*/
@NonNull Optional<QueryOptions> lookupQueryOptions(@NonNull User user);
@NonNull Optional<QueryOptions> getQueryOptions(@NonNull User user);
/**
* Gets the static query options, using the registered static context calculators.
@@ -124,29 +124,6 @@ public interface ContextManager {
*/
@NonNull QueryOptions getStaticQueryOptions();
/**
* Forms a {@link QueryOptions} instance from an {@link ImmutableContextSet}.
*
* <p>This method relies on the plugins configuration to form the
* {@link QueryOptions} instance.</p>
*
* @param subject the reference subject
* @param contextSet the context set
* @return a options instance
*/
@NonNull QueryOptions formQueryOptions(@NonNull Object subject, @NonNull ImmutableContextSet contextSet);
/**
* Forms a {@link QueryOptions} instance from an {@link ImmutableContextSet}.
*
* <p>This method relies on the plugins configuration to form the
* {@link QueryOptions} instance.</p>
*
* @param contextSet the context set
* @return a options instance
*/
@NonNull QueryOptions formQueryOptions(@NonNull ImmutableContextSet contextSet);
/**
* Registers a context calculator with the manager.
*

View File

@@ -52,7 +52,7 @@ public interface TrackMutateEvent extends LuckPermsEvent {
* @return the data before the change
*/
@Param(1)
@NonNull List<String> getDataBefore();
@NonNull List<String> getStateBefore();
/**
* Gets an immutable copy of the tracks data after the change
@@ -60,6 +60,6 @@ public interface TrackMutateEvent extends LuckPermsEvent {
* @return the data after the change
*/
@Param(2)
@NonNull List<String> getDataAfter();
@NonNull List<String> getStateAfter();
}

View File

@@ -53,19 +53,6 @@ public interface MetaStackFactory {
*/
@NonNull List<MetaStackElement> fromStrings(@NonNull List<String> definitions);
/**
* Creates a new {@link MetaStackDefinition} with the given properties.
*
* @param elements the elements to be included in the stack.
* @param startSpacer the spacer to be included at the start of the stacks output
* @param middleSpacer the spacer to be included between stack elements
* @param endSpacer the spacer to be included at the end of the stacks output
* @return the new stack definition instance
*/
default @NonNull MetaStackDefinition createDefinition(@NonNull List<MetaStackElement> elements, @NonNull String startSpacer, @NonNull String middleSpacer, @NonNull String endSpacer) {
return createDefinition(elements, DuplicateRemovalFunction.RETAIN_ALL, startSpacer, middleSpacer, endSpacer);
}
/**
* Creates a new {@link MetaStackDefinition} with the given properties.
*

View File

@@ -48,7 +48,6 @@ import java.util.Map;
import java.util.Set;
import java.util.SortedSet;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import java.util.function.Predicate;
/**
@@ -127,16 +126,6 @@ public interface PermissionHolder {
*/
@NonNull CachedDataManager getCachedData();
/**
* Refreshes and applies any changes to the cached holder data.
*
* <p>Calling this method is unnecessary in most cases. Cache updates are handled
* behind the scenes by the implementation.</p>
*
* @return the task future
*/
@NonNull CompletableFuture<Void> refreshCachedData();
/**
* Gets the {@link Data} of a particular type.
*

View File

@@ -152,11 +152,11 @@ public interface UserManager {
/**
* Gets a loaded user.
*
* @param name the username of the user to get
* @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
* @throws NullPointerException if the name is null
*/
@Nullable User getUser(@NonNull String name);
@Nullable User getUser(@NonNull String username);
/**
* Gets a set of all loaded users.