add FILTER_WHITELIST_USES_DURABILITY

Took 3 minutes
This commit is contained in:
Kiran Hart 2022-10-03 20:58:37 -04:00
parent 6ccbcc9b2d
commit 023107b898
No known key found for this signature in database
GPG Key ID: 5F36C7BC79D3EBC3
2 changed files with 7 additions and 2 deletions

View File

@ -160,8 +160,12 @@ public class GUIAuctionHouse extends AbstractPlaceholderGui {
private boolean checkFilterCriteria(AuctionedItem auctionItem, AuctionItemCategory category) {
// option for only whitelisted shit
if (Settings.FILTER_ONLY_USES_WHITELIST.getBoolean())
return AuctionHouse.getInstance().getFilterManager().getFilterWhitelist(category).stream().anyMatch(item -> item.isSimilar(auctionItem.getItem()));
if (Settings.FILTER_ONLY_USES_WHITELIST.getBoolean()) {
if (!Settings.FILTER_WHITELIST_USES_DURABILITY.getBoolean())
return AuctionHouse.getInstance().getFilterManager().getFilterWhitelist(category).stream().anyMatch(item -> item.isSimilar(auctionItem.getItem()));
else
return AuctionHouse.getInstance().getFilterManager().getFilterWhitelist(category).stream().anyMatch(item -> item.getType() == auctionItem.getItem().getType() && item.getDurability() == auctionItem.getItem().getDurability());
}
return auctionItem.getCategory() == category ||
AuctionHouse.getInstance().getFilterManager().getFilterWhitelist(category).stream().anyMatch(item -> item.isSimilar(auctionItem.getItem()));

View File

@ -129,6 +129,7 @@ public class Settings {
public static final ConfigSetting USE_SEPARATE_FILTER_MENU = new ConfigSetting(config, "auction setting.use separate filter menu", false, "If true, rather than using a single filter item inside the auction menu", "it will open an entirely new menu to select the filter");
public static final ConfigSetting FILTER_ONLY_USES_WHITELIST = new ConfigSetting(config, "auction setting.filter only uses whitelist", false, "If true, auction house will ignore default filters, and only filter by the items added to the category whitelists");
public static final ConfigSetting FILTER_WHITELIST_USES_DURABILITY = new ConfigSetting(config, "auction setting.filter whitelist uses durability", false, "If true, the filter will look at material names and durability values for comparisons only");
public static final ConfigSetting SELL_MENU_REQUIRES_USER_TO_HOLD_ITEM = new ConfigSetting(config, "auction setting.require user to hold item when using sell menu", false, "If enabled, when running just /ah sell, the user will need to hold the item in their hand, otherwise they just add it in the gui.");
public static final ConfigSetting OPEN_MAIN_AUCTION_HOUSE_AFTER_MENU_LIST = new ConfigSetting(config, "auction setting.open main auction house after listing using menu", true, "Should the main auction house be opened after the user lists an item using the sell menu?");
public static final ConfigSetting SELL_MENU_CLOSE_SENDS_TO_LISTING = new ConfigSetting(config, "auction setting.sell menu close sends to listings", true, "If true, when the player clicks the close button within the sell menu, it will send them to the main auction house");