Class APlayer
java.lang.Object
com.olziedev.playerauctions.api.player.APlayer
Handles and manages all the player data.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classHandles all the currency containers for the player. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidaddMadeOffline(String server, ACurrency currency, String internalCurrency, double amount) Modifies the amount the player has made when they are offline.abstract voidaddRecentAuction(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.abstract intgetExpireTime(boolean bid) abstract AGUIPlayerabstract Stringabstract longabstract longgetLogs()abstract List<APlayer.ACurrencyContainer> abstract longabstract StringgetName()abstract OfflinePlayerabstract PlayergetPlayerAuctions(CommandSender sender) abstract StringgetRecentAuctions(CommandSender sender) abstract doublegetSellPrice(double price) Get the price of how much they will be charged when selling an auction.abstract longabstract longgetUsedAuctions(CommandSender sender) abstract UUIDgetUUID()abstract voidGives an item to the player, if the player is either offline or their inventory is full it will be added to their backpack.abstract voidhandleJoin(boolean title) Handles all the join notifications and economy updates for the player.abstract booleanabstract voidmanageMessage(String message, boolean add) Add or remove an offline message from a player.abstract voidUpdate the player's name for, called when joined.abstract voidsetBackpack(List<ItemStack> backpack) Modifies the players backpackabstract voidsetBlacklistedPlayers(List<UUID> blacklistedPlayers) Modifies the blacklisted players for this player.abstract voidsetLanguage(String language) Modifies the language the player will receive messages in.abstract voidsetLastKnownLimit(long limit) Modifies the last known limit the player had, via permissions.abstract voidModifies the logged actions for this player.abstract voidsetStaticAuctions(long addedAuctions) Modifies the static maximum auctions a player can set.
-
Constructor Details
-
APlayer
public APlayer()
-
-
Method Details
-
getUUID
- Returns:
- The UUID of the auction player.
-
getName
- Returns:
- The last known auction player's name.
-
getPlayer
- Returns:
- The Bukkit player instance.
-
getOfflinePlayer
- Returns:
- The Bukkit offline player instance.
-
getPlayerAuctions
- Returns:
- List of the current actions the player has.
-
getPlayerAuctions
- 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
- 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
- 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 fromprice- 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
- 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
- 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
- Returns:
- List of pending offline messages the player has.
-
manageMessage
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
- Returns:
- List of blacklisted players from the players' auctions.
-
setBlacklistedPlayers
Modifies the blacklisted players for this player.- Parameters:
blacklistedPlayers- Blacklisted players.
-
getBackpack
- Returns:
- List of items from the players backpack.
-
setBackpack
Modifies the players backpack- Parameters:
backpack- The items to set to their backpack.
-
getLogs
- Returns:
- List of the logged actions.
-
setLogs
Modifies the logged actions for this player.- Parameters:
logs- Logged actions.
-
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
- Returns:
- The language the player will receive messages in.
-
setLanguage
Modifies the language the player will receive messages in.- Parameters:
language- The language that the plugin supports.
-
giveItem
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.
-