🪲 Fixed transaction final price

Took 2 minutes
This commit is contained in:
Kiran Hart 2023-03-24 15:50:51 -04:00
parent 14af0816e4
commit fa965583d4
No known key found for this signature in database
GPG Key ID: 5F36C7BC79D3EBC3

View File

@ -92,6 +92,12 @@ public class AuctionListeners implements Listener {
AuctionHouse.newChain().async(() -> {
if (Settings.RECORD_TRANSACTIONS.getBoolean()) {
final AuctionHouse instance = AuctionHouse.getInstance();
double price = auctionedItem.getBasePrice();
if (e.getSaleType() == AuctionSaleType.USED_BIDDING_SYSTEM) {
price = auctionedItem.getCurrentPrice();
}
instance.getDataManager().insertTransactionAsync(new Transaction(
UUID.randomUUID(),
originalOwnerUUID,
@ -101,7 +107,7 @@ public class AuctionListeners implements Listener {
System.currentTimeMillis(),
auctionedItem.getItem(),
e.getSaleType(),
auctionedItem.getCurrentPrice()
price
), (error, transaction) -> {
if (error == null) {
instance.getTransactionManager().addTransaction(transaction);