Class BukkitVersionAccessor

java.lang.Object
com.github.juliarn.npclib.bukkit.BukkitVersionAccessor
All Implemented Interfaces:
com.github.juliarn.npclib.api.PlatformVersionAccessor

public final class BukkitVersionAccessor extends Object implements com.github.juliarn.npclib.api.PlatformVersionAccessor
  • Field Details

    • MC_VERSION_PATTERN

      private static final Pattern MC_VERSION_PATTERN
      Regex for any number.number.number combination, where the last number is optional.
    • BUKKIT_VERSION_PATTERN

      private static final Pattern BUKKIT_VERSION_PATTERN
      Regex for the bukkit mc version representation.
    • FAILED_PARSE_INPUT

      private static final String FAILED_PARSE_INPUT
      The version string that couldn't be parsed when no default instance could be constructed. null in case a default instance was constructed successfully.
    • DEFAULT_INSTANCE

      private static final com.github.juliarn.npclib.api.PlatformVersionAccessor DEFAULT_INSTANCE
      Default instance parsed from a version string. null in case the version input string couldn't be converted to a SemVer version. In this case the failed parse input field is non-null and holds the parse input that failed.
    • major

      private final int major
    • minor

      private final int minor
    • patch

      private final int patch
  • Constructor Details

    • BukkitVersionAccessor

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

    • hasDefaultAccessor

      public static boolean hasDefaultAccessor()
    • versionAccessor

      @NotNull public static @NotNull com.github.juliarn.npclib.api.PlatformVersionAccessor versionAccessor()
    • major

      public int major()
      Specified by:
      major in interface com.github.juliarn.npclib.api.PlatformVersionAccessor
    • minor

      public int minor()
      Specified by:
      minor in interface com.github.juliarn.npclib.api.PlatformVersionAccessor
    • patch

      public int patch()
      Specified by:
      patch in interface com.github.juliarn.npclib.api.PlatformVersionAccessor
    • atLeast

      public boolean atLeast(int major, int minor, int patch)
      Specified by:
      atLeast in interface com.github.juliarn.npclib.api.PlatformVersionAccessor