From bd3f0329d0e391bd84b5f9e3ff207d9dd9815853 Mon Sep 17 00:00:00 2001 From: Yasin Date: Mon, 9 Oct 2023 12:58:02 +0200 Subject: new pr because fixing merge conflict would take too long --- .../me/xmrvizzy/skyblocker/config/ConfigUtils.java | 25 - .../skyblocker/config/SkyblockerConfig.java | 787 --------------------- .../skyblocker/config/SkyblockerConfigManager.java | 86 --- .../config/categories/DiscordRPCCategory.java | 49 -- .../config/categories/DungeonsCategory.java | 316 --------- .../config/categories/DwarvenMinesCategory.java | 94 --- .../config/categories/GeneralCategory.java | 508 ------------- .../config/categories/LocationsCategory.java | 80 --- .../config/categories/MessageFilterCategory.java | 98 --- .../config/categories/QuickNavigationCategory.java | 605 ---------------- .../config/categories/SlayersCategory.java | 116 --- .../config/controllers/EnumDropdownController.java | 93 --- .../controllers/EnumDropdownControllerBuilder.java | 27 - .../EnumDropdownControllerBuilderImpl.java | 27 - .../controllers/EnumDropdownControllerElement.java | 26 - 15 files changed, 2937 deletions(-) delete mode 100644 src/main/java/me/xmrvizzy/skyblocker/config/ConfigUtils.java delete mode 100644 src/main/java/me/xmrvizzy/skyblocker/config/SkyblockerConfig.java delete mode 100644 src/main/java/me/xmrvizzy/skyblocker/config/SkyblockerConfigManager.java delete mode 100644 src/main/java/me/xmrvizzy/skyblocker/config/categories/DiscordRPCCategory.java delete mode 100644 src/main/java/me/xmrvizzy/skyblocker/config/categories/DungeonsCategory.java delete mode 100644 src/main/java/me/xmrvizzy/skyblocker/config/categories/DwarvenMinesCategory.java delete mode 100644 src/main/java/me/xmrvizzy/skyblocker/config/categories/GeneralCategory.java delete mode 100644 src/main/java/me/xmrvizzy/skyblocker/config/categories/LocationsCategory.java delete mode 100644 src/main/java/me/xmrvizzy/skyblocker/config/categories/MessageFilterCategory.java delete mode 100644 src/main/java/me/xmrvizzy/skyblocker/config/categories/QuickNavigationCategory.java delete mode 100644 src/main/java/me/xmrvizzy/skyblocker/config/categories/SlayersCategory.java delete mode 100644 src/main/java/me/xmrvizzy/skyblocker/config/controllers/EnumDropdownController.java delete mode 100644 src/main/java/me/xmrvizzy/skyblocker/config/controllers/EnumDropdownControllerBuilder.java delete mode 100644 src/main/java/me/xmrvizzy/skyblocker/config/controllers/EnumDropdownControllerBuilderImpl.java delete mode 100644 src/main/java/me/xmrvizzy/skyblocker/config/controllers/EnumDropdownControllerElement.java (limited to 'src/main/java/me/xmrvizzy/skyblocker/config') diff --git a/src/main/java/me/xmrvizzy/skyblocker/config/ConfigUtils.java b/src/main/java/me/xmrvizzy/skyblocker/config/ConfigUtils.java deleted file mode 100644 index 552ed091..00000000 --- a/src/main/java/me/xmrvizzy/skyblocker/config/ConfigUtils.java +++ /dev/null @@ -1,25 +0,0 @@ -package me.xmrvizzy.skyblocker.config; - -import dev.isxander.yacl3.api.Option; -import dev.isxander.yacl3.api.controller.BooleanControllerBuilder; -import dev.isxander.yacl3.api.controller.EnumControllerBuilder; -import dev.isxander.yacl3.api.controller.ValueFormatter; -import net.minecraft.text.Text; -import net.minecraft.util.Formatting; -import org.apache.commons.lang3.StringUtils; - -import java.util.function.Function; - -public class ConfigUtils { - public static final Function FORMATTING_TO_STRING = formatting -> StringUtils.capitalize(formatting.getName().replaceAll("_", " ")); - public static final ValueFormatter FLOAT_TWO_FORMATTER = value -> Text.literal(String.format("%,.2f", value).replaceAll("[\u00a0\u202F]", " ")); - - public static BooleanControllerBuilder createBooleanController(Option opt) { - return BooleanControllerBuilder.create(opt).yesNoFormatter().coloured(true); - } - - @SuppressWarnings("unchecked") - public static > EnumControllerBuilder createEnumCyclingListController(Option opt) { - return EnumControllerBuilder.create(opt).enumClass((Class) opt.binding().defaultValue().getClass()); - } -} diff --git a/src/main/java/me/xmrvizzy/skyblocker/config/SkyblockerConfig.java b/src/main/java/me/xmrvizzy/skyblocker/config/SkyblockerConfig.java deleted file mode 100644 index 8e014124..00000000 --- a/src/main/java/me/xmrvizzy/skyblocker/config/SkyblockerConfig.java +++ /dev/null @@ -1,787 +0,0 @@ -package me.xmrvizzy.skyblocker.config; - -import dev.isxander.yacl3.config.v2.api.SerialEntry; -import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; -import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; -import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; -import me.xmrvizzy.skyblocker.skyblock.item.CustomArmorTrims; -import me.xmrvizzy.skyblocker.utils.chat.ChatFilterResult; -import net.minecraft.client.resource.language.I18n; -import net.minecraft.text.Text; -import net.minecraft.util.Formatting; - -import java.util.ArrayList; -import java.util.List; - -public class SkyblockerConfig { - @SerialEntry - public int version = 1; - - @SerialEntry - public General general = new General(); - - @SerialEntry - public Locations locations = new Locations(); - - @SerialEntry - public Slayer slayer = new Slayer(); - - @SerialEntry - public QuickNav quickNav = new QuickNav(); - - @SerialEntry - public Messages messages = new Messages(); - - @SerialEntry - public RichPresence richPresence = new RichPresence(); - - public static class QuickNav { - @SerialEntry - public boolean enableQuickNav = true; - - @SerialEntry - public QuickNavItem button1 = new QuickNavItem(true, new ItemData("diamond_sword"), "Your Skills", "/skills"); - - @SerialEntry - public QuickNavItem button2 = new QuickNavItem(true, new ItemData("painting"), "Collections", "/collection"); - - /* REGEX Explanation - * "Pets" : simple match on letters - * "(?: \\(\\d+\\/\\d+\\))?" : optional match on the non-capturing group for the page in the format " ($number/$number)" - */ - @SerialEntry - public QuickNavItem button3 = new QuickNavItem(true, new ItemData("bone"), "Pets(:? \\(\\d+\\/\\d+\\))?", "/pets"); - - /* REGEX Explanation - * "Wardrobe" : simple match on letters - * " \\([12]\\/2\\)" : match on the page either " (1/2)" or " (2/2)" - */ - @SerialEntry - public QuickNavItem button4 = new QuickNavItem(true, - new ItemData("leather_chestplate", 1, "tag:{display:{color:8991416}}"), "Wardrobe \\([12]/2\\)", - "/wardrobe"); - - @SerialEntry - public QuickNavItem button5 = new QuickNavItem(true, new ItemData("player_head", 1, - "tag:{SkullOwner:{Id:[I;-2081424676,-57521078,-2073572414,158072763],Properties:{textures:[{Value:\"ewogICJ0aW1lc3RhbXAiIDogMTU5MTMxMDU4NTYwOSwKICAicHJvZmlsZUlkIiA6ICI0MWQzYWJjMmQ3NDk0MDBjOTA5MGQ1NDM0ZDAzODMxYiIsCiAgInByb2ZpbGVOYW1lIiA6ICJNZWdha2xvb24iLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvODBhMDc3ZTI0OGQxNDI3NzJlYTgwMDg2NGY4YzU3OGI5ZDM2ODg1YjI5ZGFmODM2YjY0YTcwNjg4MmI2ZWMxMCIKICAgIH0KICB9Cn0=\"}]}}}"), - "Sack of Sacks", "/sacks"); - - /* REGEX Explanation - * "(?:Rift )?" : optional match on the non-capturing group "Rift " - * "Storage" : simple match on letters - * "(?: \\([12]\\/2\\))?" : optional match on the non-capturing group " (1/2)" or " (2/2)" - */ - @SerialEntry - public QuickNavItem button6 = new QuickNavItem(true, new ItemData("ender_chest"), - "(?:Rift )?Storage(?: \\(1/2\\))?", "/storage"); - - @SerialEntry - public QuickNavItem button7 = new QuickNavItem(true, new ItemData("player_head", 1, - "tag:{SkullOwner:{Id:[I;-300151517,-631415889,-1193921967,-1821784279],Properties:{textures:[{Value:\"e3RleHR1cmVzOntTS0lOOnt1cmw6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDdjYzY2ODc0MjNkMDU3MGQ1NTZhYzUzZTA2NzZjYjU2M2JiZGQ5NzE3Y2Q4MjY5YmRlYmVkNmY2ZDRlN2JmOCJ9fX0=\"}]}}}"), - "none", "/hub"); - - @SerialEntry - public QuickNavItem button8 = new QuickNavItem(true, new ItemData("player_head", 1, - "tag:{SkullOwner:{Id:[I;1605800870,415127827,-1236127084,15358548],Properties:{textures:[{Value:\"e3RleHR1cmVzOntTS0lOOnt1cmw6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzg5MWQ1YjI3M2ZmMGJjNTBjOTYwYjJjZDg2ZWVmMWM0MGExYjk0MDMyYWU3MWU3NTQ3NWE1NjhhODI1NzQyMSJ9fX0=\"}]}}}"), - "none", "/warp dungeon_hub"); - - @SerialEntry - public QuickNavItem button9 = new QuickNavItem(true, new ItemData("player_head", 1, - "tag:{SkullOwner:{Id:[I;-562285948,532499670,-1705302742,775653035],Properties:{textures:[{Value:\"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjVkZjU1NTkyNjQzMGQ1ZDc1YWRlZDIxZGQ5NjE5Yjc2YzViN2NhMmM3ZjU0MDE0NDA1MjNkNTNhOGJjZmFhYiJ9fX0=\"}]}}}"), - "Visit prtl", "/visit prtl"); - - @SerialEntry - public QuickNavItem button10 = new QuickNavItem(true, new ItemData("enchanting_table"), "Enchant Item", - "/etable"); - - @SerialEntry - public QuickNavItem button11 = new QuickNavItem(true, new ItemData("anvil"), "Anvil", "/anvil"); - - @SerialEntry - public QuickNavItem button12 = new QuickNavItem(true, new ItemData("crafting_table"), "Craft Item", "/craft"); - } - - public static class QuickNavItem { - public QuickNavItem(Boolean render, ItemData itemData, String uiTitle, String clickEvent) { - this.render = render; - this.item = itemData; - this.clickEvent = clickEvent; - this.uiTitle = uiTitle; - } - - @SerialEntry - public Boolean render; - - @SerialEntry - public ItemData item; - - @SerialEntry - public String uiTitle; - - @SerialEntry - public String clickEvent; - } - - public static class ItemData { - public ItemData(String itemName, int count, String nbt) { - this.itemName = itemName; - this.count = count; - this.nbt = nbt; - } - - public ItemData(String itemName) { - this.itemName = itemName; - this.count = 1; - this.nbt = ""; - } - - @SerialEntry - public String itemName; - - @SerialEntry - public int count; - - @SerialEntry - public String nbt; - } - - public static class General { - @SerialEntry - public boolean acceptReparty = true; - - @SerialEntry - public boolean backpackPreviewWithoutShift = false; - - @SerialEntry - public boolean compactorDeletorPreview = true; - - @SerialEntry - public boolean hideEmptyTooltips = true; - - @SerialEntry - public boolean hideStatusEffectOverlay = false; - - @SerialEntry - public TabHudConf tabHud = new TabHudConf(); - - @SerialEntry - public Bars bars = new Bars(); - - @SerialEntry - public Experiments experiments = new Experiments(); - - @SerialEntry - public Fishing fishing = new Fishing(); - - @SerialEntry - public FairySouls fairySouls = new FairySouls(); - - @SerialEntry - public ItemCooldown itemCooldown = new ItemCooldown(); - - @SerialEntry - public Shortcuts shortcuts = new Shortcuts(); - - @SerialEntry - public QuiverWarning quiverWarning = new QuiverWarning(); - - @SerialEntry - public ItemList itemList = new ItemList(); - - @SerialEntry - public ItemTooltip itemTooltip = new ItemTooltip(); - - @SerialEntry - public ItemInfoDisplay itemInfoDisplay = new ItemInfoDisplay(); - - @SerialEntry - public SpecialEffects specialEffects = new SpecialEffects(); - - @SerialEntry - public Hitbox hitbox = new Hitbox(); - - @SerialEntry - public TitleContainer titleContainer = new TitleContainer(); - - @SerialEntry - public TeleportOverlay teleportOverlay = new TeleportOverlay(); - - @SerialEntry - public List lockedSlots = new ArrayList<>(); - - @SerialEntry - public ObjectOpenHashSet protectedItems = new ObjectOpenHashSet<>(); - - @SerialEntry - public Object2ObjectOpenHashMap customItemNames = new Object2ObjectOpenHashMap<>(); - - @SerialEntry - public Object2IntOpenHashMap customDyeColors = new Object2IntOpenHashMap<>(); - - @SerialEntry - public Object2ObjectOpenHashMap customArmorTrims = new Object2ObjectOpenHashMap<>(); - } - - public static class TabHudConf { - @SerialEntry - public boolean tabHudEnabled = true; - - @SerialEntry - public int tabHudScale = 100; - - @SerialEntry - public boolean plainPlayerNames = false; - - @SerialEntry - public NameSorting nameSorting = NameSorting.DEFAULT; - } - - public enum NameSorting { - DEFAULT, ALPHABETICAL; - - @Override - public String toString() { - return switch (this) { - case DEFAULT -> "Default"; - case ALPHABETICAL -> "Alphabetical"; - }; - } - } - - public static class Bars { - @SerialEntry - public boolean enableBars = true; - - @SerialEntry - public BarPositions barPositions = new BarPositions(); - } - - public static class BarPositions { - @SerialEntry - public BarPosition healthBarPosition = BarPosition.LAYER1; - - @SerialEntry - public BarPosition manaBarPosition = BarPosition.LAYER1; - - @SerialEntry - public BarPosition defenceBarPosition = BarPosition.LAYER1; - - @SerialEntry - public BarPosition experienceBarPosition = BarPosition.LAYER1; - - } - - public enum BarPosition { - LAYER1, LAYER2, RIGHT, NONE; - - @Override - public String toString() { - return I18n.translate("text.autoconfig.skyblocker.option.general.bars.barpositions." + name()); - } - - public int toInt() { - return switch (this) { - case LAYER1 -> 0; - case LAYER2 -> 1; - case RIGHT -> 2; - case NONE -> -1; - }; - } - } - - public static class Experiments { - @SerialEntry - public boolean enableChronomatronSolver = true; - - @SerialEntry - public boolean enableSuperpairsSolver = true; - - @SerialEntry - public boolean enableUltrasequencerSolver = true; - } - - public static class Fishing { - @SerialEntry - public boolean enableFishingHelper = true; - } - - public static class FairySouls { - @SerialEntry - public boolean enableFairySoulsHelper = false; - - @SerialEntry - public boolean highlightFoundSouls = true; - - @SerialEntry - public boolean highlightOnlyNearbySouls = false; - } - - public static class ItemCooldown { - @SerialEntry - public boolean enableItemCooldowns = true; - } - - public static class Shortcuts { - @SerialEntry - public boolean enableShortcuts = true; - - @SerialEntry - public boolean enableCommandShortcuts = true; - - @SerialEntry - public boolean enableCommandArgShortcuts = true; - } - - public static class QuiverWarning { - @SerialEntry - public boolean enableQuiverWarning = true; - - @SerialEntry - public boolean enableQuiverWarningInDungeons = true; - - @SerialEntry - public boolean enableQuiverWarningAfterDungeon = true; - } - - public static class Hitbox { - @SerialEntry - public boolean oldFarmlandHitbox = true; - - @SerialEntry - public boolean oldLeverHitbox = false; - } - - public static class TitleContainer { - @SerialEntry - public float titleContainerScale = 100; - - @SerialEntry - public int x = 540; - - @SerialEntry - public int y = 10; - - @SerialEntry - public Direction direction = Direction.HORIZONTAL; - - @SerialEntry - public Alignment alignment = Alignment.MIDDLE; - } - - public static class TeleportOverlay { - @SerialEntry - public boolean enableTeleportOverlays = true; - - @SerialEntry - public boolean enableWeirdTransmission = true; - - @SerialEntry - public boolean enableInstantTransmission = true; - - @SerialEntry - public boolean enableEtherTransmission = true; - - @SerialEntry - public boolean enableSinrecallTransmission = true; - - @SerialEntry - public boolean enableWitherImpact = true; - } - - public enum Direction { - HORIZONTAL, VERTICAL; - - @Override - public String toString() { - return switch (this) { - case HORIZONTAL -> "Horizontal"; - case VERTICAL -> "Vertical"; - }; - } - } - - public enum Alignment { - LEFT, RIGHT, MIDDLE; - - @Override - public String toString() { - return switch (this) { - case LEFT -> "Left"; - case RIGHT -> "Right"; - case MIDDLE -> "Middle"; - }; - } - } - - public static class RichPresence { - @SerialEntry - public boolean enableRichPresence = false; - - @SerialEntry - public Info info = Info.LOCATION; - - @SerialEntry - public boolean cycleMode = false; - - @SerialEntry - public String customMessage = "Playing Skyblock"; - } - - public static class ItemList { - @SerialEntry - public boolean enableItemList = true; - } - - public enum Average { - ONE_DAY, THREE_DAY, BOTH; - - @Override - public String toString() { - return I18n.translate("text.autoconfig.skyblocker.option.general.itemTooltip.avg." + name()); - } - } - - public static class ItemTooltip { - @SerialEntry - public boolean enableNPCPrice = true; - - @SerialEntry - public boolean enableMotesPrice = true; - - @SerialEntry - public boolean enableAvgBIN = true; - - @SerialEntry - public Average avg = Average.THREE_DAY; - - @SerialEntry - public boolean enableLowestBIN = true; - - @SerialEntry - public boolean enableBazaarPrice = true; - - @SerialEntry - public boolean enableMuseumDate = true; - } - - public static class ItemInfoDisplay { - @SerialEntry - public boolean attributeShardInfo = true; - - @SerialEntry - public boolean itemRarityBackgrounds = false; - - @SerialEntry - public float itemRarityBackgroundsOpacity = 1f; - } - - public static class SpecialEffects { - @SerialEntry - public boolean rareDungeonDropEffects = true; - } - - public static class Locations { - @SerialEntry - public Barn barn = new Barn(); - - @SerialEntry - public Dungeons dungeons = new Dungeons(); - - @SerialEntry - public DwarvenMines dwarvenMines = new DwarvenMines(); - - @SerialEntry - public Rift rift = new Rift(); - - @SerialEntry - public SpidersDen spidersDen = new SpidersDen(); - } - - public static class Dungeons { - @SerialEntry - public SecretWaypoints secretWaypoints = new SecretWaypoints(); - - @SerialEntry - public DungeonChestProfit dungeonChestProfit = new DungeonChestProfit(); - - @SerialEntry - public boolean croesusHelper = true; - - @SerialEntry - public boolean enableMap = true; - - @SerialEntry - public float mapScaling = 1f; - - @SerialEntry - public int mapX = 2; - - @SerialEntry - public int mapY = 2; - - @SerialEntry - public boolean starredMobGlow = true; - - @SerialEntry - public boolean solveThreeWeirdos = true; - - @SerialEntry - public boolean blazesolver = true; - - @SerialEntry - public boolean solveTrivia = true; - - @SerialEntry - public boolean solveTicTacToe = true; - - @SerialEntry - public LividColor lividColor = new LividColor(); - - @SerialEntry - public Terminals terminals = new Terminals(); - } - - public static class SecretWaypoints { - @SerialEntry - public boolean enableSecretWaypoints = true; - - @SerialEntry - public boolean noInitSecretWaypoints = false; - - @SerialEntry - public boolean enableEntranceWaypoints = true; - - @SerialEntry - public boolean enableSuperboomWaypoints = true; - - @SerialEntry - public boolean enableChestWaypoints = true; - - @SerialEntry - public boolean enableItemWaypoints = true; - - @SerialEntry - public boolean enableBatWaypoints = true; - - @SerialEntry - public boolean enableWitherWaypoints = true; - - @SerialEntry - public boolean enableLeverWaypoints = true; - - @SerialEntry - public boolean enableFairySoulWaypoints = true; - - @SerialEntry - public boolean enableStonkWaypoints = true; - - @SerialEntry - public boolean enableDefaultWaypoints = true; - } - - public static class DungeonChestProfit { - @SerialEntry - public boolean enableProfitCalculator = true; - - @SerialEntry - public boolean includeKismet = false; - - @SerialEntry - public boolean includeEssence = true; - - @SerialEntry - public int neutralThreshold = 1000; - - @SerialEntry - public Formatting neutralColor = Formatting.DARK_GRAY; - - @SerialEntry - public Formatting profitColor = Formatting.DARK_GREEN; - - @SerialEntry - public Formatting lossColor = Formatting.RED; - - @SerialEntry - public Formatting incompleteColor = Formatting.BLUE; - - } - - public static class LividColor { - @SerialEntry - public boolean enableLividColor = true; - - @SerialEntry - public String lividColorText = "The livid color is [color]"; - } - - public static class Terminals { - @SerialEntry - public boolean solveColor = true; - - @SerialEntry - public boolean solveOrder = true; - - @SerialEntry - public boolean solveStartsWith = true; - } - - public static class DwarvenMines { - @SerialEntry - public boolean enableDrillFuel = true; - - @SerialEntry - public boolean solveFetchur = true; - - @SerialEntry - public boolean solvePuzzler = true; - - @SerialEntry - public DwarvenHud dwarvenHud = new DwarvenHud(); - } - - public static class DwarvenHud { - @SerialEntry - public boolean enabled = true; - - @SerialEntry - public DwarvenHudStyle style = DwarvenHudStyle.SIMPLE; - - @SerialEntry - public boolean enableBackground = true; - - @SerialEntry - public int x = 10; - - @SerialEntry - public int y = 10; - } - - public enum DwarvenHudStyle { - SIMPLE, FANCY, CLASSIC; - - @Override - public String toString() { - return switch (this) { - case SIMPLE -> "Simple"; - case FANCY -> "Fancy"; - case CLASSIC -> "Classic"; - }; - } - } - - public static class Barn { - @SerialEntry - public boolean solveHungryHiker = true; - - @SerialEntry - public boolean solveTreasureHunter = true; - } - - public static class Rift { - @SerialEntry - public boolean mirrorverseWaypoints = true; - - @SerialEntry - public int mcGrubberStacks = 0; - } - - public static class SpidersDen { - @SerialEntry - public Relics relics = new Relics(); - } - - public static class Relics { - @SerialEntry - public boolean enableRelicsHelper = false; - - @SerialEntry - public boolean highlightFoundRelics = true; - } - - public static class Slayer { - @SerialEntry - public VampireSlayer vampireSlayer = new VampireSlayer(); - } - - public static class VampireSlayer { - @SerialEntry - public boolean enableEffigyWaypoints = true; - - @SerialEntry - public boolean compactEffigyWaypoints; - - @SerialEntry - public int effigyUpdateFrequency = 5; - - @SerialEntry - public boolean enableHolyIceIndicator = true; - - @SerialEntry - public int holyIceIndicatorTickDelay = 10; - - @SerialEntry - public int holyIceUpdateFrequency = 5; - - @SerialEntry - public boolean enableHealingMelonIndicator = true; - - @SerialEntry - public float healingMelonHealthThreshold = 4f; - - @SerialEntry - public boolean enableSteakStakeIndicator = true; - - @SerialEntry - public int steakStakeUpdateFrequency = 5; - - @SerialEntry - public boolean enableManiaIndicator = true; - - @SerialEntry - public int maniaUpdateFrequency = 5; - } - - public static class Messages { - @SerialEntry - public ChatFilterResult hideAbility = ChatFilterResult.PASS; - - @SerialEntry - public ChatFilterResult hideHeal = ChatFilterResult.PASS; - - @SerialEntry - public ChatFilterResult hideAOTE = ChatFilterResult.PASS; - - @SerialEntry - public ChatFilterResult hideImplosion = ChatFilterResult.PASS; - - @SerialEntry - public ChatFilterResult hideMoltenWave = ChatFilterResult.PASS; - - @SerialEntry - public ChatFilterResult hideAds = ChatFilterResult.PASS; - - @SerialEntry - public ChatFilterResult hideTeleportPad = ChatFilterResult.PASS; - - @SerialEntry - public ChatFilterResult hideCombo = ChatFilterResult.PASS; - - @SerialEntry - public ChatFilterResult hideAutopet = ChatFilterResult.PASS; - - @SerialEntry - public ChatFilterResult hideShowOff = ChatFilterResult.PASS; - - @SerialEntry - public boolean hideMana = false; - } - - public enum Info { - PURSE, BITS, LOCATION; - - @Override - public String toString() { - return I18n.translate("text.autoconfig.skyblocker.option.richPresence.info." + name()); - } - } -} diff --git a/src/main/java/me/xmrvizzy/skyblocker/config/SkyblockerConfigManager.java b/src/main/java/me/xmrvizzy/skyblocker/config/SkyblockerConfigManager.java deleted file mode 100644 index eb756641..00000000 --- a/src/main/java/me/xmrvizzy/skyblocker/config/SkyblockerConfigManager.java +++ /dev/null @@ -1,86 +0,0 @@ -package me.xmrvizzy.skyblocker.config; - -import java.lang.StackWalker.Option; -import java.nio.file.Path; - -import com.google.gson.FieldNamingPolicy; -import com.mojang.brigadier.builder.LiteralArgumentBuilder; - -import dev.isxander.yacl3.api.YetAnotherConfigLib; -import dev.isxander.yacl3.config.v2.api.ConfigClassHandler; -import dev.isxander.yacl3.config.v2.api.serializer.GsonConfigSerializerBuilder; -import me.xmrvizzy.skyblocker.SkyblockerMod; -import me.xmrvizzy.skyblocker.config.categories.DiscordRPCCategory; -import me.xmrvizzy.skyblocker.config.categories.DungeonsCategory; -import me.xmrvizzy.skyblocker.config.categories.DwarvenMinesCategory; -import me.xmrvizzy.skyblocker.config.categories.GeneralCategory; -import me.xmrvizzy.skyblocker.config.categories.LocationsCategory; -import me.xmrvizzy.skyblocker.config.categories.MessageFilterCategory; -import me.xmrvizzy.skyblocker.config.categories.QuickNavigationCategory; -import me.xmrvizzy.skyblocker.config.categories.SlayersCategory; -import me.xmrvizzy.skyblocker.utils.scheduler.Scheduler; -import net.fabricmc.fabric.api.client.command.v2.ClientCommandManager; -import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; -import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; -import net.fabricmc.loader.api.FabricLoader; -import net.minecraft.client.gui.screen.Screen; -import net.minecraft.text.Text; -import net.minecraft.util.Identifier; - -public class SkyblockerConfigManager { - private static final Path PATH = FabricLoader.getInstance().getConfigDir().resolve("skyblocker.json"); - private static final ConfigClassHandler HANDLER = ConfigClassHandler.createBuilder(SkyblockerConfig.class) - .serializer(config -> GsonConfigSerializerBuilder.create(config) - .setPath(PATH) - .setJson5(false) - .appendGsonBuilder(builder -> builder - .setFieldNamingPolicy(FieldNamingPolicy.IDENTITY) - .registerTypeHierarchyAdapter(Identifier.class, new Identifier.Serializer())) - .build()) - .build(); - - public static SkyblockerConfig get() { - return HANDLER.instance(); - } - - /** - * This method is caller sensitive and can only be called by the mod initializer, - * this is enforced. - */ - public static void init() { - if (StackWalker.getInstance(Option.RETAIN_CLASS_REFERENCE).getCallerClass() != SkyblockerMod.class) { - throw new RuntimeException("Skyblocker: Called config init from an illegal place!"); - } - - HANDLER.load(); - ClientCommandRegistrationCallback.EVENT.register(((dispatcher, registryAccess) -> dispatcher.register(ClientCommandManager.literal(SkyblockerMod.NAMESPACE).then(optionsLiteral("config")).then(optionsLiteral("options"))))); - } - - public static void save() { - HANDLER.save(); - } - - public static Screen createGUI(Screen parent) { - return YetAnotherConfigLib.create(HANDLER, (defaults, config, builder) -> builder - .title(Text.translatable("text.autoconfig.skyblocker.title")) - .category(GeneralCategory.create(defaults, config)) - .category(DungeonsCategory.create(defaults, config)) - .category(DwarvenMinesCategory.create(defaults, config)) - .category(LocationsCategory.create(defaults, config)) - .category(SlayersCategory.create(defaults, config)) - .category(QuickNavigationCategory.create(defaults, config)) - .category(MessageFilterCategory.create(defaults, config)) - .category(DiscordRPCCategory.create(defaults, config))).generateScreen(parent); - } - - /** - * Registers an options command with the given name. Used for registering both options and config as valid commands. - * - * @param name the name of the command node - * @return the command builder - */ - private static LiteralArgumentBuilder optionsLiteral(String name) { - // Don't immediately open the next screen as it will be closed by ChatScreen right after this command is executed - return ClientCommandManager.literal(name).executes(Scheduler.queueOpenScreenCommand(() -> createGUI(null))); - } -} diff --git a/src/main/java/me/xmrvizzy/skyblocker/config/categories/DiscordRPCCategory.java b/src/main/java/me/xmrvizzy/skyblocker/config/categories/DiscordRPCCategory.java deleted file mode 100644 index 1e35bc32..00000000 --- a/src/main/java/me/xmrvizzy/skyblocker/config/categories/DiscordRPCCategory.java +++ /dev/null @@ -1,49 +0,0 @@ -package me.xmrvizzy.skyblocker.config.categories; - -import dev.isxander.yacl3.api.ConfigCategory; -import dev.isxander.yacl3.api.Option; -import dev.isxander.yacl3.api.OptionDescription; -import dev.isxander.yacl3.api.controller.StringControllerBuilder; -import me.xmrvizzy.skyblocker.config.SkyblockerConfig; -import me.xmrvizzy.skyblocker.config.ConfigUtils; -import net.minecraft.text.Text; - -public class DiscordRPCCategory { - - public static ConfigCategory create(SkyblockerConfig defaults, SkyblockerConfig config) { - return ConfigCategory.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.category.richPresence")) - - //Uncategorized Options - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.richPresence.enableRichPresence")) - .binding(defaults.richPresence.enableRichPresence, - () -> config.richPresence.enableRichPresence, - newValue -> config.richPresence.enableRichPresence = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.richPresence.info")) - .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.richPresence.info.@Tooltip"))) - .binding(defaults.richPresence.info, - () -> config.richPresence.info, - newValue -> config.richPresence.info = newValue) - .controller(ConfigUtils::createEnumCyclingListController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.richPresence.cycleMode")) - .binding(defaults.richPresence.cycleMode, - () -> config.richPresence.cycleMode, - newValue -> config.richPresence.cycleMode = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.richPresence.customMessage")) - .binding(defaults.richPresence.customMessage, - () -> config.richPresence.customMessage, - newValue -> config.richPresence.customMessage = newValue) - .controller(StringControllerBuilder::create) - .build()) - .build(); - } -} diff --git a/src/main/java/me/xmrvizzy/skyblocker/config/categories/DungeonsCategory.java b/src/main/java/me/xmrvizzy/skyblocker/config/categories/DungeonsCategory.java deleted file mode 100644 index 2d641ac1..00000000 --- a/src/main/java/me/xmrvizzy/skyblocker/config/categories/DungeonsCategory.java +++ /dev/null @@ -1,316 +0,0 @@ -package me.xmrvizzy.skyblocker.config.categories; - -import dev.isxander.yacl3.api.ButtonOption; -import dev.isxander.yacl3.api.ConfigCategory; -import dev.isxander.yacl3.api.Option; -import dev.isxander.yacl3.api.OptionDescription; -import dev.isxander.yacl3.api.OptionFlag; -import dev.isxander.yacl3.api.OptionGroup; -import dev.isxander.yacl3.api.controller.FloatFieldControllerBuilder; -import dev.isxander.yacl3.api.controller.IntegerFieldControllerBuilder; -import dev.isxander.yacl3.api.controller.StringControllerBuilder; -import me.xmrvizzy.skyblocker.config.SkyblockerConfig; -import me.xmrvizzy.skyblocker.config.ConfigUtils; -import me.xmrvizzy.skyblocker.config.controllers.EnumDropdownControllerBuilder; -import me.xmrvizzy.skyblocker.skyblock.dungeon.DungeonMapConfigScreen; -import net.minecraft.client.MinecraftClient; -import net.minecraft.text.Text; -import net.minecraft.util.Formatting; - -public class DungeonsCategory { - - public static ConfigCategory create(SkyblockerConfig defaults, SkyblockerConfig config) { - return ConfigCategory.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons")) - - //Dungeon Secret Waypoints - .group(OptionGroup.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints")) - .collapsed(true) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableSecretWaypoints")) - .binding(defaults.locations.dungeons.secretWaypoints.enableSecretWaypoints, - () -> config.locations.dungeons.secretWaypoints.enableSecretWaypoints, - newValue -> config.locations.dungeons.secretWaypoints.enableSecretWaypoints = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.noInitSecretWaypoints")) - .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.noInitSecretWaypoints.@Tooltip"))) - .binding(defaults.locations.dungeons.secretWaypoints.noInitSecretWaypoints, - () -> config.locations.dungeons.secretWaypoints.noInitSecretWaypoints, - newValue -> config.locations.dungeons.secretWaypoints.noInitSecretWaypoints = newValue) - .controller(ConfigUtils::createBooleanController) - .flag(OptionFlag.GAME_RESTART) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableEntranceWaypoints")) - .binding(defaults.locations.dungeons.secretWaypoints.enableEntranceWaypoints, - () -> config.locations.dungeons.secretWaypoints.enableEntranceWaypoints, - newValue -> config.locations.dungeons.secretWaypoints.enableEntranceWaypoints = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableSuperboomWaypoints")) - .binding(defaults.locations.dungeons.secretWaypoints.enableSuperboomWaypoints, - () -> config.locations.dungeons.secretWaypoints.enableSuperboomWaypoints, - newValue -> config.locations.dungeons.secretWaypoints.enableSuperboomWaypoints = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableChestWaypoints")) - .binding(defaults.locations.dungeons.secretWaypoints.enableChestWaypoints, - () -> config.locations.dungeons.secretWaypoints.enableChestWaypoints, - newValue -> config.locations.dungeons.secretWaypoints.enableChestWaypoints = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableItemWaypoints")) - .binding(defaults.locations.dungeons.secretWaypoints.enableItemWaypoints, - () -> config.locations.dungeons.secretWaypoints.enableItemWaypoints, - newValue -> config.locations.dungeons.secretWaypoints.enableItemWaypoints = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableBatWaypoints")) - .binding(defaults.locations.dungeons.secretWaypoints.enableBatWaypoints, - () -> config.locations.dungeons.secretWaypoints.enableBatWaypoints, - newValue -> config.locations.dungeons.secretWaypoints.enableBatWaypoints = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableWitherWaypoints")) - .binding(defaults.locations.dungeons.secretWaypoints.enableWitherWaypoints, - () -> config.locations.dungeons.secretWaypoints.enableWitherWaypoints, - newValue -> config.locations.dungeons.secretWaypoints.enableWitherWaypoints = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableLeverWaypoints")) - .binding(defaults.locations.dungeons.secretWaypoints.enableLeverWaypoints, - () -> config.locations.dungeons.secretWaypoints.enableLeverWaypoints, - newValue -> config.locations.dungeons.secretWaypoints.enableLeverWaypoints = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableFairySoulWaypoints")) - .binding(defaults.locations.dungeons.secretWaypoints.enableFairySoulWaypoints, - () -> config.locations.dungeons.secretWaypoints.enableFairySoulWaypoints, - newValue -> config.locations.dungeons.secretWaypoints.enableFairySoulWaypoints = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableStonkWaypoints")) - .binding(defaults.locations.dungeons.secretWaypoints.enableStonkWaypoints, - () -> config.locations.dungeons.secretWaypoints.enableStonkWaypoints, - newValue -> config.locations.dungeons.secretWaypoints.enableStonkWaypoints = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableDefaultWaypoints")) - .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableDefaultWaypoints.@Tooltip"))) - .binding(defaults.locations.dungeons.secretWaypoints.enableDefaultWaypoints, - () -> config.locations.dungeons.secretWaypoints.enableDefaultWaypoints, - newValue -> config.locations.dungeons.secretWaypoints.enableDefaultWaypoints = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .build()) - - .group(OptionGroup.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit")) - .collapsed(true) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.enableProfitCalculator")) - .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.enableProfitCalculator.@Tooltip"))) - .binding(defaults.locations.dungeons.dungeonChestProfit.enableProfitCalculator, - () -> config.locations.dungeons.dungeonChestProfit.enableProfitCalculator, - newValue -> config.locations.dungeons.dungeonChestProfit.enableProfitCalculator = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.includeKismet")) - .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.includeKismet.@Tooltip"))) - .binding(defaults.locations.dungeons.dungeonChestProfit.includeKismet, - () -> config.locations.dungeons.dungeonChestProfit.includeKismet, - newValue -> config.locations.dungeons.dungeonChestProfit.includeKismet = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.includeEssence")) - .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.includeEssence.@Tooltip"))) - .binding(defaults.locations.dungeons.dungeonChestProfit.includeEssence, - () -> config.locations.dungeons.dungeonChestProfit.includeEssence, - newValue -> config.locations.dungeons.dungeonChestProfit.includeEssence = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.neutralThreshold")) - .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.neutralThreshold.@Tooltip"))) - .binding(defaults.locations.dungeons.dungeonChestProfit.neutralThreshold, - () -> config.locations.dungeons.dungeonChestProfit.neutralThreshold, - newValue -> config.locations.dungeons.dungeonChestProfit.neutralThreshold = newValue) - .controller(IntegerFieldControllerBuilder::create) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.neutralColor")) - .binding(defaults.locations.dungeons.dungeonChestProfit.neutralColor, - () -> config.locations.dungeons.dungeonChestProfit.neutralColor, - newValue -> config.locations.dungeons.dungeonChestProfit.neutralColor = newValue) - .controller(EnumDropdownControllerBuilder.getFactory(ConfigUtils.FORMATTING_TO_STRING)) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.profitColor")) - .binding(defaults.locations.dungeons.dungeonChestProfit.profitColor, - () -> config.locations.dungeons.dungeonChestProfit.profitColor, - newValue -> config.locations.dungeons.dungeonChestProfit.profitColor = newValue) - .controller(EnumDropdownControllerBuilder.getFactory(ConfigUtils.FORMATTING_TO_STRING)) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.lossColor")) - .binding(defaults.locations.dungeons.dungeonChestProfit.lossColor, - () -> config.locations.dungeons.dungeonChestProfit.lossColor, - newValue -> config.locations.dungeons.dungeonChestProfit.lossColor = newValue) - .controller(EnumDropdownControllerBuilder.getFactory(ConfigUtils.FORMATTING_TO_STRING)) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.incompleteColor")) - .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.incompleteColor.@Tooltip"))) - .binding(defaults.locations.dungeons.dungeonChestProfit.incompleteColor, - () -> config.locations.dungeons.dungeonChestProfit.incompleteColor, - newValue -> config.locations.dungeons.dungeonChestProfit.incompleteColor = newValue) - .controller(EnumDropdownControllerBuilder.getFactory(ConfigUtils.FORMATTING_TO_STRING)) - .build()) - .build()) - - //Others - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.croesusHelper")) - .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.croesusHelper.@Tooltip"))) - .binding(defaults.locations.dungeons.croesusHelper, - () -> config.locations.dungeons.croesusHelper, - newValue -> config.locations.dungeons.croesusHelper = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.enableMap")) - .binding(defaults.locations.dungeons.enableMap, - () -> config.locations.dungeons.enableMap, - newValue -> config.locations.dungeons.enableMap = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(ButtonOption.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.mapScreen")) - .text(Text.translatable("text.skyblocker.open")) - .action((screen, opt) -> MinecraftClient.getInstance().setScreen(new DungeonMapConfigScreen(screen))) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.mapScaling")) - .binding(defaults.locations.dungeons.mapScaling, - () -> config.locations.dungeons.mapScaling, - newValue -> config.locations.dungeons.mapScaling = newValue) - .controller(FloatFieldControllerBuilder::create) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.mapX")) - .binding(defaults.locations.dungeons.mapX, - () -> config.locations.dungeons.mapX, - newValue -> config.locations.dungeons.mapX = newValue) - .controller(IntegerFieldControllerBuilder::create) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.mapY")) - .binding(defaults.locations.dungeons.mapY, - () -> config.locations.dungeons.mapY, - newValue -> config.locations.dungeons.mapY = newValue) - .controller(IntegerFieldControllerBuilder::create) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.starredMobGlow")) - .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.starredMobGlow.@Tooltip"))) - .binding(defaults.locations.dungeons.starredMobGlow, - () -> config.locations.dungeons.starredMobGlow, - newValue -> config.locations.dungeons.starredMobGlow = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.solveThreeWeirdos")) - .binding(defaults.locations.dungeons.solveThreeWeirdos, - () -> config.locations.dungeons.solveThreeWeirdos, - newValue -> config.locations.dungeons.solveThreeWeirdos = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.blazesolver")) - .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.blazesolver.@Tooltip"))) - .binding(defaults.locations.dungeons.blazesolver, - () -> config.locations.dungeons.blazesolver, - newValue -> config.locations.dungeons.blazesolver = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.solveTrivia")) - .binding(defaults.locations.dungeons.solveTrivia, - () -> config.locations.dungeons.solveTrivia, - newValue -> config.locations.dungeons.solveTrivia = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.solveTicTacToe")) - .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.solveTicTacToe.@Tooltip"))) - .binding(defaults.locations.dungeons.solveTicTacToe, - () -> config.locations.dungeons.solveTicTacToe, - newValue -> config.locations.dungeons.solveTicTacToe = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - - //Livid Color - .group(OptionGroup.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.lividColor")) - .collapsed(true) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.lividColor.enableLividColor")) - .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.lividColor.enableLividColor.@Tooltip"))) - .binding(defaults.locations.dungeons.lividColor.enableLividColor, - () -> config.locations.dungeons.lividColor.enableLividColor, - newValue -> config.locations.dungeons.lividColor.enableLividColor = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.lividColor.lividColorText")) - .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.lividColor.lividColorText.@Tooltip"))) - .binding(defaults.locations.dungeons.lividColor.lividColorText, - () -> config.locations.dungeons.lividColor.lividColorText, - newValue -> config.locations.dungeons.lividColor.lividColorText = newValue) - .controller(StringControllerBuilder::create) - .build()) - .build()) - - //Terminal Solvers - .group(OptionGroup.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.terminals")) - .collapsed(true) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.terminals.solveColor")) - .binding(defaults.locations.dungeons.terminals.solveColor, - () -> config.locations.dungeons.terminals.solveColor, - newValue -> config.locations.dungeons.terminals.solveColor = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.terminals.solveOrder")) - .binding(defaults.locations.dungeons.terminals.solveOrder, - () -> config.locations.dungeons.terminals.solveOrder, - newValue -> config.locations.dungeons.terminals.solveOrder = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.terminals.solveStartsWith")) - .binding(defaults.locations.dungeons.terminals.solveStartsWith, - () -> config.locations.dungeons.terminals.solveStartsWith, - newValue -> config.locations.dungeons.terminals.solveStartsWith = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .build()) - .build(); - } -} diff --git a/src/main/java/me/xmrvizzy/skyblocker/config/categories/DwarvenMinesCategory.java b/src/main/java/me/xmrvizzy/skyblocker/config/categories/DwarvenMinesCategory.java deleted file mode 100644 index 8330ba2a..00000000 --- a/src/main/java/me/xmrvizzy/skyblocker/config/categories/DwarvenMinesCategory.java +++ /dev/null @@ -1,94 +0,0 @@ -package me.xmrvizzy.skyblocker.config.categories; - -import dev.isxander.yacl3.api.ButtonOption; -import dev.isxander.yacl3.api.ConfigCategory; -import dev.isxander.yacl3.api.Option; -import dev.isxander.yacl3.api.OptionDescription; -import dev.isxander.yacl3.api.OptionGroup; -import dev.isxander.yacl3.api.controller.IntegerFieldControllerBuilder; -import me.xmrvizzy.skyblocker.config.SkyblockerConfig; -import me.xmrvizzy.skyblocker.config.ConfigUtils; -import me.xmrvizzy.skyblocker.skyblock.dwarven.DwarvenHudConfigScreen; -import net.minecraft.client.MinecraftClient; -import net.minecraft.text.Text; - -public class DwarvenMinesCategory { - - public static ConfigCategory create(SkyblockerConfig defaults, SkyblockerConfig config) { - return ConfigCategory.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dwarvenMines")) - - //Uncategorized Options - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dwarvenMines.enableDrillFuel")) - .binding(defaults.locations.dwarvenMines.enableDrillFuel, - () -> config.locations.dwarvenMines.enableDrillFuel, - newValue -> config.locations.dwarvenMines.enableDrillFuel = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dwarvenMines.solveFetchur")) - .binding(defaults.locations.dwarvenMines.solveFetchur, - () -> config.locations.dwarvenMines.solveFetchur, - newValue -> config.locations.dwarvenMines.solveFetchur = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dwarvenMines.solvePuzzler")) - .binding(defaults.locations.dwarvenMines.solvePuzzler, - () -> config.locations.dwarvenMines.solvePuzzler, - newValue -> config.locations.dwarvenMines.solvePuzzler = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - - //Dwarven HUD - .group(OptionGroup.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud")) - .collapsed(false) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.enabled")) - .binding(defaults.locations.dwarvenMines.dwarvenHud.enabled, - () -> config.locations.dwarvenMines.dwarvenHud.enabled, - newValue -> config.locations.dwarvenMines.dwarvenHud.enabled = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.style")) - .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.style.@Tooltip[0]"), - Text.translatable("text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.style.@Tooltip[1]"), - Text.translatable("text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.style.@Tooltip[2]"))) - .binding(defaults.locations.dwarvenMines.dwarvenHud.style, - () -> config.locations.dwarvenMines.dwarvenHud.style, - newValue -> config.locations.dwarvenMines.dwarvenHud.style = newValue) - .controller(ConfigUtils::createEnumCyclingListController) - .build()) - .option(ButtonOption.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.screen")) - .text(Text.translatable("text.skyblocker.open")) - .action((screen, opt) -> MinecraftClient.getInstance().setScreen(new DwarvenHudConfigScreen(screen))) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.enableBackground")) - .binding(defaults.locations.dwarvenMines.dwarvenHud.enableBackground, - () -> config.locations.dwarvenMines.dwarvenHud.enableBackground, - newValue -> config.locations.dwarvenMines.dwarvenHud.enableBackground = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.x")) - .binding(defaults.locations.dwarvenMines.dwarvenHud.x, - () -> config.locations.dwarvenMines.dwarvenHud.x, - newValue -> config.locations.dwarvenMines.dwarvenHud.x = newValue) - .controller(IntegerFieldControllerBuilder::create) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.y")) - .binding(defaults.locations.dwarvenMines.dwarvenHud.y, - () -> config.locations.dwarvenMines.dwarvenHud.y, - newValue -> config.locations.dwarvenMines.dwarvenHud.y = newValue) - .controller(IntegerFieldControllerBuilder::create) - .build()) - .build()) - .build(); - } -} diff --git a/src/main/java/me/xmrvizzy/skyblocker/config/categories/GeneralCategory.java b/src/main/java/me/xmrvizzy/skyblocker/config/categories/GeneralCategory.java deleted file mode 100644 index 318d579c..00000000 --- a/src/main/java/me/xmrvizzy/skyblocker/config/categories/GeneralCategory.java +++ /dev/null @@ -1,508 +0,0 @@ -package me.xmrvizzy.skyblocker.config.categories; - -import dev.isxander.yacl3.api.*; -import dev.isxander.yacl3.api.controller.FloatFieldControllerBuilder; -import dev.isxander.yacl3.api.controller.FloatSliderControllerBuilder; -import dev.isxander.yacl3.api.controller.IntegerFieldControllerBuilder; -import dev.isxander.yacl3.api.controller.IntegerSliderControllerBuilder; -import me.xmrvizzy.skyblocker.config.ConfigUtils; -import me.xmrvizzy.skyblocker.config.SkyblockerConfig; -import me.xmrvizzy.skyblocker.skyblock.shortcut.ShortcutsConfigScreen; -import me.xmrvizzy.skyblocker.utils.render.title.TitleContainerConfigScreen; -import net.minecraft.client.MinecraftClient; -import net.minecraft.text.Text; - -public class GeneralCategory { - - public static ConfigCategory create(SkyblockerConfig defaults, SkyblockerConfig config) { - return ConfigCategory.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.category.general")) - - //Ungrouped Options - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.general.acceptReparty")) - .binding(defaults.general.acceptReparty, - () -> config.general.acceptReparty, - newValue -> config.general.acceptReparty = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.general.backpackPreviewWithoutShift")) - .binding(defaults.general.backpackPreviewWithoutShift, - () -> config.general.backpackPreviewWithoutShift, - newValue -> config.general.backpackPreviewWithoutShift = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.general.compactorDeletorPreview")) - .binding(defaults.general.compactorDeletorPreview, - () -> config.general.compactorDeletorPreview, - newValue -> config.general.compactorDeletorPreview = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.general.hideEmptyTooltips")) - .binding(defaults.general.hideEmptyTooltips, - () -> config.general.hideEmptyTooltips, - newValue -> config.general.hideEmptyTooltips = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.general.hideStatusEffectOverlay")) - .binding(defaults.general.hideStatusEffectOverlay, - () -> config.general.hideStatusEffectOverlay, - newValue -> config.general.hideStatusEffectOverlay = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - - //Tab Hud - .group(OptionGroup.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.general.tabHud")) - .collapsed(true) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.general.tabHud.tabHudEnabled")) - .binding(defaults.general.tabHud.tabHudEnabled, - () -> config.general.tabHud.tabHudEnabled, - newValue -> config.general.tabHud.tabHudEnabled = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.general.tabHud.tabHudScale")) - .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.general.tabHud.tabHudScale.@Tooltip"))) - .binding(defaults.general.tabHud.tabHudScale, - () -> config.general.tabHud.tabHudScale, - newValue -> config.general.tabHud.tabHudScale = newValue) - .controller(opt -> IntegerSliderControllerBuilder.create(opt).range(10, 200).step(1)) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.general.tabHud.plainPlayerNames")) - .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.general.tabHud.plainPlayerNames.@Tooltip"))) - .binding(defaults.general.tabHud.plainPlayerNames, - () -> config.general.tabHud.plainPlayerNames, - newValue -> config.general.tabHud.plainPlayerNames = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.general.tabHud.nameSorting")) - .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.general.tabHud.nameSorting.@Tooltip"))) - .binding(defaults.general.tabHud.nameSorting, - () -> config.general.tabHud.nameSorting, - newValue -> config.general.tabHud.nameSorting = newValue) - .controller(ConfigUtils::createEnumCyclingListController) - .build()) - .build()) - - //Fancy Bars - .group(OptionGroup.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.general.bars")) - .collapsed(true) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.general.bars.enableBars")) - .binding(defaults.general.bars.enableBars, - () -> config.general.bars.enableBars, - newValue -> config.general.bars.enableBars = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.general.bars.barpositions.healthBarPosition")) - .binding(defaults.general.bars.barPositions.healthBarPosition, - () -> config.general.bars.barPositions.healthBarPosition, - newValue -> co