Skip to main content

API Overview

SigmaOrders exposes a public SigmaOrdersAPI for other plugins to create and manage orders, validate items, handle payments, send announcements, and read player statistics.

Getting the APIโ€‹

import com.sigma.orders.api.SigmaOrdersAPI;
import org.bukkit.Bukkit;
import org.bukkit.plugin.ServicesManager;

ServicesManager servicesManager = Bukkit.getServicesManager();
SigmaOrdersAPI ordersAPI = servicesManager.load(SigmaOrdersAPI.class);

if (ordersAPI == null) {
getLogger().warning("SigmaOrders not found! API not available.");
}

See Getting Started for full setup (dependency declaration, instantiation, async handling, and a direct-plugin-access alternative).

API Characteristicsโ€‹

  • Async: most methods return CompletableFuture and are safe to call from any thread; database operations never block.
  • Errors: methods return null/false on failure and log internally rather than throwing (except programming errors).
  • Versioning: API version matches plugin version; backward compatibility is maintained within major versions, and deprecated methods remain until the next major version.

Methods by Domainโ€‹

Plugin Infoโ€‹

MethodReturnsDescription
getVersion()StringCurrent plugin version
isEnabled()booleanWhether the plugin is enabled

Order Managementโ€‹

MethodDescription
createOrder(...)Create a new order
getOrder(orderId)Get an order by ID
getActiveOrders()Get all pending/in-progress orders
getOrdersByPlayer(playerUuid)Get a player's orders
getOrdersByStatus(status)Filter orders by status
cancelOrder(orderId, playerUuid)Cancel an owned order
deleteOrder(orderId)Admin: permanently delete an order
deliverItems(...)Deliver items toward an order
collectItems(...)Collect delivered/paid items

Item Managementโ€‹

MethodDescription
validateItem(item, orderItem)Check an item matches an order's requirements
hasNBTData(item)Check if an item carries NBT data
countItems(inventory, material)Count matching items in an inventory
removeItems(inventory, material, amount)Remove items from an inventory

Economy Operationsโ€‹

MethodDescription
isEconomyEnabled()Check whether economy is active
getBalance(playerUuid)Get a player's balance
hasBalance(playerUuid, amount)Check sufficient funds
withdrawPlayer(playerUuid, amount)Withdraw from a player
depositPlayer(playerUuid, amount)Deposit to a player
formatCurrency(amount)Format an amount as currency
getCurrencyName() / getCurrencyNameSingular()Currency display names

Announcementsโ€‹

MethodDescription
areAnnouncementsEnabled()Check whether announcements are enabled
createOrderAnnouncement(...)Build a clickable announcement component
broadcastOrderAnnouncement(...)Broadcast an order to the server (config-aware)
sendOrderAnnouncement(...)Send an announcement to one player

Statisticsโ€‹

MethodDescription
getPlayerStatistics(playerUuid)Get a player's PlayerStats

Dependencyโ€‹

Maven:

<dependency>
<groupId>com.sigma</groupId>
<artifactId>sigma-orders</artifactId>
<version>1.0.2</version>
<scope>provided</scope>
</dependency>

Gradle:

dependencies {
compileOnly 'com.sigma:sigma-orders:1.0.2'
}

See Alsoโ€‹