Class ActionConsumer
java.lang.Object
de.eldoria.eldoutilities.inventory.ActionConsumer
Class which holds some simple consumers which can be used in a
ActionItem
.- Since:
- 1.2.3
-
Method Summary
Modifier and TypeMethodDescriptionstatic Consumer<InventoryClickEvent>
Gets a consumer which allows to toggle a boolean value.static Consumer<InventoryClickEvent>
getDoubleRange
(NamespacedKey key, double min, double max) Get a consumer which allows to raise and lower a value between a range.static Consumer<InventoryClickEvent>
getIntRange
(NamespacedKey key, int min, int max) Get a consumer which allows to raise and lower a value between a range.
-
Method Details
-
getIntRange
Get a consumer which allows to raise and lower a value between a range.- Parameters:
key
- key of valuemin
- min value. inclusive.max
- max value. inclusive.- Returns:
- consumer with range
-
getDoubleRange
public static Consumer<InventoryClickEvent> getDoubleRange(NamespacedKey key, double min, double max) Get a consumer which allows to raise and lower a value between a range.- Parameters:
key
- key of valuemin
- min value. inclusive.max
- max value. inclusive.- Returns:
- consumer with range
-
booleanToggle
Gets a consumer which allows to toggle a boolean value. Used forPersistentDataType.BYTE
fields.- Parameters:
key
- key of value- Returns:
- consumer for boolean
-