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 booleanprotected StorageVehicleInternal 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.InventorygetTrunk()The trunk of this vehicleinthashCode()booleanIf this vehicle is a configurator vehicle used by the Vehicle Configurator This for example disables some features in the Vehicle GUIbooleanisLocked()The locked statevoidsetConfigurator(boolean configurator) If this vehicle is a configurator vehicle used by the Vehicle Configurator This for example disables some features in the Vehicle GUIbooleansetLocked(boolean locked) Lock or unlock this vehicle.booleansetLocked(boolean locked, org.bukkit.entity.Player locker) Lock or unlock this vehicle.toString()voidupdate()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, setHolderMethods 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:SpawnedVehicleUpdate the vehicle (check for collisions).- Overrides:
updatein classSpawnedVehicle
-
despawnVehicle
Description copied from class:SpawnedVehicleInternal method to despawn the vehicle. UseSpawnedVehicle.despawn(VehicleDespawnEvent.DespawnReason)orSpawnedVehicle.despawn(boolean, Player)instead.- Overrides:
despawnVehiclein 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:
getFromStrategyin interfaceIVehicle- Overrides:
getFromStrategyin classSpawnedVehicle
-
equals
- Overrides:
equalsin classSpawnedVehicle
-
canEqual
- Overrides:
canEqualin classSpawnedVehicle
-
hashCode
public int hashCode()- Overrides:
hashCodein classSpawnedVehicle
-
toString
- Overrides:
toStringin 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
-