Enum Class PlayerSpeed

java.lang.Object
java.lang.Enum<PlayerSpeed>
fr.multimc.api.spigot.common.entities.player.PlayerSpeed
All Implemented Interfaces:
Serializable, Comparable<PlayerSpeed>, Constable

public enum PlayerSpeed extends Enum<PlayerSpeed>
Useful enumeration of the different possible speed level for a player.
Since:
04/10/2022
  • Enum Constant Details

  • Method Details

    • values

      public static PlayerSpeed[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static PlayerSpeed valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • fromWalkSpeed

      public static Optional<PlayerSpeed> fromWalkSpeed(float walkSpeed)
      Get a speed level from the player's walk speed level.
      Parameters:
      walkSpeed - Speed level.
      Returns:
      Optional speed level.
    • fromFlySpeed

      public static Optional<PlayerSpeed> fromFlySpeed(float flySpeed)
      Get a speed level from the player's fly speed level.
      Parameters:
      flySpeed - Speed level.
      Returns:
      Optional speed level.
    • getWalkLevel

      public float getWalkLevel()
      Get the walk speed value.
      Returns:
      Speed level.
    • getFlyLevel

      public float getFlyLevel()
      Get the fly speed value.
      Returns:
      Speed level.