Enum Class VehicleType
- All Implemented Interfaces:
Serializable
,Comparable<VehicleType>
,Constable
Type of vehicle
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionAirplanes - with the ability to fly, their movement differs from helicoptersBoats - with the ability to move only on waterCar includes cars, bicycles, as well as motorcyclesHelicopters - with the ability to fly, with bladesVehicles floating in the air (hovercraft and UFO)Tanks - with the ability to shoot -
Method Summary
Modifier and TypeMethodDescriptionboolean
canFly()
Vehicle is considered as 'able to fly' if it is either an Airplane or a HelicoptergetName()
boolean
boolean
isBoat()
boolean
isCar()
boolean
boolean
isHover()
boolean
isTank()
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)static VehicleType
Returns the enum constant of this class with the specified name.static VehicleType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CAR
Car includes cars, bicycles, as well as motorcycles -
HOVER
Vehicles floating in the air (hovercraft and UFO) -
TANK
Tanks - with the ability to shoot -
HELICOPTER
Helicopters - with the ability to fly, with blades -
AIRPLANE
Airplanes - with the ability to fly, their movement differs from helicopters -
BOAT
Boats - with the ability to move only on water
-
-
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
-
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)
-