Class EssentialsHook
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic com.earth2me.essentials.EssentialsGets the EssentialsX plugin instance.static net.ess3.api.IUsergetIUser(org.bukkit.entity.Player player) Gets the EssentialsX IUser instance for a player.static org.bukkit.plugin.java.JavaPluginstatic com.earth2me.essentials.UsergetUser(org.bukkit.entity.Player player) Gets the EssentialsX User instance for a player.static voidHook()Attempts to hook into EssentialsX.static booleanisAfk(org.bukkit.entity.Player player) Checks if a player is currently AFK (Away From Keyboard).static booleanisHooked()Checks if EssentialsX is currently hooked.static List<org.bukkit.entity.Player> Gets a list of all online players who are not vanished.
-
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:
trueif EssentialsX is installed and active,falseotherwise
-
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
nullif not hooked
-
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:
trueif the player is AFK,falseotherwise
-
getPlugin
public static org.bukkit.plugin.java.JavaPlugin getPlugin()
-