Enum Class MinecartType

java.lang.Object
java.lang.Enum<MinecartType>
cn.nukkit.utils.MinecartType
All Implemented Interfaces:
Serializable, Comparable<MinecartType>, Constable

public enum MinecartType extends Enum<MinecartType>
Helper class of Minecart variants

By Adam Matthew Creation time: 2017/7/17 19:55.

  • Enum Constant Details

    • MINECART_EMPTY

      public static final MinecartType MINECART_EMPTY
      Represents an empty vehicle.
    • MINECART_CHEST

      public static final MinecartType MINECART_CHEST
      Represents a chest holder.
    • MINECART_FURNACE

      public static final MinecartType MINECART_FURNACE
      Represents a furnace minecart.
    • MINECART_TNT

      public static final MinecartType MINECART_TNT
      Represents a TNT minecart.
    • MINECART_MOB_SPAWNER

      public static final MinecartType MINECART_MOB_SPAWNER
      Represents a mob spawner minecart.
    • MINECART_HOPPER

      public static final MinecartType MINECART_HOPPER
      Represents a hopper minecart.
    • MINECART_COMMAND_BLOCK

      public static final MinecartType MINECART_COMMAND_BLOCK
      Represents a command block minecart.
    • MINECART_UNKNOWN

      public static final MinecartType MINECART_UNKNOWN
      Represents an unknown minecart.
  • Method Details

    • values

      public static MinecartType[] 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

      public static MinecartType valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getId

      public int getId()
      Get the variants of the current minecart
      Returns:
      Integer
    • getName

      public String getName()
      Get the name of the minecart variants
      Returns:
      String
    • hasBlockInside

      public boolean hasBlockInside()
      Gets if the minecart contains block
      Returns:
      Boolean
    • valueOf

      public static MinecartType valueOf(int types)
      Returns of an instance of Minecart-variants
      Parameters:
      types - The number of minecart
      Returns:
      Integer