java.lang.Object
nl.sbdeveloper.vehiclesplus.api.vehicles.settings.impl.Gearbox
All Implemented Interfaces:
Setting

public class Gearbox extends Object implements Setting
  • 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

      public int handleGearbox(MovementInput input, float currentSpeed)
      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

      public String toString()
      Overrides:
      toString in class Object
    • 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

      public Gearbox.Gear getCurrentGear()
      The current gear of the gearbox.
    • isInCooldown

      public boolean isInCooldown()
      Is the gearbox in cooldown?