Class Gearbox
java.lang.Object
nl.sbdeveloper.vehiclesplus.api.vehicles.settings.impl.Gearbox
- All Implemented Interfaces:
Setting
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
The amount of ticks it takes to shift gears.The current gear of the gearbox.int
handleGearbox
(MovementInput input, float currentSpeed) Handle the gearbox.boolean
Is this the first run of the gearbox?boolean
Is the gearbox in cooldown?boolean
Is the gearbox realistic?void
setCooldown
(long cooldown) The amount of ticks it takes to shift gears.void
setRealistic
(boolean realistic) Is the gearbox realistic?toString()
-
Constructor Details
-
Gearbox
public Gearbox()Construct a non-realistic gearbox. -
Gearbox
public Gearbox(boolean realistic) Construct a new gearbox.- Parameters:
realistic
- Is the gearbox realistic?
-
Gearbox
public Gearbox(boolean realistic, long cooldown) Construct a new gearbox.- Parameters:
realistic
- Is the gearbox realistic?cooldown
- The amount of ticks it takes to shift gears.
-
-
Method Details
-
handleGearbox
Handle the gearbox.- Parameters:
input
- The input of the player.currentSpeed
- The current speed of the vehicle.- Returns:
- The amount of speed to add to the vehicle.
-
toString
-
isRealistic
public boolean isRealistic()Is the gearbox realistic? This means that the vehicle will have 3 gears and will shift automatically. -
setRealistic
public void setRealistic(boolean realistic) Is the gearbox realistic? This means that the vehicle will have 3 gears and will shift automatically. -
getCooldown
public long getCooldown()The amount of ticks it takes to shift gears. -
setCooldown
public void setCooldown(long cooldown) The amount of ticks it takes to shift gears. -
isFirstRun
public boolean isFirstRun()Is this the first run of the gearbox? -
getCurrentGear
The current gear of the gearbox. -
isInCooldown
public boolean isInCooldown()Is the gearbox in cooldown?
-