Class ShieldBreakAPI

java.lang.Object
dev.sbmc.freezy.ShieldBreakAPI

public class ShieldBreakAPI extends Object
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");
  • Constructor Details

    • ShieldBreakAPI

      public ShieldBreakAPI(String baseUrl, String apiKey)
      Creates a new ShieldBreakAPI client.
      Parameters:
      baseUrl - the base URL of the API server (e.g., "http://localhost:7070")
      apiKey - the API key for authentication
  • Method Details

    • ping

      public String ping()
      Pings the server.

      No authentication required.

      Returns:
      server timestamp
    • getPlayerByUuid

      public ShieldBreakAPI.PlayerResponse getPlayerByUuid(String uuid)
      Gets a player by UUID.
      Parameters:
      uuid - the player's UUID (required)
      Returns:
      the player response
    • getPlayerByName

      public ShieldBreakAPI.PlayerResponse getPlayerByName(String name)
      Gets a player by name.
      Parameters:
      name - the player's name (required)
      Returns:
      the player response
    • upsertPlayer

      public ShieldBreakAPI.PlayerResponse upsertPlayer(String uuid, String name)
      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

      public ShieldBreakAPI.RankResponse getRank(int rid)
      Gets a rank by ID.
      Parameters:
      rid - the rank ID (required)
      Returns:
      the rank response
    • upsertRank

      public ShieldBreakAPI.RankResponse upsertRank(int rid, String prefix, String suffix, String color)
      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

      public ShieldBreakAPI.ServerResponse getServer(String name)
      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