Class AnvilInput
- All Implemented Interfaces:
me.devnatan.inventoryframework.state.MutableState<String>,me.devnatan.inventoryframework.state.State<String>,me.devnatan.inventoryframework.ViewConfig.Modifier
-
Field Summary
Fields inherited from interface me.devnatan.inventoryframework.state.State
ids -
Constructor Summary
ConstructorsConstructorDescriptionAnvilInput(long id, me.devnatan.inventoryframework.state.StateValueFactory valueFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(@NotNull me.devnatan.inventoryframework.ViewConfigBuilder config, @NotNull me.devnatan.inventoryframework.context.IFContext context) static AnvilInputCreates a new AnvilInput instance.static AnvilInputcreateAnvilInput(@NotNull String initialInput) Creates a new AnvilInput instance with an initial input.static AnvilInputcreateAnvilInput(@NotNull String initialInput, @NotNull UnaryOperator<String> onInputChange) Creates a new AnvilInput instance with an initial input and an input change handler.static AnvilInputcreateAnvilInput(@NotNull UnaryOperator<String> onInputChange) Creates a new AnvilInput instance with an input change handler.static AnvilInputcreateAnvilInput(@NotNull AnvilInputConfig config) Creates a new AnvilInput instance.static AnvilInputConfigReturns the default configuration of the anvil input feature.Methods inherited from class me.devnatan.inventoryframework.state.BaseMutableState
setMethods inherited from class me.devnatan.inventoryframework.state.BaseState
equals, factory, get, hashCode, internalId, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:
applyin interfaceme.devnatan.inventoryframework.ViewConfig.Modifier
-
defaultConfig
Returns the default configuration of the anvil input feature.- Returns:
- Default configuration of the anvil input feature.
-
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
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.onInputChangeparameter 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'sfirst 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.onInputChangeparameter 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'sfirst 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
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:
-