This repository was archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathHeartbeatApi.java
93 lines (81 loc) · 2.65 KB
/
HeartbeatApi.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
package net.badlion.heartbeatapi;
import java.util.Collection;
import java.util.UUID;
public abstract class HeartbeatApi {
protected static HeartbeatApi instance;
/**
* Get the api instance
* Must be called after the Badlion Heartbeat plugin is initialized
*
* @return A singleton instance of the api
*/
public static HeartbeatApi getInstance() {
return HeartbeatApi.instance;
}
/**
* Returns {@code true} if a player is using Badlion Anti-Cheat
*
* @param uuid UUID of player to check
* @return {@code true} if using Badlion Anti-Cheat
*/
public abstract boolean isPlayerUsingBadlionAnticheat(UUID uuid);
/**
* Get if BAC-only mode is enabled
*
* @return {@code true} if BAC-only mode is enabled
*/
public abstract boolean isBacOnly();
/**
* Enable or disable BAC-only mode (disabled by default)
* If enabled, player will need to use Badlion-Anticheat to log in the server
* Enabling this option while players are on will not kick them out of the network
* We recommend calling this method as quickly as you can in your plugin(s).
* This setting will be stored in the config to persist if the server restarts.
*
* @param enabled New state for the BAC-only mode
*/
public abstract void setBacOnly(boolean enabled);
/**
* Add a player to the whitelist
* That player will be able to connect even if BAC-only mode is enabled and he is not using Badlion Anti-Cheat
* This whitelist will be stored in the config to persist if the server restarts.
*
* @param uuid UUID of player to add
*/
public abstract void addPlayerToWhitelist(UUID uuid);
/**
* Remove a player from the whitelist
*
* @param uuid UUID of player to remove
*/
public abstract void removePlayerFromWhitelist(UUID uuid);
/**
* Get the whitelisted players who can bypass the BAC-only mode
*
* @return Collection of uuids
*/
public abstract Collection<UUID> getWhitelistedPlayers();
/**
* This is a Bungeecord feature
* Get the server names where BAC is required on.
* This means that each server in this list requires users to have BAC enabled to be able to join
* Supports regex as well
*
* @return Collection of server names
*/
public abstract Collection<String> getBacRequiredServers();
/**
* This is a Bungeecord feature
* Adds a server from the BAC required server list
*
* @param serverName Server name of server to add
*/
public abstract void addServerToRequiredServers(String serverName);
/**
* This is a Bungeecord feature
* Removes a server from the BAC required server list
*
* @param serverName Server name of server to remove
*/
public abstract void removeServerToRequiredServers(String serverName);
}