Class EconomyManager

java.lang.Object
org.sgrewritten.stargate.economy.EconomyManager
All Implemented Interfaces:
EconomyAPI, StargateEconomyAPI
Direct Known Subclasses:
VaultEconomyManager

public abstract class EconomyManager extends Object implements EconomyAPI, StargateEconomyAPI
An abstract economy manager containing the essential economy code
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Instantiates a new economy manager
  • Method Summary

    Modifier and Type
    Method
    Description
    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
    boolean
    chargePlayer(org.bukkit.OfflinePlayer player, Portal origin, double amount)
    Charges the given player for using the given portal
    boolean
    refundPlayer(org.bukkit.OfflinePlayer player, Portal origin, double amount)
    Refunds a player's payment for using a portal
    protected void
    sendChargeSuccessMessage(org.bukkit.OfflinePlayer offlinePlayer, double amount)
    Sends a message to a player telling them they've been successfully charged
    protected void
    sendObtainSuccessMessage(org.bukkit.OfflinePlayer offlinePlayer, double amount, String portalName)
    Sends a message to the player telling them they've successfully received funds

    Methods 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

      protected EconomyManager(LanguageManager languageManager)
      Instantiates a new economy manager
      Parameters:
      languageManager -

      The language manager to use for translations

  • Method Details

    • chargePlayer

      public boolean chargePlayer(org.bukkit.OfflinePlayer player, Portal origin, double amount)
      Description copied from interface: StargateEconomyAPI
      Charges the given player for using the given portal
      Specified by:
      chargePlayer in interface StargateEconomyAPI
      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

      public boolean refundPlayer(org.bukkit.OfflinePlayer player, Portal origin, double amount)
      Description copied from interface: StargateEconomyAPI
      Refunds a player's payment for using a portal
      Specified by:
      refundPlayer in interface StargateEconomyAPI
      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