Package cloud.commandframework.bukkit
Class BukkitBrigadierMapper<C>
java.lang.Object
cloud.commandframework.bukkit.BukkitBrigadierMapper<C>
- Type Parameters:
C- Command sender type
Class which handles mapping argument types to their NMS Brigadier counterpart on Bukkit platforms.
-
Constructor Summary
ConstructorsConstructorDescriptionBukkitBrigadierMapper(@NonNull BukkitCommandManager<C> commandManager, @NonNull cloud.commandframework.brigadier.CloudBrigadierManager<C, ?> brigadierManager) Class that handles mapping argument types to Brigadier for Bukkit (Commodore) and Paper. -
Method Summary
Modifier and TypeMethodDescriptionvoidmapComplexNMS(@NonNull Class<?> type, @NonNull Supplier<com.mojang.brigadier.arguments.ArgumentType<?>> argumentTypeSupplier) Deprecated.<T extends cloud.commandframework.arguments.parser.ArgumentParser<C,?>>
voidmapNMS(@NonNull io.leangen.geantyref.TypeToken<T> type, @NonNull Supplier<com.mojang.brigadier.arguments.ArgumentType<?>> argumentTypeSupplier) Attempt to register a mapping between a type and a NMS argument type<T extends cloud.commandframework.arguments.parser.ArgumentParser<C,?>>
voidmapSimpleContextNMS(@NonNull io.leangen.geantyref.TypeToken<T> type, @NonNull String argumentId) Attempt to register a mapping between a cloud argument parser type and an NMS brigadier argument type which has a single-arg constructor taking CommandBuildContext.<T extends cloud.commandframework.arguments.parser.ArgumentParser<C,?>>
voidmapSimpleNMS(@NonNull io.leangen.geantyref.TypeToken<T> type, @NonNull String argumentId) Attempt to register a mapping between a cloud argument parser type and an NMS brigadier argument type which has a no-args constructor.<T extends cloud.commandframework.arguments.parser.ArgumentParser<C,?>>
voidmapSimpleNMS(@NonNull io.leangen.geantyref.TypeToken<T> type, @NonNull String argumentId, boolean useCloudSuggestions) Attempt to register a mapping between a cloud argument parser type and an NMS brigadier argument type which has a no-args constructor.voidmapSimpleNMS(@NonNull Class<?> type, @NonNull Constructor<?> constructor) Deprecated.usemapSimpleNMS(TypeToken, String)instead
-
Constructor Details
-
BukkitBrigadierMapper
public BukkitBrigadierMapper(@NonNull BukkitCommandManager<C> commandManager, @NonNull cloud.commandframework.brigadier.CloudBrigadierManager<C, ?> brigadierManager) Class that handles mapping argument types to Brigadier for Bukkit (Commodore) and Paper.- Parameters:
commandManager- TheBukkitCommandManagerto use for mappingbrigadierManager- TheCloudBrigadierManagerto use for mapping
-
-
Method Details
-
mapSimpleContextNMS
public <T extends cloud.commandframework.arguments.parser.ArgumentParser<C,?>> void mapSimpleContextNMS(@NonNull io.leangen.geantyref.TypeToken<T> type, @NonNull String argumentId) Attempt to register a mapping between a cloud argument parser type and an NMS brigadier argument type which has a single-arg constructor taking CommandBuildContext. Will fall back to behavior ofmapSimpleNMS(TypeToken, String)on older versions.- Type Parameters:
T- argument parser type- Parameters:
type- Type to mapargumentId- registry id of argument type- Since:
- 1.7.0
-
mapSimpleNMS
public <T extends cloud.commandframework.arguments.parser.ArgumentParser<C,?>> void mapSimpleNMS(@NonNull io.leangen.geantyref.TypeToken<T> type, @NonNull String argumentId) Attempt to register a mapping between a cloud argument parser type and an NMS brigadier argument type which has a no-args constructor.- Type Parameters:
T- argument parser type- Parameters:
type- Type to mapargumentId- registry id of argument type- Since:
- 1.5.0
-
mapSimpleNMS
public <T extends cloud.commandframework.arguments.parser.ArgumentParser<C,?>> void mapSimpleNMS(@NonNull io.leangen.geantyref.TypeToken<T> type, @NonNull String argumentId, boolean useCloudSuggestions) Attempt to register a mapping between a cloud argument parser type and an NMS brigadier argument type which has a no-args constructor.- Type Parameters:
T- argument parser type- Parameters:
type- Type to mapargumentId- registry id of argument typeuseCloudSuggestions- whether to use cloud suggestions- Since:
- 1.6.0
-
mapNMS
public <T extends cloud.commandframework.arguments.parser.ArgumentParser<C,?>> void mapNMS(@NonNull io.leangen.geantyref.TypeToken<T> type, @NonNull Supplier<com.mojang.brigadier.arguments.ArgumentType<?>> argumentTypeSupplier) Attempt to register a mapping between a type and a NMS argument type- Type Parameters:
T- argument parser type- Parameters:
type- Type to mapargumentTypeSupplier- Supplier of the NMS argument type- Since:
- 1.5.0
-
mapSimpleNMS
Deprecated.usemapSimpleNMS(TypeToken, String)insteadAttempt to register a mapping between a type and a NMS argument type- Parameters:
type- Type to mapconstructor- Constructor that construct the NMS argument type
-
mapComplexNMS
@Deprecated public void mapComplexNMS(@NonNull Class<?> type, @NonNull Supplier<com.mojang.brigadier.arguments.ArgumentType<?>> argumentTypeSupplier) Deprecated.usemapNMS(TypeToken, Supplier)insteadAttempt to register a mapping between a type and a NMS argument type- Parameters:
type- Type to mapargumentTypeSupplier- Supplier of the NMS argument type
-
mapNMS(TypeToken, Supplier)instead