Class Wander
java.lang.Object
ua.mcchickenstudio.opencreative.wanders.OfflineWander
ua.mcchickenstudio.opencreative.wanders.Wander
- All Implemented Interfaces:
net.kyori.adventure.audience.Audience, net.kyori.adventure.pointer.Pointered
Wander
This class represents wander, that could be online. Wander is a player, who plays on planets. He has nickname, description, gender, favorite worlds and last played world.-
Nested Class Summary
Nested classes/interfaces inherited from class OfflineWander
OfflineWander.Gender -
Field Summary
Fields inherited from class OfflineWander
description, favoriteWorlds, friends, gender, hideHints, lastLocation, lastPlayedWorldId, links, name, uuid, visitsModifier and TypeFieldDescriptionprotected @Nullable Stringprotected @Nullable OfflineWander.Genderprotected booleanprotected org.bukkit.Locationprotected intprotected Linksprotected @Nullable Stringprotected final @NotNull UUIDprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable PlanetReturns current planet, where wander is currently in.@NotNull GriefStatsReturns statistics of destructive changes to world.@NotNull org.bukkit.entity.PlayerbooleanChecks whether wander is trying to connect to some planet.voidsendActionBar(@NotNull net.kyori.adventure.text.Component message) voidsendMessage(@NotNull net.kyori.adventure.text.Component message) voidsetConnectingToPlanet(boolean connectingToPlanet) Sets whether wander is currently connecting to planet.voidshowTitle(@NotNull net.kyori.adventure.title.Title title) Methods inherited from class OfflineWander
addFavoriteWorld, addFriend, clearData, equals, getDescription, getFavoriteWorlds, getFriends, getGender, getLastLocation, getLastPlayedWorldId, getLink, getName, getOfflinePlayer, getUniqueId, getVisits, hashCode, isOnline, loadInfo, removeFavoriteWorld, removeFriend, removeLink, saveData, setDescription, setGender, setLastPlayedWorldId, setLink, setName, setVisits, shouldHideHints, toStringModifier and TypeMethodDescriptionbooleanaddFavoriteWorld(int worldId) Adds specified planet's ID to favorite worlds.booleanAdds specified UUID to friends list.booleanClears all data and removes json file.boolean@Nullable StringReturns profile's description, or null - if not set.Returns set of favorite worlds IDs, marked by player.Returns set of friends UUIDs, picked by player.@Nullable OfflineWander.GenderReturns profile's gender, or null - if not set.@Nullable org.bukkit.LocationReturns last location of wander (where player was playing before leaving the server), or null - if not saved.intReturns ID of last visited planet by player, or -1 - if not saved.@Nullable StringReturns link of social media by ID, or null - if not set.@Nullable StringgetName()Returns custom name of wander, or null - if not set.@NotNull org.bukkit.OfflinePlayerReturns offline player associated with wander.@NotNull UUIDReturns unique ID of wander.intReturns amount of all visited worlds by player.inthashCode()booleanisOnline()Checks whether wander is playing on server.voidloadInfo()Loads information about wander from disk.booleanremoveFavoriteWorld(int worldId) Removes specified planet's ID from favorite worlds.booleanremoveFriend(@NotNull UUID friendUUID) Removes specified UUID from friends list.voidremoveLink(@NotNull String id) Removes social media link by ID.voidsaveData()Saves wander's information to disk.voidsetDescription(@NotNull String description) Sets profile's description.booleansetGender(@NotNull OfflineWander.Gender gender) Sets profile's gender.voidsetLastPlayedWorldId(int lastPlayedWorldId) Sets last visited world ID.voidSets link of social media by ID.voidSets profile's custom name.voidsetVisits(int visits) Sets amount of visits.booleanChecks whether hints should be hidden from player.toString()Methods inherited from interface net.kyori.adventure.audience.Audience
clearResourcePacks, clearTitle, deleteMessage, deleteMessage, filterAudience, forEachAudience, hideBossBar, openBook, openBook, playSound, playSound, playSound, removeResourcePacks, removeResourcePacks, removeResourcePacks, removeResourcePacks, removeResourcePacks, resetTitle, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendPlayerListHeaderAndFooter, sendResourcePacks, sendResourcePacks, sendResourcePacks, sendTitlePart, showBossBar, stopSound, stopSoundMethods inherited from interface net.kyori.adventure.pointer.Pointered
get, getOrDefault, getOrDefaultFrom, pointers
-
Constructor Details
-
Wander
public Wander(@NotNull @NotNull org.bukkit.entity.Player player)
-
-
Method Details
-
getGriefStats
Returns statistics of destructive changes to world.It will be cleared, when player leaves the world.
- Returns:
- grief statistics.
-
getPlayer
@NotNull public @NotNull org.bukkit.entity.Player getPlayer() -
getCurrentPlanet
Returns current planet, where wander is currently in.- Returns:
- current planet, or null.
-
sendMessage
public void sendMessage(@NotNull @NotNull net.kyori.adventure.text.Component message) - Specified by:
sendMessagein interfacenet.kyori.adventure.audience.Audience
-
sendActionBar
public void sendActionBar(@NotNull @NotNull net.kyori.adventure.text.Component message) - Specified by:
sendActionBarin interfacenet.kyori.adventure.audience.Audience
-
showTitle
public void showTitle(@NotNull @NotNull net.kyori.adventure.title.Title title) - Specified by:
showTitlein interfacenet.kyori.adventure.audience.Audience
-
setConnectingToPlanet
public void setConnectingToPlanet(boolean connectingToPlanet) Sets whether wander is currently connecting to planet.- Parameters:
connectingToPlanet- whether wander is connecting to planet or not.
-
isConnectingToPlanet
public boolean isConnectingToPlanet()Checks whether wander is trying to connect to some planet.- Returns:
- true - is connecting, false - not connecting.
-