java.lang.Object
me.remigio07.chatplugin.api.common.punishment.ban.banwave.BanwaveEntry

public abstract class BanwaveEntry extends Object
Represents a banwave entry handled by the BanwaveManager.
See Also:
  • Field Details

    • PLACEHOLDERS

      public static final String[] PLACEHOLDERS
      Array containing all available placeholders that can be translated with a banwave entry's information.

      Content: ["player", "player_uuid", "ip_address", "staff_member", "who_removed", "reason", "server", "type", "date", "removal_date", "duration", "active", "global", "silent"]

      See Also:
  • Method Details

    • getPlayer

      public OfflinePlayer getPlayer()
      Gets this entry's player.

      Will return null if they have not been specified (BanType.IP_ADDRESS with no given player).

      Returns:
      Entry's player
    • getIPAddress

      public InetAddress getIPAddress()
      Gets this entry's IP address.

      Will return null if the IP address is unknown.

      Returns:
      Entry's IP address
    • getStaffMember

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

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

      public String getWhoRemoved()
      Gets who removed the entry.

      Will return null if the entry has not been removed.

      Returns:
      Who removed the entry
    • setWhoRemoved

      public void setWhoRemoved(String whoRemoved)
      Sets who removed the entry.
      Parameters:
      whoRemoved - Who removed the entry
    • getReason

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

      Will return null if no reason was specified.

      Returns:
      Entry's reason
    • setReason

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

      You can specify null to reset the reason.

      Parameters:
      reason - Entry's reason
    • getServer

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

      public void setServer(String server)
      Sets this entry's origin server.
      Parameters:
      server - Entry's origin server
    • getType

      public BanType getType()
      Gets this entry's type.
      Returns:
      Entry's type
    • getDate

      public long getDate()
      Gets this entry's creation or modification date, in milliseconds.
      Returns:
      Entry's creation or modification date
    • setDate

      public void setDate(long date)
      Sets this entry's modification date.
      Parameters:
      date - Entry's modification date
    • getRemovalDate

      public long getRemovalDate()
      Gets this entry's removal's date, in milliseconds.

      Will return -1 if the entry has not been removed.

      Returns:
      Entry's removal's date
    • setRemovalDate

      public void setRemovalDate(long removalDate)
      Sets this entry's removal's date, in milliseconds.
      Parameters:
      removalDate - Entry's removal's date
    • getDuration

      public long getDuration()
      Gets this entry's duration, in milliseconds.

      Will return -1 if this entry is permanent.

      Returns:
      Entry's duration
    • setDuration

      public void setDuration(long duration)
      Sets this entry's duration, in milliseconds.

      You can specify -1 for a permanent entry.

      Parameters:
      duration - Entry's duration
    • isGlobal

      public boolean isGlobal()
      Checks if this entry affects all servers inside of the network.

      Only applies on multi instance setups with a proxy.

      Returns:
      Whether this entry is global
    • setGlobal

      public void setGlobal(boolean global)
      Sets if this entry should affect all servers inside of the network.

      Only applies on multi instance setups with a proxy.

      Parameters:
      global - Whether this entry is global
    • isSilent

      public boolean isSilent()
      Checks if this entry is silent.

      If true, only Staff members will receive the announcement.

      Returns:
      Whether this entry is silent
    • setSilent

      public void setSilent(boolean silent)
      Sets if this entry should be silent.

      If true, only Staff members will receive the announcement.

      Parameters:
      silent - Whether this entry is silent
    • formatPlaceholders

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

      Check PLACEHOLDERS to find out the available placeholders.

      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 entry's specific placeholders.

      Check PLACEHOLDERS to find out the available placeholders.

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