# API

## Methods

```java
// ConnectTheBlocksAPI class
public static ConnectTheBlocks getPlugin();
public static boolean hasCompletedCategory(Player player, String category);
public static boolean hasCompletedCategory(String playerName, String category);
public static PlayerData getPlayerData(Player player);
public static PlayerData getPlayerData(String playerName);
```

## Events

```java
// Event called when a player completes a level
@EventHandler
public void levelCompleted(CTBLevelFinishEvent event){
  PlayerData playerData = event.getPlayerData();
  int level = event.getLevel();
  String category = event.getCategory();
  double time = event.getTime();
}
```
