java.lang.Object
me.remigio07.chatplugin.api.common.punishment.Punishment
me.remigio07.chatplugin.api.common.punishment.mute.Mute

public abstract class Mute extends Punishment
Represents a mute handled by the MuteManager.
See Also:
  • Field Details

    • PLACEHOLDERS

      public static final String[] 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

      public OfflinePlayer getPlayer()
      Gets this mute's player.
      Returns:
      Mute's player
    • getWhoUnmuted

      public String getWhoUnmuted()
      Gets who unmuted getPlayer().

      Will return null if the player has not been manually unmuted.

      Returns:
      Who unmuted the player
    • setWhoUnmuted

      public void setWhoUnmuted(String whoUnmuted)
      Sets who unmuted getPlayer().
      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