Welcome to the VortexGens API. This API allows developers to hook into the generator system, listen for production events, and programmatically manage generator levels, owners, and custom economy providers.
You can browse our available API versions and artifacts directly in your browser at our repositiory.
π¦ Dependency Management
To use the API, you need to add our Maven repository and the API dependency to your project.
Maven
Add the following to your pom.xml:
<repositories><repository><id>vortex-repo</id><url>https://repo.vortexdevelopment.net/repository</url></repository></repositories><dependencies><dependency><groupId>net.vortexdevelopment</groupId><artifactId>VortexGens-API</artifactId><version>1.0.1</version><!-- Or use 'latest' --><scope>provided</scope></dependency></dependencies>
Gradle (Groovy)
Add the following to your build.gradle:
π Getting Started
Accessing the API
The main entry point for the API is the VortexGensAPI class. Note that you should always check if the plugin is enabled before accessing managers, as they are initialized during the plugin load phase. All managers are statically accessible:
π API Modules
The API is split into several modules to keep things organized:
EconomyManager: Register or retrieve economy providers used for generator upgrades.
π Events
VortexGens fires custom events that you can listen to in your own plugins:
GeneratorGenerateEvent: Fired whenever a generator successfully produces an item or reward. Useful for modifying loot on the fly or tracking production stats.
GeneratorAccessEvent: Fired when a player tries to interact with or open the GUI of a generator.
GeneratorEvent: The base event for all generator-related actions.
π Plugin.yml
If you are depending on VortexGens, don't forget to add it to your plugin.yml to ensure proper load order: