Package com.earth2me.essentials
Class Worth
java.lang.Object
com.earth2me.essentials.Worth
- All Implemented Interfaces:
IConf
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
getAmount
(IEssentials ess, User user, ItemStack is, String[] args, boolean isBulkSell) Get the amount of items to be sold from a player's inventory.getFile()
getPrice
(IEssentials ess, ItemStack itemStack) Get the value of an item stack from the config.void
void
setPrice
(IEssentials ess, ItemStack itemStack, double price) Set the price of an item and save it to the config.
-
Constructor Details
-
Worth
-
-
Method Details
-
getPrice
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
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
-
reloadConfig
public void reloadConfig()- Specified by:
reloadConfig
in interfaceIConf
-