Class NexoHook

java.lang.Object
valorless.havenbags.hooks.NexoHook
All Implemented Interfaces:
org.bukkit.event.Listener

public class NexoHook extends Object implements org.bukkit.event.Listener
Integration hook for the Nexo plugin.

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

    Fields
    Modifier and Type
    Field
    Description
    static boolean
    Indicates whether Nexo items have been loaded and are ready for use.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Attempts to hook into Nexo.
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.bukkit.plugin.java.JavaPlugin
    Gets 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 boolean
    Checks if Nexo is currently hooked.
    void
    onItemsLoaded(com.nexomc.nexo.api.events.NexoItemsLoadedEvent event)
    Event handler for Nexo items loaded event.

    Methods inherited from class java.lang.Object

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

    • ready

      public static boolean ready
      Indicates whether Nexo items have been loaded and are ready for use.

      This flag is set to true when the NexoItemsLoadedEvent is 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 ready flag 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 ready flag 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:
      true if Nexo is installed and active, false otherwise
    • 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 null if 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