Package com.velocitypowered.api.util
Class Favicon
- java.lang.Object
-
- com.velocitypowered.api.util.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.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Faviconcreate(BufferedImage image)Creates a newFaviconfrom the specifiedimage.static Faviconcreate(Path path)Creates a newFaviconby reading the image from the specifiedpath.booleanequals(@Nullable Object o)StringgetBase64Url()Returns the Base64-encoded URI for this image.inthashCode()StringtoString()
-
-
-
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
-
create
public static Favicon create(BufferedImage image)
Creates a newFaviconfrom the specifiedimage.- Parameters:
image- the image to use for the favicon- Returns:
- the created
Faviconinstance
-
create
public static Favicon create(Path path) throws IOException
Creates a newFaviconby reading the image from the specifiedpath.- Parameters:
path- the path to the image to create a favicon for- Returns:
- the created
Faviconinstance - Throws:
IOException- if the file could not be read from the path
-
-