Enum CosmeticItemOwnership.Cause
java.lang.Object
java.lang.Enum<CosmeticItemOwnership.Cause>
de.marcely.bedwars.api.cosmetics.shop.CosmeticItemOwnership.Cause
- All Implemented Interfaces:
Serializable
,Comparable<CosmeticItemOwnership.Cause>
,java.lang.constant.Constable
- Enclosing interface:
CosmeticItemOwnership
Represents the cause of a shop item ownership.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe item has no price and was granted for free.The item was granted for free by a permission.The item was purchased by the player for its regular price. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks whether purchases with this cause will be stored permanently.static CosmeticItemOwnership.Cause
Returns the enum constant of this type with the specified name.static CosmeticItemOwnership.Cause[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.boolean
Get whether the weights of this cause are greater than the given one.
-
Enum Constant Details
-
PURCHASE
The item was purchased by the player for its regular price. -
PERMISSION
The item was granted for free by a permission. -
FREE
The item has no price and was granted for free.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
storeItem
public boolean storeItem()Checks whether purchases with this cause will be stored permanently.- Returns:
true
if the purchase will be stored
-
weightsGreaterThan
Get whether the weights of this cause are greater than the given one.E.g. a player may receive a free items, but this might have no relevance if he already purchased it. This behavior is important to not override past purchases.
- Parameters:
cause
- The cause to compare with- Returns:
true
if this weights greater
-