Package dev.majek.hexnicks.api
Class HexNicksApi
java.lang.Object
dev.majek.hexnicks.api.HexNicksApi
Handles the Nicks API. Contains some useful utility methods.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
callEvent
(@NotNull org.bukkit.event.Event event) Shortcut for calling a Bukkit event.@Nullable CompletableFuture<net.kyori.adventure.text.Component>
getStoredNick
(@NotNull UUID uuid) Get a nickname from a player's unique id.@Nullable CompletableFuture<net.kyori.adventure.text.Component>
getStoredNick
(@NotNull org.bukkit.entity.Player player) Get a nickname from an onlinePlayer
.@Nullable CompletableFuture<net.kyori.adventure.text.Component>
getStoredNick
(@NotNull org.bukkit.OfflinePlayer player) Get a nickname from anOfflinePlayer
.@Nullable org.bukkit.OfflinePlayer
playerFromNick
(@NotNull String nickname) Get theOfflinePlayer
a nickname belongs to from the nickname string.
-
Constructor Details
-
HexNicksApi
public HexNicksApi()
-
-
Method Details
-
callEvent
public void callEvent(@NotNull @NotNull org.bukkit.event.Event event) Shortcut for calling a Bukkit event.- Parameters:
event
- The event to call.- Since:
- 1.0.0
-
playerFromNick
@Nullable public @Nullable org.bukkit.OfflinePlayer playerFromNick(@NotNull @NotNull String nickname) Get theOfflinePlayer
a nickname belongs to from the nickname string.- Parameters:
nickname
- The nickname. If you want to call this with aComponent
as the param, usePlainTextComponentSerializer
to get a string.- Returns:
- The
OfflinePlayer
if found. - Since:
- 1.0.0
-
getStoredNick
@Nullable public @Nullable CompletableFuture<net.kyori.adventure.text.Component> getStoredNick(@NotNull @NotNull UUID uuid) Get a nickname from a player's unique id.- Parameters:
uuid
- The unique id.- Returns:
- Nickname if it exists.
-
getStoredNick
@Nullable public @Nullable CompletableFuture<net.kyori.adventure.text.Component> getStoredNick(@NotNull @NotNull org.bukkit.entity.Player player) Get a nickname from an onlinePlayer
.- Parameters:
player
- Player.- Returns:
- Nickname if it exists.
-
getStoredNick
@Nullable public @Nullable CompletableFuture<net.kyori.adventure.text.Component> getStoredNick(@NotNull @NotNull org.bukkit.OfflinePlayer player) Get a nickname from anOfflinePlayer
.- Parameters:
player
- OfflinePlayer.- Returns:
- Nickname if it exists.
-