mirror of
https://github.com/kiranhart/Auction-House.git
synced 2025-02-26 21:21:21 +01:00
add isAllButAllDisabled() to AuctionItemCategory, and update profile to use ALL filter if everything else is disabled
Took 5 minutes
This commit is contained in:
parent
201f034006
commit
b3aa3d4e06
@ -42,6 +42,19 @@ public enum AuctionItemCategory {
|
||||
return whitelistAllowed;
|
||||
}
|
||||
|
||||
public static boolean isAllButAllDisabled() {
|
||||
boolean isDisabled = AuctionItemCategory.ALL.enabled;
|
||||
for (AuctionItemCategory value : AuctionItemCategory.values()) {
|
||||
if (value == ALL) continue;
|
||||
if (!value.enabled) {
|
||||
isDisabled = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return isDisabled;
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
@ -2,6 +2,8 @@ package ca.tweetzy.auctionhouse.managers;
|
||||
|
||||
import ca.tweetzy.auctionhouse.AuctionHouse;
|
||||
import ca.tweetzy.auctionhouse.auction.AuctionPlayer;
|
||||
import ca.tweetzy.auctionhouse.auction.enums.AuctionItemCategory;
|
||||
import ca.tweetzy.auctionhouse.auction.enums.AuctionSaleType;
|
||||
import ca.tweetzy.auctionhouse.settings.Settings;
|
||||
import lombok.Getter;
|
||||
import org.bukkit.Bukkit;
|
||||
@ -52,6 +54,14 @@ public class AuctionPlayerManager {
|
||||
}
|
||||
|
||||
found.setPlayer(player);
|
||||
|
||||
if (!Settings.ALLOW_USAGE_OF_BID_SYSTEM.getBoolean())
|
||||
found.setSelectedSaleType(AuctionSaleType.BOTH);
|
||||
|
||||
|
||||
if (AuctionItemCategory.isAllButAllDisabled())
|
||||
found.setSelectedFilter(AuctionItemCategory.ALL);
|
||||
|
||||
if (!Settings.DISABLE_PROFILE_UPDATE_MSG.getBoolean())
|
||||
AuctionHouse.getInstance().getLogger().info("Updating profile player reference for: " + player.getName());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user