Enum Class VehicleType

java.lang.Object
java.lang.Enum<VehicleType>
nl.mtvehicles.core.infrastructure.enums.VehicleType
All Implemented Interfaces:
Serializable, Comparable<VehicleType>, Constable

public enum VehicleType extends Enum<VehicleType>
Type of vehicle
  • Enum Constant Details

    • CAR

      public static final VehicleType CAR
      Car includes cars, bicycles, as well as motorcycles
    • HOVER

      public static final VehicleType HOVER
      Vehicles floating in the air (hovercraft and UFO)
    • TANK

      public static final VehicleType TANK
      Tanks - with the ability to shoot
    • HELICOPTER

      public static final VehicleType HELICOPTER
      Helicopters - with the ability to fly, with blades
    • AIRPLANE

      public static final VehicleType AIRPLANE
      Airplanes - with the ability to fly, their movement differs from helicopters
    • BOAT

      public static final VehicleType BOAT
      Boats - with the ability to move only on water
  • Method Details

    • values

      public static VehicleType[] 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 VehicleType 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
    • getName

      public String getName()
    • isCar

      public boolean isCar()
    • isHover

      public boolean isHover()
    • isTank

      public boolean isTank()
    • isHelicopter

      public boolean isHelicopter()
    • isAirplane

      public boolean isAirplane()
    • isBoat

      public boolean isBoat()
    • canFly

      public boolean canFly()
      Vehicle is considered as 'able to fly' if it is either an Airplane or a Helicopter
      Returns:
      True if vehicle can fly
    • isUsageDisabled

      public boolean isUsageDisabled(org.bukkit.entity.Player player, org.bukkit.Location loc)
      Check if usage of this vehicle type is disabled in a certain location (by WorldGuard flags)
      Parameters:
      loc - Location where the vehicle is being used (placed, clicked, ...)
      Returns:
      True if the vehicle can't be used. (Returns false if WorldGuard is not enabled)