Interface ServerBuildInfo


@NullMarked @NonExtendable public interface ServerBuildInfo
Information about the current server build.
  • Field Details

    • BRAND_PAPER_ID

      static final Key BRAND_PAPER_ID
      The brand id for Paper.
    • BRAND_DAYDREAM_ID

      static final Key BRAND_DAYDREAM_ID
      The brand id for Daydream.
  • Method Details

    • buildInfo

      static ServerBuildInfo buildInfo()
      Gets the ServerBuildInfo.
      Returns:
      the ServerBuildInfo
    • brandId

      Key brandId()
      Gets the brand id of the server.
      Returns:
      the brand id of the server (e.g. "papermc:paper")
    • isBrandCompatible

      @Experimental boolean isBrandCompatible(Key brandId)
      Checks if the current server supports the specified brand.
      Parameters:
      brandId - the brand to check (e.g. "papermc:folia")
      Returns:
      true if the server supports the specified brand
    • brandName

      String brandName()
      Gets the brand name of the server.
      Returns:
      the brand name of the server (e.g. "Paper")
    • minecraftVersionId

      String minecraftVersionId()
      Gets the Minecraft version id.
      Returns:
      the Minecraft version id (e.g. "1.20.4", "1.20.2-pre2", "23w31a")
    • minecraftVersionName

      String minecraftVersionName()
      Gets the Minecraft version name.
      Returns:
      the Minecraft version name (e.g. "1.20.4", "1.20.2 Pre-release 2", "23w31a")
    • protocolVersion

      default int protocolVersion()
      Gets the Minecraft protocol version.
      Returns:
      the Minecraft protocol version
    • buildNumber

      OptionalInt buildNumber()
      Gets the build number.
      Returns:
      the build number
    • buildTime

      Instant buildTime()
      Gets the build time.
      Returns:
      the build time
    • gitBranch

      Optional<String> gitBranch()
      Gets the git commit branch.
      Returns:
      the git commit branch
    • gitCommit

      Optional<String> gitCommit()
      Gets the git commit hash.
      Returns:
      the git commit hash
    • asString

      String asString(ServerBuildInfo.StringRepresentation representation)
      Creates a string representation of the server build information.
      Parameters:
      representation - the type of representation
      Returns:
      a string