SupremeDev
  • Supreme Development
  • Important
    • Installation
    • PayPal + Google Pay
    • Server Owner Advice
    • Json - Why?
    • Free Client Plugins
      • Supreme KillHolograms
        • config.yml
      • Supreme EXPShop
        • Commands & Permissions
        • config.yml
      • Supreme DeathBans
        • Commands & Permissions
        • config.yml
        • lang.yml
  • Plugins
    • Supreme Factions
      • Placeholders
      • Commands & Permissions
      • Developer API
      • Files
        • raids.json
        • lang.yml
        • conf.json
        • config.yml
        • upgrades.yml
    • Supreme Spawners
      • Commands & Permissions
      • Developer API
      • Files
        • lang.json
        • conf.json
        • entity-settings.json
        • stacker-settings.json
    • Supreme Hoes
      • Commands & Permissions
      • Placeholders
      • Developer API
      • Files
        • config.yml
        • captcha.yml
        • menus.yml
    • Supreme Printer
      • Commands & Permissions
      • Developer API
      • Files
        • config.yml
    • Supreme Blood Orbs
      • Commands & Permissions
      • Files
        • config.yml
        • lang.yml
    • Supreme TokenShop
      • Commands & Permissions
      • config.yml
    • Supreme LMS
      • Commands & Permissions
      • Files
        • lang.json
        • config.json
    • Supreme Roam
      • Commands & Permissions
      • Files
        • lang.yml
        • config.yml
    • Supreme MobSwords
      • Commands & Permissions
      • Placeholders
      • Files
        • menus.yml
        • config.yml
    • Supreme BindIP
      • Commands & Permissions
    • Supreme Robots
      • Commands & Permissions
      • Developer API
      • Files
        • lang.json
        • config.json
    • Supreme Meteors
      • Commands & Permissions
      • Files
        • config.yml
        • lang.json
    • Supreme Tools
      • Commands & Permissions
      • Files
        • config.yml
    • Supreme Collectors
      • Commands & Permissions
      • Files
        • lang.json
        • config.json
    • Supreme Player Stats
      • Commands & Permissions
      • Statistic Types
      • Files
        • menus.yml
        • config.json
    • Supreme Miner Picks
      • Commands & Permissions
      • Files
        • drops.yml
        • menus.yml
        • config.yml
  • Addons
    • Factions Top
    • Harvest Event
    • Hoe Boosters
  • Libraries
  • SupremeCaptcha
    • Commands & Permissions
    • Files
      • config.json
  • SupremeTokens
    • Commands & Permissions
    • Files
      • lang.json
      • config.json
Powered by GitBook
On this page
  • Interacting with the Hoes persistant data.
  • Enchantment API

Was this helpful?

  1. Plugins
  2. Supreme Hoes

Developer API

Interacting with the Hoes persistant data.

// Get harvester by player object.
Harvester harvester = Harvesters.getInstance().getByPlayer(Player);

// Get all harvesters on server.
List<Harvester> allHarvesters = Harvesters.getInstance().getAllHarvesters();

// Get raw cane harvested by a player.
double cane = harvester.getRawCane();

// Add raw cane harvested to a player.
harvester.addCaneRaw(int amount);

if (harvester.hasTokens(1000)) { }

// Event that is called whenever a player harvests a block.
@EventHandler
public void onPlayerHarvest(CaneHarvestEvent e) {
  e.setCancelled(true);
}

Enchantment API

Implemented in SupremeHoes Version 2.4.4

Creating an enchantment.

public class ExampleExternalEnchant extends Enchant {

    public ExampleExternalEnchant() {
        // Enchantment name, Enchant Priority
        super("Example Enchant", 100);
        // Set the max level of the enchant
        this.maxLevel = 1000; 
        // Set the default itemstack used for the enchants menu
        this.baseItem = new ItemStack(Material.AIR, 1);
        // Integer level, Double cost
        this.costUpgradeMap = new LinkedHashMap<>();
    }

    @Override
    public void perform(HarvestContext e) {
        // This is called when your enchant is up to process the HarvestContext
        // & make changes
    }
    
    @Override
    public String getLoreString(int x) {
        // Override the getLoreString to your config.
        // If you are using the hoes config to store your enchant info you don't need to override
        return "";
    }

    @Override
    public int getSlot() {
        // Override the getSlot to your config.
        // If you are using the hoes config to store your enchant info you don't need to override
        return -1;
    }

}

Registering your enchantment.

Enchants.getInstance().addEnchant(new ExampleExternalEnchant());

PreviousPlaceholdersNextFiles

Last updated 4 years ago

Was this helpful?