added setting to disable usage of the buy now feature on biddable items.

This commit is contained in:
Kiran Hart 2021-04-24 15:52:56 -04:00
parent 6f495bc530
commit 1c2864e063
4 changed files with 7 additions and 4 deletions

View File

@ -6,7 +6,7 @@
<groupId>ca.tweetzy</groupId>
<artifactId>auctionhouse</artifactId>
<version>2.4.0</version>
<version>2.5.0</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

View File

@ -210,6 +210,8 @@ public class GUIAuctionHouse extends Gui {
break;
case RIGHT:
if (auctionItem.getBidStartPrice() >= Settings.MIN_AUCTION_START_PRICE.getDouble()) {
if (!Settings.ALLOW_USAGE_OF_BUY_NOW_SYSTEM.getBoolean()) return;
if (e.player.getUniqueId().equals(auctionItem.getOwner()) && !Settings.OWNER_CAN_PURCHASE_OWN_ITEM.getBoolean()) {
AuctionHouse.getInstance().getLocale().getMessage("general.cantbuyown").sendPrefixedMessage(e.player);
return;

View File

@ -71,14 +71,14 @@ public class GUIConfirmPurchase extends Gui {
AuctionHouse.getInstance().getAuctionItemManager().removeItem(located.getKey());
PlayerUtils.giveItem(e.player, AuctionAPI.getInstance().deserializeItem(located.getRawItem()));
AuctionHouse.getInstance().getLocale().getMessage("pricing.moneyremove").processPlaceholder("price", String.format("%,.2f", located.getCurrentPrice())).sendPrefixedMessage(e.player);
AuctionHouse.getInstance().getLocale().getMessage("pricing.moneyremove").processPlaceholder("price", String.format("%,.2f", located.getBasePrice())).sendPrefixedMessage(e.player);
if (Bukkit.getOfflinePlayer(located.getOwner()).isOnline()) {
AuctionHouse.getInstance().getLocale().getMessage("auction.itemsold")
.processPlaceholder("item", WordUtils.capitalizeFully(AuctionAPI.getInstance().deserializeItem(located.getRawItem()).getType().name().replace("_", " ")))
.processPlaceholder("price", String.format("%,.2f", located.getCurrentPrice()))
.processPlaceholder("price", String.format("%,.2f", located.getBasePrice()))
.sendPrefixedMessage(Bukkit.getOfflinePlayer(located.getOwner()).getPlayer());
AuctionHouse.getInstance().getLocale().getMessage("pricing.moneyadd").processPlaceholder("price", String.format("%,.2f", located.getCurrentPrice())).sendPrefixedMessage(Bukkit.getOfflinePlayer(located.getOwner()).getPlayer());
AuctionHouse.getInstance().getLocale().getMessage("pricing.moneyadd").processPlaceholder("price", String.format("%,.2f", located.getBasePrice())).sendPrefixedMessage(Bukkit.getOfflinePlayer(located.getOwner()).getPlayer());
}
e.manager.showGUI(e.player, new GUIAuctionHouse(this.auctionPlayer));

View File

@ -46,6 +46,7 @@ public class Settings {
public static final ConfigSetting USE_ASYNC_GUI_REFRESH = new ConfigSetting(config, "auction setting.use async gui refresh", false, "Should the gui refresh be done using asynchronous tasks?", "This may reduce lag that can be caused, but", "items may have a flickering effect inside the gui.");
public static final ConfigSetting SEND_REMOVED_ITEM_BACK_TO_PLAYER = new ConfigSetting(config, "auction setting.send removed item back to player", true, "Should items removed by staff from the auction house be sent back to the player?");
public static final ConfigSetting ALLOW_USAGE_OF_BID_SYSTEM = new ConfigSetting(config, "auction setting.allow bid system usage", true, "Should players be allowed to use the bid option cmd params?");
public static final ConfigSetting ALLOW_USAGE_OF_BUY_NOW_SYSTEM = new ConfigSetting(config, "auction setting.allow buy now system usage", true, "Should players be allowed to use the right-click buy now feature on biddable items?");
public static final ConfigSetting AUTO_SAVE_ENABLED = new ConfigSetting(config, "auction setting.auto save.enabled", true, "Should the auto save task be enabled?");
public static final ConfigSetting AUTO_SAVE_EVERY = new ConfigSetting(config, "auction setting.auto save.time", 900, "How often should the auto save active? (in seconds. Ex. 900 = 15min)");