java.lang.Object
com.olziedev.playerauctions.api.player.APlayer

public abstract class APlayer extends Object
Handles and manages all the player data.
  • Constructor Details

    • APlayer

      public APlayer()
  • Method Details

    • getUUID

      public abstract UUID getUUID()
      Returns:
      The UUID of the auction player.
    • getName

      public abstract String getName()
      Returns:
      The last known auction player's name.
    • getPlayer

      public abstract Player getPlayer()
      Returns:
      The Bukkit player instance.
    • getOfflinePlayer

      public abstract OfflinePlayer getOfflinePlayer()
      Returns:
      The Bukkit offline player instance.
    • getPlayerAuctions

      public abstract List<Auction> getPlayerAuctions()
      Returns:
      List of the current actions the player has.
    • getPlayerAuctions

      public abstract List<Auction> getPlayerAuctions(CommandSender sender)
      Parameters:
      sender - The command sender, this is to check if they can see specific warps or not.
      Returns:
      List of the current actions the player has.
    • getUsedAuctions

      public abstract long getUsedAuctions(CommandSender sender)
      Parameters:
      sender - The command sender, this is to check if they can see specific warps or not.
      Returns:
      The current active auctions the player has.
    • getRecentAuctions

      public abstract List<ARecent> getRecentAuctions(CommandSender sender)
      Parameters:
      sender - The command sender, this is to check if they can see specific warps or not.
      Returns:
      List of the recently sold/bought auctions by a player.
    • addRecentAuction

      public abstract void addRecentAuction(Auction auction, UUID target, double price, ACurrency currency, String internalCurrency, ASerializableProduct<?> product, RecentAuctionType type, Runnable runnable)
      Add a recent auction (sold/bought/auctioned) to the player.
      Parameters:
      auction - The auction object.
      target - The player's UUID who they bought/sold from
      price - The price of the auction.
      currency - THe currency used in the auction.
      product - The product of the auction.
      type - The type of the recent auction.
      runnable - Callback when the recent auction has been added.
    • getMaximumAuctions

      public abstract long getMaximumAuctions()
      Returns:
      The maximum amount of auctions a player can sell. Retrieves it from the permission and static amount.
    • getPrettyMaximumAuctions

      public abstract String getPrettyMaximumAuctions()
      Returns:
      The pretty maximum amount of auctions a player can sell. Retrieves it from the permission and static amount.
    • getStaticAuctions

      public abstract long getStaticAuctions()
      Returns:
      The static amount of auctions a player can sell.
    • getLastKnownLimit

      public abstract long getLastKnownLimit()
      Returns:
      The last known limit the player had, via permission limit.
    • getLimitPermission

      public abstract long getLimitPermission()
      Returns:
      The limit permission the player has.
    • getGUIPlayer

      public abstract AGUIPlayer getGUIPlayer()
      Returns:
      The GUIPlayer object, used for saving values when a GUI is opened.
    • refreshName

      public abstract void refreshName()
      Update the player's name for, called when joined. getName()
    • setStaticAuctions

      public abstract void setStaticAuctions(long addedAuctions)
      Modifies the static maximum auctions a player can set.
      Parameters:
      addedAuctions - Static maximum amount of auctions.
    • setLastKnownLimit

      public abstract void setLastKnownLimit(long limit)
      Modifies the last known limit the player had, via permissions.
      Parameters:
      limit - The last known limit permission the player had.
    • getSellPrice

      public abstract double getSellPrice(double price)
      Get the price of how much they will be charged when selling an auction.
      Parameters:
      price - The price of the auction.
      Returns:
      How much they will be charged when selling an auction.
    • getExpireTime

      public abstract int getExpireTime(boolean bid)
      Parameters:
      bid - If the time should be from a bid or not.
      Returns:
      How much expire time they will have when selling an auction.
    • getMessages

      public abstract List<String> getMessages()
      Returns:
      List of pending offline messages the player has.
    • manageMessage

      public abstract void manageMessage(String message, boolean add)
      Add or remove an offline message from a player.
      Parameters:
      message - The offline message the player should see when joined.
      add - Add a message or remove a message?
    • getBlacklistedPlayers

      public abstract List<UUID> getBlacklistedPlayers()
      Returns:
      List of blacklisted players from the players' auctions.
    • setBlacklistedPlayers

      public abstract void setBlacklistedPlayers(List<UUID> blacklistedPlayers)
      Modifies the blacklisted players for this player.
      Parameters:
      blacklistedPlayers - Blacklisted players.
    • getBackpack

      public abstract List<ItemStack> getBackpack()
      Returns:
      List of items from the players backpack.
    • setBackpack

      public abstract void setBackpack(List<ItemStack> backpack)
      Modifies the players backpack
      Parameters:
      backpack - The items to set to their backpack.
    • getLogs

      public abstract List<String> getLogs()
      Returns:
      List of the logged actions.
    • setLogs

      public abstract void setLogs(List<String> logs)
      Modifies the logged actions for this player.
      Parameters:
      logs - Logged actions.
    • getMadeOffline

      public abstract List<APlayer.ACurrencyContainer> getMadeOffline()
      Returns:
      How much a player has made offline.
    • addMadeOffline

      public abstract void addMadeOffline(String server, ACurrency currency, String internalCurrency, double amount)
      Modifies the amount the player has made when they are offline.
      Parameters:
      server - The server for this currency.
      currency - The currency to add the amount to.
      internalCurrency - The internal currency to add the amount to.
      amount - The amount to add.
    • handleJoin

      public abstract void handleJoin(boolean title)
      Handles all the join notifications and economy updates for the player.
      Parameters:
      title - If the title for all the notifications should be added.
    • getLanguage

      public abstract String getLanguage()
      Returns:
      The language the player will receive messages in.
    • setLanguage

      public abstract void setLanguage(String language)
      Modifies the language the player will receive messages in.
      Parameters:
      language - The language that the plugin supports.
    • giveItem

      public abstract void giveItem(ItemStack itemStack)
      Gives an item to the player, if the player is either offline or their inventory is full it will be added to their backpack.
      Parameters:
      itemStack - The item stack to give to the player.
    • hasReachedPurchaseLimit

      public abstract boolean hasReachedPurchaseLimit()
      Returns:
      If the player has reached their purchase limit. This relies on the recent auctions' system.