Class CustomStructuresAPI
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the custom item manager.Get the loot table handler.int
Get the number of structures.Get the schematics folder.Get the structure handler.boolean
Deprecated.Void spawning is now always enabled.void
registerCustomAddon(CustomStructureAddon customStructureAddon)
Register an addon to the Custom Structure plugin.
-
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
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
Get the structure handler.This is not initialized until after all plugins are loaded.
- Returns:
- The structure handler.
-
getLootTableHandler
Get the loot table handler.- Returns:
- The loot table handler.
-
getCustomItemManager
Get the custom item manager.- Returns:
- The custom item manager.
-
getSchematicsFolder
Get the schematics folder.- Returns:
- The schematics folder.
-
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.
-