force assign player instance in AuctionPlayer if null

Took 4 minutes
This commit is contained in:
Kiran Hart 2023-03-06 13:16:15 -05:00
parent 9b51ab1ae7
commit 64d140c40c
No known key found for this signature in database
GPG Key ID: 5F36C7BC79D3EBC3

View File

@ -67,6 +67,9 @@ public class AuctionPlayer {
}
public boolean canListItem() {
if (this.player == null)
this.player = Bukkit.getPlayer(this.uuid);
if (Settings.LIST_ITEM_DELAY.getInt() == -1) {
return true;
}
@ -87,6 +90,9 @@ public class AuctionPlayer {
}
public List<AuctionedItem> getItems(boolean getExpired) {
if (this.player == null)
this.player = Bukkit.getPlayer(this.uuid);
final List<AuctionedItem> items = new ArrayList<>();
final AuctionHouse instance = AuctionHouse.getInstance();
for (Map.Entry<UUID, AuctionedItem> entry : instance.getAuctionItemManager().getItems().entrySet()) {
@ -123,6 +129,9 @@ public class AuctionPlayer {
}
public int getAllowedSellTime(AuctionSaleType auctionSaleType) {
if (this.player == null)
this.player = Bukkit.getPlayer(this.uuid);
List<Integer> possibleTimes = new ArrayList<>();
Settings.AUCTION_TIME.getStringList().forEach(line -> {
String[] split = line.split(":");