Class DrivableVehicle
java.lang.Object
nl.sbdeveloper.vehiclesplus.api.vehicles.Vehicle
nl.sbdeveloper.vehiclesplus.api.vehicles.impl.SpawnedVehicle
nl.sbdeveloper.vehiclesplus.api.vehicles.impl.DrivableVehicle
- All Implemented Interfaces:
IVehicle
A spawned vehicle that can be driven by a player.
-
Field Summary
Fields inherited from class nl.sbdeveloper.vehiclesplus.api.vehicles.impl.SpawnedVehicle
holder, storageVehicle
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
protected StorageVehicle
Internal method to despawn the vehicle.boolean
<T extends MovementStrategy,
R>
RgetFromStrategy
(MovementType type, Function<T, R> applyFunction, R defaultValue) List
<org.bukkit.util.Vector> The momentum of this vehicleorg.bukkit.inventory.Inventory
getTrunk()
The trunk of this vehicleint
hashCode()
boolean
If this vehicle is a configurator vehicle used by the Vehicle Configurator This for example disables some features in the Vehicle GUIboolean
isLocked()
The locked statevoid
setConfigurator
(boolean configurator) If this vehicle is a configurator vehicle used by the Vehicle Configurator This for example disables some features in the Vehicle GUIboolean
setLocked
(boolean locked) Lock or unlock this vehicle.boolean
setLocked
(boolean locked, org.bukkit.entity.Player locker) Lock or unlock this vehicle.toString()
void
update()
Update the vehicle (check for collisions).Methods inherited from class nl.sbdeveloper.vehiclesplus.api.vehicles.impl.SpawnedVehicle
applyToStrategy, despawn, despawn, despawn, despawn, getAsDrivableVehicle, getAsPersistentVehicle, getCollisionHandler, getHolder, getInfoList, getLastKnownLocation, getPart, getPart, getPart, getParts, getParts, getParts, getStatics, getStorageVehicle, getUuid, getVehicleModel, hasAddedParts, isDrivable, isPersistent, setHolder
Methods inherited from class nl.sbdeveloper.vehiclesplus.api.vehicles.Vehicle
getGarage, getSpawnedVehicle, getStorageVehicle, isSpawned, remove, remove
-
Method Details
-
update
public void update()Description copied from class:SpawnedVehicle
Update the vehicle (check for collisions).- Overrides:
update
in classSpawnedVehicle
-
despawnVehicle
Description copied from class:SpawnedVehicle
Internal method to despawn the vehicle. UseSpawnedVehicle.despawn(VehicleDespawnEvent.DespawnReason)
orSpawnedVehicle.despawn(boolean, Player)
instead.- Overrides:
despawnVehicle
in classSpawnedVehicle
- Returns:
- The StorageVehicle if despawned.
-
setLocked
public boolean setLocked(boolean locked) Lock or unlock this vehicle.- Parameters:
locked
- The new locked state.- Returns:
- true if changed to the given value, false if cancelled/changed by the event.
-
setLocked
public boolean setLocked(boolean locked, org.bukkit.entity.Player locker) Lock or unlock this vehicle.- Parameters:
locked
- The new locked state.locker
- The player who locked the vehicle.- Returns:
- true if changed to the given value, false if cancelled/changed by the event.
-
getFromStrategy
public <T extends MovementStrategy,R> R getFromStrategy(MovementType type, Function<T, R> applyFunction, @NotNull R defaultValue) - Specified by:
getFromStrategy
in interfaceIVehicle
- Overrides:
getFromStrategy
in classSpawnedVehicle
-
equals
- Overrides:
equals
in classSpawnedVehicle
-
canEqual
- Overrides:
canEqual
in classSpawnedVehicle
-
hashCode
public int hashCode()- Overrides:
hashCode
in classSpawnedVehicle
-
toString
- Overrides:
toString
in classSpawnedVehicle
-
getMomentum
The momentum of this vehicle -
isLocked
public boolean isLocked()The locked state -
isConfigurator
public boolean isConfigurator()If this vehicle is a configurator vehicle used by the Vehicle Configurator This for example disables some features in the Vehicle GUI -
setConfigurator
public void setConfigurator(boolean configurator) If this vehicle is a configurator vehicle used by the Vehicle Configurator This for example disables some features in the Vehicle GUI -
getTrunk
public org.bukkit.inventory.Inventory getTrunk()The trunk of this vehicle
-