Class AbstractDirectionConverter<D>

java.lang.Object
com.sk89q.worldedit.command.argument.AbstractDirectionConverter<D>
All Implemented Interfaces:
org.enginehub.piston.converter.ArgumentConverter<D>, org.enginehub.piston.converter.Converter<D>, org.enginehub.piston.converter.SuggestionProvider
Direct Known Subclasses:
DirectionConverter, DirectionVectorConverter

public abstract class AbstractDirectionConverter<D> extends Object implements org.enginehub.piston.converter.ArgumentConverter<D>
  • Constructor Details

    • AbstractDirectionConverter

      protected AbstractDirectionConverter(WorldEdit worldEdit, boolean includeDiagonals)
  • Method Details

    • register

      protected static <D> void register(org.enginehub.piston.CommandManager commandManager, AbstractDirectionConverter<D> converter, Class<D> keyClass, boolean includeDiagonals)
    • convert

      public org.enginehub.piston.converter.ConversionResult<D> convert(String argument, org.enginehub.piston.inject.InjectedValueAccess context)
      Specified by:
      convert in interface org.enginehub.piston.converter.Converter<D>
    • convertDirection

      protected abstract D convertDirection(String argument, @Nullable Player player, boolean includeDiagonals) throws UnknownDirectionException
      Throws:
      UnknownDirectionException
    • describeAcceptableArguments

      public com.sk89q.worldedit.util.formatting.text.Component describeAcceptableArguments()
      Specified by:
      describeAcceptableArguments in interface org.enginehub.piston.converter.ArgumentConverter<D>
    • getSuggestions

      public List<String> getSuggestions(String input, org.enginehub.piston.inject.InjectedValueAccess context)
      Specified by:
      getSuggestions in interface org.enginehub.piston.converter.ArgumentConverter<D>
      Specified by:
      getSuggestions in interface org.enginehub.piston.converter.SuggestionProvider
    • getWorldEdit

      protected WorldEdit getWorldEdit()