public class CEconomy extends Observable
Economy
objectModifier 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, notifyObservers
public 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)
Player
p
- The Player
to take fromvalue
- A Config
double value representing how much to
taketrue
if the money was successfully taken, or if
isEnabled()
returns false
public boolean charge(org.bukkit.entity.Player p, double cost)
Player
p
- The Player
to take money fromcost
- The amount of money to taketrue
if the money was successfully taken, or if
isEnabled()
returns false
public boolean pay(org.bukkit.entity.Player p, Config value)
Player
p
- 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 false
public boolean pay(org.bukkit.entity.Player p, double amount)
Player
p
- The Player
to give money toamount
- The amount of money to givetrue
if the money was deposited successfully, or if
isEnabled()
returns false
public void notifyObservers(Object arg)
notifyObservers
in class Observable
arg
- An EconomyChangePacket
protected void setChanged()
setChanged
in class Observable
public double getBalance(org.bukkit.entity.Player p)
Player
p
- The Player
for which the balanced is checkedisEnabled()
returns false
public final boolean isEnabled()
Economy
object could be retrieved
from Vaultfalse
if the Economy
object is null
protected 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.