From 017d6ee9f747eb2f0275d192fd66c22fa23bc763 Mon Sep 17 00:00:00 2001 From: Kiran Hart Date: Tue, 25 Jan 2022 12:02:44 -0500 Subject: [PATCH] 2.54.1 - finished rounding values --- pom.xml | 2 +- .../java/ca/tweetzy/auctionhouse/guis/GUIAuctionHouse.java | 4 ++-- src/main/java/ca/tweetzy/auctionhouse/guis/GUIBid.java | 4 ++-- .../auctionhouse/guis/confirmation/GUIConfirmBid.java | 4 ++-- .../auctionhouse/guis/confirmation/GUIConfirmPurchase.java | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pom.xml b/pom.xml index 0b09098..75cddda 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ 4.0.0 ca.tweetzy auctionhouse - 2.54.0 + 2.54.1 UTF-8 diff --git a/src/main/java/ca/tweetzy/auctionhouse/guis/GUIAuctionHouse.java b/src/main/java/ca/tweetzy/auctionhouse/guis/GUIAuctionHouse.java index 3d10814..efbb59d 100644 --- a/src/main/java/ca/tweetzy/auctionhouse/guis/GUIAuctionHouse.java +++ b/src/main/java/ca/tweetzy/auctionhouse/guis/GUIAuctionHouse.java @@ -270,9 +270,9 @@ public class GUIAuctionHouse extends Gui { auctionItem.setHighestBidder(e.player.getUniqueId()); auctionItem.setHighestBidderName(e.player.getName()); - auctionItem.setCurrentPrice(newBiddingAmount); + auctionItem.setCurrentPrice(Settings.ROUND_ALL_PRICES.getBoolean() ? Math.round(newBiddingAmount) : newBiddingAmount); if (auctionItem.getBasePrice() != -1 && Settings.SYNC_BASE_PRICE_TO_HIGHEST_PRICE.getBoolean() && auctionItem.getCurrentPrice() > auctionItem.getBasePrice()) { - auctionItem.setBasePrice(auctionItem.getCurrentPrice()); + auctionItem.setBasePrice(Settings.ROUND_ALL_PRICES.getBoolean() ? Math.round(auctionItem.getCurrentPrice()) : auctionItem.getCurrentPrice()); } if (Settings.INCREASE_TIME_ON_BID.getBoolean()) { diff --git a/src/main/java/ca/tweetzy/auctionhouse/guis/GUIBid.java b/src/main/java/ca/tweetzy/auctionhouse/guis/GUIBid.java index 678d025..8325bb3 100644 --- a/src/main/java/ca/tweetzy/auctionhouse/guis/GUIBid.java +++ b/src/main/java/ca/tweetzy/auctionhouse/guis/GUIBid.java @@ -107,9 +107,9 @@ public class GUIBid extends Gui { auctionItem.setHighestBidder(e.player.getUniqueId()); auctionItem.setHighestBidderName(e.player.getName()); - auctionItem.setCurrentPrice(newBiddingAmount); + auctionItem.setCurrentPrice(Settings.ROUND_ALL_PRICES.getBoolean() ? Math.round(newBiddingAmount) : newBiddingAmount); if (auctionItem.getBasePrice() != -1 && Settings.SYNC_BASE_PRICE_TO_HIGHEST_PRICE.getBoolean() && auctionItem.getCurrentPrice() > auctionItem.getBasePrice()) { - auctionItem.setBasePrice(auctionItem.getCurrentPrice()); + auctionItem.setBasePrice(Settings.ROUND_ALL_PRICES.getBoolean() ? Math.round(auctionItem.getCurrentPrice()) : auctionItem.getCurrentPrice()); } if (Settings.INCREASE_TIME_ON_BID.getBoolean()) { diff --git a/src/main/java/ca/tweetzy/auctionhouse/guis/confirmation/GUIConfirmBid.java b/src/main/java/ca/tweetzy/auctionhouse/guis/confirmation/GUIConfirmBid.java index 55d0ca0..36d7719 100644 --- a/src/main/java/ca/tweetzy/auctionhouse/guis/confirmation/GUIConfirmBid.java +++ b/src/main/java/ca/tweetzy/auctionhouse/guis/confirmation/GUIConfirmBid.java @@ -117,9 +117,9 @@ public class GUIConfirmBid extends Gui { auctionItem.setHighestBidder(e.player.getUniqueId()); auctionItem.setHighestBidderName(e.player.getName()); - auctionItem.setCurrentPrice(newBiddingAmount); + auctionItem.setCurrentPrice(Settings.ROUND_ALL_PRICES.getBoolean() ? Math.round(newBiddingAmount) : newBiddingAmount); if (auctionItem.getBasePrice() != -1 && Settings.SYNC_BASE_PRICE_TO_HIGHEST_PRICE.getBoolean() && Settings.ALLOW_USAGE_OF_BUY_NOW_SYSTEM.getBoolean() && auctionItem.getCurrentPrice() > auctionItem.getBasePrice()) { - auctionItem.setBasePrice(auctionItem.getCurrentPrice()); + auctionItem.setBasePrice(Settings.ROUND_ALL_PRICES.getBoolean() ? Math.round(auctionItem.getCurrentPrice()) : auctionItem.getCurrentPrice()); } if (Settings.INCREASE_TIME_ON_BID.getBoolean()) { diff --git a/src/main/java/ca/tweetzy/auctionhouse/guis/confirmation/GUIConfirmPurchase.java b/src/main/java/ca/tweetzy/auctionhouse/guis/confirmation/GUIConfirmPurchase.java index 8aaf13a..98be31e 100644 --- a/src/main/java/ca/tweetzy/auctionhouse/guis/confirmation/GUIConfirmPurchase.java +++ b/src/main/java/ca/tweetzy/auctionhouse/guis/confirmation/GUIConfirmPurchase.java @@ -141,7 +141,7 @@ public class GUIConfirmPurchase extends Gui { if (!located.isInfinite()) { located.setItem(item); - located.setBasePrice(located.getBasePrice() - buyNowPrice); + located.setBasePrice(Settings.ROUND_ALL_PRICES.getBoolean() ? Math.round(located.getBasePrice() - buyNowPrice) : located.getBasePrice() - buyNowPrice); } item.setAmount(this.purchaseQuantity); @@ -211,8 +211,8 @@ public class GUIConfirmPurchase extends Gui { private void transferFunds(Player from, double amount) { double tax = Settings.TAX_ENABLED.getBoolean() ? (Settings.TAX_SALES_TAX_BUY_NOW_PERCENTAGE.getDouble() / 100) * amount : 0D; - AuctionAPI.getInstance().withdrawBalance(from, Settings.TAX_CHARGE_SALES_TAX_TO_BUYER.getBoolean() ? amount + tax : amount); - AuctionAPI.getInstance().depositBalance(Bukkit.getOfflinePlayer(this.auctionItem.getOwner()), Settings.TAX_CHARGE_SALES_TAX_TO_BUYER.getBoolean() ? amount : amount - tax); + AuctionAPI.getInstance().withdrawBalance(from, Settings.ROUND_ALL_PRICES.getBoolean() ? Math.round(Settings.TAX_CHARGE_SALES_TAX_TO_BUYER.getBoolean() ? amount + tax : amount) : Settings.TAX_CHARGE_SALES_TAX_TO_BUYER.getBoolean() ? amount + tax : amount); + AuctionAPI.getInstance().depositBalance(Bukkit.getOfflinePlayer(this.auctionItem.getOwner()), Settings.ROUND_ALL_PRICES.getBoolean() ? Math.round(Settings.TAX_CHARGE_SALES_TAX_TO_BUYER.getBoolean() ? amount : amount - tax) : Settings.TAX_CHARGE_SALES_TAX_TO_BUYER.getBoolean() ? amount : amount - tax); } private void sendMessages(GuiClickEvent e, AuctionedItem located, boolean overwritePrice, double price) {