Class Vehicle
java.lang.Object
nl.sbdeveloper.vehiclesplus.api.vehicles.Vehicle
- All Implemented Interfaces:
IVehicle
- Direct Known Subclasses:
SpawnedVehicle
,StorageVehicle
An abstract Vehicle class.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the garage this vehicle is inGet the information of this vehicleabstract <V> V
Get the first occurrence of a specific type.abstract @Nullable Part
getPart
(org.bukkit.entity.ArmorStand stand) Get a part from the holder stand.getParts()
Get all the parts of this vehicle.abstract <V> @NotNull List
<V> Get all the parts of a specific type.@Nullable SpawnedVehicle
Get theSpawnedVehicle
of this vehicle.abstract VehicleStatics
Get the statics of this vehicle.@NotNull StorageVehicle
Get theStorageVehicle
of this vehicle.@NotNull StorageVehicle
getStorageVehicle
(boolean force) Get theStorageVehicle
of this vehicle.abstract UUID
getUuid()
Get the UUID of this vehicleabstract VehicleModel
Get the basevehicle / type of this vehicleabstract boolean
Check if this vehicle has any addon parts.boolean
Check if this vehicle is persistent or not.void
remove()
Remove this vehiclevoid
remove
(org.bukkit.entity.Player remover) Remove this vehicleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface nl.sbdeveloper.vehiclesplus.api.vehicles.IVehicle
getFromStrategy
-
Constructor Details
-
Vehicle
public Vehicle()
-
-
Method Details
-
isSpawned
public boolean isSpawned()Check if this vehicle is persistent or not.- Returns:
- Check if this vehicle is persistent.
-
getStorageVehicle
Get theStorageVehicle
of this vehicle.- Returns:
- The StorageVehicle if not spawned, or null.
-
getStorageVehicle
Get theStorageVehicle
of this vehicle.- Parameters:
force
- If true, it will return theStorageVehicle
stored by theSpawnedVehicle
if spawned.- Returns:
- The StorageVehicle, or if spawned and force is false null.
-
getSpawnedVehicle
Get theSpawnedVehicle
of this vehicle.- Returns:
- The SpawnedVehicle if spawned, or null.
-
getUuid
Get the UUID of this vehicle- Returns:
- The UUID of this vehicle
-
getVehicleModel
Get the basevehicle / type of this vehicle- Returns:
- The basevehicle / type of this vehicle
-
getParts
Get all the parts of this vehicle.- Returns:
- A list of all the parts.
-
getParts
Get all the parts of a specific type.- Type Parameters:
V
- The part itself.- Parameters:
partClass
- The class of the part.- Returns:
- A list of all the parts of that type.
-
getPart
Get the first occurrence of a specific type.- Type Parameters:
V
- The part itself.- Parameters:
partClass
- The class of the part.- Returns:
- The part of that type, or null if not found.
-
getPart
Get a part from the holder stand.- Parameters:
stand
- The holder stand.- Returns:
- The part.
-
hasAddedParts
public abstract boolean hasAddedParts()Check if this vehicle has any addon parts.- Returns:
- If this vehicle has any addon parts.
-
getStatics
Get the statics of this vehicle.- Returns:
- The statics of this vehicle
-
getInfoList
Get the information of this vehicle- Returns:
- A list with the formatted information
-
getGarage
Get the garage this vehicle is in- Returns:
- The garage this vehicle is in
-
remove
Remove this vehicle- Throws:
DataStorageException
- If the vehicle could not be removed from the database
-
remove
Remove this vehicle- Parameters:
remover
- The player that removed the vehicle- Throws:
DataStorageException
- If the vehicle could not be removed from the database
-