public interface OfflinePlayer extends ServerOperator, AnimalTamer, ConfigurationSerializable
Modifier and Type | Method and Description |
---|---|
default @NotNull BanEntry |
banPlayer(@Nullable String reason)
Permanently Bans this player from the server
|
default @NotNull BanEntry |
banPlayer(@Nullable String reason,
Date expires)
Bans this player from the server
|
default @NotNull BanEntry |
banPlayer(@Nullable String reason,
Date expires,
@Nullable String source)
Bans this player from the server
|
default @NotNull BanEntry |
banPlayer(@Nullable String reason,
Date expires,
@Nullable String source,
boolean kickIfOnline) |
default @NotNull BanEntry |
banPlayer(@Nullable String reason,
@Nullable String source)
Permanently Bans this player from the server
|
void |
decrementStatistic(@NotNull Statistic statistic)
Decrements the given statistic for this player.
|
void |
decrementStatistic(@NotNull Statistic statistic,
@NotNull EntityType entityType)
Decrements the given statistic for this player for the given entity.
|
void |
decrementStatistic(@NotNull Statistic statistic,
@NotNull EntityType entityType,
int amount)
Decrements the given statistic for this player for the given entity.
|
void |
decrementStatistic(@NotNull Statistic statistic,
int amount)
Decrements the given statistic for this player.
|
void |
decrementStatistic(@NotNull Statistic statistic,
@NotNull Material material)
Decrements the given statistic for this player for the given material.
|
void |
decrementStatistic(@NotNull Statistic statistic,
@NotNull Material material,
int amount)
Decrements the given statistic for this player for the given material.
|
@Nullable Location |
getBedSpawnLocation()
Gets the Location where the player will spawn at their bed, null if
they have not slept in one or their current bed spawn is invalid.
|
long |
getFirstPlayed()
Gets the first date and time that this player was witnessed on this
server.
|
long |
getLastLogin()
Gets the last date and time that this player logged into the server.
|
long |
getLastPlayed()
Deprecated.
The API contract is ambiguous and the implementation may or may not return the correct value given this API ambiguity. It is instead recommended use
getLastLogin() or getLastSeen() depending on your needs. |
long |
getLastSeen()
Gets the last date and time that this player was seen on the server.
|
@Nullable String |
getName()
Returns the name of this player
|
@Nullable Player |
getPlayer()
Gets a
Player object that this represents, if there is one |
int |
getStatistic(@NotNull Statistic statistic)
Gets the value of the given statistic for this player.
|
int |
getStatistic(@NotNull Statistic statistic,
@NotNull EntityType entityType)
Gets the value of the given statistic for this player.
|
int |
getStatistic(@NotNull Statistic statistic,
@NotNull Material material)
Gets the value of the given statistic for this player.
|
@NotNull UUID |
getUniqueId()
Returns the UUID of this player
|
boolean |
hasPlayedBefore()
Checks if this player has played on this server before.
|
void |
incrementStatistic(@NotNull Statistic statistic)
Increments the given statistic for this player.
|
void |
incrementStatistic(@NotNull Statistic statistic,
@NotNull EntityType entityType)
Increments the given statistic for this player for the given entity.
|
void |
incrementStatistic(@NotNull Statistic statistic,
@NotNull EntityType entityType,
int amount)
Increments the given statistic for this player for the given entity.
|
void |
incrementStatistic(@NotNull Statistic statistic,
int amount)
Increments the given statistic for this player.
|
void |
incrementStatistic(@NotNull Statistic statistic,
@NotNull Material material)
Increments the given statistic for this player for the given material.
|
void |
incrementStatistic(@NotNull Statistic statistic,
@NotNull Material material,
int amount)
Increments the given statistic for this player for the given material.
|
boolean |
isBanned()
Checks if this player is banned or not
|
boolean |
isOnline()
Checks if this player is currently online
|
boolean |
isWhitelisted()
Checks if this player is whitelisted or not
|
void |
setStatistic(@NotNull Statistic statistic,
@NotNull EntityType entityType,
int newValue)
Sets the given statistic for this player for the given entity.
|
void |
setStatistic(@NotNull Statistic statistic,
int newValue)
Sets the given statistic for this player.
|
void |
setStatistic(@NotNull Statistic statistic,
@NotNull Material material,
int newValue)
Sets the given statistic for this player for the given material.
|
void |
setWhitelisted(boolean value)
Sets if this player is whitelisted or not
|
isOp, setOp
serialize
boolean isOnline()
@Nullable @Nullable String getName()
Names are no longer unique past a single game session. For persistent storage
it is recommended that you use getUniqueId()
instead.
getName
in interface AnimalTamer
@NotNull @NotNull UUID getUniqueId()
getUniqueId
in interface AnimalTamer
boolean isBanned()
@NotNull default @NotNull BanEntry banPlayer(@Nullable @Nullable String reason)
reason
- Reason for Ban@NotNull default @NotNull BanEntry banPlayer(@Nullable @Nullable String reason, @Nullable @Nullable String source)
reason
- Reason for Bansource
- Source of the ban, or null for default@NotNull default @NotNull BanEntry banPlayer(@Nullable @Nullable String reason, @Nullable Date expires)
reason
- Reason for Banexpires
- When to expire the ban@NotNull default @NotNull BanEntry banPlayer(@Nullable @Nullable String reason, @Nullable Date expires, @Nullable @Nullable String source)
reason
- Reason for Banexpires
- When to expire the bansource
- Source of the ban or null for default@NotNull default @NotNull BanEntry banPlayer(@Nullable @Nullable String reason, @Nullable Date expires, @Nullable @Nullable String source, boolean kickIfOnline)
boolean isWhitelisted()
void setWhitelisted(boolean value)
value
- true if whitelisted@Nullable @Nullable Player getPlayer()
Player
object that this represents, if there is one
If the player is online, this will return that player. Otherwise, it will return null.
long getFirstPlayed()
If the player has never played before, this will return 0. Otherwise, it will be the amount of milliseconds since midnight, January 1, 1970 UTC.
@Deprecated long getLastPlayed()
getLastLogin()
or getLastSeen()
depending on your needs.If the player has never played before, this will return 0. Otherwise, it will be the amount of milliseconds since midnight, January 1, 1970 UTC.
boolean hasPlayedBefore()
@Nullable @Nullable Location getBedSpawnLocation()
long getLastLogin()
If the player has never played before, this will return 0. Otherwise, it will be the amount of milliseconds since midnight, January 1, 1970 UTC.
long getLastSeen()
If the player has never played before, this will return 0. If the player is currently online, this will return the current time. Otherwise it will be the amount of milliseconds since midnight, January 1, 1970 UTC.
void incrementStatistic(@NotNull @NotNull Statistic statistic) throws IllegalArgumentException
This is equivalent to the following code:
incrementStatistic(Statistic, 1)
statistic
- Statistic to incrementIllegalArgumentException
- if statistic is nullIllegalArgumentException
- if the statistic requires an
additional parametervoid decrementStatistic(@NotNull @NotNull Statistic statistic) throws IllegalArgumentException
This is equivalent to the following code:
decrementStatistic(Statistic, 1)
statistic
- Statistic to decrementIllegalArgumentException
- if statistic is nullIllegalArgumentException
- if the statistic requires an
additional parametervoid incrementStatistic(@NotNull @NotNull Statistic statistic, int amount) throws IllegalArgumentException
statistic
- Statistic to incrementamount
- Amount to increment this statistic byIllegalArgumentException
- if statistic is nullIllegalArgumentException
- if amount is negativeIllegalArgumentException
- if the statistic requires an
additional parametervoid decrementStatistic(@NotNull @NotNull Statistic statistic, int amount) throws IllegalArgumentException
statistic
- Statistic to decrementamount
- Amount to decrement this statistic byIllegalArgumentException
- if statistic is nullIllegalArgumentException
- if amount is negativeIllegalArgumentException
- if the statistic requires an
additional parametervoid setStatistic(@NotNull @NotNull Statistic statistic, int newValue) throws IllegalArgumentException
statistic
- Statistic to setnewValue
- The value to set this statistic toIllegalArgumentException
- if statistic is nullIllegalArgumentException
- if newValue is negativeIllegalArgumentException
- if the statistic requires an
additional parameterint getStatistic(@NotNull @NotNull Statistic statistic) throws IllegalArgumentException
statistic
- Statistic to checkIllegalArgumentException
- if statistic is nullIllegalArgumentException
- if the statistic requires an
additional parametervoid incrementStatistic(@NotNull @NotNull Statistic statistic, @NotNull @NotNull Material material) throws IllegalArgumentException
This is equivalent to the following code:
incrementStatistic(Statistic, Material, 1)
statistic
- Statistic to incrementmaterial
- Material to offset the statistic withIllegalArgumentException
- if statistic is nullIllegalArgumentException
- if material is nullIllegalArgumentException
- if the given parameter is not valid
for the statisticvoid decrementStatistic(@NotNull @NotNull Statistic statistic, @NotNull @NotNull Material material) throws IllegalArgumentException
This is equivalent to the following code:
decrementStatistic(Statistic, Material, 1)
statistic
- Statistic to decrementmaterial
- Material to offset the statistic withIllegalArgumentException
- if statistic is nullIllegalArgumentException
- if material is nullIllegalArgumentException
- if the given parameter is not valid
for the statisticint getStatistic(@NotNull @NotNull Statistic statistic, @NotNull @NotNull Material material) throws IllegalArgumentException
statistic
- Statistic to checkmaterial
- Material offset of the statisticIllegalArgumentException
- if statistic is nullIllegalArgumentException
- if material is nullIllegalArgumentException
- if the given parameter is not valid
for the statisticvoid incrementStatistic(@NotNull @NotNull Statistic statistic, @NotNull @NotNull Material material, int amount) throws IllegalArgumentException
statistic
- Statistic to incrementmaterial
- Material to offset the statistic withamount
- Amount to increment this statistic byIllegalArgumentException
- if statistic is nullIllegalArgumentException
- if material is nullIllegalArgumentException
- if amount is negativeIllegalArgumentException
- if the given parameter is not valid
for the statisticvoid decrementStatistic(@NotNull @NotNull Statistic statistic, @NotNull @NotNull Material material, int amount) throws IllegalArgumentException
statistic
- Statistic to decrementmaterial
- Material to offset the statistic withamount
- Amount to decrement this statistic byIllegalArgumentException
- if statistic is nullIllegalArgumentException
- if material is nullIllegalArgumentException
- if amount is negativeIllegalArgumentException
- if the given parameter is not valid
for the statisticvoid setStatistic(@NotNull @NotNull Statistic statistic, @NotNull @NotNull Material material, int newValue) throws IllegalArgumentException
statistic
- Statistic to setmaterial
- Material to offset the statistic withnewValue
- The value to set this statistic toIllegalArgumentException
- if statistic is nullIllegalArgumentException
- if material is nullIllegalArgumentException
- if newValue is negativeIllegalArgumentException
- if the given parameter is not valid
for the statisticvoid incrementStatistic(@NotNull @NotNull Statistic statistic, @NotNull @NotNull EntityType entityType) throws IllegalArgumentException
This is equivalent to the following code:
incrementStatistic(Statistic, EntityType, 1)
statistic
- Statistic to incremententityType
- EntityType to offset the statistic withIllegalArgumentException
- if statistic is nullIllegalArgumentException
- if entityType is nullIllegalArgumentException
- if the given parameter is not valid
for the statisticvoid decrementStatistic(@NotNull @NotNull Statistic statistic, @NotNull @NotNull EntityType entityType) throws IllegalArgumentException
This is equivalent to the following code:
decrementStatistic(Statistic, EntityType, 1)
statistic
- Statistic to decremententityType
- EntityType to offset the statistic withIllegalArgumentException
- if statistic is nullIllegalArgumentException
- if entityType is nullIllegalArgumentException
- if the given parameter is not valid
for the statisticint getStatistic(@NotNull @NotNull Statistic statistic, @NotNull @NotNull EntityType entityType) throws IllegalArgumentException
statistic
- Statistic to checkentityType
- EntityType offset of the statisticIllegalArgumentException
- if statistic is nullIllegalArgumentException
- if entityType is nullIllegalArgumentException
- if the given parameter is not valid
for the statisticvoid incrementStatistic(@NotNull @NotNull Statistic statistic, @NotNull @NotNull EntityType entityType, int amount) throws IllegalArgumentException
statistic
- Statistic to incremententityType
- EntityType to offset the statistic withamount
- Amount to increment this statistic byIllegalArgumentException
- if statistic is nullIllegalArgumentException
- if entityType is nullIllegalArgumentException
- if amount is negativeIllegalArgumentException
- if the given parameter is not valid
for the statisticvoid decrementStatistic(@NotNull @NotNull Statistic statistic, @NotNull @NotNull EntityType entityType, int amount)
statistic
- Statistic to decremententityType
- EntityType to offset the statistic withamount
- Amount to decrement this statistic byIllegalArgumentException
- if statistic is nullIllegalArgumentException
- if entityType is nullIllegalArgumentException
- if amount is negativeIllegalArgumentException
- if the given parameter is not valid
for the statisticvoid setStatistic(@NotNull @NotNull Statistic statistic, @NotNull @NotNull EntityType entityType, int newValue)
statistic
- Statistic to setentityType
- EntityType to offset the statistic withnewValue
- The value to set this statistic toIllegalArgumentException
- if statistic is nullIllegalArgumentException
- if entityType is nullIllegalArgumentException
- if newValue is negativeIllegalArgumentException
- if the given parameter is not valid
for the statisticCopyright © 2021. All rights reserved.