Class AnvilInput

java.lang.Object
me.devnatan.inventoryframework.state.BaseState<T>
me.devnatan.inventoryframework.state.BaseMutableState<String>
me.devnatan.inventoryframework.AnvilInput
All Implemented Interfaces:
me.devnatan.inventoryframework.state.MutableState<String>, me.devnatan.inventoryframework.state.State<String>, me.devnatan.inventoryframework.ViewConfig.Modifier

public final class AnvilInput extends me.devnatan.inventoryframework.state.BaseMutableState<String> implements me.devnatan.inventoryframework.ViewConfig.Modifier
  • Field Summary

    Fields inherited from interface me.devnatan.inventoryframework.state.State

    ids
  • Constructor Summary

    Constructors
    Constructor
    Description
    AnvilInput(long id, me.devnatan.inventoryframework.state.StateValueFactory valueFactory)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    apply(@NotNull me.devnatan.inventoryframework.ViewConfigBuilder config, @NotNull me.devnatan.inventoryframework.context.IFContext context)
     
    static AnvilInput
    Creates a new AnvilInput instance.
    static AnvilInput
    createAnvilInput(@NotNull String initialInput)
    Creates a new AnvilInput instance with an initial input.
    static AnvilInput
    createAnvilInput(@NotNull String initialInput, @NotNull UnaryOperator<String> onInputChange)
    Creates a new AnvilInput instance with an initial input and an input change handler.
    static AnvilInput
    createAnvilInput(@NotNull UnaryOperator<String> onInputChange)
    Creates a new AnvilInput instance with an input change handler.
    static AnvilInput
    Creates a new AnvilInput instance.
    Returns the default configuration of the anvil input feature.

    Methods inherited from class me.devnatan.inventoryframework.state.BaseMutableState

    set

    Methods inherited from class me.devnatan.inventoryframework.state.BaseState

    equals, factory, get, hashCode, internalId, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface me.devnatan.inventoryframework.state.State

    factory, get, internalId
  • Constructor Details

    • AnvilInput

      AnvilInput(long id, me.devnatan.inventoryframework.state.StateValueFactory valueFactory)
  • Method Details

    • apply

      public void apply(@NotNull @NotNull me.devnatan.inventoryframework.ViewConfigBuilder config, @NotNull @NotNull me.devnatan.inventoryframework.context.IFContext context)
      Specified by:
      apply in interface me.devnatan.inventoryframework.ViewConfig.Modifier
    • defaultConfig

      public static AnvilInputConfig defaultConfig()
      Returns the default configuration of the anvil input feature.
      Returns:
      Default configuration of the anvil input feature.
    • createAnvilInput

      @Experimental public static AnvilInput createAnvilInput()
      Creates a new AnvilInput instance.

      This API is experimental and is not subject to the general compatibility guarantees such API may be changed or may be removed completely in any further release.

      See Also:
    • createAnvilInput

      @Experimental public static AnvilInput createAnvilInput(@NotNull @NotNull String initialInput)
      Creates a new AnvilInput instance with an initial input.

      This API is experimental and is not subject to the general compatibility guarantees such API may be changed or may be removed completely in any further release.

      Parameters:
      initialInput - Initial text input value.
      See Also:
    • createAnvilInput

      @Experimental public static AnvilInput createAnvilInput(@NotNull @NotNull UnaryOperator<String> onInputChange)
      Creates a new AnvilInput instance with an input change handler.

      onInputChange parameter can be used to transform the input provided by the player. Note that it's not called immediately, only when view is closed or the player interacts with the item placed at container's first result slot.

      This API is experimental and is not subject to the general compatibility guarantees such API may be changed or may be removed completely in any further release.

      Parameters:
      onInputChange - Input change handler, current input will be set to the result of it.
      See Also:
    • createAnvilInput

      @Experimental public static AnvilInput createAnvilInput(@NotNull @NotNull String initialInput, @NotNull @NotNull UnaryOperator<String> onInputChange)
      Creates a new AnvilInput instance with an initial input and an input change handler.

      onInputChange parameter can be used to transform the input provided by the player. Note that it's not called immediately, only when view is closed or the player interacts with the item placed at container's first result slot.

      This API is experimental and is not subject to the general compatibility guarantees such API may be changed or may be removed completely in any further release.

      Parameters:
      initialInput - Initial text input value.
      onInputChange - Input change handler, current input will be set to the result of it.
      See Also:
    • createAnvilInput

      @Experimental public static AnvilInput createAnvilInput(@NotNull @NotNull AnvilInputConfig config)
      Creates a new AnvilInput instance.

      This API is experimental and is not subject to the general compatibility guarantees such API may be changed or may be removed completely in any further release.

      Parameters:
      config - Anvil input feature configuration.
      See Also: