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> VGet the first occurrence of a specific type.abstract @Nullable PartgetPart(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 SpawnedVehicleGet theSpawnedVehicleof this vehicle.abstract VehicleStaticsGet the statics of this vehicle.@NotNull StorageVehicleGet theStorageVehicleof this vehicle.@NotNull StorageVehiclegetStorageVehicle(boolean force) Get theStorageVehicleof this vehicle.abstract UUIDgetUuid()Get the UUID of this vehicleabstract VehicleModelGet the basevehicle / type of this vehicleabstract booleanCheck if this vehicle has any addon parts.booleanCheck if this vehicle is persistent or not.voidremove()Remove this vehiclevoidremove(org.bukkit.entity.Player remover) Remove this vehicleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 theStorageVehicleof this vehicle.- Returns:
- The StorageVehicle if not spawned, or null.
-
getStorageVehicle
Get theStorageVehicleof this vehicle.- Parameters:
force- If true, it will return theStorageVehiclestored by theSpawnedVehicleif spawned.- Returns:
- The StorageVehicle, or if spawned and force is false null.
-
getSpawnedVehicle
Get theSpawnedVehicleof 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
-