Class HexNicksApi

java.lang.Object
dev.majek.hexnicks.api.HexNicksApi

public class HexNicksApi extends Object
Handles the Nicks API. Contains some useful utility methods.
  • 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 the OfflinePlayer a nickname belongs to from the nickname string.
      Parameters:
      nickname - The nickname. If you want to call this with a Component as the param, use PlainTextComponentSerializer 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 online Player.
      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 an OfflinePlayer.
      Parameters:
      player - OfflinePlayer.
      Returns:
      Nickname if it exists.