Class ShieldBreakAPI
java.lang.Object
dev.sbmc.freezy.shieldbreakapi.ShieldBreakAPI
Client for interacting with the ShieldBreakAPI server.
Example usage:
ShieldBreakAPI api = new ShieldBreakAPI("http://localhost:7070", "your-api-key");
PlayerResponse player = api.getPlayerByUuid("uuid-here");
api.upsertPlayer("uuid-here", "PlayerName");
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classException thrown when the API returns an error.static classResponse object for player endpoints.static classResponse object for rank endpoints.static classResponse object for server endpoints. -
Constructor Summary
ConstructorsConstructorDescriptionShieldBreakAPI(String baseUrl, String apiKey) Creates a new ShieldBreakAPI client. -
Method Summary
Modifier and TypeMethodDescriptiongetPlayerByName(String name) Gets a player by name.getPlayerByUuid(String uuid) Gets a player by UUID.getRank(int rid) Gets a rank by ID.Gets a server by name.ping()Pings the server.upsertPlayer(String uuid, String name) Creates or updates a player.upsertRank(int rid, String prefix, String suffix, String color) Creates or updates a rank.upsertServer(String name, String groupid, String host, int port) Creates or updates a server.
-
Constructor Details
-
ShieldBreakAPI
-
-
Method Details
-
ping
-
getPlayerByUuid
Gets a player by UUID.- Parameters:
uuid- the player's UUID (required)- Returns:
- the player response
-
getPlayerByName
Gets a player by name.- Parameters:
name- the player's name (required)- Returns:
- the player response
-
upsertPlayer
Creates or updates a player.- Parameters:
uuid- the player's UUID (required)name- the player's name (required)- Returns:
- the player response with creation status
-
getRank
Gets a rank by ID.- Parameters:
rid- the rank ID (required)- Returns:
- the rank response
-
upsertRank
Creates or updates a rank.- Parameters:
rid- the rank ID (required)prefix- the rank prefix (optional, can be null)suffix- the rank suffix (optional, can be null)color- the rank color (optional, can be null)- Returns:
- the rank response with creation status
-
getServer
Gets a server by name.- Parameters:
name- the server name (required)- Returns:
- the server response
-
upsertServer
public ShieldBreakAPI.ServerResponse upsertServer(String name, String groupid, String host, int port) Creates or updates a server.- Parameters:
name- the server name (required)groupid- the server group ID (optional, can be null)host- the server host (required)port- the server port (required, 1-65535)- Returns:
- the server response with creation status
-