Class Punishment
java.lang.Object
me.remigio07.chatplugin.api.common.punishment.Punishment
Represents a punishment (ban, warning, kick,
mute) handled by a
PunishmentManager
.-
Method Summary
Modifier and TypeMethodDescriptionabstract String
formatPlaceholders
(String input, Language language) Translates an input string with this punishment's specific placeholders.formatPlaceholders
(List<String> input, Language language) Translates an input string list with this punishment's specific placeholders.long
getDate()
Gets this punishment's creation or modification date, in milliseconds.int
getID()
Gets this punishment's ID.Gets this punishment's reason.Gets this punishment's origin server.Gets who punished the player.boolean
isSilent()
Checks if this punishment is silent.void
setDate
(long date) Sets this punishment's modification date.void
Sets this punishment's reason.void
Sets this punishment's origin server.void
setSilent
(boolean silent) Sets if this punishment should be silent.void
setStaffMember
(String staffMember) Sets who punished the player.
-
Method Details
-
getID
public int getID()Gets this punishment's ID.- Returns:
- Punishment's ID
-
getStaffMember
Gets who punished the player.- Returns:
- Punishment's staff member
-
setStaffMember
Sets who punished the player.- Parameters:
staffMember
- Punishment's staff member
-
getReason
Gets this punishment's reason.Will return
null
if no reason was specified.- Returns:
- Punishment's reason
-
setReason
Sets this punishment's reason.You can specify
null
to reset the reason.- Parameters:
reason
- Punishment's reason
-
getServer
Gets this punishment's origin server.- Returns:
- Punishment's origin server
-
setServer
Sets this punishment's origin server.- Parameters:
server
- Punishment's origin server
-
getDate
public long getDate()Gets this punishment's creation or modification date, in milliseconds.- Returns:
- Punishment's creation or modification date
-
setDate
public void setDate(long date) Sets this punishment's modification date.- Parameters:
date
- Punishment's modification date
-
isSilent
public boolean isSilent()Checks if this punishment is silent.If
true
, only Staff members will receive the announcement.- Returns:
- Whether this punishment is silent
-
setSilent
public void setSilent(boolean silent) Sets if this punishment should be silent.If
true
, only Staff members will receive the announcement.- Parameters:
silent
- Whether this punishment is silent
-
formatPlaceholders
Translates an input string with this punishment's specific placeholders.Every punishment has different placeholders available. Check the following fields:
Ban.PLACEHOLDERS
- bans' placeholdersWarning.PLACEHOLDERS
- warnings' placeholdersKick.PLACEHOLDERS
- kicks' placeholdersMute.PLACEHOLDERS
- mutes' placeholders
- Parameters:
input
- Input containing placeholderslanguage
- Language used to translate the placeholders- Returns:
- Translated placeholders
-
formatPlaceholders
Translates an input string list with this punishment's specific placeholders.Every punishment has different placeholders available. Check the following fields:
Ban.PLACEHOLDERS
- bans' placeholdersWarning.PLACEHOLDERS
- warnings' placeholdersKick.PLACEHOLDERS
- kicks' placeholdersMute.PLACEHOLDERS
- mutes' placeholders
- Parameters:
input
- Input containing placeholderslanguage
- Language used to translate the placeholders- Returns:
- Translated placeholders
-