Class NexoHook
- All Implemented Interfaces:
org.bukkit.event.Listener
Nexo is a custom items and blocks plugin that allows server owners to create unique items with custom textures, properties, and behaviors. This hook enables Ravencrest to integrate with Nexo's custom items and access its recipe system.
The hook is active only when Nexo is installed and enabled on the server.
Additionally, this hook implements Listener to track when Nexo items
are fully loaded and ready for use.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic booleanIndicates whether Nexo items have been loaded and are ready for use. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.plugin.java.JavaPluginGets the Nexo plugin instance.static List<org.bukkit.configuration.ConfigurationSection> GetRecipes(valorless.valorlessutils.config.Config config) Retrieves all recipe configuration sections from a Nexo config file.static booleanisHooked()Checks if Nexo is currently hooked.voidonItemsLoaded(com.nexomc.nexo.api.events.NexoItemsLoadedEvent event) Event handler for Nexo items loaded event.
-
Field Details
-
ready
public static boolean readyIndicates whether Nexo items have been loaded and are ready for use.This flag is set to
truewhen theNexoItemsLoadedEventis fired, signaling that all Nexo custom items are available.
-
-
Constructor Details
-
NexoHook
public NexoHook()Attempts to hook into Nexo.Checks if Nexo is installed and logs the integration status. The hook is active only when the plugin is detected.
Note: Even after hooking, items may not be immediately available. Check the
readyflag to ensure items are loaded.
-
-
Method Details
-
onItemsLoaded
public void onItemsLoaded(com.nexomc.nexo.api.events.NexoItemsLoadedEvent event) Event handler for Nexo items loaded event.This method is called when Nexo finishes loading all custom items. It sets the
readyflag to indicate that Nexo is fully initialized.- Parameters:
event- the NexoItemsLoadedEvent triggered when items are loaded
-
isHooked
public static boolean isHooked()Checks if Nexo is currently hooked.This method verifies whether Nexo is present and available for integration.
- Returns:
trueif Nexo is installed and active,falseotherwise
-
getPlugin
public static org.bukkit.plugin.java.JavaPlugin getPlugin()Gets the Nexo plugin instance.This instance can be used to access Nexo functionality directly.
- Returns:
- the Nexo plugin instance as a JavaPlugin, or
nullif not hooked
-
GetRecipes
public static List<org.bukkit.configuration.ConfigurationSection> GetRecipes(valorless.valorlessutils.config.Config config) Retrieves all recipe configuration sections from a Nexo config file.This method extracts all top-level configuration sections from the provided config, which typically represent individual recipes in Nexo's format.
- Parameters:
config- the configuration file to extract recipes from- Returns:
- a list of ConfigurationSection objects representing individual recipes
-