Package be.seeseemelk.mockbukkit.entity
Class OfflinePlayerMock
java.lang.Object
be.seeseemelk.mockbukkit.entity.OfflinePlayerMock
- All Implemented Interfaces:
PersistentDataViewHolder,ConfigurationSerializable,AnimalTamer,OfflinePlayer,ServerOperator
Mock implementation of an
OfflinePlayer.
Not interchangeable with PlayerMock.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionOfflinePlayerMock(@Nullable String name) Constructs a newOfflinePlayerMockon the providedServerMockwith a randomUUIDand specified name.OfflinePlayerMock(@NotNull UUID uuid, @Nullable String name) -
Method Summary
Modifier and TypeMethodDescription@Nullable BanEntry<PlayerProfile> @Nullable BanEntry<PlayerProfile> @Nullable BanEntry<PlayerProfile> voiddecrementStatistic(@NotNull Statistic statistic) voiddecrementStatistic(@NotNull Statistic statistic, int amount) voiddecrementStatistic(@NotNull Statistic statistic, @NotNull Material material) voiddecrementStatistic(@NotNull Statistic statistic, @NotNull Material material, int amount) voiddecrementStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType) voiddecrementStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType, int amount) @Nullable Locationlong@Nullable LocationlonglongDeprecated.long@Nullable Location@Nullable StringgetName()@NotNull PersistentDataContainerView@Nullable Player@NotNull PlayerProfile@Nullable LocationintgetStatistic(@NotNull Statistic statistic) intgetStatistic(@NotNull Statistic statistic, @NotNull Material material) intgetStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType) @NotNull UUIDbooleanvoidincrementStatistic(@NotNull Statistic statistic) voidincrementStatistic(@NotNull Statistic statistic, int amount) voidincrementStatistic(@NotNull Statistic statistic, @NotNull Material material) voidincrementStatistic(@NotNull Statistic statistic, @NotNull Material material, int amount) voidincrementStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType) voidincrementStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType, int amount) booleanisBanned()booleanbooleanisOnline()booleanisOp()boolean@NotNull PlayerMockjoin(@NotNull ServerMock server) Makes this offline player join the server.voidsetOp(boolean value) voidsetStatistic(@NotNull Statistic statistic, int newValue) voidsetStatistic(@NotNull Statistic statistic, @NotNull Material material, int newValue) voidsetStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType, int newValue) voidsetWhitelisted(boolean value)
-
Constructor Details
-
OfflinePlayerMock
- Parameters:
uuid- The UUID of the player.name- The name of the player.
-
OfflinePlayerMock
Constructs a newOfflinePlayerMockon the providedServerMockwith a randomUUIDand specified name.- Parameters:
name- The name of the player.
-
-
Method Details
-
join
Makes this offline player join the server. A new PlayerMock will be constructed, and added to the server. Will throw anIllegalStateExceptionif the player is already online.- Parameters:
server- The server to join.- Returns:
- The created PlayerMock.
-
isOnline
public boolean isOnline()- Specified by:
isOnlinein interfaceOfflinePlayer
-
isConnected
public boolean isConnected()- Specified by:
isConnectedin interfaceOfflinePlayer
-
getName
- Specified by:
getNamein interfaceAnimalTamer- Specified by:
getNamein interfaceOfflinePlayer
-
getUniqueId
- Specified by:
getUniqueIdin interfaceAnimalTamer- Specified by:
getUniqueIdin interfaceOfflinePlayer
-
isOp
public boolean isOp()- Specified by:
isOpin interfaceServerOperator
-
setOp
public void setOp(boolean value) - Specified by:
setOpin interfaceServerOperator
-
serialize
- Specified by:
serializein interfaceConfigurationSerializable
-
isBanned
public boolean isBanned()- Specified by:
isBannedin interfaceOfflinePlayer
-
ban
@Nullable public @Nullable BanEntry<PlayerProfile> ban(@Nullable @Nullable String reason, @Nullable @Nullable Date expires, @Nullable @Nullable String source) - Specified by:
banin interfaceOfflinePlayer
-
ban
@Nullable public @Nullable BanEntry<PlayerProfile> ban(@Nullable @Nullable String reason, @Nullable @Nullable Instant expires, @Nullable @Nullable String source) - Specified by:
banin interfaceOfflinePlayer
-
ban
@Nullable public @Nullable BanEntry<PlayerProfile> ban(@Nullable @Nullable String reason, @Nullable @Nullable Duration duration, @Nullable @Nullable String source) - Specified by:
banin interfaceOfflinePlayer
-
isWhitelisted
public boolean isWhitelisted()- Specified by:
isWhitelistedin interfaceOfflinePlayer
-
setWhitelisted
public void setWhitelisted(boolean value) - Specified by:
setWhitelistedin interfaceOfflinePlayer
-
getPlayer
- Specified by:
getPlayerin interfaceOfflinePlayer
-
getFirstPlayed
public long getFirstPlayed()- Specified by:
getFirstPlayedin interfaceOfflinePlayer
-
getLastPlayed
Deprecated.- Specified by:
getLastPlayedin interfaceOfflinePlayer
-
hasPlayedBefore
public boolean hasPlayedBefore()- Specified by:
hasPlayedBeforein interfaceOfflinePlayer
-
getRespawnLocation
- Specified by:
getRespawnLocationin interfaceOfflinePlayer
-
getBedSpawnLocation
- Specified by:
getBedSpawnLocationin interfaceOfflinePlayer
-
getLastLogin
public long getLastLogin()- Specified by:
getLastLoginin interfaceOfflinePlayer
-
getLastSeen
public long getLastSeen()- Specified by:
getLastSeenin interfaceOfflinePlayer
-
incrementStatistic
- Specified by:
incrementStatisticin interfaceOfflinePlayer
-
decrementStatistic
- Specified by:
decrementStatisticin interfaceOfflinePlayer
-
incrementStatistic
- Specified by:
incrementStatisticin interfaceOfflinePlayer
-
decrementStatistic
- Specified by:
decrementStatisticin interfaceOfflinePlayer
-
setStatistic
- Specified by:
setStatisticin interfaceOfflinePlayer
-
getStatistic
- Specified by:
getStatisticin interfaceOfflinePlayer
-
incrementStatistic
public void incrementStatistic(@NotNull @NotNull Statistic statistic, @NotNull @NotNull Material material) - Specified by:
incrementStatisticin interfaceOfflinePlayer
-
decrementStatistic
public void decrementStatistic(@NotNull @NotNull Statistic statistic, @NotNull @NotNull Material material) - Specified by:
decrementStatisticin interfaceOfflinePlayer
-
getStatistic
- Specified by:
getStatisticin interfaceOfflinePlayer
-
incrementStatistic
public void incrementStatistic(@NotNull @NotNull Statistic statistic, @NotNull @NotNull Material material, int amount) - Specified by:
incrementStatisticin interfaceOfflinePlayer
-
decrementStatistic
public void decrementStatistic(@NotNull @NotNull Statistic statistic, @NotNull @NotNull Material material, int amount) - Specified by:
decrementStatisticin interfaceOfflinePlayer
-
setStatistic
public void setStatistic(@NotNull @NotNull Statistic statistic, @NotNull @NotNull Material material, int newValue) - Specified by:
setStatisticin interfaceOfflinePlayer
-
incrementStatistic
public void incrementStatistic(@NotNull @NotNull Statistic statistic, @NotNull @NotNull EntityType entityType) - Specified by:
incrementStatisticin interfaceOfflinePlayer
-
decrementStatistic
public void decrementStatistic(@NotNull @NotNull Statistic statistic, @NotNull @NotNull EntityType entityType) - Specified by:
decrementStatisticin interfaceOfflinePlayer
-
getStatistic
public int getStatistic(@NotNull @NotNull Statistic statistic, @NotNull @NotNull EntityType entityType) - Specified by:
getStatisticin interfaceOfflinePlayer
-
incrementStatistic
public void incrementStatistic(@NotNull @NotNull Statistic statistic, @NotNull @NotNull EntityType entityType, int amount) - Specified by:
incrementStatisticin interfaceOfflinePlayer
-
decrementStatistic
public void decrementStatistic(@NotNull @NotNull Statistic statistic, @NotNull @NotNull EntityType entityType, int amount) - Specified by:
decrementStatisticin interfaceOfflinePlayer
-
setStatistic
public void setStatistic(@NotNull @NotNull Statistic statistic, @NotNull @NotNull EntityType entityType, int newValue) - Specified by:
setStatisticin interfaceOfflinePlayer
-
getLastDeathLocation
- Specified by:
getLastDeathLocationin interfaceOfflinePlayer
-
getLocation
- Specified by:
getLocationin interfaceOfflinePlayer
-
getPersistentDataContainer
- Specified by:
getPersistentDataContainerin interfaceOfflinePlayer- Specified by:
getPersistentDataContainerin interfacePersistentDataViewHolder
-
getPlayerProfile
- Specified by:
getPlayerProfilein interfaceOfflinePlayer
-