java.lang.Object
nl.sbdeveloper.vehiclesplus.api.vehicles.Vehicle
All Implemented Interfaces:
IVehicle
Direct Known Subclasses:
SpawnedVehicle, StorageVehicle

public abstract class Vehicle extends Object implements IVehicle
An abstract Vehicle class.
  • 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

      @NotNull public @NotNull StorageVehicle getStorageVehicle()
      Get the StorageVehicle of this vehicle.
      Returns:
      The StorageVehicle if not spawned, or null.
    • getStorageVehicle

      @NotNull public @NotNull StorageVehicle getStorageVehicle(boolean force)
      Get the StorageVehicle of this vehicle.
      Parameters:
      force - If true, it will return the StorageVehicle stored by the SpawnedVehicle if spawned.
      Returns:
      The StorageVehicle, or if spawned and force is false null.
    • getSpawnedVehicle

      @Nullable public @Nullable SpawnedVehicle getSpawnedVehicle()
      Get the SpawnedVehicle of this vehicle.
      Returns:
      The SpawnedVehicle if spawned, or null.
    • getUuid

      public abstract UUID getUuid()
      Get the UUID of this vehicle
      Returns:
      The UUID of this vehicle
    • getVehicleModel

      public abstract VehicleModel getVehicleModel()
      Get the basevehicle / type of this vehicle
      Returns:
      The basevehicle / type of this vehicle
    • getParts

      @NotNull public abstract @NotNull List<Part> getParts()
      Get all the parts of this vehicle.
      Returns:
      A list of all the parts.
    • getParts

      @NotNull public abstract <V> @NotNull List<V> getParts(Class<V> partClass)
      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

      @Nullable public abstract <V> V getPart(@NotNull @NotNull Class<V> partClass)
      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

      @Nullable public abstract @Nullable Part getPart(org.bukkit.entity.ArmorStand stand)
      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

      public abstract VehicleStatics getStatics()
      Get the statics of this vehicle.
      Returns:
      The statics of this vehicle
    • getInfoList

      public abstract List<String> getInfoList()
      Get the information of this vehicle
      Returns:
      A list with the formatted information
    • getGarage

      public Garage getGarage()
      Get the garage this vehicle is in
      Returns:
      The garage this vehicle is in
    • remove

      public void remove() throws DataStorageException
      Remove this vehicle
      Throws:
      DataStorageException - If the vehicle could not be removed from the database
    • remove

      public void remove(org.bukkit.entity.Player remover) throws DataStorageException
      Remove this vehicle
      Parameters:
      remover - The player that removed the vehicle
      Throws:
      DataStorageException - If the vehicle could not be removed from the database