Package cn.nukkit.utils
Enum Class MinecartType
- All Implemented Interfaces:
Serializable
,Comparable<MinecartType>
,Constable
Helper class of Minecart variants
By Adam Matthew Creation time: 2017/7/17 19:55.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionRepresents a chest holder.Represents a command block minecart.Represents an empty vehicle.Represents a furnace minecart.Represents a hopper minecart.Represents a mob spawner minecart.Represents a TNT minecart.Represents an unknown minecart. -
Method Summary
Modifier and TypeMethodDescriptionint
getId()
Get the variants of the current minecartgetName()
Get the name of the minecart variantsboolean
Gets if the minecart contains blockstatic MinecartType
valueOf
(int types) Returns of an instance of Minecart-variantsstatic MinecartType
Returns the enum constant of this class with the specified name.static MinecartType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
MINECART_EMPTY
Represents an empty vehicle. -
MINECART_CHEST
Represents a chest holder. -
MINECART_FURNACE
Represents a furnace minecart. -
MINECART_TNT
Represents a TNT minecart. -
MINECART_MOB_SPAWNER
Represents a mob spawner minecart. -
MINECART_HOPPER
Represents a hopper minecart. -
MINECART_COMMAND_BLOCK
Represents a command block minecart. -
MINECART_UNKNOWN
Represents an unknown minecart.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
getId
public int getId()Get the variants of the current minecart- Returns:
- Integer
-
getName
Get the name of the minecart variants- Returns:
- String
-
hasBlockInside
public boolean hasBlockInside()Gets if the minecart contains block- Returns:
- Boolean
-
valueOf
Returns of an instance of Minecart-variants- Parameters:
types
- The number of minecart- Returns:
- Integer
-