Class OnyxNamespaceImpl

java.lang.Object
com.zombienw.onyxlib.impl.registry.OnyxNamespaceImpl
All Implemented Interfaces:
OnyxNamespace

public class OnyxNamespaceImpl extends Object implements OnyxNamespace
Implements OnyxNamespaces
  • Constructor Details

    • OnyxNamespaceImpl

      public OnyxNamespaceImpl(Plugin plugin, String namespaceId)
  • Method Details

    • getPlugin

      public Plugin getPlugin()
    • getKey

      public NamespacedKey getKey()
      Description copied from interface: OnyxNamespace
      Gets the key associated with this namespace.
      Specified by:
      getKey in interface OnyxNamespace
      Returns:
      The underlying Bukkit NamespacedKey.
    • item

      public OnyxItem item(String id)
      Description copied from interface: OnyxNamespace
      Creates or looks up an OnyxItem.
      Specified by:
      item in interface OnyxNamespace
      Parameters:
      id - The unique identifier for the item (e.g., "strawberry").
      Returns:
      The OnyxItem configuration and creation wrapper.
    • block

      public OnyxBlock block(String id)
      Description copied from interface: OnyxNamespace
      Creates or looks up an OnyxBlock.
      Specified by:
      block in interface OnyxNamespace
      Parameters:
      id - The unique identifier for the item (e.g., "marble").
      Returns:
      The OnyxBlock configuration and creation wrapper.
    • matchItem

      public OnyxItem matchItem(ItemStack stack)
      Description copied from interface: OnyxNamespace
      Checks the given ItemStack and matches it to a registered OnyxItem if it exists.
      Specified by:
      matchItem in interface OnyxNamespace
      Parameters:
      stack - The ItemStack to check.
      Returns:
      The matching OnyxItem or null if not found.
    • matchBlock

      public OnyxBlock matchBlock(Block block)
      Description copied from interface: OnyxNamespace
      Checks the given block to determine if it is tracking an OnyxBlock.
      Specified by:
      matchBlock in interface OnyxNamespace
      Parameters:
      block - The physical Block to check.
      Returns:
      The matching OnyxBlock or null if not found.
    • lock

      public void lock()
      Locks the namespace to prevent further items from being registered
    • getItems

      public Collection<OnyxItemImpl> getItems()
    • getItem

      public OnyxItemImpl getItem(String id)
    • getBlocks

      public Collection<OnyxBlockImpl> getBlocks()
    • getBlock

      public OnyxBlockImpl getBlock(String id)
    • getElement

      public OnyxElement getElement(String id)
    • getElements

      public Collection<OnyxElement> getElements()