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
ConstructorsModifierConstructorDescriptionprotectedEconomyManager(LanguageManager languageManager) Instantiates a new economy manager -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanchargeAndDepositPlayer(org.bukkit.OfflinePlayer player, org.bukkit.OfflinePlayer transactionTarget, double amount) Charges the given player and deposits it into the other given player's accountbooleanchargePlayer(org.bukkit.OfflinePlayer player, Portal origin, double amount) Charges the given player for using the given portalbooleanrefundPlayer(org.bukkit.OfflinePlayer player, Portal origin, double amount) Refunds a player's payment for using a portalprotected voidsendChargeSuccessMessage(org.bukkit.OfflinePlayer offlinePlayer, double amount) Sends a message to a player telling them they've been successfully chargedprotected voidsendObtainSuccessMessage(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, waitMethods inherited from interface org.sgrewritten.stargate.economy.EconomyAPI
chargePlayer, depositPlayer, hasMethods 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:StargateEconomyAPICharges the given player for using the given portal- Specified by:
chargePlayerin 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:StargateEconomyAPIRefunds a player's payment for using a portal- Specified by:
refundPlayerin 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
-