Class CustomStructureAddon
java.lang.Object
com.ryandw11.structure.api.structaddon.CustomStructureAddon
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 Summary
ConstructorDescriptionCustomStructureAddon(org.bukkit.plugin.Plugin plugin)
Create an addon for custom structures. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addStructureSection(Class<? extends StructureSection> structureSection)
Add structure sections to the addon.Get the authors of the addon.getName()
Get the name of the addon.Get all provider registered on this addonList<Class<? extends StructureSection>>
Get the list of structure sections.void
Handles Re-registering items from the addon when the plugin is reloaded.void
registerLootItem(String typeName, Class<? extends ConfigLootItem> lootItemClass)
Register a custom LootItem for use.void
registerLootTable(LootTable lootTable)
Register a custom LootTable for use.void
Register StructureSectionProvider to the addon.boolean
registerStructureSign(String name, Class<? extends StructureSign> structureSign)
Register a structure sign to be used.void
Unregister StructureSectionProvider from the addon.
-
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
Get the name of the addon.This is automatically taken from the plugin's name.
- Returns:
- The name of the addon.
-
getAuthors
Get the authors of the addon.- Returns:
- The authors of the addon.
-
addStructureSection
Add structure sections to the addon.- Parameters:
structureSection
- The structure section to add.
-
registerStructureSectionProvider
Register StructureSectionProvider to the addon.- Parameters:
provider
- The provider to register.
-
unregisterStructureSectionProvider
Unregister StructureSectionProvider from the addon.- Parameters:
provider
- The provider to remove.
-
getStructureSections
Get the list of structure sections.- Returns:
- The list of structure sections.
-
getProviderSet
Get all provider registered on this addon- Returns:
- a set of providers.
-
registerStructureSign
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
Register a custom LootTable for use.- Parameters:
lootTable
- The LootTable to be registered.
-
registerLootItem
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.
-