Class ACurrency
java.lang.Object
com.olziedev.playerauctions.api.expansion.PluginExpansion
com.olziedev.playerauctions.api.expansion.Expansion
com.olziedev.playerauctions.api.expansion.ACurrency
Represents an auction currency addon that can allow multiple currencies for the plugin.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a bank provider that can be used to withdraw money from a bank account. -
Field Summary
Fields inherited from class com.olziedev.playerauctions.api.expansion.PluginExpansion
config, expansionConfig, file, integrated, plugin, registry, version -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidDeposit the amount into the players balance in this currency.abstract voidgetBalance(APlayer aPlayer, String internalCurrency, Consumer<Double> balanceConsumer) Retrieve the balance from a player in this currency.abstract StringRetrieve the currency name.abstract StringgetCurrencyPrefix(String internalCurrency) Retrieve the prefix for the currency.getCurrencyPrefix(String internalCurrency, String amount) Retrieve the prefix for the currency with the replaced variable.abstract doubleRetrieve the currency maximum price amount.abstract doubleRetrieve the currency minimum bid amount.abstract doubleRetrieve the currency minimum price amount.abstract doubleRetrieve the currency minimum price amount.voidhasBalance(APlayer aPlayer, double amount, String internalCurrency, Consumer<Boolean> hasConsumer) Retrieve if the player has the balance specified in this currency.abstract booleanRetrieve if the currency allows doubles (decimals) or integers (whole).abstract booleanRetrieve if the currency supports customizable confirm amount.abstract voidWithdraw the amount from the players balance in this currency.
-
Constructor Details
-
ACurrency
public ACurrency()
-
-
Method Details
-
getCurrencyName
Retrieve the currency name.- Returns:
- The currency name from the configuration file that is used by players to determine the currency.
-
getInternalCurrencies
- Returns:
- The internal currencies that is supported by the currency.
-
getCurrencyPrefix
Retrieve the prefix for the currency.- Parameters:
internalCurrency- If currency supported, what currency to withdraw from.- Returns:
- The currency prefix from the configuration file that is shown is used for the price variable.
-
getCurrencyPrefix
Retrieve the prefix for the currency with the replaced variable.- Parameters:
internalCurrency- If currency supported, what currency to withdraw from.amount- The formatted amount that is shown in the currency prefix.- Returns:
- The original currency prefix with the replaced variable as the specified amount.
-
getMinPricePurchaseAmount
public abstract double getMinPricePurchaseAmount()Retrieve the currency minimum price amount.- Returns:
- The currency minimum price amount for the confirmation GUI.
-
supportsCustomizableConfirmAmount
public abstract boolean supportsCustomizableConfirmAmount()Retrieve if the currency supports customizable confirm amount.- Returns:
- If the currency supports customizable confirm amount in the confirmation GUI.
-
getMinPriceSellAmount
public abstract double getMinPriceSellAmount()Retrieve the currency minimum price amount.- Returns:
- The minimum price you can sell an item for.
-
getMaxPriceSellAmount
public abstract double getMaxPriceSellAmount()Retrieve the currency maximum price amount.- Returns:
- The maximum price you can sell an item for.
-
getMinPriceBidAmount
public abstract double getMinPriceBidAmount()Retrieve the currency minimum bid amount.- Returns:
- The minimum price you can bid for an item.
-
hasDecimalSupport
public abstract boolean hasDecimalSupport()Retrieve if the currency allows doubles (decimals) or integers (whole).- Returns:
- If the currency allows decimals or not.
-
hasBalance
public void hasBalance(APlayer aPlayer, double amount, String internalCurrency, Consumer<Boolean> hasConsumer) Retrieve if the player has the balance specified in this currency.- Parameters:
aPlayer- The player to that checks the balance for.amount- The amount to check for.internalCurrency- If currency supported, what currency to withdraw from.hasConsumer- Callback If the player has the amount in this currency.
-
getBalance
public abstract void getBalance(APlayer aPlayer, String internalCurrency, Consumer<Double> balanceConsumer) Retrieve the balance from a player in this currency.- Parameters:
aPlayer- The player to get the balance from.internalCurrency- If currency supported, what currency to withdraw from.balanceConsumer- Callback for getting the balance.
-
deposit
public abstract void deposit(APlayer aPlayer, double amount, String internalCurrency, Consumer<Boolean> response) Deposit the amount into the players balance in this currency.- Parameters:
aPlayer- The player that'll receive a deposit in this currency.amount- The amount to give in this currency.internalCurrency- If currency supported, what currency to withdraw from.response- The response of the deposit.
-
withdraw
public abstract void withdraw(APlayer aPlayer, double amount, String internalCurrency, Consumer<Boolean> response) Withdraw the amount from the players balance in this currency.- Parameters:
aPlayer- The player to withdraw the currency from.amount- The amount to take from this currency.internalCurrency- If currency supported, what currency to withdraw from.response- The response of the withdrawal.
-