Package de.florianmichael.classic4j
Class BetaCraftHandler
java.lang.Object
de.florianmichael.classic4j.BetaCraftHandler
This class provides methods to interact with the BetaCraft API. These API methods are used to request the Multiplayer Pass for a server.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidauthenticate(JoinServerInterface joinServerInterface) Authenticates the player with the BetaCraft API.static voidauthenticate(JoinServerInterface joinServerInterface, Consumer<Throwable> throwableConsumer) Authenticates the player with the BetaCraft API.static voidrequestServerList(Consumer<BCServerList> complete) Requests the server list from the BetaCraft API.static voidrequestServerList(Consumer<BCServerList> complete, Consumer<Throwable> throwableConsumer) Requests the server list from the BetaCraft API.
-
Field Details
-
BETACRAFT_ROOT_URI
The URI of the BetaCraft API. -
SERVER_LIST_URI
-
-
Constructor Details
-
BetaCraftHandler
public BetaCraftHandler()
-
-
Method Details
-
authenticate
Authenticates the player with the BetaCraft API.- Parameters:
joinServerInterface- TheJoinServerInterfaceto use for the request. This is used to send the authentication request.
-
authenticate
public static void authenticate(JoinServerInterface joinServerInterface, Consumer<Throwable> throwableConsumer) Authenticates the player with the BetaCraft API.- Parameters:
joinServerInterface- TheJoinServerInterfaceto use for the request. This is used to send the authentication request.
-
requestServerList
Requests the server list from the BetaCraft API.- Parameters:
complete- The consumer that will be called when the request is complete.
-
requestServerList
public static void requestServerList(Consumer<BCServerList> complete, Consumer<Throwable> throwableConsumer) Requests the server list from the BetaCraft API.- Parameters:
complete- The consumer that will be called when the request is complete.throwableConsumer- The consumer that will be called when an error occurs.
-