Package org.incendo.cloud.paper.parser
Class KeyedWorldParser<C>
java.lang.Object
org.incendo.cloud.paper.parser.KeyedWorldParser<C>
- Type Parameters:
C- Command sender type
- All Implemented Interfaces:
ArgumentParser<C,,World> SuggestionProvider<C>,SuggestionProviderHolder<C>
public final class KeyedWorldParser<C>
extends Object
implements ArgumentParser<C,World>, SuggestionProvider<C>
Parses Bukkit
worlds from a NamespacedKey.
Falls back to parsing by name, using the WorldParser on server implementations where World
does not implement Keyed.
- Since:
- 1.6.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.incendo.cloud.parser.ArgumentParser
ArgumentParser.FutureArgumentParser<C,T> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <C> @NonNull CommandComponent.Builder<C, World> Returns aCommandComponent.BuilderusingkeyedWorldParser()as the parser.static <C> @NonNull ParserDescriptor<C, World> Creates a new keyed world parser.parse(@NonNull CommandContext<@NonNull C> commandContext, @NonNull CommandInput commandInput) @NonNull CompletableFuture<? extends @NonNull Iterable<? extends @NonNull Suggestion>> suggestionsFuture(@NonNull CommandContext<C> commandContext, @NonNull CommandInput input) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.incendo.cloud.parser.ArgumentParser
flatMap, flatMapSuccess, mapSuccess, parseFuture, suggestionProvider
-
Constructor Details
-
KeyedWorldParser
public KeyedWorldParser()Create a newKeyedWorldParser.
-
-
Method Details
-
keyedWorldParser
@API(status=STABLE, since="2.0.0") public static <C> @NonNull ParserDescriptor<C,World> keyedWorldParser()Creates a new keyed world parser.- Type Parameters:
C- command sender type- Returns:
- the created parser
- Since:
- 2.0.0
-
keyedWorldComponent
@API(status=STABLE, since="2.0.0") public static <C> @NonNull CommandComponent.Builder<C,World> keyedWorldComponent()Returns aCommandComponent.BuilderusingkeyedWorldParser()as the parser.- Type Parameters:
C- the command sender type- Returns:
- the component builder
- Since:
- 2.0.0
-
parse
public @NonNull ArgumentParseResult<@NonNull World> parse(@NonNull CommandContext<@NonNull C> commandContext, @NonNull CommandInput commandInput) - Specified by:
parsein interfaceArgumentParser<C,World>
-
suggestionsFuture
public @NonNull CompletableFuture<? extends @NonNull Iterable<? extends @NonNull Suggestion>> suggestionsFuture(@NonNull CommandContext<C> commandContext, @NonNull CommandInput input) - Specified by:
suggestionsFuturein interfaceSuggestionProvider<C>
-