Package com.hazebyte.crate.api.crate
Enum CrateType
- java.lang.Object
-
- java.lang.Enum<CrateType>
-
- com.hazebyte.crate.api.crate.CrateType
-
- All Implemented Interfaces:
Serializable
,Comparable<CrateType>
public enum CrateType extends Enum<CrateType>
Contain states that determine the interactions a crate takes.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getId()
static CrateType
getType(int id)
static CrateType
getType(String name)
static CrateType
valueOf(String name)
Returns the enum constant of this type with the specified name.static CrateType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SUPPLY
public static final CrateType SUPPLY
Type of crate that item is specifically a chest. This crate may only be activated or opened in-game by placing the chest onto a ground surface. The winning rewards are placed into the chest inventory.
This type does not support any gui animations at the moment.
-
MYSTERY
public static final CrateType MYSTERY
Type of crate that can be opened at any time. It may be activated at anytime or anywhere by performing a left or right click. This type supports all animations. Notes: https://github.com/Hazebyte/CrateReloadedAPI/issues/16
-
KEY
public static final CrateType KEY
Type of crate which specifically uses a key. A preset location must be present for users to interact with. This type supports all animations.
-
MENU
public static final CrateType MENU
Deprecated.
-
-
Method Detail
-
values
public static CrateType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (CrateType c : CrateType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CrateType valueOf(String name)
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
-
getId
public int getId()
-
getType
public static CrateType getType(int id)
-
-