Skip to main content

Vexor Core API Overview

Developer documentation for integrating with Vexor Core plugins.

Introduction

The Vexor Core plugin ecosystem provides comprehensive APIs for developers to integrate and extend functionality. Each plugin offers its own API while following common design patterns.

Common Patterns

All Vexor Core plugins share similar architectural patterns:

Plugin Instance Access

// Standard pattern for accessing plugin instances
PluginName plugin = (PluginName) Bukkit.getPluginManager().getPlugin("PluginName");

if (plugin != null) {
// Plugin is loaded and available
String version = plugin.getDescription().getVersion();
}

Manager Classes

Most plugins use Manager classes to handle core functionality:

// Example: DoorManager, TeamManager, CrateManager, etc.
Manager manager = plugin.getManager();
manager.performOperation();

Event-Driven Architecture

Plugins use Bukkit's event system:

@EventHandler
public void onCustomEvent(CustomEvent event) {
if (event.isCancelled()) return;
// Handle event
}

Plugin APIs

Core Plugins

  • PivotPoly API - Animated door system integration
  • ItemLimiter API - Item limitation and restriction system
  • EnchantLimits API - Enchantment control system
  • Cornicopia Core API - Core functionality and utilities
  • CoreTeams API - Team management system

Gameplay Plugins

  • SupplyCrates API - Supply crate and loot system
  • PvPManager API - PvP configuration and management
  • Recipe Crafter API - Custom recipe system
  • fillloot API - Advanced loot table management

Management Plugins

  • Spectre API - Punishment management system
  • Resolve API - Ticket management system

Integration Best Practices

1. Soft Dependencies

Always use soft dependencies for optional integrations:

# plugin.yml
softdepend: [PivotPoly, CoreTeams, SupplyCrates]

2. Null Safety

Always check if plugins are loaded:

public class MyPlugin extends JavaPlugin {
private PivotPoly pivotPoly = null;

@Override
public void onEnable() {
if (Bukkit.getPluginManager().isPluginEnabled("PivotPoly")) {
pivotPoly = (PivotPoly) Bukkit.getPluginManager().getPlugin("PivotPoly");
if (pivotPoly != null) {
getLogger().info("Hooked into PivotPoly!");
}
}
}

public void usePivotPolyFeature() {
if (pivotPoly == null) {
getLogger().warning("PivotPoly not available");
return;
}
// Safe to use
}
}

3. Version Compatibility

Check API versions for compatibility:

String apiVersion = plugin.getDescription().getAPIVersion();
if (apiVersion != null && apiVersion.startsWith("1.21")) {
// Compatible with 1.21 API
}

Maven/Gradle Dependencies

Maven Repository Setup

<repositories>
<repository>
<id>vexorcore-repo</id>
<url>https://repo.vexorcore.com/releases</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>VexorCore.Logix</groupId>
<artifactId>pluginname</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
</dependencies>

Gradle Setup

repositories {
maven {
url 'https://repo.vexorcore.com/releases'
}
}

dependencies {
compileOnly 'VexorCore.Logix:pluginname:1.0'
}

Common Integration Examples

Example 1: Multi-Plugin Integration

public class IntegrationPlugin extends JavaPlugin {
private PivotPoly pivotPoly;
private CoreTeams coreTeams;
private SupplyCrates supplyCrates;

@Override
public void onEnable() {
// Hook into available plugins
hookPivotPoly();
hookCoreTeams();
hookSupplyCrates();
}

private void hookPivotPoly() {
if (Bukkit.getPluginManager().isPluginEnabled("PivotPoly")) {
pivotPoly = (PivotPoly) Bukkit.getPluginManager().getPlugin("PivotPoly");
getLogger().info("Hooked into PivotPoly");
}
}

// Similar for other plugins...
}

Example 2: Event Bridge

// Bridge events between plugins
@EventHandler
public void onTeamCreate(TeamCreateEvent event) {
Team team = event.getTeam();

// Grant team access to supply crates
if (supplyCrates != null) {
supplyCrates.grantTeamAccess(team.getId());
}

// Create team door
if (pivotPoly != null) {
String doorName = "Team_" + team.getId() + "_Door";
// Create door for team...
}
}

Support & Resources

  • Documentation: Detailed API docs for each plugin
  • Examples: Check individual plugin API pages for specific examples
  • Discord: Developer Channel for integration help
  • GitHub: Example integration projects

Next: Explore specific plugin APIs for detailed integration guides