Class AnvilInputConfig

java.lang.Object
me.devnatan.inventoryframework.AnvilInputConfig

public class AnvilInputConfig extends Object
  • Field Details

    • initialInput

      String initialInput
    • closeOnSelect

      boolean closeOnSelect
    • inputChangeHandler

      UnaryOperator<String> inputChangeHandler
  • Constructor Details

    • AnvilInputConfig

      AnvilInputConfig()
  • Method Details

    • initialInput

      @Contract("_ -> this") public AnvilInputConfig initialInput(String initialInput)
      Sets the initial anvil text input value.
      Parameters:
      initialInput - Initial anvil text input value.
      Returns:
      This anvil input config.
    • closeOnSelect

      @Contract("-> this") public AnvilInputConfig closeOnSelect()
      Configures the view to close immediately when the player interacts with the item placed at container's first result slot.
      Returns:
      This anvil input feature config.
    • onInputChange

      @Contract("_ -> this") public AnvilInputConfig onInputChange(UnaryOperator<String> inputChangeHandler)
      Setups a handler that 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.

      Parameters:
      inputChangeHandler - The input change handler.
      Returns:
      This anvil input feature config.