Class KeyedWorldArgument<C>

java.lang.Object
cloud.commandframework.arguments.CommandArgument<C,org.bukkit.World>
cloud.commandframework.paper.argument.KeyedWorldArgument<C>
Type Parameters:
C - Command sender type
All Implemented Interfaces:
cloud.commandframework.keys.CloudKeyHolder<org.bukkit.World>, Comparable<cloud.commandframework.arguments.CommandArgument<?,?>>

public final class KeyedWorldArgument<C> extends cloud.commandframework.arguments.CommandArgument<C,org.bukkit.World>
Argument type that parses Bukkit worlds from a NamespacedKey.

Falls back to parsing by name, using the WorldArgument.WorldParser on server implementations where World does not implement Keyed.

Since:
1.6.0
  • Method Details

    • builder

      public static <C> @NonNull KeyedWorldArgument.Builder<C> builder(@NonNull String name)
      Type Parameters:
      C - Command sender type
      Parameters:
      name - Name of the argument
      Returns:
      Created builder
      Since:
      1.6.0
    • of

      public static <C> @NonNull KeyedWorldArgument<C> of(@NonNull String name)
      Create a new required KeyedWorldArgument.
      Type Parameters:
      C - Command sender type
      Parameters:
      name - Argument name
      Returns:
      Created argument
      Since:
      1.6.0
    • optional

      public static <C> @NonNull KeyedWorldArgument<C> optional(@NonNull String name)
      Create a new optional KeyedWorldArgument.
      Type Parameters:
      C - Command sender type
      Parameters:
      name - Argument name
      Returns:
      Created argument
      Since:
      1.6.0
    • optional

      public static <C> @NonNull KeyedWorldArgument<C> optional(@NonNull String name, @NonNull org.bukkit.NamespacedKey defaultValue)
      Create a new KeyedWorldArgument with the specified default value.
      Type Parameters:
      C - Command sender type
      Parameters:
      name - Argument name
      defaultValue - Default value
      Returns:
      Created argument
      Since:
      1.6.0