Package ch.njol.skript.lang.util.common
Interface AnyAmount
- All Superinterfaces:
AnyProvider
- All Known Implementing Classes:
CursorSlot
,DisplayEntitySlot
,DroppedItemSlot
,EquipmentSlot
,InventorySlot
,ItemFrameSlot
,ItemType
,SkriptQueue
,Slot
,SlotWithIndex
,ThrowableProjectileSlot
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
@Deprecated(since="2.13",
forRemoval=true)
public interface AnyAmount
extends AnyProvider
Deprecated, for removal: This API element is subject to removal in a future version.
A provider for anything with a (number) amount/size.
Anything implementing this (or convertible to this) can be used by the
PropExprAmount
property expression.- See Also:
-
Method Summary
Modifier and TypeMethodDescription@NotNull Number
amount()
Deprecated, for removal: This API element is subject to removal in a future version.default boolean
isEmpty()
Deprecated, for removal: This API element is subject to removal in a future version.default void
Deprecated, for removal: This API element is subject to removal in a future version.The behaviour for changing this thing's name, if possible.default boolean
Deprecated, for removal: This API element is subject to removal in a future version.This is called beforesetAmount(Number)
.
-
Method Details
-
amount
Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- This thing's amount/size
-
supportsAmountChange
default boolean supportsAmountChange()Deprecated, for removal: This API element is subject to removal in a future version.This is called beforesetAmount(Number)
. If the result is false, setting the name will never be attempted.- Returns:
- Whether this supports being set
-
setAmount
Deprecated, for removal: This API element is subject to removal in a future version.The behaviour for changing this thing's name, if possible. If not possible, thensupportsAmountChange()
should return false and this may throw an error.- Parameters:
amount
- The name to change- Throws:
UnsupportedOperationException
- If this is impossible
-
isEmpty
default boolean isEmpty()Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- Whether the amount of this is zero, i.e. empty
-
Property.AMOUNT
instead.