Class Warning
java.lang.Object
me.remigio07.chatplugin.api.common.punishment.Punishment
me.remigio07.chatplugin.api.common.punishment.warning.Warning
Represents a warning handled by the
WarningManager.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String[]Array containing all available placeholders that can be translated with a warning's information. -
Method Summary
Modifier and TypeMethodDescriptionlongGets this warning's duration, in milliseconds.Gets this warning's player.longGets this warning's remaining time, in milliseconds.longGets this warning's expiration task's ID.longGets this warning's unwarn date, in milliseconds.Gets who unwarnedgetPlayer().booleanisActive()Checks if this warning is active at the moment.booleanisGlobal()Checks if this warning affects all servers inside of the network.voidsetGlobal(boolean global) Sets if this warning should affect all servers inside of the network.voidsetUnwarnDate(long unwarnDate) Sets this warning's unwarn date, in milliseconds.voidsetWhoUnwarned(String whoUnwarned) Sets who unwarnedgetPlayer().Methods inherited from class me.remigio07.chatplugin.api.common.punishment.Punishment
formatPlaceholders, formatPlaceholders, getDate, getID, getReason, getServer, getStaffMember, isSilent, setDate, setReason, setServer, setSilent, setStaffMember
-
Field Details
-
PLACEHOLDERS
Array containing all available placeholders that can be translated with a warning's information.Content: ["id", "player", "player_uuid", "staff_member", "who_unwarned", "reason", "server", "date", "unwarn_date", "expiration_date", "duration", "remaining_time", "amount", "max_amount", "active", "global", "silent"]
- See Also:
-
-
Method Details
-
getPlayer
Gets this warning's player.- Returns:
- Warning's player
-
getWhoUnwarned
Gets who unwarnedgetPlayer().Will return
nullif the player has not been manually unwarned.- Returns:
- Who unwarned the player
-
setWhoUnwarned
Sets who unwarnedgetPlayer().- Parameters:
whoUnwarned- Who unwarned the player
-
getUnwarnDate
public long getUnwarnDate()Gets this warning's unwarn date, in milliseconds.Will return -1 if the player has not been unwarned.
- Returns:
- Unwarn's date
-
setUnwarnDate
public void setUnwarnDate(long unwarnDate) Sets this warning's unwarn date, in milliseconds.- Parameters:
unwarnDate- Unwarn's date
-
getDuration
public long getDuration()Gets this warning's duration, in milliseconds.- Returns:
- Warning's duration
-
getRemainingTime
public long getRemainingTime()Gets this warning's remaining time, in milliseconds.Will return 0 if the player has been unwarned.
- Returns:
- Warning's remaining time
-
getTaskID
public long getTaskID()Gets this warning's expiration task's ID.May be used with
TaskManager.cancelAsync(long).Will return -1 if this warning has already expired or if
!.Environment.isProxy()&&ProxyManager.isEnabled()- Returns:
- Warning's expiration task's ID
-
isGlobal
public boolean isGlobal()Checks if this warning affects all servers inside of the network.Only applies on multi instance setups with a proxy.
- Returns:
- Whether this warning is global
-
setGlobal
public void setGlobal(boolean global) Sets if this warning should affect all servers inside of the network.Only applies on multi instance setups with a proxy.
- Parameters:
global- Whether this warning is global
-
isActive
public boolean isActive()Checks if this warning is active at the moment.- Returns:
- Whether this warning is active
-