java.lang.Object
me.devnatan.inventoryframework.runtime.thirdparty.McVersion
All Implemented Interfaces:
Comparable<McVersion>

public class McVersion extends Object implements Comparable<McVersion>
  • Constructor Details

    • McVersion

      public McVersion(int major, int minor)
    • McVersion

      public McVersion(int major, int minor, int patch)
  • Method Details

    • current

      public static McVersion current()
      Gets the currently running McVersion
    • isAtLeast

      public boolean isAtLeast(McVersion other)
    • compareTo

      public int compareTo(McVersion other)
      Specified by:
      compareTo in interface Comparable<McVersion>
    • getMajor

      public int getMajor()
      Gets the "major" part of this McVersion. For 1.16.5, this would be 1
    • getMinor

      public int getMinor()
      Gets the "minor" part of this McVersion. For 1.16.5, this would be 16
    • getPatch

      public int getPatch()
      Gets the "patch" part of this McVersion. For 1.16.5, this would be 5.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getName

      public String getName()
    • isAtLeast

      public boolean isAtLeast(int major, int minor, int patch)
    • isAtLeast

      public boolean isAtLeast(int major, int minor)
    • supports

      public static boolean supports(int minorNumber)
      Checks whether the server version is equal or greater than the given version.
      Parameters:
      minorNumber - the version to compare the server version with.
      Returns:
      true if the version is equal or newer, otherwise false.
      Since:
      4.0.0
      See Also:
      • CURRENT_VERSION
    • supports

      public static boolean supports(int minorNumber, int patchNumber)
      Checks whether the server version is equal or greater than the given version.
      Parameters:
      minorNumber - the version to compare the server version with.
      patchNumber - the version to compare the server version with.
      Returns:
      true if the version is equal or newer, otherwise false.
      Since:
      4.0.0
      See Also:
      • CURRENT_VERSION