Class Vehicle
java.lang.Object
nl.mtvehicles.core.infrastructure.vehicle.Vehicle
Vehicle with its specifications
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic HashMap<String,MTVSubCommand>
Deprecated.There is no use for this HashMap. -
Constructor Summary
ConstructorDescriptionVehicle()
Plain constructorVehicle(@Nullable Map<?,?> vehicleData, String licensePlate, String name, VehicleType vehicleType, boolean isPublic, int skinDamage, String skinItem, boolean glowing, boolean hornEnabled, double health, boolean fuelEnabled, double fuel, double fuelUsage, boolean trunkEnabled, int trunkRows, List<String> trunkData, double accelerationSpeed, double maxSpeed, double maxSpeedBackwards, double brakingSpeed, double frictionSpeed, int rotateSpeed, UUID owner, List<String> riders, List<String> members, double price, String nbtValue)
Create a new Vehicle instance with all the values necessary -
Method Summary
Modifier and TypeMethodDescriptionboolean
canRide(org.bukkit.entity.Player player)
boolean
canSit(org.bukkit.entity.Player player)
void
delete()
Delete a vehicle from the database (vehicleData.yml)double
double
@Nullable org.bukkit.entity.Player
Get the current driver of the vehicle@Nullable Double
Get the current fuel amount of a vehicle - returns null if fuel is disabled.@Nullable Double
Get the current speed of a vehicle - returns null if the vehicle is not placed.double
double
getFuel()
double
double
double
double
getName()
double
getPrice()
int
getSeats()
Get the list of seatsint
Get the amount of seats this vehicle hasint
int
getUUID()
Get vehicle's UUID (can be found in vehicles.yml, used in /vehicle givecar)Map<?,?>
boolean
boolean
isGlow()
Deprecated.UseisGlowing()
boolean
boolean
boolean
isOpen()
Deprecated.UseisPublic()
boolean
isOwner(org.bukkit.OfflinePlayer player)
boolean
isPublic()
boolean
void
save()
Save the vehicle specifications (and possible adjustments) to vehicleData.ymlvoid
Save vehicle's seats from vehicles.yml to VehicleDatavoid
setAccelerationSpeed(double accelerationSpeed)
void
setBenzineEnabled(boolean benzineEnabled)
void
setBrakingSpeed(double brakingSpeed)
void
setFrictionSpeed(double frictionSpeed)
void
setFuel(double fuel)
void
setFuelUsage(double fuelUsage)
void
setGlow(boolean glow)
Deprecated.void
setGlowing(boolean glow)
void
setHealth(double health)
void
setHornEnabled(boolean hornEnabled)
void
setLicensePlate(String licensePlate)
void
setMaxSpeed(double maxSpeed)
void
setMaxSpeedBackwards(double maxSpeedBackwards)
void
setMembers(List<String> members)
void
void
setNbtValue(String nbt)
void
setOpen(boolean isPublic)
Deprecated.void
Deprecated.UsesetOwner(UUID)
instead.void
void
setPrice(double price)
void
setPublic(boolean isPublic)
void
void
setRotateSpeed(int rotateSpeed)
void
setSkinDamage(int skinDamage)
void
setSkinItem(String skinItem)
void
setTrunk(boolean trunk)
void
setTrunkData(List<String> trunkData)
void
setTrunkRows(int trunkRows)
void
setVehicleData(Map<?,?> vehicleData)
void
setVehicleType(VehicleType vehicleType)
-
Field Details
-
subcommands
Deprecated.There is no use for this HashMap. Please, avoid using it in any way as it may get removed soon.
-
-
Constructor Details
-
Vehicle
public Vehicle()Plain constructor -
Vehicle
public Vehicle(@Nullable @Nullable Map<?,?> vehicleData, String licensePlate, String name, VehicleType vehicleType, boolean isPublic, int skinDamage, String skinItem, boolean glowing, boolean hornEnabled, double health, boolean fuelEnabled, double fuel, double fuelUsage, boolean trunkEnabled, int trunkRows, List<String> trunkData, double accelerationSpeed, double maxSpeed, double maxSpeedBackwards, double brakingSpeed, double frictionSpeed, int rotateSpeed, UUID owner, List<String> riders, List<String> members, double price, String nbtValue)Create a new Vehicle instance with all the values necessary- Since:
- 2.5.1
-
-
Method Details
-
save
public void save()Save the vehicle specifications (and possible adjustments) to vehicleData.yml -
delete
Delete a vehicle from the database (vehicleData.yml)- Throws:
IllegalStateException
- If vehicle is already deleted.
-
getUUID
Get vehicle's UUID (can be found in vehicles.yml, used in /vehicle givecar)- See Also:
VehicleUtils.getUUID(String)
-
getSeatsAmount
public int getSeatsAmount()Get the amount of seats this vehicle has -
getCurrentDriver
@Nullable public @Nullable org.bukkit.entity.Player getCurrentDriver()Get the current driver of the vehicle- Returns:
- Returns null if the vehicle is not being driven by any player at the moment.
- See Also:
VehicleUtils.getCurrentDriver(String)
-
getSeats
Get the list of seats -
getCurrentSpeed
Get the current speed of a vehicle - returns null if the vehicle is not placed.- Returns:
- Current vehicle's speed in blocks per second. (As opposed to
VehicleData.speed
.)
-
getCurrentFuel
Get the current fuel amount of a vehicle - returns null if fuel is disabled.- Returns:
- Current vehicle's fuel
- See Also:
VehicleData.fuel
-
getLicensePlate
-
setLicensePlate
-
getName
-
getSkinDamage
public int getSkinDamage() -
getSkinItem
-
isGlowing
public boolean isGlowing() -
isGlow
Deprecated.UseisGlowing()
-
isPublic
public boolean isPublic() -
isOpen
Deprecated.UseisPublic()
-
isFuelEnabled
public boolean isFuelEnabled() -
isHornEnabled
public boolean isHornEnabled() -
getHealth
public double getHealth() -
getFuel
public double getFuel() -
isTrunkEnabled
public boolean isTrunkEnabled() -
getTrunkRows
public int getTrunkRows() -
getAccelerationSpeed
public double getAccelerationSpeed() -
getMaxSpeed
public double getMaxSpeed() -
getBrakingSpeed
public double getBrakingSpeed() -
getFrictionSpeed
public double getFrictionSpeed() -
getRotateSpeed
public int getRotateSpeed() -
getMaxSpeedBackwards
public double getMaxSpeedBackwards() -
getOwnerUUID
-
getOwnerName
-
isOwner
public boolean isOwner(org.bukkit.OfflinePlayer player) -
getNbtValue
-
getRiders
-
getMembers
-
getFuelUsage
public double getFuelUsage() -
getPrice
public double getPrice() -
setPrice
public void setPrice(double price) -
setName
-
setSkinDamage
public void setSkinDamage(int skinDamage) -
setSkinItem
-
setGlowing
public void setGlowing(boolean glow) -
setGlow
Deprecated. -
setPublic
public void setPublic(boolean isPublic) -
setOpen
Deprecated. -
setBenzineEnabled
public void setBenzineEnabled(boolean benzineEnabled) -
setHornEnabled
public void setHornEnabled(boolean hornEnabled) -
setHealth
public void setHealth(double health) -
setFuel
public void setFuel(double fuel) -
setTrunk
public void setTrunk(boolean trunk) -
setTrunkRows
public void setTrunkRows(int trunkRows) -
getTrunkData
-
setTrunkData
-
setAccelerationSpeed
public void setAccelerationSpeed(double accelerationSpeed) -
setMaxSpeed
public void setMaxSpeed(double maxSpeed) -
setBrakingSpeed
public void setBrakingSpeed(double brakingSpeed) -
setFrictionSpeed
public void setFrictionSpeed(double frictionSpeed) -
setRotateSpeed
public void setRotateSpeed(int rotateSpeed) -
setMaxSpeedBackwards
public void setMaxSpeedBackwards(double maxSpeedBackwards) -
setOwner
Deprecated.UsesetOwner(UUID)
instead. -
setOwner
-
setNbtValue
-
setRiders
-
setMembers
-
setFuelUsage
public void setFuelUsage(double fuelUsage) -
getVehicleData
-
setVehicleData
-
canRide
public boolean canRide(org.bukkit.entity.Player player) -
canSit
public boolean canSit(org.bukkit.entity.Player player) -
getVehicleType
-
setVehicleType
-
saveSeats
public void saveSeats()Save vehicle's seats from vehicles.yml to VehicleData
-