Class Mute
MuteManager.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String[]Array containing all available placeholders that can be translated with a mute's information. -
Method Summary
Modifier and TypeMethodDescriptionlongGets this mute's duration, in milliseconds.Gets this mute's player.longGets this mute's remaining time, in milliseconds.longGets this mute's expiration task's ID.longGets this mute's unmute date, in milliseconds.Gets who unmutedgetPlayer().booleanisActive()Checks if this mute is active at the moment.booleanisGlobal()Checks if this mute affects all servers inside of the network.voidsetDuration(long duration) Sets this mute's duration, in milliseconds.voidsetGlobal(boolean global) Sets if this mute should affect all servers inside of the network.voidsetUnmuteDate(long unmuteDate) Sets this mute's unmute date, in milliseconds.voidsetWhoUnmuted(String whoUnmuted) Sets who unmutedgetPlayer().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 mute's information.Content: ["id", "player", "player_uuid", "staff_member", "who_unmuted", "reason", "server", "date", "unmute_date", "expiration_date", "duration", "remaining_time", "active", "global", "silent"]
- See Also:
-
-
Method Details
-
getPlayer
Gets this mute's player.- Returns:
- Mute's player
-
getWhoUnmuted
Gets who unmutedgetPlayer().Will return
nullif the player has not been manually unmuted.- Returns:
- Who unmuted the player
-
setWhoUnmuted
Sets who unmutedgetPlayer().- Parameters:
whoUnmuted- Who unmuted the player
-
getUnmuteDate
public long getUnmuteDate()Gets this mute's unmute date, in milliseconds.Will return -1 if the player has not been manually unmuted.
- Returns:
- Unmute's date
-
setUnmuteDate
public void setUnmuteDate(long unmuteDate) Sets this mute's unmute date, in milliseconds.- Parameters:
unmuteDate- Unmute's date
-
getDuration
public long getDuration()Gets this mute's duration, in milliseconds.Will return -1 if this mute is permanent.
- Returns:
- Mute's duration
-
setDuration
public void setDuration(long duration) Sets this mute's duration, in milliseconds.You can specify -1 for a permanent mute.
- Parameters:
duration- Mute's duration
-
getRemainingTime
public long getRemainingTime()Gets this mute's remaining time, in milliseconds.Will return 0 if the player has been unmuted otherwise -1 if the mute is permanent.
- Returns:
- Mute's remaining time
-
getTaskID
public long getTaskID()Gets this mute's expiration task's ID.May be used with
TaskManager.cancelAsync(long).Will return -1 if this mute is permanent, if it has already expired or if
!.Environment.isProxy()&&ProxyManager.isEnabled()- Returns:
- Mute's expiration task's ID
-
isGlobal
public boolean isGlobal()Checks if this mute affects all servers inside of the network.Only applies on multi instance setups with a proxy.
- Returns:
- Whether this mute is global
-
setGlobal
public void setGlobal(boolean global) Sets if this mute should affect all servers inside of the network.Only applies on multi instance setups with a proxy.
- Parameters:
global- Whether this mute is global
-
isActive
public boolean isActive()Checks if this mute is active at the moment.- Returns:
- Whether this mute is active
-