SigmaSellAxe Wiki

Complete documentation for SigmaSellAxe

API Documentation

Complete developer documentation for integrating with SigmaSellAxe. This API allows other plugins to interact with SigmaSellAxe programmatically.

Getting the Plugin Instance

All API interactions start by obtaining the plugin instance:

SigmaSellAxe plugin = (SigmaSellAxe) Bukkit.getPluginManager().getPlugin("SigmaSellAxe");
if (plugin == null || !plugin.isEnabled()) {
    // Plugin not loaded
    return;
}

Core API Classes

SigmaSellAxe

Main plugin class providing access to all managers and hooks.

Method Return Type Description
getInstance() SigmaSellAxe Get the plugin instance (static method)
getConfigManager() ConfigManager Get configuration manager for accessing configs
getEconomyHook() EconomyHook Get economy hook for price operations
getShopDetector() ShopDetector Get shop detector for shop management
getLandsHook() LandsHook Get Lands integration hook
getGriefPreventionHook() GriefPreventionHook Get GriefPrevention integration hook
getWorldGuardHook() WorldGuardHook Get WorldGuard integration hook

ConfigManager

Manages all plugin configuration files and settings.

Method Return Type Description
getMainConfig() FileConfiguration Get main configuration file
getShopConfig(String shopId) FileConfiguration Get shop-specific configuration
getAllShopConfigs() Map<String, FileConfiguration> Get all shop configurations
getItemBoost(String shopId, String material) double Get item boost multiplier for a material in a shop
getShopGlobalBoost(String shopId) double Get global boost multiplier for a shop
getFallbackPrice(String material) double Get fallback price for a material (when not in shops)
getSelectedShopPlugin() String Get selected shop plugin name ("excellentshop", "economyshopgui", "none")
isItemDisabled(String shopId, String material) boolean Check if an item is disabled in a shop
isShopEnabled(String shopId) boolean Check if a shop is enabled
reload() void Reload all configurations

EconomyHook

Handles economy operations and shop plugin integration.

Method Return Type Description
getShopPrice(Player player, Material material) double Get sell price for material (with permission checks)
getShopPriceForGUI(Material material) double Get sell price for GUI display (no permission checks)
getBestSellProduct(Player player, Material material) Object Get best sell product from shop plugin (shop-specific)
getShopPluginManager() ShopPluginManager Get shop plugin manager
isEconomyAvailable() boolean Check if Vault economy is available
getEconomyProvider() String Get economy provider name (e.g., "Essentials", "CMI")
addMoney(Player player, double amount) boolean Add money to player's account

ShopPluginManager

Manages shop plugin integrations and provides unified access to shop prices.

Method Return Type Description
getActiveShopPlugin() ShopPluginInterface Get currently active shop plugin
getPrice(Player player, Material material) double Get sell price from active shop plugin
getBuyPrice(Player player, Material material) double Get buy price from active shop plugin
getPriceForGUI(Material material) double Get price for GUI display (no permission checks)
getBestSellProduct(Player player, Material material) Object Get best sell product from active shop plugin
isShopPluginAvailable(String pluginName) boolean Check if a shop plugin is available

ShopPluginInterface

Interface for shop plugin integrations. Implement this to add support for new shop plugins.

Method Return Type Description
getPluginName() String Get the name of the shop plugin
isAvailable() boolean Check if the shop plugin is available
getPrice(Player player, Material material) double Get sell price for a material (with permission checks)
getPriceForGUI(Material material) double Get sell price for GUI display
getBuyPrice(Player player, Material material) double Get buy price for a material
getBestSellProduct(Player player, Material material) Object Get best sell product (shop-specific)
detectShops() Map<String, ShopData> Detect and return all shops
getDetectedShopsCount() int Get number of detected shops
reinitialize() void Reinitialize the shop plugin integration

DupeDetector

Utility class for detecting potential money duplication exploits.

Method Return Type Description
detectDupeItems(Player player) Map<Material, DupeInfo> Detect items where boosted sell price exceeds buy price

DupeInfo

Information about a potential duplication exploit.

Field Type Description
material Material The material with dupe potential
shopId String Shop ID where the item is sold
buyPrice double Buy price from shop
sellPrice double Base sell price
boostedSellPrice double Sell price with boost applied

Code Examples

Getting Sell Price

SigmaSellAxe plugin = (SigmaSellAxe) Bukkit.getPluginManager().getPlugin("SigmaSellAxe");
if (plugin == null || !plugin.isEnabled()) {
    return;
}

EconomyHook economyHook = plugin.getEconomyHook();
double price = economyHook.getShopPrice(player, Material.DIAMOND_ORE);

if (price > 0) {
    player.sendMessage("Diamond Ore sells for: $" + price);
} else {
    player.sendMessage("Diamond Ore cannot be sold");
}

Getting Item Boost

ConfigManager configManager = plugin.getConfigManager();
double boost = configManager.getItemBoost("farming", "PUMPKIN");

if (boost > 0) {
    player.sendMessage("Pumpkin has a " + (boost * 100) + "% boost in farming shop");
}

Checking Shop Plugin

ShopPluginManager shopManager = economyHook.getShopPluginManager();
ShopPluginInterface activePlugin = shopManager.getActiveShopPlugin();

if (activePlugin != null) {
    String pluginName = activePlugin.getPluginName();
    int shopCount = activePlugin.getDetectedShopsCount();
    player.sendMessage("Active shop plugin: " + pluginName + " (" + shopCount + " shops)");
} else {
    player.sendMessage("No shop plugin active - using fallback prices");
}

Detecting Duplication Exploits

DupeDetector dupeDetector = new DupeDetector(plugin);
Map<Material, DupeDetector.DupeInfo> dupeItems = dupeDetector.detectDupeItems(player);

if (!dupeItems.isEmpty()) {
    player.sendMessage("Warning: " + dupeItems.size() + " items have dupe potential!");
    for (Map.Entry<Material, DupeDetector.DupeInfo> entry : dupeItems.entrySet()) {
        DupeDetector.DupeInfo info = entry.getValue();
        player.sendMessage("- " + entry.getKey() + ": Buy $" + info.buyPrice + 
            ", Sell $" + info.boostedSellPrice);
    }
}

Checking Protection Plugin Integration

// Check if Lands is available
LandsHook landsHook = plugin.getLandsHook();
if (landsHook.isLandsAvailable()) {
    boolean canSell = landsHook.canPlayerSellInArea(player, location);
    if (!canSell) {
        player.sendMessage("You don't have permission to sell here!");
    }
}

// Check GriefPrevention
GriefPreventionHook gpHook = plugin.getGriefPreventionHook();
if (gpHook.isGriefPreventionAvailable()) {
    boolean canSell = gpHook.canPlayerSellInClaim(player, location);
    if (!canSell) {
        player.sendMessage("You don't have permission to sell in this claim!");
    }
}

Thread Safety

All API methods are thread-safe and can be called from any thread. The plugin uses synchronized blocks and volatile variables to ensure thread safety, making it safe for use on Folia and other multi-threaded servers.

Version Compatibility

API methods may change between major versions. Check the plugin documentation for breaking changes when updating the plugin.

Dependencies

To use the API in your plugin, add SigmaSellAxe as a dependency:

<dependency>
    <groupId>me.jayesh</groupId>
    <artifactId>SigmaSellAxe</artifactId>
    <version>2.0.7</version>
    <scope>provided</scope>
</dependency>

Support

For API questions or feature requests: