Interface Ban
- All Known Subinterfaces:
Ban.IP
,Ban.Profile
public interface Ban
Represents a ban made on an object.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Represents a builder that creates bans.static interface
Represents a ban made on an IP.static interface
Represents a ban made on aGameProfile
. -
Method Summary
Modifier and TypeMethodDescriptionGets the source that created this ban, if available.static Ban.Builder
builder()
Creates a new Builder.Gets the creation date of the ban.Gets the expiration date of this ban, if available.default boolean
Gets whether this ban is indefinitely long, e.g.static Ban
of
(GameProfile profile) Creates an indefinite ban on a profile.static Ban
of
(GameProfile profile, Component reason) Creates an indefinite ban with a reason on a profile.reason()
Gets the reason for the ban, if available.type()
Gets the type of this ban.
-
Method Details
-
builder
Creates a new Builder.- Returns:
- A new ban builder
-
of
Creates an indefinite ban on a profile.- Parameters:
profile
- The profile- Returns:
- The created ban
-
of
Creates an indefinite ban with a reason on a profile.- Parameters:
profile
- The profilereason
- The reason- Returns:
- The created ban
-
type
BanType type()Gets the type of this ban.- Returns:
- The ban type
-
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 byBanService.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
Gets the source that created this ban, if available.- Returns:
- the source of this ban, if available
-
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
-