Skip to main content

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​

MethodReturnsChangeRefused
getVersion()String plugin version
isEnabled()boolean
createOrder(UUID player, String name, List<OrderItem> items)CompletableFuture<Order>ChangeFails 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 ordersChangefalse
deleteOrder(int orderId)CompletableFuture<Boolean> (admin delete)Changefalse
deliverItems(int orderId, int itemId, int amount, UUID deliverer, String name)CompletableFuture<Integer>: delivered amount, 0 if full, -1 on errorChange-1
collectItems(int orderId, int itemId, int amount, UUID collector)CompletableFuture<Boolean>Changefalse
processRefund(int orderId, UUID player, String name, double amount)CompletableFuture<Boolean>Changefalse
processAdminRefund(int orderId, UUID player, String name, double amount)CompletableFuture<Boolean>Changefalse
processExpiredOrders()CompletableFuture<Integer> orders processedChange0
getPlayerStatistics(UUID player)CompletableFuture<PlayerStats>

OrderStatus: PENDING, IN_PROGRESS, DELIVERED, COMPLETED, CANCELLED, EXPIRED. PlayerStats getters: getOrdersCreated(), getOrdersFulfilled(), getItemsDelivered(), getTotalSpent(), getTotalEarned(), hasActivity().

Items​

MethodReturns
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​

MethodReturnsChangeRefused
isEconomyEnabled()boolean
getBalance(UUID player)double (0 without economy)
hasBalance(UUID player, double amount)boolean
withdrawPlayer(UUID player, double amount)booleanChangefalse
depositPlayer(UUID player, double amount)booleanChangefalse
formatCurrency(double amount)String
getCurrencyName() / getCurrencyNameSingular()String (empty without economy)

Announcements​

MethodDescription
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).

InterfaceMethodsPurpose
ServerPriceProviderdouble 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
CosmeticLoreFilterboolean isCosmeticLoreLine(String line)Mark lore lines your plugin adds as cosmetic, so they are ignored when matching delivered items to orders