added getTax() to AuctionEndEvent, relates to #10

Took 4 minutes
This commit is contained in:
Kiran Hart 2022-10-06 12:46:53 -04:00
parent 411935aa57
commit a71645f6b5
No known key found for this signature in database
GPG Key ID: 5F36C7BC79D3EBC3
2 changed files with 7 additions and 4 deletions

View File

@ -28,16 +28,19 @@ public class AuctionEndEvent extends Event implements Cancellable {
private AuctionedItem auctionItem; private AuctionedItem auctionItem;
private AuctionSaleType saleType; private AuctionSaleType saleType;
public AuctionEndEvent(OfflinePlayer originalOwner, OfflinePlayer buyer, AuctionedItem auctionItem, AuctionSaleType saleType, boolean async) { private double tax;
public AuctionEndEvent(OfflinePlayer originalOwner, OfflinePlayer buyer, AuctionedItem auctionItem, AuctionSaleType saleType, double tax, boolean async) {
super(async); super(async);
this.originalOwner = originalOwner; this.originalOwner = originalOwner;
this.buyer = buyer; this.buyer = buyer;
this.auctionItem = auctionItem; this.auctionItem = auctionItem;
this.saleType = saleType; this.saleType = saleType;
this.tax = tax;
} }
public AuctionEndEvent(OfflinePlayer originalOwner, OfflinePlayer buyer, AuctionedItem auctionItem, AuctionSaleType saleType) { public AuctionEndEvent(OfflinePlayer originalOwner, OfflinePlayer buyer, AuctionedItem auctionItem, AuctionSaleType saleType, double tax) {
this(originalOwner, buyer, auctionItem, saleType, true); this(originalOwner, buyer, auctionItem, saleType, tax, true);
} }
public HandlerList getHandlers() { public HandlerList getHandlers() {

View File

@ -127,7 +127,7 @@ public class GUIConfirmPurchase extends AbstractPlaceholderGui {
return; return;
} }
AuctionEndEvent auctionEndEvent = new AuctionEndEvent(Bukkit.getOfflinePlayer(this.auctionItem.getOwner()), e.player, this.auctionItem, AuctionSaleType.WITHOUT_BIDDING_SYSTEM, false); AuctionEndEvent auctionEndEvent = new AuctionEndEvent(Bukkit.getOfflinePlayer(this.auctionItem.getOwner()), e.player, this.auctionItem, AuctionSaleType.WITHOUT_BIDDING_SYSTEM, tax, false);
Bukkit.getServer().getPluginManager().callEvent(auctionEndEvent); Bukkit.getServer().getPluginManager().callEvent(auctionEndEvent);
if (auctionEndEvent.isCancelled()) return; if (auctionEndEvent.isCancelled()) return;