Interface Ban.Builder

All Superinterfaces:
AbstractBuilder<Ban>, Builder<Ban,Ban.Builder>, CopyableBuilder<Ban,Ban.Builder>, ResettableBuilder<Ban,Ban.Builder>
Enclosing interface:
Ban

public static interface Ban.Builder extends Builder<Ban,Ban.Builder>, CopyableBuilder<Ban,Ban.Builder>
Represents a builder that creates bans.
  • Method Details

    • profile

      Ban.Builder profile(GameProfile profile)
      Sets the profile to be banned.

      This can only be done if the BanType has been set to BanTypes.PROFILE.

      Parameters:
      profile - The profile
      Returns:
      This builder
    • address

      Ban.Builder address(InetAddress address)
      Sets the IP address to be banned.

      This can only be done if the BanType has been set to BanTypes.IP.

      Parameters:
      address - The IP address
      Returns:
      This builder
    • type

      Ban.Builder type(BanType type)
      Sets the type of the ban.
      Parameters:
      type - The type to be set
      Returns:
      This builder
    • type

      default Ban.Builder type(Supplier<? extends BanType> type)
      Sets the type of the ban.
      Parameters:
      type - The type to be set
      Returns:
      This builder
    • reason

      Ban.Builder reason(@Nullable Component reason)
      Sets the reason for the ban.

      If the specified reason is null, or not provided, then the reason will be be available on the created ban.

      Parameters:
      reason - The reason
      Returns:
      This builder
    • startDate

      Ban.Builder startDate(Instant instant)
      Sets the date that the ban starts.
      Parameters:
      instant - The start date
      Returns:
      This builder
    • expirationDate

      Ban.Builder expirationDate(@Nullable Instant instant)
      Sets the expiration date of the ban, or removes it.
      Parameters:
      instant - The expiration date, or null in order to remove it
      Returns:
      This builder
    • source

      Ban.Builder source(@Nullable Component source)
      Sets the source of the ban as a Component, or removes it if null is passed in.
      Parameters:
      source - The source of the ban, or null
      Returns:
      This builder
    • build

      Ban build()
      Creates a new Ban from this builder.
      Specified by:
      build in interface AbstractBuilder<Ban>
      Returns:
      A new Ban