Class Mute
MuteManager
.-
Field Summary
Modifier and TypeFieldDescriptionstatic final String[]
Array containing all available placeholders that can be translated with a mute's information. -
Method Summary
Modifier and TypeMethodDescriptionlong
Gets this mute's duration, in milliseconds.Gets this mute's player.long
Gets this mute's remaining time, in milliseconds.long
Gets this mute's expiration task's ID.long
Gets this mute's unmute date, in milliseconds.Gets who unmutedgetPlayer()
.boolean
isActive()
Checks if this mute is active at the moment.boolean
isGlobal()
Checks if this mute affects all servers inside of the network.void
setDuration
(long duration) Sets this mute's duration, in milliseconds.void
setGlobal
(boolean global) Sets if this mute should affect all servers inside of the network.void
setUnmuteDate
(long unmuteDate) Sets this mute's unmute date, in milliseconds.void
setWhoUnmuted
(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"]
-
-
Method Details
-
getPlayer
Gets this mute's player.- Returns:
- Mute's player
-
getWhoUnmuted
Gets who unmutedgetPlayer()
.Will return
null
if 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
-