API Service
SigmaOrdersAPI (com.sigma.orders.api) reads and changes orders, items and money. Get it with Bukkit.getServicesManager().load(SigmaOrdersAPI.class). CompletableFuture results may complete on a database thread; schedule world or inventory work yourself.
Methods marked Change are refused when the server sets orders.allow-changes: false and your plugin is not in orders.trusted-plugins (api.yml). The "Refused" column shows what you get back then.
Orders
| Method | Returns | Change | Refused |
|---|---|---|---|
getVersion() | String plugin version | ||
isEnabled() | boolean | ||
createOrder(UUID player, String name, List<OrderItem> items) | CompletableFuture<Order> | Change | Fails with IllegalStateException |
getOrder(int orderId) | CompletableFuture<Order> (null if not found) | ||
getActiveOrders() | CompletableFuture<List<Order>> (PENDING / IN_PROGRESS) | ||
getOrdersByPlayer(UUID player) | CompletableFuture<List<Order>> | ||
getOrdersByStatus(OrderStatus status) | CompletableFuture<List<Order>> | ||
cancelOrder(int orderId, UUID player) | CompletableFuture<Boolean>; only the owner's orders | Change | false |
deleteOrder(int orderId) | CompletableFuture<Boolean> (admin delete) | Change | false |
deliverItems(int orderId, int itemId, int amount, UUID deliverer, String name) | CompletableFuture<Integer>: delivered amount, 0 if full, -1 on error | Change | -1 |
collectItems(int orderId, int itemId, int amount, UUID collector) | CompletableFuture<Boolean> | Change | false |
processRefund(int orderId, UUID player, String name, double amount) | CompletableFuture<Boolean> | Change | false |
processAdminRefund(int orderId, UUID player, String name, double amount) | CompletableFuture<Boolean> | Change | false |
processExpiredOrders() | CompletableFuture<Integer> orders processed | Change | 0 |
getPlayerStatistics(UUID player) | CompletableFuture<PlayerStats> |
OrderStatus: PENDING, IN_PROGRESS, DELIVERED, COMPLETED, CANCELLED, EXPIRED. PlayerStats getters: getOrdersCreated(), getOrdersFulfilled(), getItemsDelivered(), getTotalSpent(), getTotalEarned(), hasActivity().
Items
| Method | Returns |
|---|---|
validateItem(ItemStack item, OrderItem orderItem) | boolean item matches the order item |
hasNBTData(ItemStack item) | boolean has custom name, lore, enchantments, etc. |
countItems(Inventory inv, Material material) | int |
removeItems(Inventory inv, Material material, int amount) | int amount removed |
createCustomItem(String storedId, int amount) | ItemStack from an id like itemsadder:pack:item, or null |
isCustomItem(String storedId) | boolean |
getCustomItemId(ItemStack item) | String stored id (<hook>:<id>), or null |
getCustomItemMaterial(String storedId) | Material, or null |
Economy
| Method | Returns | Change | Refused |
|---|---|---|---|
isEconomyEnabled() | boolean | ||
getBalance(UUID player) | double (0 without economy) | ||
hasBalance(UUID player, double amount) | boolean | ||
withdrawPlayer(UUID player, double amount) | boolean | Change | false |
depositPlayer(UUID player, double amount) | boolean | Change | false |
formatCurrency(double amount) | String | ||
getCurrencyName() / getCurrencyNameSingular() | String (empty without economy) |
Announcements
| Method | Description |
|---|---|
areAnnouncementsEnabled() | Whether order announcements are on |
createOrderAnnouncement(String player, int orderId, Material material, int qty, double pricePerItem) | Clickable Component that opens /orders |
broadcastOrderAnnouncement(String player, int orderId, Material material, int qty, double pricePerItem) | Broadcast using the server's announcement settings |
broadcastOrderAnnouncement(String player, int orderId, OrderItem item) | Same, keeps custom item ids |
sendOrderAnnouncement(Player target, String player, int orderId, Material material, int qty, double pricePerItem) | Send to one player |
Services you can register
Register these with Bukkit.getServicesManager().register(Type.class, impl, plugin, ServicePriority.Normal).
| Interface | Methods | Purpose |
|---|---|---|
ServerPriceProvider | double getServerPrice(ItemStack item), String formatPrice(double amount) | Publish a flat server price per item (used by the Worth add-on). Called from packet threads: must be thread-safe and cheap |
CosmeticLoreFilter | boolean isCosmeticLoreLine(String line) | Mark lore lines your plugin adds as cosmetic, so they are ignored when matching delivered items to orders |