Class Favicon


  • public final class Favicon
    extends Object
    Represents a Minecraft server favicon. A Minecraft server favicon is a 64x64 image that can be displayed to a remote client that sends a Server List Ping packet, and is automatically displayed in the Minecraft client.
    • Constructor Detail

      • Favicon

        public Favicon​(String base64Url)
        Directly create a favicon using its Base64 URL directly. You are generally better served by the create() series of functions.
        Parameters:
        base64Url - the url for use with this favicon
    • Method Detail

      • getBase64Url

        public String getBase64Url()
        Returns the Base64-encoded URI for this image.
        Returns:
        a URL representing this favicon
      • equals

        public boolean equals​(@Nullable Object o)
        Overrides:
        equals in class Object
      • hashCode

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

        public static Favicon create​(BufferedImage image)
        Creates a new Favicon from the specified image.
        Parameters:
        image - the image to use for the favicon
        Returns:
        the created Favicon instance
      • create

        public static Favicon create​(Path path)
                              throws IOException
        Creates a new Favicon by reading the image from the specified path.
        Parameters:
        path - the path to the image to create a favicon for
        Returns:
        the created Favicon instance
        Throws:
        IOException - if the file could not be read from the path