Class CustomStructureAddon

java.lang.Object
com.ryandw11.structure.api.structaddon.CustomStructureAddon

public final class CustomStructureAddon extends Object
This class is responsible for extending CustomStructure functionality.

Note: This class is not required to use events, but may be useful for your users to know that your plugin interfaces with CustomStructures.

Register this addon with the plugin by using CustomStructuresAPI.registerCustomAddon(CustomStructureAddon).

Since:
1.5.8
  • Constructor Details

    • CustomStructureAddon

      public CustomStructureAddon(org.bukkit.plugin.Plugin plugin)
      Create an addon for custom structures.

      Note: This is not required to use events, but may be useful for your users to know that your plugin interfaces with CustomStructures.

      Parameters:
      plugin - Your plugin.
  • Method Details

    • getName

      public String getName()
      Get the name of the addon.

      This is automatically taken from the plugin's name.

      Returns:
      The name of the addon.
    • getAuthors

      public List<String> getAuthors()
      Get the authors of the addon.
      Returns:
      The authors of the addon.
    • addStructureSection

      public void addStructureSection(Class<? extends StructureSection> structureSection)
      Add structure sections to the addon.
      Parameters:
      structureSection - The structure section to add.
    • registerStructureSectionProvider

      public void registerStructureSectionProvider(StructureSectionProvider provider)
      Register StructureSectionProvider to the addon.
      Parameters:
      provider - The provider to register.
    • unregisterStructureSectionProvider

      public void unregisterStructureSectionProvider(StructureSectionProvider provider)
      Unregister StructureSectionProvider from the addon.
      Parameters:
      provider - The provider to remove.
    • getStructureSections

      public List<Class<? extends StructureSection>> getStructureSections()
      Get the list of structure sections.
      Returns:
      The list of structure sections.
    • getProviderSet

      public Set<StructureSectionProvider> getProviderSet()
      Get all provider registered on this addon
      Returns:
      a set of providers.
    • registerStructureSign

      public boolean registerStructureSign(String name, Class<? extends StructureSign> structureSign)
      Register a structure sign to be used.

      This provides the same functionality as StructureSignHandler.registerStructureSign(String, Class).

      Parameters:
      name - The name of the structure sign.
      structureSign - The class of the structure sign.
      Returns:
      If the registration was successful. (False if a sign with that name already exists).
    • registerLootTable

      public void registerLootTable(LootTable lootTable)
      Register a custom LootTable for use.
      Parameters:
      lootTable - The LootTable to be registered.
    • registerLootItem

      public void registerLootItem(String typeName, Class<? extends ConfigLootItem> lootItemClass)
      Register a custom LootItem for use.
      Parameters:
      typeName - The type name for the custom LootItem.
      lootItemClass - The class for the custom LootItem.
    • handlePluginReload

      public void handlePluginReload()
      Handles Re-registering items from the addon when the plugin is reloaded.

      Internal Use Only.