Class Worth

java.lang.Object
com.earth2me.essentials.Worth
All Implemented Interfaces:
IConf

public class Worth extends Object implements IConf
  • Constructor Details

    • Worth

      public Worth(File dataFolder)
  • Method Details

    • getPrice

      public BigDecimal getPrice(IEssentials ess, ItemStack itemStack)
      Get the value of an item stack from the config.
      Parameters:
      ess - The Essentials instance.
      itemStack - The item stack to look up in the config.
      Returns:
      The price from the config.
    • getAmount

      public int getAmount(IEssentials ess, User user, ItemStack is, String[] args, boolean isBulkSell) throws Exception
      Get the amount of items to be sold from a player's inventory.
      Parameters:
      ess - The Essentials instance.
      user - The user attempting to sell the item.
      is - A stack of the item to search the inventory for.
      args - The amount to try to sell.
      isBulkSell - Whether or not to try and bulk sell all items.
      Returns:
      The amount of items to sell from the player's inventory.
      Throws:
      Exception - Thrown if trying to sell air or an invalid amount.
    • setPrice

      public void setPrice(IEssentials ess, ItemStack itemStack, double price)
      Set the price of an item and save it to the config.
      Parameters:
      ess - The Essentials instance.
      itemStack - A stack of the item to save.
      price - The new price of the item.
    • getFile

      public File getFile()
    • reloadConfig

      public void reloadConfig()
      Specified by:
      reloadConfig in interface IConf