Interface Ban

  • All Known Subinterfaces:
    Ban.IP, Ban.Profile

    public interface Ban
    Represents a ban made on an object.
    • Method Detail

      • builder

        static Ban.Builder builder()
        Creates a new Builder.
        Returns:
        A new ban builder
      • of

        static Ban of​(GameProfile profile)
        Creates an indefinite ban on a profile.
        Parameters:
        profile - The profile
        Returns:
        The created ban
      • of

        static Ban of​(GameProfile profile,
                      Component reason)
        Creates an indefinite ban with a reason on a profile.
        Parameters:
        profile - The profile
        reason - The reason
        Returns:
        The created ban
      • type

        BanType type()
        Gets the type of this ban.
        Returns:
        The ban type
      • reason

        Optional<Component> reason()
        Gets the reason for the ban, if available.
        Returns:
        The reason specified for the ban, if available
      • creationDate

        Instant creationDate()
        Gets the creation date of the ban.

        Note that this Instant has no effect on whether or not a ban is active. Any ban returned by BanService.find(GameProfile) will be used (when checking if a player can join, for example), regardless of its creation date.

        Returns:
        Creation date of the ban
      • banSource

        Optional<Component> banSource()
        Gets the source that created this ban, if available.
        Returns:
        the source of this ban, if available
      • expirationDate

        Optional<Instant> expirationDate()
        Gets the expiration date of this ban, if available.
        Returns:
        Expiration time of the ban or Optional.empty()
      • isIndefinite

        default boolean isIndefinite()
        Gets whether this ban is indefinitely long, e.g. has no expiration date.
        Returns:
        True if this ban has no expiration date, otherwise false