Class EssentialsHook

java.lang.Object
valorless.rarespawns.hooks.EssentialsHook

public class EssentialsHook extends Object
Integration hook for the EssentialsX plugin.

EssentialsX is a comprehensive server management plugin providing features like player homes, warps, kits, AFK status, vanish mode, and more. This hook enables Ravencrest to access player data, visibility status, and AFK information from EssentialsX when it is available on the server.

The hook is active only when EssentialsX is installed and enabled on the server.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.earth2me.essentials.Essentials
    Gets the EssentialsX plugin instance.
    static net.ess3.api.IUser
    getIUser(org.bukkit.entity.Player player)
    Gets the EssentialsX IUser instance for a player.
    static org.bukkit.plugin.java.JavaPlugin
     
    static com.earth2me.essentials.User
    getUser(org.bukkit.entity.Player player)
    Gets the EssentialsX User instance for a player.
    static void
    Attempts to hook into EssentialsX.
    static boolean
    isAfk(org.bukkit.entity.Player player)
    Checks if a player is currently AFK (Away From Keyboard).
    static boolean
    Checks if EssentialsX is currently hooked.
    static List<org.bukkit.entity.Player>
    Gets a list of all online players who are not vanished.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • EssentialsHook

      public EssentialsHook()
  • Method Details

    • Hook

      public static void Hook()
      Attempts to hook into EssentialsX.

      Checks if EssentialsX is installed, stores the plugin instance for later use, and logs the integration status. The hook is active only when the plugin is detected.

    • isHooked

      public static boolean isHooked()
      Checks if EssentialsX is currently hooked.

      This method verifies whether EssentialsX is present and available for integration.

      Returns:
      true if EssentialsX is installed and active, false otherwise
    • getInstance

      public static com.earth2me.essentials.Essentials getInstance()
      Gets the EssentialsX plugin instance.

      This instance can be used to access EssentialsX functionality directly.

      Returns:
      the EssentialsX plugin instance, or null if not hooked
    • visiblePlayers

      public static List<org.bukkit.entity.Player> visiblePlayers()
      Gets a list of all online players who are not vanished.

      This method filters out players who are in vanish mode through EssentialsX, providing only the list of visible players.

      Returns:
      a list of visible (non-vanished) online players
    • getIUser

      public static net.ess3.api.IUser getIUser(org.bukkit.entity.Player player)
      Gets the EssentialsX IUser instance for a player.

      The IUser interface provides access to EssentialsX player data and methods.

      Parameters:
      player - the player to get the IUser for
      Returns:
      the IUser instance for the specified player
    • getUser

      public static com.earth2me.essentials.User getUser(org.bukkit.entity.Player player)
      Gets the EssentialsX User instance for a player.

      The User class provides access to EssentialsX player data and methods.

      Parameters:
      player - the player to get the User for
      Returns:
      the User instance for the specified player
    • isAfk

      public static boolean isAfk(org.bukkit.entity.Player player)
      Checks if a player is currently AFK (Away From Keyboard).

      Uses EssentialsX's AFK detection to determine if the player is marked as away.

      Parameters:
      player - the player to check
      Returns:
      true if the player is AFK, false otherwise
    • getPlugin

      public static org.bukkit.plugin.java.JavaPlugin getPlugin()