java.lang.Object
me.remigio07.chatplugin.api.common.punishment.Punishment
Direct Known Subclasses:
Ban, Kick, Mute, Warning

public abstract class Punishment extends Object
Represents a punishment (ban, warning, kick, mute) handled by a PunishmentManager.
  • Method Details

    • getID

      public int getID()
      Gets this punishment's ID.
      Returns:
      Punishment's ID
    • getStaffMember

      public String getStaffMember()
      Gets who punished the player.
      Returns:
      Punishment's staff member
    • setStaffMember

      public void setStaffMember(String staffMember)
      Sets who punished the player.
      Parameters:
      staffMember - Punishment's staff member
    • getReason

      public String getReason()
      Gets this punishment's reason.

      Will return null if no reason was specified.

      Returns:
      Punishment's reason
    • setReason

      public void setReason(String reason)
      Sets this punishment's reason.

      You can specify null to reset the reason.

      Parameters:
      reason - Punishment's reason
    • getServer

      public String getServer()
      Gets this punishment's origin server.
      Returns:
      Punishment's origin server
    • setServer

      public void setServer(String server)
      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

      public abstract String formatPlaceholders(String input, Language language)
      Translates an input string with this punishment's specific placeholders.

      Every punishment has different placeholders available. Check the following fields:

      Parameters:
      input - Input containing placeholders
      language - Language used to translate the placeholders
      Returns:
      Translated placeholders
    • formatPlaceholders

      public abstract List<String> formatPlaceholders(List<String> input, Language language)
      Translates an input string list with this punishment's specific placeholders.

      Every punishment has different placeholders available. Check the following fields:

      Parameters:
      input - Input containing placeholders
      language - Language used to translate the placeholders
      Returns:
      Translated placeholders