Package be.seeseemelk.mockbukkit.entity
Class OfflinePlayerMock
java.lang.Object
be.seeseemelk.mockbukkit.entity.OfflinePlayerMock
- All Implemented Interfaces:
org.bukkit.configuration.serialization.ConfigurationSerializable,org.bukkit.entity.AnimalTamer,org.bukkit.OfflinePlayer,org.bukkit.permissions.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 org.bukkit.BanEntry<com.destroystokyo.paper.profile.PlayerProfile> @Nullable org.bukkit.BanEntry<com.destroystokyo.paper.profile.PlayerProfile> @Nullable org.bukkit.BanEntry<com.destroystokyo.paper.profile.PlayerProfile> voiddecrementStatistic(@NotNull org.bukkit.Statistic statistic) voiddecrementStatistic(@NotNull org.bukkit.Statistic statistic, int amount) voiddecrementStatistic(@NotNull org.bukkit.Statistic statistic, @NotNull org.bukkit.Material material) voiddecrementStatistic(@NotNull org.bukkit.Statistic statistic, @NotNull org.bukkit.Material material, int amount) voiddecrementStatistic(@NotNull org.bukkit.Statistic statistic, @NotNull org.bukkit.entity.EntityType entityType) voiddecrementStatistic(@NotNull org.bukkit.Statistic statistic, @NotNull org.bukkit.entity.EntityType entityType, int amount) @Nullable org.bukkit.Locationlong@Nullable org.bukkit.LocationlonglongDeprecated.long@Nullable org.bukkit.Location@Nullable StringgetName()@Nullable org.bukkit.entity.Player@NotNull com.destroystokyo.paper.profile.PlayerProfile@Nullable org.bukkit.LocationintgetStatistic(@NotNull org.bukkit.Statistic statistic) intgetStatistic(@NotNull org.bukkit.Statistic statistic, @NotNull org.bukkit.Material material) intgetStatistic(@NotNull org.bukkit.Statistic statistic, @NotNull org.bukkit.entity.EntityType entityType) @NotNull UUIDbooleanvoidincrementStatistic(@NotNull org.bukkit.Statistic statistic) voidincrementStatistic(@NotNull org.bukkit.Statistic statistic, int amount) voidincrementStatistic(@NotNull org.bukkit.Statistic statistic, @NotNull org.bukkit.Material material) voidincrementStatistic(@NotNull org.bukkit.Statistic statistic, @NotNull org.bukkit.Material material, int amount) voidincrementStatistic(@NotNull org.bukkit.Statistic statistic, @NotNull org.bukkit.entity.EntityType entityType) voidincrementStatistic(@NotNull org.bukkit.Statistic statistic, @NotNull org.bukkit.entity.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 org.bukkit.Statistic statistic, int newValue) voidsetStatistic(@NotNull org.bukkit.Statistic statistic, @NotNull org.bukkit.Material material, int newValue) voidsetStatistic(@NotNull org.bukkit.Statistic statistic, @NotNull org.bukkit.entity.EntityType entityType, int newValue) voidsetWhitelisted(boolean value) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.bukkit.OfflinePlayer
banPlayer, banPlayer, banPlayer, banPlayer, banPlayer
-
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 interfaceorg.bukkit.OfflinePlayer
-
isConnected
public boolean isConnected()- Specified by:
isConnectedin interfaceorg.bukkit.OfflinePlayer
-
getName
- Specified by:
getNamein interfaceorg.bukkit.entity.AnimalTamer- Specified by:
getNamein interfaceorg.bukkit.OfflinePlayer
-
getUniqueId
- Specified by:
getUniqueIdin interfaceorg.bukkit.entity.AnimalTamer- Specified by:
getUniqueIdin interfaceorg.bukkit.OfflinePlayer
-
isOp
public boolean isOp()- Specified by:
isOpin interfaceorg.bukkit.permissions.ServerOperator
-
setOp
public void setOp(boolean value) - Specified by:
setOpin interfaceorg.bukkit.permissions.ServerOperator
-
serialize
- Specified by:
serializein interfaceorg.bukkit.configuration.serialization.ConfigurationSerializable
-
isBanned
public boolean isBanned()- Specified by:
isBannedin interfaceorg.bukkit.OfflinePlayer
-
ban
@Nullable public @Nullable org.bukkit.BanEntry<com.destroystokyo.paper.profile.PlayerProfile> ban(@Nullable @Nullable String reason, @Nullable @Nullable Date expires, @Nullable @Nullable String source) - Specified by:
banin interfaceorg.bukkit.OfflinePlayer
-
ban
@Nullable public @Nullable org.bukkit.BanEntry<com.destroystokyo.paper.profile.PlayerProfile> ban(@Nullable @Nullable String reason, @Nullable @Nullable Instant expires, @Nullable @Nullable String source) - Specified by:
banin interfaceorg.bukkit.OfflinePlayer
-
ban
@Nullable public @Nullable org.bukkit.BanEntry<com.destroystokyo.paper.profile.PlayerProfile> ban(@Nullable @Nullable String reason, @Nullable @Nullable Duration duration, @Nullable @Nullable String source) - Specified by:
banin interfaceorg.bukkit.OfflinePlayer
-
isWhitelisted
public boolean isWhitelisted()- Specified by:
isWhitelistedin interfaceorg.bukkit.OfflinePlayer
-
setWhitelisted
public void setWhitelisted(boolean value) - Specified by:
setWhitelistedin interfaceorg.bukkit.OfflinePlayer
-
getPlayer
@Nullable public @Nullable org.bukkit.entity.Player getPlayer()- Specified by:
getPlayerin interfaceorg.bukkit.OfflinePlayer
-
getFirstPlayed
public long getFirstPlayed()- Specified by:
getFirstPlayedin interfaceorg.bukkit.OfflinePlayer
-
getLastPlayed
Deprecated.- Specified by:
getLastPlayedin interfaceorg.bukkit.OfflinePlayer
-
hasPlayedBefore
public boolean hasPlayedBefore()- Specified by:
hasPlayedBeforein interfaceorg.bukkit.OfflinePlayer
-
getRespawnLocation
@Nullable public @Nullable org.bukkit.Location getRespawnLocation()- Specified by:
getRespawnLocationin interfaceorg.bukkit.OfflinePlayer
-
getBedSpawnLocation
@Nullable public @Nullable org.bukkit.Location getBedSpawnLocation()- Specified by:
getBedSpawnLocationin interfaceorg.bukkit.OfflinePlayer
-
getLastLogin
public long getLastLogin()- Specified by:
getLastLoginin interfaceorg.bukkit.OfflinePlayer
-
getLastSeen
public long getLastSeen()- Specified by:
getLastSeenin interfaceorg.bukkit.OfflinePlayer
-
incrementStatistic
public void incrementStatistic(@NotNull @NotNull org.bukkit.Statistic statistic) - Specified by:
incrementStatisticin interfaceorg.bukkit.OfflinePlayer
-
decrementStatistic
public void decrementStatistic(@NotNull @NotNull org.bukkit.Statistic statistic) - Specified by:
decrementStatisticin interfaceorg.bukkit.OfflinePlayer
-
incrementStatistic
public void incrementStatistic(@NotNull @NotNull org.bukkit.Statistic statistic, int amount) - Specified by:
incrementStatisticin interfaceorg.bukkit.OfflinePlayer
-
decrementStatistic
public void decrementStatistic(@NotNull @NotNull org.bukkit.Statistic statistic, int amount) - Specified by:
decrementStatisticin interfaceorg.bukkit.OfflinePlayer
-
setStatistic
public void setStatistic(@NotNull @NotNull org.bukkit.Statistic statistic, int newValue) - Specified by:
setStatisticin interfaceorg.bukkit.OfflinePlayer
-
getStatistic
public int getStatistic(@NotNull @NotNull org.bukkit.Statistic statistic) - Specified by:
getStatisticin interfaceorg.bukkit.OfflinePlayer
-
incrementStatistic
public void incrementStatistic(@NotNull @NotNull org.bukkit.Statistic statistic, @NotNull @NotNull org.bukkit.Material material) - Specified by:
incrementStatisticin interfaceorg.bukkit.OfflinePlayer
-
decrementStatistic
public void decrementStatistic(@NotNull @NotNull org.bukkit.Statistic statistic, @NotNull @NotNull org.bukkit.Material material) - Specified by:
decrementStatisticin interfaceorg.bukkit.OfflinePlayer
-
getStatistic
public int getStatistic(@NotNull @NotNull org.bukkit.Statistic statistic, @NotNull @NotNull org.bukkit.Material material) - Specified by:
getStatisticin interfaceorg.bukkit.OfflinePlayer
-
incrementStatistic
public void incrementStatistic(@NotNull @NotNull org.bukkit.Statistic statistic, @NotNull @NotNull org.bukkit.Material material, int amount) - Specified by:
incrementStatisticin interfaceorg.bukkit.OfflinePlayer
-
decrementStatistic
public void decrementStatistic(@NotNull @NotNull org.bukkit.Statistic statistic, @NotNull @NotNull org.bukkit.Material material, int amount) - Specified by:
decrementStatisticin interfaceorg.bukkit.OfflinePlayer
-
setStatistic
public void setStatistic(@NotNull @NotNull org.bukkit.Statistic statistic, @NotNull @NotNull org.bukkit.Material material, int newValue) - Specified by:
setStatisticin interfaceorg.bukkit.OfflinePlayer
-
incrementStatistic
public void incrementStatistic(@NotNull @NotNull org.bukkit.Statistic statistic, @NotNull @NotNull org.bukkit.entity.EntityType entityType) - Specified by:
incrementStatisticin interfaceorg.bukkit.OfflinePlayer
-
decrementStatistic
public void decrementStatistic(@NotNull @NotNull org.bukkit.Statistic statistic, @NotNull @NotNull org.bukkit.entity.EntityType entityType) - Specified by:
decrementStatisticin interfaceorg.bukkit.OfflinePlayer
-
getStatistic
public int getStatistic(@NotNull @NotNull org.bukkit.Statistic statistic, @NotNull @NotNull org.bukkit.entity.EntityType entityType) - Specified by:
getStatisticin interfaceorg.bukkit.OfflinePlayer
-
incrementStatistic
public void incrementStatistic(@NotNull @NotNull org.bukkit.Statistic statistic, @NotNull @NotNull org.bukkit.entity.EntityType entityType, int amount) - Specified by:
incrementStatisticin interfaceorg.bukkit.OfflinePlayer
-
decrementStatistic
public void decrementStatistic(@NotNull @NotNull org.bukkit.Statistic statistic, @NotNull @NotNull org.bukkit.entity.EntityType entityType, int amount) - Specified by:
decrementStatisticin interfaceorg.bukkit.OfflinePlayer
-
setStatistic
public void setStatistic(@NotNull @NotNull org.bukkit.Statistic statistic, @NotNull @NotNull org.bukkit.entity.EntityType entityType, int newValue) - Specified by:
setStatisticin interfaceorg.bukkit.OfflinePlayer
-
getLastDeathLocation
@Nullable public @Nullable org.bukkit.Location getLastDeathLocation()- Specified by:
getLastDeathLocationin interfaceorg.bukkit.OfflinePlayer
-
getLocation
@Nullable public @Nullable org.bukkit.Location getLocation()- Specified by:
getLocationin interfaceorg.bukkit.OfflinePlayer
-
getPlayerProfile
@NotNull public @NotNull com.destroystokyo.paper.profile.PlayerProfile getPlayerProfile()- Specified by:
getPlayerProfilein interfaceorg.bukkit.OfflinePlayer
-