Class CustomStructuresAPI

java.lang.Object
com.ryandw11.structure.api.CustomStructuresAPI

public class CustomStructuresAPI extends Object
The class for the general API of CustomStructures.

This class is used to access the entire API of the plugin. From here you can access the various handlers that the plugin uses.

  • Constructor Details

    • CustomStructuresAPI

      public CustomStructuresAPI()
      Construct the CustomStructuresAPI class.

      This is how you obtain the CustomStructureAPI class. Nothing special needs to be done other than use this constructor.

      Throws:
      IllegalStateException - If CustomStructures has yet to be initialized.
  • Method Details

    • registerCustomAddon

      public void registerCustomAddon(CustomStructureAddon customStructureAddon)
      Register an addon to the Custom Structure plugin.

      This is used to add custom configuration sections and inform the plugin that your plugin interfaces with it. This is not required to use any of the events.

      This should be called in the plugin's onEnable method. Ensure that you add CustomStructures as a dependency in your plugin.yml file so that way the plugin loads first and the addon system can be initialized. An error may occur if your plugin loads first.

      Parameters:
      customStructureAddon - The addon to register.
    • getNumberOfStructures

      public int getNumberOfStructures()
      Get the number of structures.
      Returns:
      The number of structures.
    • getStructureHandler

      public StructureHandler getStructureHandler()
      Get the structure handler.

      This is not initialized until after all plugins are loaded.

      Returns:
      The structure handler.
    • getLootTableHandler

      public LootTableHandler getLootTableHandler()
      Get the loot table handler.
      Returns:
      The loot table handler.
    • getCustomItemManager

      public CustomItemManager getCustomItemManager()
      Get the custom item manager.
      Returns:
      The custom item manager.
    • getSchematicsFolder

      public String getSchematicsFolder()
      Get the schematics folder.
      Returns:
      The schematics folder.
    • isVoidSpawningEnabled

      @Deprecated public boolean isVoidSpawningEnabled()
      Deprecated.
      Void spawning is now always enabled.
      Get if structures can spawn in the void.

      This setting is set by the user in the config file.

      Returns:
      Get if structures can spawn in the void.