Package org.sgrewritten.stargate.economy
Class EconomyManager
java.lang.Object
org.sgrewritten.stargate.economy.EconomyManager
- All Implemented Interfaces:
EconomyAPI
,StargateEconomyAPI
- Direct Known Subclasses:
VaultEconomyManager
An abstract economy manager containing the essential economy code
-
Constructor Summary
ModifierConstructorDescriptionprotected
EconomyManager
(LanguageManager languageManager) Instantiates a new economy manager -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
chargeAndDepositPlayer
(org.bukkit.OfflinePlayer player, org.bukkit.OfflinePlayer transactionTarget, double amount) Charges the given player and deposits it into the other given player's accountboolean
chargePlayer
(org.bukkit.OfflinePlayer player, Portal origin, double amount) Charges the given player for using the given portalboolean
refundPlayer
(org.bukkit.OfflinePlayer player, Portal origin, double amount) Refunds a player's payment for using a portalprotected void
sendChargeSuccessMessage
(org.bukkit.OfflinePlayer offlinePlayer, double amount) Sends a message to a player telling them they've been successfully chargedprotected void
sendObtainSuccessMessage
(org.bukkit.OfflinePlayer offlinePlayer, double amount, String portalName) Sends a message to the player telling them they've successfully received fundsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.sgrewritten.stargate.economy.EconomyAPI
chargePlayer, depositPlayer, has
Methods inherited from interface org.sgrewritten.stargate.economy.StargateEconomyAPI
setupEconomy
-
Constructor Details
-
EconomyManager
Instantiates a new economy manager- Parameters:
languageManager
-The language manager to use for translations
-
-
Method Details
-
chargePlayer
Description copied from interface:StargateEconomyAPI
Charges the given player for using the given portal- Specified by:
chargePlayer
in interfaceStargateEconomyAPI
- Parameters:
player
-The player to charge
origin
-The portal the player entered from, or null if not portal usage
amount
-The amount to charge the player
- Returns:
True if there were no problems in processing the payment
-
refundPlayer
Description copied from interface:StargateEconomyAPI
Refunds a player's payment for using a portal- Specified by:
refundPlayer
in interfaceStargateEconomyAPI
- Parameters:
player
-The player that used a portal
origin
-The portal the player used
amount
-The amount to refund the player
- Returns:
True if the player was successfully refunded
-
chargeAndDepositPlayer
protected boolean chargeAndDepositPlayer(org.bukkit.OfflinePlayer player, org.bukkit.OfflinePlayer transactionTarget, double amount) Charges the given player and deposits it into the other given player's account- Parameters:
player
-The player to charge
transactionTarget
-The player to receive the payment
amount
-The amount the player should be charged
- Returns:
True if there was no problems with the payment
-
sendChargeSuccessMessage
protected void sendChargeSuccessMessage(org.bukkit.OfflinePlayer offlinePlayer, double amount) Sends a message to a player telling them they've been successfully charged- Parameters:
offlinePlayer
-The player to send the message to
amount
-The amount the player was charged
-
sendObtainSuccessMessage
protected void sendObtainSuccessMessage(org.bukkit.OfflinePlayer offlinePlayer, double amount, String portalName) Sends a message to the player telling them they've successfully received funds- Parameters:
offlinePlayer
-The player to send the message to
amount
-The amount the player received
portalName
-The portal used by another player
-