public class CEconomy extends Observable
Economy object| Modifier and Type | Field and Description |
|---|---|
protected Lang |
format
The
Lang format to use for output |
| Constructor and Description |
|---|
CEconomy(org.bukkit.plugin.Plugin plugin)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
double |
bonusRate()
Represents a rate that is multiplied to money given through the
pay(Player, double) method. |
ChargeStatus |
canCharge(org.bukkit.entity.Player p,
Config value)
Returns whether or not a specific
Player can be charged an amount |
ChargeStatus |
canCharge(org.bukkit.entity.Player p,
double cost)
Returns whether or not a specific
Player can be charged an amount |
boolean |
charge(org.bukkit.entity.Player p,
Config value)
Takes money away from the
Player |
boolean |
charge(org.bukkit.entity.Player p,
double cost)
Takes money away from the
Player |
double |
getBalance(org.bukkit.entity.Player p)
Returns the relevant balance for the
Player |
protected net.milkbowl.vault.economy.Economy |
getEconomy()
Returns the underlying
Economy object that is backed by a
VaultProxy InvocationHandler |
boolean |
isEnabled()
Returns whether or not the
Economy object could be retrieved
from Vault |
void |
notifyObservers(Object arg)
Modified to send a Bukkit event and force notification of the change
|
boolean |
pay(org.bukkit.entity.Player p,
Config value)
Gives money to the
Player |
boolean |
pay(org.bukkit.entity.Player p,
double amount)
Gives money to the
Player |
protected void |
setChanged() |
double |
taxRate()
Represents a rate that is multiplied to money taken through the
charge(Player, double) method. |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObserverspublic CEconomy(org.bukkit.plugin.Plugin plugin)
Economy class is proxied and
if not, then it will manually call for it to be proxied.plugin - The Plugin that instantiated this classpublic ChargeStatus canCharge(org.bukkit.entity.Player p, Config value)
Player can be charged an amountp - The Player to chargevalue - A Config double value representing how much to
takeChargeStatus representing the total cost and the status
of whether or not the Player can be charged. If
isEnabled() returns false, this will be
a ChargeStatus of true with a returned cost of 0public ChargeStatus canCharge(org.bukkit.entity.Player p, double cost)
Player can be charged an amountp - The Player to chargecost - The amount to chargeChargeStatus representing the total cost and the status
of whether or not the Player can be charged. If
isEnabled() returns false, this will be
a ChargeStatus of true with a returned cost of 0public boolean charge(org.bukkit.entity.Player p,
Config value)
Playerp - The Player to take fromvalue - A Config double value representing how much to
taketrue if the money was successfully taken, or if
isEnabled() returns falsepublic boolean charge(org.bukkit.entity.Player p,
double cost)
Playerp - The Player to take money fromcost - The amount of money to taketrue if the money was successfully taken, or if
isEnabled() returns falsepublic boolean pay(org.bukkit.entity.Player p,
Config value)
Playerp - The Player to give money tovalue - A Config double value representing how much to
givetrue if the money was deposited successfully, or if
isEnabled() returns falsepublic boolean pay(org.bukkit.entity.Player p,
double amount)
Playerp - The Player to give money toamount - The amount of money to givetrue if the money was deposited successfully, or if
isEnabled() returns falsepublic void notifyObservers(Object arg)
notifyObservers in class Observablearg - An EconomyChangePacketprotected void setChanged()
setChanged in class Observablepublic double getBalance(org.bukkit.entity.Player p)
Playerp - The Player for which the balanced is checkedisEnabled()
returns falsepublic final boolean isEnabled()
Economy object could be retrieved
from Vaultfalse if the Economy object is nullprotected final net.milkbowl.vault.economy.Economy getEconomy()
Economy object that is backed by a
VaultProxy InvocationHandlerEconomy objectpublic double taxRate()
charge(Player, double) method. This method is purposely
overridable to allow for people to specify their own rates. Values that
are negative or zero will be automatically converted to 1.public double bonusRate()
pay(Player, double) method. This method is purposely
overridable to allow for people to specify their own rates. Values that
are negative or zero will be automatically converted to 1.Copyright © 2015. All rights reserved.