diff --git a/src/main/java/com/shadebyte/auctionhouse/auction/DiscordMessageWrapper.java b/src/main/java/com/shadebyte/auctionhouse/auction/DiscordMessageWrapper.java index d0ff741..0e9c134 100644 --- a/src/main/java/com/shadebyte/auctionhouse/auction/DiscordMessageWrapper.java +++ b/src/main/java/com/shadebyte/auctionhouse/auction/DiscordMessageWrapper.java @@ -32,8 +32,8 @@ public class DiscordMessageWrapper { .name(name.substring(name.lastIndexOf(".")).replace("_", " ").replace(".", "")) .value(Core.getInstance().getConfig().getString(configLocation + ".data").replace("{seller}", Bukkit.getOfflinePlayer(UUID.fromString(auctionItem.getOwner())).getName()) .replace("{bid_start}", AuctionAPI.getInstance().friendlyNumber(auctionItem.getStartPrice())) - .replace("{bid_increment}", AuctionAPI.getInstance().friendlyNumber(auctionItem.getBidIncrement())) - .replace("{buy_now}", AuctionAPI.getInstance().friendlyNumber(auctionItem.getBuyNowPrice())) + .replace("{bid_increment}", (auctionItem.getBidIncrement() == 0) ? "0" : AuctionAPI.getInstance().friendlyNumber(auctionItem.getBidIncrement())) + .replace("{buy_now}", (auctionItem.getBuyNowPrice() == 0) ? "0" : AuctionAPI.getInstance().friendlyNumber(auctionItem.getBuyNowPrice())) .replace("{item_type}", auctionItem.getItem().getType().name()) .replace("{item_name}", getDisplayName()) .replace("{item_enchants}", getEnchantments()) diff --git a/src/main/java/com/shadebyte/auctionhouse/cmds/subcmds/SellCommand.java b/src/main/java/com/shadebyte/auctionhouse/cmds/subcmds/SellCommand.java index bf5d3dd..85e94d4 100644 --- a/src/main/java/com/shadebyte/auctionhouse/cmds/subcmds/SellCommand.java +++ b/src/main/java/com/shadebyte/auctionhouse/cmds/subcmds/SellCommand.java @@ -17,7 +17,10 @@ import org.bukkit.Material; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; /** * The current file has been created by Kiran Hart @@ -55,11 +58,11 @@ public class SellCommand extends SubCommand { int timeLimit; List times = new ArrayList<>(); - for (String nodes : Core.getInstance().getConfig().getStringList("time-limits")) { - if (p.hasPermission(nodes)) { - times.add(Core.getInstance().getConfig().getInt("time-limits." + nodes)); + Core.getInstance().getConfig().getConfigurationSection("auctiontime").getKeys(false).forEach(perm -> { + if (p.hasPermission("auctiontime." + String.valueOf(perm))) { + times.add(Core.getInstance().getConfig().getInt("auctiontime." + perm)); } - } + }); timeLimit = (times.size() <= 0) ? Core.getInstance().getConfig().getInt("settings.default-auction-time") : Collections.max(times); diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 7f500d5..5981d9a 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -15,7 +15,7 @@ settings: min-auction-increment: 1 owner-can-purchase-own: false owner-can-bid-own: false - use-bid-system: false + use-bid-system: false #WARNING : CHANGING THIS WHILE ITEMS ARE IN THE AUCTION HOUSE WILL CAUSE THEM TO BE LOST, END ALL AUCTIONS BEFORE CHANGING AND RESTARTING THE SERVER. auto-refresh-auction-page: true bid: increase-on-bid: true @@ -66,9 +66,9 @@ discord: data: "{item_lore}" #add permissions to allow more auction time. -time-limits: - auctionhouse.times.default: 600 - auctionhouse.times.rank1: 1200 +auctiontime: + default: 600 + rank1: 1200 #Blocked items that cannot be listed on the auction house #You must include the type data (the number of : ) usually it's 0