Class CompositeVictim

java.lang.Object
space.arim.libertybans.api.Victim
space.arim.libertybans.api.CompositeVictim

public final class CompositeVictim extends Victim
An victim which is a composite of a UUID and an IP address. This can be thought of as an IP ban which is slightly more powerful, because it applies to the banned user's UUID as well.
Author:
A248
  • Field Details

    • WILDCARD_UUID

      public static final UUID WILDCARD_UUID
      The wildcard (empty) UUID. This is used as a special value in several places where victims are accepted, so as to match all composite victims with a given IP address while disregarding the UUID.

      Punishments cannot be made using this UUID; punishments can only be selected and revoked using it.
    • WILDCARD_ADDRESS

      public static final NetworkAddress WILDCARD_ADDRESS
      The wildcard (empty) network address. This is used as a special value in several places where victims are accepted, so as to match all composite victims with a given UUID while disregarding the IP address.

      Punishments cannot be made using this IP address; punishments can only be seleted and revoked using it.

      If this is combined with WILDCARD_UUID, the result is a composite victim which will match all composite victims.
  • Method Details

    • of

      public static CompositeVictim of(UUID uuid, NetworkAddress address)
      Gets a victim for the UUID and address
      Parameters:
      uuid - the UUID
      address - the network address
      Returns:
      a composite victim
    • of

      public static CompositeVictim of(UUID uuid, InetAddress address)
      Gets a victim for the UUID and address
      Parameters:
      uuid - the UUID
      address - the inet address
      Returns:
      a composite victim
    • of

      public static CompositeVictim of(UUID uuid, byte[] address)
      Gets a victim for the UUID and address bytes. Shortcut for CompositeVictim.of(uuid, NetworkAddress.of(address))
      Parameters:
      uuid - the UUID
      address - the raw address bytes
      Returns:
      a composite victim
      Throws:
      IllegalArgumentException - if the address bytes array is of illegal length
    • getType

      public Victim.VictimType getType()
      Gets this victim's type: Victim.VictimType.COMPOSITE
      Specified by:
      getType in class Victim
      Returns:
      the victim type
    • getUUID

      public UUID getUUID()
      Gets the UUID of this victim
      Returns:
      the player UUID
    • getAddress

      public NetworkAddress getAddress()
      Gets the network address of this victim
      Returns:
      the address
    • equals

      public boolean equals(Object o)
      Description copied from class: Victim
      Evaluates whether this victim is the same as another
      Specified by:
      equals in class Victim
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in class Victim
    • toString

      public String toString()
      Specified by:
      toString in class Victim