Package ca.stellardrift.colonel.api
Class ServerArgumentType<T extends com.mojang.brigadier.arguments.ArgumentType<?>>
- java.lang.Object
-
- ca.stellardrift.colonel.api.ServerArgumentType<T>
-
- Type Parameters:
T- argument type
public abstract class ServerArgumentType<T extends com.mojang.brigadier.arguments.ArgumentType<?>> extends Object
An argument type that only needs to be known on the server
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classServerArgumentType.Builder<T extends com.mojang.brigadier.arguments.ArgumentType<?>>A builder forServerArgumentTypes
-
Constructor Summary
Constructors Constructor Description ServerArgumentType()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static <T extends com.mojang.brigadier.arguments.ArgumentType<?>>
ServerArgumentType.Builder<T>builder(Identifier id)abstract Function<T,com.mojang.brigadier.arguments.ArgumentType<?>>fallbackProvider()A function to transform an argument of your type into one understandable by the Vanilla client.abstract @Nullable com.mojang.brigadier.suggestion.SuggestionProvider<?>fallbackSuggestions()Add an override for suggestions.abstract Identifierid()The unique identifier for this argument type.abstract ArgumentSerializer<T>serializer()The type's argument serializer.abstract Class<? super T>type()The argument type class to register
-
-
-
Constructor Detail
-
ServerArgumentType
public ServerArgumentType()
-
-
Method Detail
-
builder
public static <T extends com.mojang.brigadier.arguments.ArgumentType<?>> ServerArgumentType.Builder<T> builder(Identifier id)
-
id
public abstract Identifier id()
The unique identifier for this argument type.- Returns:
- identifier
-
type
public abstract Class<? super T> type()
The argument type class to register- Returns:
- argument type
-
serializer
public abstract ArgumentSerializer<T> serializer()
The type's argument serializer. This will only be used on clients who have this argument attached.- Returns:
- serializer
- See Also:
for a simple implementation
-
fallbackProvider
public abstract Function<T,com.mojang.brigadier.arguments.ArgumentType<?>> fallbackProvider()
A function to transform an argument of your type into one understandable by the Vanilla client.This is currently unvalidated -- but generally, anything in
ArgumentTypesshould be acceptable- Returns:
- argument transformer
-
fallbackSuggestions
public abstract @Nullable com.mojang.brigadier.suggestion.SuggestionProvider<?> fallbackSuggestions()
Add an override for suggestions.- Returns:
- fallback suggestion provider
-
-