Package ch.andre601.fluxpoint4j
Class Fluxpoint4J
- java.lang.Object
-
- ch.andre601.fluxpoint4j.Fluxpoint4J
-
public class Fluxpoint4J extends java.lang.ObjectMain class to interact with the Fluxpoint API.It currently supports the following features:
- Creating custom Images:
- Creating Welcome Images:
- Getting MC Server information:
-
-
Constructor Summary
Constructors Constructor Description Fluxpoint4J()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description @Nullable GenericAPIResponsegetCustomImage(@NotNull CustomImage image)Generates a custom image using the providedCustomImage instance.GenericAPIResponsegetMCServerInfo(@NotNull java.lang.String host)Deprecated.Use thenew Builderinstead.GenericAPIResponsegetMCServerInfo(@NotNull java.lang.String host, int port)Deprecated.Use thenew Builderinstead.MCRequestBuildergetNewMCRequestBuilder()Creates and returns a new instance of theMCRequestBuilderto use, which allows you to set various things in the request such as domain, port and if icon should be included.@Nullable GenericAPIResponsegetWelcomeImage(@NotNull WelcomeImage image)Generates a Welcome image using the providedWelcomeImage instance.java.util.concurrent.CompletableFuture<GenericAPIResponse>queueCustomImage(@NotNull CustomImage image)CallsgetCustomImage(CustomImage)and wraps it into aCompletableFuture<GenericAPIResponse>for you to use.java.util.concurrent.CompletableFuture<GenericAPIResponse>queueMCServerInfo(@NotNull java.lang.String host)Deprecated.Use thenew Builderinstead.java.util.concurrent.CompletableFuture<GenericAPIResponse>queueMCServerInfo(@NotNull java.lang.String host, int port)Deprecated.Use thenew Builderinstead.java.util.concurrent.CompletableFuture<GenericAPIResponse>queueWelcomeImage(@NotNull WelcomeImage image)CallsgetWelcomeImage(WelcomeImage)and wraps it into aCompletableFuture<GeneratedImage>for you to use.voidsetToken(@NotNull java.lang.String token)Sets the API token to use for the Fluxpoint API.
-
-
-
Method Detail
-
setToken
public void setToken(@NotNull @NotNull java.lang.String token)Sets the API token to use for the Fluxpoint API.- Parameters:
token- The API token to use.
-
getCustomImage
@Nullable public @Nullable GenericAPIResponse getCustomImage(@NotNull @NotNull CustomImage image)
Generates a custom image using the providedCustomImage instance.The returned
GenericAPIResponsecan be one of two instances:- Instance of
GeneratedImageon a successful request. - Instance of
FailedAPIResponseon a failed request
GenericAPIResponse response = getCustomImage(someCustomImage); if(response instanceof FailedAPIResponse){ // The request was not successful! System.out.println("Request failed!"); return; } // Request was successful. Response is a GeneratedImage instance! GeneratedImage image = (GeneratedImage)response;- Parameters:
image- TheCustomImageto generate.- Returns:
GenericAPIResponsethat is either the GeneratedImage or FailedAPIResponse instance.
- Instance of
-
queueCustomImage
public java.util.concurrent.CompletableFuture<GenericAPIResponse> queueCustomImage(@NotNull @NotNull CustomImage image)
CallsgetCustomImage(CustomImage)and wraps it into aCompletableFuture<GenericAPIResponse>for you to use.The returned
GenericAPIResponsecan be one of two instances:- Instance of
GeneratedImageon a successful request. - Instance of
FailedAPIResponseon a failed request
GenericAPIResponse response = getCustomImage(someCustomImage); if(response instanceof FailedAPIResponse){ // The request was not successful! System.out.println("Request failed!"); return; } // Request was successful. Response is a GeneratedImage instance! GeneratedImage image = (GeneratedImage)response;- Parameters:
image- TheCustomImageto generate.- Returns:
CompletableFuturewith aGenericAPIResponseinstance.- See Also:
getCustomImage
- Instance of
-
getWelcomeImage
@Nullable public @Nullable GenericAPIResponse getWelcomeImage(@NotNull @NotNull WelcomeImage image)
Generates a Welcome image using the providedWelcomeImage instance.The returned
GenericAPIResponsecan be one of two instances:- Instance of
GeneratedImageon a successful request. - Instance of
FailedAPIResponseon a failed request
GenericAPIResponse response = getWelcomeImage(someWelcomeImage); if(response instanceof FailedAPIResponse){ // The request was not successful! System.out.println("Request failed!"); return; } // Request was successful. Response is a GeneratedImage instance! GeneratedImage image = (GeneratedImage)response;- Parameters:
image- TheWelcomeImageto generate.- Returns:
GenericAPIResponsethat is either the GeneratedImage or a failed API response.
- Instance of
-
queueWelcomeImage
public java.util.concurrent.CompletableFuture<GenericAPIResponse> queueWelcomeImage(@NotNull @NotNull WelcomeImage image)
CallsgetWelcomeImage(WelcomeImage)and wraps it into aCompletableFuture<GeneratedImage>for you to use.The returned
GenericAPIResponsecan be one of two instances:- Instance of
GeneratedImageon a successful request. - Instance of
FailedAPIResponseon a failed request
GenericAPIResponse response = getWelcomeImage(someWelcomeImage); if(response instanceof FailedAPIResponse){ // The request was not successful! System.out.println("Request failed!"); return; } // Request was successful. Response is a GeneratedImage instance! GeneratedImage image = (GeneratedImage)response;- Parameters:
image- TheWelcomeImageto generate.- Returns:
CompletableFuturewith aGenericAPIResponseinstance.- See Also:
getWelcomeImage
- Instance of
-
getNewMCRequestBuilder
public MCRequestBuilder getNewMCRequestBuilder()
Creates and returns a new instance of theMCRequestBuilderto use, which allows you to set various things in the request such as domain, port and if icon should be included.- Returns:
- A new, usable instance of
MCRequestBuilder.
-
getMCServerInfo
@Deprecated public GenericAPIResponse getMCServerInfo(@NotNull @NotNull java.lang.String host)
Deprecated.Use thenew Builderinstead.Performs a request to the Fluxpoint API to check a Server and receive possible information from it.
This particular method will ping the server with the default port 25565. If you want to set a own port, usegetMCServerInfo(String, int)instead.The returned
GenericAPIResponsecan be one of two instances:- Instance of
MCServerPingResponseon a successful request. - Instance of
FailedAPIResponseon a failed request
GenericAPIResponse response = getMCServerInfo("mc.example.com"); if(response instanceof FailedAPIResponse){ // The request was not successful! System.out.println("Request failed!"); return; } // Request was successful. Response is a MCServerPingResponse instance! GeneratedImage image = (MCServerPingResponse)response;- Parameters:
host- The server to ping. This can be a domain or IP.- Returns:
GenericAPIResponsethat is either a MCServerPingResponse or FailedAPIResponse instance.- See Also:
getMCServerInfo
- Instance of
-
getMCServerInfo
@Deprecated public GenericAPIResponse getMCServerInfo(@NotNull @NotNull java.lang.String host, int port)
Deprecated.Use thenew Builderinstead.Performs a request to the Fluxpoint API to check a Server and receive possible information from it.The returned
GenericAPIResponsecan be one of two instances:- Instance of
MCServerPingResponseon a successful request. - Instance of
FailedAPIResponseon a failed request
GenericAPIResponse response = getMCServerInfo("mc.example.com"); if(response instanceof FailedAPIResponse){ // The request was not successful! System.out.println("Request failed!"); return; } // Request was successful. Response is a MCServerPingResponse instance! GeneratedImage image = (MCServerPingResponse)response;- Parameters:
host- The server to ping. This can be a domain or IP.port- The port to ping the server on.- Returns:
GenericAPIResponsethat is either a MCServerPingResponse or FailedAPIResponse instance.
- Instance of
-
queueMCServerInfo
@Deprecated public java.util.concurrent.CompletableFuture<GenericAPIResponse> queueMCServerInfo(@NotNull @NotNull java.lang.String host)
Deprecated.Use thenew Builderinstead.CallsgetMCServerInfo(String)and wraps it into aCompletableFuture<GeneratedImage>for you to use.The returned
GenericAPIResponsecan be one of two instances:- Instance of
MCServerPingResponseon a successful request. - Instance of
FailedAPIResponseon a failed request
GenericAPIResponse response = getMCServerInfo("mc.example.com"); if(response instanceof FailedAPIResponse){ // The request was not successful! System.out.println("Request failed!"); return; } // Request was successful. Response is a MCServerPingResponse instance! GeneratedImage image = (MCServerPingResponse)response;- Parameters:
host- The server to ping. This can be a domain or IP.- Returns:
GenericAPIResponsethat is either a MCServerPingResponse or FailedAPIResponse instance.- See Also:
getMCServerInfo
- Instance of
-
queueMCServerInfo
@Deprecated public java.util.concurrent.CompletableFuture<GenericAPIResponse> queueMCServerInfo(@NotNull @NotNull java.lang.String host, int port)
Deprecated.Use thenew Builderinstead.CallsgetMCServerInfo(String, int)and wraps it into aCompletableFuture<GeneratedImage>for you to use.The returned
GenericAPIResponsecan be one of two instances:- Instance of
MCServerPingResponseon a successful request. - Instance of
FailedAPIResponseon a failed request
GenericAPIResponse response = getMCServerInfo("mc.example.com"); if(response instanceof FailedAPIResponse){ // The request was not successful! System.out.println("Request failed!"); return; } // Request was successful. Response is a MCServerPingResponse instance! GeneratedImage image = (MCServerPingResponse)response;- Parameters:
host- The server to ping. This can be a domain or IP.port- The port to ping the server on.- Returns:
GenericAPIResponsethat is either a MCServerPingResponse or FailedAPIResponse instance.- See Also:
getMCServerInfo
- Instance of
-
-