public class BmAPI
extends java.lang.Object
Constructor and Description |
---|
BmAPI() |
Modifier and Type | Method and Description |
---|---|
static boolean |
ban(IPAddress ip,
PlayerData actor,
java.lang.String reason,
boolean silent)
Permanently ban an ip.
|
static boolean |
ban(IPAddress ip,
PlayerData actor,
java.lang.String reason,
boolean silent,
long expires)
Temporarily ban an ip
You must handle kicking the player if they are online.
|
static boolean |
ban(IpBanData ban)
Permanently ban an ip.
|
static boolean |
ban(PlayerBanData ban)
Permanently ban a player.
|
static boolean |
ban(PlayerData player,
PlayerData actor,
java.lang.String reason,
boolean silent)
Permanently ban a player.
|
static boolean |
ban(PlayerData player,
PlayerData actor,
java.lang.String reason,
boolean silent,
long expires)
Temporarily ban a player
You must handle kicking the player if they are online.
|
static <any> |
getBanRecords(IPAddress ip) |
static <any> |
getBanRecords(PlayerData player) |
static PlayerData |
getConsole()
Get the console for use as an actor
|
static IpBanData |
getCurrentBan(IPAddress ip)
Thread safe
|
static PlayerBanData |
getCurrentBan(java.lang.String name)
Thread safe
|
static PlayerBanData |
getCurrentBan(java.util.UUID uuid)
Thread safe
|
static PlayerMuteData |
getCurrentMute(java.lang.String name)
Thread safe
|
static PlayerMuteData |
getCurrentMute(java.util.UUID uuid)
Thread safe
|
static ConnectionSource |
getLocalConnection() |
static Message |
getMessage(java.lang.String key) |
static <any> |
getMuteRecords(PlayerData player) |
static PlayerData |
getPlayer(java.lang.String name) |
static PlayerData |
getPlayer(java.util.UUID uuid) |
static <any> |
getWarnings(PlayerData player)
Retrieve past warnings of a player.
|
static boolean |
isBanned(IPAddress ip)
Thread safe
|
static boolean |
isBanned(java.lang.String name)
Thread safe
|
static boolean |
isBanned(java.util.UUID uuid)
Thread safe
|
static boolean |
isMuted(IPAddress ip)
Thread safe
|
static boolean |
isMuted(java.lang.String name)
Thread safe
|
static boolean |
isMuted(java.util.UUID uuid)
Thread safe
|
static boolean |
mute(IpMuteData mute)
Mute an IP.
|
static boolean |
mute(PlayerData player,
PlayerData actor,
java.lang.String reason)
Permanently mute a player.
|
static boolean |
mute(PlayerData player,
PlayerData actor,
java.lang.String reason,
boolean silent)
Permanently mute a player.
|
static boolean |
mute(PlayerData player,
PlayerData actor,
java.lang.String reason,
boolean silent,
boolean isSoft)
Permanently mute a player.
|
static boolean |
mute(PlayerData player,
PlayerData actor,
java.lang.String reason,
boolean silent,
boolean isSoft,
long expires)
Temporarily mute a player
You must handle kicking the player if they are online.
|
static boolean |
mute(PlayerMuteData mute)
Permanently mute a player.
|
static IPAddress |
toIp(java.lang.String ip)
Convert an ip string of x.x.x.x to IPAddress
|
static boolean |
unban(IpBanData ban,
PlayerData actor) |
static boolean |
unban(PlayerBanData ban,
PlayerData actor) |
static boolean |
unmute(IpMuteData mute,
PlayerData actor) |
static boolean |
unmute(PlayerMuteData mute,
PlayerData actor) |
static boolean |
warn(PlayerData player,
PlayerData actor,
java.lang.String reason,
boolean read)
Warn a player.
|
static boolean |
warn(PlayerData player,
PlayerData actor,
java.lang.String reason,
boolean read,
boolean silent)
Warn a player.
|
static boolean |
warn(PlayerWarnData data)
Warn a player.
|
static boolean |
warn(PlayerWarnData data,
boolean silent)
Warn a player.
|
public static PlayerData getPlayer(java.util.UUID uuid) throws java.sql.SQLException
uuid
- Player UUIDjava.sql.SQLException
public static PlayerData getPlayer(java.lang.String name) throws java.sql.SQLException
name
- Player namejava.sql.SQLException
public static PlayerData getConsole()
public static IPAddress toIp(java.lang.String ip)
ip
- IPv4 in x.x.x.x formatpublic static boolean ban(PlayerBanData ban) throws java.sql.SQLException
ban
- PlayerBanDatajava.sql.SQLException
public static boolean ban(PlayerData player, PlayerData actor, java.lang.String reason, boolean silent) throws java.sql.SQLException
player
- Player to banactor
- Who the ban is byreason
- Why they are bannedsilent
- Whether the ban should be broadcastjava.sql.SQLException
public static boolean ban(PlayerData player, PlayerData actor, java.lang.String reason, boolean silent, long expires) throws java.sql.SQLException
player
- Player to banactor
- Who the ban is byreason
- Why they are bannedexpires
- Unix Timestamp in seconds stating the time of when the ban endsjava.sql.SQLException
public static boolean unban(PlayerBanData ban, PlayerData actor) throws java.sql.SQLException
ban
- The ban (can be retrieved via getBan)actor
- Who is unbanning the playerjava.sql.SQLException
public static boolean isBanned(java.util.UUID uuid)
uuid
- Player UUIDpublic static boolean isBanned(java.lang.String name)
name
- Player namepublic static PlayerBanData getCurrentBan(java.lang.String name)
name
- Player namepublic static PlayerBanData getCurrentBan(java.util.UUID uuid)
uuid
- Player UUIDpublic static <any> getBanRecords(PlayerData player) throws java.sql.SQLException
player
- BanManager's player recordjava.sql.SQLException
public static boolean mute(PlayerMuteData mute) throws java.sql.SQLException
mute
- PlayerMuteDatajava.sql.SQLException
public static boolean mute(PlayerData player, PlayerData actor, java.lang.String reason) throws java.sql.SQLException
player
- Player to muteactor
- Who the mute is byreason
- Why they are mutedjava.sql.SQLException
public static boolean mute(PlayerData player, PlayerData actor, java.lang.String reason, boolean silent) throws java.sql.SQLException
player
- Player to muteactor
- Who the mute is byreason
- Why they are mutenedsilent
- Whether the mute should be broadcastjava.sql.SQLException
public static boolean mute(PlayerData player, PlayerData actor, java.lang.String reason, boolean silent, boolean isSoft) throws java.sql.SQLException
player
- Player to muteactor
- Who the mute is byreason
- Why they are mutenedsilent
- Whether the mute should be broadcastisSoft
- Whether the player should be aware they are muted; they will still see their own messages but nobody else willjava.sql.SQLException
public static boolean mute(PlayerData player, PlayerData actor, java.lang.String reason, boolean silent, boolean isSoft, long expires) throws java.sql.SQLException
player
- Player to muteactor
- Who the mute is byreason
- Why they are mutenedsilent
- Whether the mute should be broadcastisSoft
- Whether the player should be aware they are muted; they will still see their own messages but nobody else willexpires
- Unix Timestamp in seconds stating the time of when the mute endsjava.sql.SQLException
public static boolean mute(IpMuteData mute) throws java.sql.SQLException
mute
- IpMuteDatajava.sql.SQLException
public static boolean unmute(PlayerMuteData mute, PlayerData actor) throws java.sql.SQLException
mute
- PlayerMuteDataactor
- Who unmuted the playerjava.sql.SQLException
public static boolean unmute(IpMuteData mute, PlayerData actor) throws java.sql.SQLException
mute
- IP Mute recordactor
- Who unmuted the ipjava.sql.SQLException
public static boolean isMuted(java.util.UUID uuid)
uuid
- Player UUIDpublic static boolean isMuted(java.lang.String name)
name
- Player Namepublic static boolean isMuted(IPAddress ip)
ip
- IP addresspublic static PlayerMuteData getCurrentMute(java.lang.String name)
name
- public static PlayerMuteData getCurrentMute(java.util.UUID uuid)
uuid
- public static <any> getMuteRecords(PlayerData player) throws java.sql.SQLException
player
- Player recordjava.sql.SQLException
public static boolean ban(IpBanData ban) throws java.sql.SQLException
ban
- IpBanDatajava.sql.SQLException
public static boolean ban(IPAddress ip, PlayerData actor, java.lang.String reason, boolean silent) throws java.sql.SQLException
ip
- IP to ban, use toIp to convert x.x.x.x to IPAddressactor
- Who the ban is byreason
- Why they are bannedsilent
- Whether the ban should be broadcastjava.sql.SQLException
public static boolean ban(IPAddress ip, PlayerData actor, java.lang.String reason, boolean silent, long expires) throws java.sql.SQLException
ip
- IP to ban, use toIp to convert x.x.x.x to IPAddressactor
- Who the ban is byreason
- Why they are bannedsilent
- Whether the ban should be broadcastexpires
- Unix Timestamp in seconds stating the time of when the ban endsjava.sql.SQLException
public static boolean unban(IpBanData ban, PlayerData actor) throws java.sql.SQLException
ban
- IP Ban recordactor
- Who unbanned the ipjava.sql.SQLException
public static boolean isBanned(IPAddress ip)
ip
- IP to ban, use toIp to convert x.x.x.x to IPAddresspublic static IpBanData getCurrentBan(IPAddress ip)
ip
- IP to ban, use toIp to convert x.x.x.x to IPAddresspublic static <any> getBanRecords(IPAddress ip) throws java.sql.SQLException
ip
- IP to ban, use toIp to convert x.x.x.x to IPAddressjava.sql.SQLException
public static boolean warn(PlayerData player, PlayerData actor, java.lang.String reason, boolean read) throws java.sql.SQLException
player
- Player recordactor
- Player record of who warned the playerreason
- What the player was warned forread
- Whether the player has already viewed the warningjava.sql.SQLException
public static boolean warn(PlayerData player, PlayerData actor, java.lang.String reason, boolean read, boolean silent) throws java.sql.SQLException
player
- Player recordactor
- Player record of who warned the playerreason
- What the player was warned forread
- Whether the player has already viewed the warningsilent
- Whether the warning should be broadcastjava.sql.SQLException
public static boolean warn(PlayerWarnData data) throws java.sql.SQLException
data
- PlayerWarnDatajava.sql.SQLException
public static boolean warn(PlayerWarnData data, boolean silent) throws java.sql.SQLException
data
- PlayerWarnDatasilent
- Whether the warning should be broadcastjava.sql.SQLException
public static <any> getWarnings(PlayerData player) throws java.sql.SQLException
player
- Player recordjava.sql.SQLException
public static Message getMessage(java.lang.String key)
key
- The message config node within messages.yml, e.g. "ban.notify"public static ConnectionSource getLocalConnection()