- Retorno:
String - Retorno:
String - Retorno:
boolean -
Parâmetros:
- value (
String)
- value (
-
Retorno:
Reason -
Parâmetros:
- value (
String)
- value (
-
Retorno:
PunishmentType - Retorno:
Collection<Reason> - Retorno:
Collection<PunishmentType> - Retorno:
PunishmentTypes[] -
Parâmetros:
-
playerName (
String) -
type (
PunishmentTypes)
-
-
Retorno:
Punishment -
Parâmetros:
-
uuid (
UUID) -
type (
PunishmentTypes)
-
-
Retorno:
Punishment -
Parâmetros:
-
playerName (
String) -
type (
PunishmentTypes) -
serverName (
String)
-
-
Retorno:
Punishment -
Parâmetros:
-
uuid (
UUID) -
type (
PunishmentTypes) -
serverName (
String)
-
-
Retorno:
Punishment -
Parâmetros:
- id (
String)
- id (
-
Retorno:
Punishment -
Parâmetros:
- address (
String)
- address (
-
Retorno:
Punishment -
Parâmetros:
- playerName (
String)
- playerName (
-
Retorno:
Collection<Punishment> -
Parâmetros:
- uuid (
UUID)
- uuid (
-
Retorno:
Collection<Punishment> -
Parâmetros:
- playerName (
String)
- playerName (
-
Retorno:
Collection<Punishment> -
Parâmetros:
- uuid (
UUID)
- uuid (
-
Retorno:
Collection<Punishment> -
Parâmetros:
- playerName (
String)
- playerName (
-
Retorno:
Collection<Punishment> -
Parâmetros:
- uuid (
UUID)
- uuid (
-
Retorno:
Collection<Punishment> -
Parâmetros:
- uuid (
UUID)
- uuid (
-
Retorno:
Collection<Warn> -
Parâmetros:
- uuid (
UUID)
- uuid (
-
Parâmetros:
- uuid (
UUID)
- uuid (
-
Retorno:
int -
Parâmetros:
- player (
UUID)
- player (
-
Retorno:
PunishmentBuilder -
Parâmetros:
- playerName (
String)
- playerName (
-
Retorno:
PunishmentBuilder -
Parâmetros:
-
player (
UUID) -
author (
UUID)
-
-
Retorno:
PunishmentBuilder -
Parâmetros:
-
playerName (
String) -
author (
UUID)
-
-
Retorno:
PunishmentBuilder -
Parâmetros:
- builder (
PunishmentBuilder)
- builder (
-
Parâmetros:
-
punishment (
Punishment) -
custom (
boolean) – indica se é punição customizada
-
-
Parâmetros:
- punishment (
Punishment)
- punishment (
-
Parâmetros:
-
punishment (
Punishment) -
author (
UUID) – quem executou a desativação
-
-
Parâmetros:
- punishment (
Punishment)
- punishment (
-
Parâmetros:
- uuid (
UUID)
- uuid (
-
Parâmetros:
- id (
String)
- id (
-
Retorno:
boolean -
Parâmetros:
- address (
String)
- address (
-
Retorno:
boolean -
Parâmetros:
-
playerName (
String) -
punishmentType (
PunishmentTypes)
-
-
Retorno:
boolean -
Parâmetros:
-
uuid (
UUID) -
punishmentType (
PunishmentTypes)
-
-
Retorno:
boolean -
Parâmetros:
-
uuid (
UUID) -
punishmentType (
PunishmentTypes) -
serverName (
String)
-
-
Retorno:
boolean - Retorno:
int -
Parâmetros:
- uuid (
UUID)
- uuid (
-
Retorno:
int -
Parâmetros:
- uuid (
UUID)
- uuid (
-
Retorno:
int -
Parâmetros:
- uuid (
UUID)
- uuid (
-
Retorno:
int
PunishAPI
PunishAPI é a interface principal para integração com o plugin LeafPunish. Ele fornece métodos para gerenciamento de punições, avisos, motivos, tipos de punição e consultas de histórico.
Todos os métodos lançam APINotLoadedException caso a API ainda não esteja carregada.
Sempre utilize a API após o plugin LeafPunish estar totalmente inicializado.
Obtendo API
LeafPunishAPI api = LeafPunishAPI.getApi();
Informações da API
getName()
Retorna o nome do plugin LeafPunish carregado no servidor.
getVersion()
Retorna a versão atual da API LeafPunish.
isPremium()
Verifica se o plugin está rodando em uma versão Premium.
Motivos e Tipos
getReason(String value)
Busca um motivo de punição pelo identificador ou valor.
getPunishmentType(String value)
Busca um tipo de punição pelo identificador.
getReasons()
Retorna todos os motivos registrados.
getPunishmentTypes()
Retorna todos os tipos de punição registrados.
getPunishmentTypesEnum()
Retorna todos os tipos de punição do enum.
Punições Ativas
getActivePunishment(String playerName, PunishmentTypes type)
Obtém uma punição ativa pelo nome do jogador e tipo.
getActivePunishment(UUID uuid, PunishmentTypes type)
Obtém uma punição ativa pelo UUID do jogador.
getActivePunishment(String playerName, PunishmentTypes type, String serverName)
Obtém uma punição ativa filtrando por servidor.
getActivePunishment(UUID uuid, PunishmentTypes type, String serverName)
Versão usando UUID do jogador.
Consulta de Punições
getPunishment(String id)
Busca uma punição pelo ID.
getPunishmentFromAddress(String address)
Busca uma punição associada a um endereço (IP).
getPunishments(String playerName)
Retorna todas as punições do jogador.
getPunishments(UUID uuid)
Versão usando UUID.
getActivePunishments(String playerName)
Retorna todas as punições ativas do jogador.
getActivePunishments(UUID uuid)
Versão usando UUID.
getInactivePunishments(String playerName)
Retorna todas as punições inativas do jogador.
getInactivePunishments(UUID uuid)
Versão usando UUID.
Avisos (Warns)
getWarns(UUID uuid)
Retorna todos os avisos do jogador.
clearWarnings(UUID uuid)
Remove todos os avisos do jogador.
getCountOfWarns(UUID uuid)
Retorna a quantidade de avisos do jogador.
Criação de Punições
createPunishment(UUID player)
Cria um PunishmentBuilder para um jogador.
createPunishment(String playerName)
Versão usando nome do jogador.
createPunishment(UUID player, UUID author)
Cria uma punição com autor definido.
createPunishment(String playerName, UUID author)
Versão usando nome do jogador.
Registro e Controle
registerPunishment(PunishmentBuilder builder)
Registra uma nova punição usando o builder.
registerPunishment(Punishment punishment, boolean custom)
Registra uma punição manualmente.
registerPunishment(Punishment punishment)
Registra uma punição padrão (chama versão com custom = false).
disablePunishment(Punishment punishment, UUID author)
Desativa uma punição ativa (remove efeito mas mantém registro).
deletePunishment(Punishment punishment)
Remove completamente uma punição do sistema.
clearHistoric(UUID uuid)
Limpa todo o histórico de punições e avisos do jogador.
Verificações
existsPunishment(String id)
Verifica se uma punição existe.
isAddressBanned(String address)
Verifica se um endereço está banido.
hasActivePunishment(String playerName, PunishmentTypes punishmentType)
Verifica se o jogador possui uma punição ativa.
hasActivePunishment(UUID uuid, PunishmentTypes punishmentType)
Versão usando UUID.
hasActivePunishment(UUID uuid, PunishmentTypes punishmentType, String serverName)
Versão filtrando por servidor.
Contadores
getCountOfAllPunishments()
Retorna a quantidade total de punições no sistema.
getCountOfAllPunishments(UUID uuid)
Retorna a quantidade total de punições do jogador.
getCountOfActivePunishments(UUID uuid)
Retorna a quantidade de punições ativas.
getCountOfInactivePunishments(UUID uuid)
Retorna a quantidade de punições inativas.
Sempre utilize os métodos de verificação antes de aplicar ou registrar punições, e prefira o uso do PunishmentBuilder para manter consistência nos dados.