Class ViaPlayer

java.lang.Object
one.tranic.t.base.player.ViaPlayer

public class ViaPlayer extends Object
  • Constructor Details

    • ViaPlayer

      public ViaPlayer()
  • Method Details

    • getVersion

      public static int getVersion(@NotNull @NotNull UUID uuid)
      Retrieves the protocol version of a player identified by their unique identifier (UUID).

      If the ViaVersion plugin is enabled, the player's protocol version is fetched using the ViaVersion API. If the plugin is not enabled, this method returns -1.

      Parameters:
      uuid - the universally unique identifier (UUID) of the player; must not be null
      Returns:
      the protocol version of the player as an integer if ViaVersion is enabled; otherwise, -1
      Throws:
      IllegalArgumentException - if the provided UUID is null
    • getVersion

      public static int getVersion(@NotNull @NotNull Object player)
      Retrieves the protocol version of the specified player.
      This method utilizes the ViaVersion API to determine the protocol version of the player if the ViaVersion plugin is enabled. If the plugin is not enabled, it defaults to returning -1.
      Parameters:
      player - the player object for which the protocol version is to be retrieved; must not be null
      Returns:
      the protocol version of the player as an integer if ViaVersion is enabled; -1 if ViaVersion is not enabled
      Throws:
      IllegalArgumentException - if the player object is null
    • isEnabled

      public static boolean isEnabled()
      Determines if the ViaVersion plugin is enabled.
      Returns:
      true if the ViaVersion plugin is active and available, false otherwise.