Class Versioning

java.lang.Object
net.paulem.arcana.utils.Versioning

public class Versioning extends Object
Utility methods for detecting the running server's Minecraft version and server software.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    Checks whether the server is running Paper (or a fork of it), by testing for the presence of a Paper-specific class on the classpath.
    static boolean
    isPost(int v)
    Checks whether the running server's Minecraft minor version is at least v.1 (i.e. strictly after minor version v, or minor version v with a patch of 1 or higher).
    static boolean
    isPost(int v, int r)
    Checks whether the running server's Minecraft version is strictly after v.r.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Versioning

      public Versioning()
  • Method Details

    • isPost

      public static boolean isPost(int v)
      Checks whether the running server's Minecraft minor version is at least v.1 (i.e. strictly after minor version v, or minor version v with a patch of 1 or higher).
      Parameters:
      v - the minor version to compare against
      Returns:
      true if the server's Minecraft version is at or after v.1
    • isPost

      public static boolean isPost(int v, int r)
      Checks whether the running server's Minecraft version is strictly after v.r.
      Parameters:
      v - the minor version to compare against
      r - the patch version to compare against
      Returns:
      true if the server's Minecraft version is strictly after v.r
    • isPaper

      public static boolean isPaper()
      Checks whether the server is running Paper (or a fork of it), by testing for the presence of a Paper-specific class on the classpath.
      Returns:
      true if the server is running Paper or a Paper fork, false otherwise