diff options
author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2024-03-15 23:25:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-15 23:25:29 +0100 |
commit | 95cb1d7c7be44a6b7f9611e6420ff6b50146a830 (patch) | |
tree | 7302978e3e3f5195376e49d726167916be68a434 /src/main | |
parent | 951bb6a26559b6db288a68a00f83d9ea45b0c3d8 (diff) | |
download | skyhanni-95cb1d7c7be44a6b7f9611e6420ff6b50146a830.tar.gz skyhanni-95cb1d7c7be44a6b7f9611e6420ff6b50146a830.tar.bz2 skyhanni-95cb1d7c7be44a6b7f9611e6420ff6b50146a830.zip |
Backend: Storage Config Moving (#1171)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main')
21 files changed, 635 insertions, 616 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/Features.java b/src/main/java/at/hannibal2/skyhanni/config/Features.java index c4bd8bbe4..2448b7ce9 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/Features.java +++ b/src/main/java/at/hannibal2/skyhanni/config/Features.java @@ -23,6 +23,7 @@ import at.hannibal2.skyhanni.config.features.rift.RiftConfig; import at.hannibal2.skyhanni.config.features.skillprogress.SkillProgressConfig; import at.hannibal2.skyhanni.config.features.slayer.SlayerConfig; import at.hannibal2.skyhanni.config.features.stranded.StrandedConfig; +import at.hannibal2.skyhanni.config.storage.Storage; import com.google.gson.annotations.Expose; import io.github.moulberry.moulconfig.Config; import io.github.moulberry.moulconfig.Social; diff --git a/src/main/java/at/hannibal2/skyhanni/config/Storage.java b/src/main/java/at/hannibal2/skyhanni/config/Storage.java deleted file mode 100644 index 95286550c..000000000 --- a/src/main/java/at/hannibal2/skyhanni/config/Storage.java +++ /dev/null @@ -1,567 +0,0 @@ -package at.hannibal2.skyhanni.config; - -import at.hannibal2.skyhanni.data.FameRank; -import at.hannibal2.skyhanni.api.SkillAPI; -import at.hannibal2.skyhanni.data.model.ComposterUpgrade; -import at.hannibal2.skyhanni.features.bingo.card.goals.BingoGoal; -import at.hannibal2.skyhanni.features.combat.endernodetracker.EnderNodeTracker; -import at.hannibal2.skyhanni.features.combat.ghostcounter.GhostData; -import at.hannibal2.skyhanni.features.dungeon.CroesusChestTracker; -import at.hannibal2.skyhanni.features.dungeon.CroesusChestTracker.Companion.OpenedState; -import at.hannibal2.skyhanni.features.dungeon.DungeonAPI; -import at.hannibal2.skyhanni.features.event.diana.DianaProfitTracker; -import at.hannibal2.skyhanni.features.event.diana.MythologicalCreatureTracker; -import at.hannibal2.skyhanni.features.event.jerry.frozentreasure.FrozenTreasureTracker; -import at.hannibal2.skyhanni.features.fishing.tracker.FishingProfitTracker; -import at.hannibal2.skyhanni.features.fishing.tracker.SeaCreatureTracker; -import at.hannibal2.skyhanni.features.fishing.trophy.TrophyRarity; -import at.hannibal2.skyhanni.features.garden.CropAccessory; -import at.hannibal2.skyhanni.features.garden.CropType; -import at.hannibal2.skyhanni.features.garden.GardenPlotAPI; -import at.hannibal2.skyhanni.features.garden.farming.ArmorDropTracker; -import at.hannibal2.skyhanni.features.garden.farming.DicerRngDropTracker; -import at.hannibal2.skyhanni.features.garden.fortuneguide.FarmingItems; -import at.hannibal2.skyhanni.features.garden.visitor.VisitorReward; -import at.hannibal2.skyhanni.features.mining.powdertracker.PowderTracker; -import at.hannibal2.skyhanni.features.misc.trevor.TrevorTracker; -import at.hannibal2.skyhanni.features.misc.visualwords.VisualWord; -import at.hannibal2.skyhanni.features.rift.area.westvillage.VerminTracker; -import at.hannibal2.skyhanni.features.rift.area.westvillage.kloon.KloonTerminal; -import at.hannibal2.skyhanni.features.skillprogress.SkillType; -import at.hannibal2.skyhanni.features.slayer.SlayerProfitTracker; -import at.hannibal2.skyhanni.utils.LorenzVec; -import at.hannibal2.skyhanni.utils.NEUInternalName; -import at.hannibal2.skyhanni.utils.tracker.SkyHanniTracker; -import com.google.gson.annotations.Expose; -import jline.internal.Nullable; -import net.minecraft.item.ItemStack; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.UUID; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -public class Storage { - - @Expose - public boolean hasPlayedBefore = false; - - @Expose - public Float savedMouselockedSensitivity = .5f; - - @Expose - public Float savedMouseloweredSensitivity = .5f; - - @Deprecated - @Expose - public Map<String, List<String>> knownFeatureToggles = new HashMap<>(); - - @Expose - public List<VisualWord> modifiedWords = new ArrayList<>(); - - @Expose - public boolean visualWordsImported = false; - - @Expose - public Boolean contestSendingAsked = false; - - @Expose - public Map<String, SkyHanniTracker.DisplayMode> trackerDisplayModes = new HashMap<>(); - - @Expose - public List<LorenzVec> foundDianaBurrowLocations = new ArrayList<>(); - - @Expose - public Map<UUID, PlayerSpecific> players = new HashMap<>(); - - @Expose - public String currentFameRank = null; - - public static class PlayerSpecific { - - @Expose - public Map<String, ProfileSpecific> profiles = new HashMap<>(); // profile name - - @Expose - public Integer gardenCommunityUpgrade = -1; - - @Expose - public long nextCityProjectParticipationTime = 0L; - - @Expose - public String currentAccountUpgrade = null; - - @Expose - public long nextAccountUpgradeCompletionTime = -1L; - - @Expose - public List<String> guildMembers = new ArrayList<>(); - - @Expose - public WinterStorage winter = new WinterStorage(); - - public static class WinterStorage { - - @Expose - public Set<String> playersThatHaveBeenGifted = new HashSet<>(); - - @Expose - public int amountGifted = 0; - - @Expose - public int cakeCollectedYear = 0; - } - - @Expose - public Map<Long, BingoSession> bingoSessions = new HashMap<>(); - - public static class BingoSession { - - @Expose - public Set<NEUInternalName> tierOneMinionsDone = new HashSet<>(); - - @Expose - public Map<Integer, BingoGoal> goals = new HashMap<>(); - } - - @Expose - public LimboStats limbo = new LimboStats(); - - public static class LimboStats { - - @Expose - public int playtime = 0; - - @Expose - public int personalBest = 0; - - @Expose - public float userLuck = 0f; - } - } - - public static class ProfileSpecific { - - @Expose - public String currentPet = ""; - - @Expose - public MaxwellPowerStorage maxwell = new MaxwellPowerStorage(); - - public static class MaxwellPowerStorage { - @Expose - public String currentPower = null; - - @Expose - public int magicalPower = -1; - } - - @Expose - public ArrowsStorage arrows = new ArrowsStorage(); - - public static class ArrowsStorage { - @Expose - public String currentArrow = null; - - @Expose - public Map<NEUInternalName, Float> arrowAmount = new HashMap<>(); - } - - @Expose - public BitsStorage bits = new BitsStorage(); - - public static class BitsStorage { - @Expose - public int bits = -1; - - @Expose - public int bitsToClaim = -1; - } - - @Expose - public Map<LorenzVec, MinionConfig> minions = new HashMap<>(); - - public static class MinionConfig { - - @Expose - public String displayName = ""; - - @Expose - public long lastClicked = -1; - - @Override - public String toString() { - return "MinionConfig{" + - "displayName='" + displayName + '\'' + - ", lastClicked=" + lastClicked + - '}'; - } - } - - @Expose - public CrimsonIsleStorage crimsonIsle = new CrimsonIsleStorage(); - - public static class CrimsonIsleStorage { - - @Expose - public List<String> quests = new ArrayList<>(); - - @Expose - public List<String> miniBossesDoneToday = new ArrayList<>(); - - @Expose - public List<String> kuudraTiersDone = new ArrayList<>(); - - @Expose - public Map<String, Map<TrophyRarity, Integer>> trophyFishes = new HashMap<>(); - } - - @Expose - public ProfileSpecific.GardenStorage garden = new ProfileSpecific.GardenStorage(); - - public static class GardenStorage { - - @Expose - public Long experience = null; - - @Expose - public Map<CropType, Long> cropCounter = new HashMap<>(); - - @Expose - public Map<CropType, Integer> cropUpgrades = new HashMap<>(); - - @Expose - public Map<CropType, Integer> cropsPerSecond = new HashMap<>(); - - @Expose - public Map<CropType, Double> latestBlocksPerSecond = new HashMap<>(); - - @Expose - public Map<CropType, Double> latestTrueFarmingFortune = new HashMap<>(); - - @Expose - public CropAccessory savedCropAccessory = null; - - @Expose - public DicerRngDropTracker.Data dicerDropTracker = new DicerRngDropTracker.Data(); - - @Expose - public long informedAboutLowMatter = 0; - - @Expose - public long informedAboutLowFuel = 0; - - @Expose - public long visitorInterval = 15 * 60_000L; - - @Expose - public long nextSixthVisitorArrival = 0; - - @Expose - public ArmorDropTracker.Data armorDropTracker = new ArmorDropTracker.Data(); - - @Expose - public Map<ComposterUpgrade, Integer> composterUpgrades = new HashMap<>(); - - @Expose - public Map<CropType, Boolean> toolWithBountiful = new HashMap<>(); - - @Expose - public NEUInternalName composterCurrentOrganicMatterItem = NEUInternalName.Companion.getNONE(); - - @Expose - public NEUInternalName composterCurrentFuelItem = NEUInternalName.Companion.getNONE(); - - @Expose - public int uniqueVisitors = 0; - - @Expose - public VisitorDrops visitorDrops = new VisitorDrops(); - - public static class VisitorDrops { - @Expose - public int acceptedVisitors = 0; - - @Expose - public int deniedVisitors = 0; - - @Expose - public List<Long> visitorRarities = new ArrayList<>(); - - @Expose - public int copper = 0; - - @Expose - public long farmingExp = 0; - - @Expose - public int gardenExp = 0; - - @Expose - public long coinsSpent = 0; - - @Expose - public long bits = 0; - - @Expose - public long mithrilPowder = 0; - - @Expose - public long gemstonePowder = 0; - - @Expose - public Map<VisitorReward, Integer> rewardsCount = new HashMap<>(); - } - - @Expose - public PlotIcon plotIcon = new PlotIcon(); - - public static class PlotIcon { - @Expose - public Map<Integer, NEUInternalName> plotList = new HashMap<>(); - } - - @Expose - public Map<Integer, GardenPlotAPI.PlotData> plotData = new HashMap<>(); - - @Expose - public Map<CropType, LorenzVec> cropStartLocations = new HashMap<>(); - - @Expose - public Fortune fortune = new Fortune(); - - public static class Fortune { - - @Expose - public Map<FarmingItems, Boolean> outdatedItems = new HashMap<>(); - - @Expose - public int anitaUpgrade = -1; - - @Expose - public int farmingStrength = -1; - - @Expose - public int farmingLevel = -1; - - @Expose - public int plotsUnlocked = -1; - - @Expose - public long cakeExpiring = -1L; - - @Expose - public boolean carrotFortune = false; - - @Expose - public boolean pumpkinFortune = false; - - @Expose - public Map<FarmingItems, ItemStack> farmingItems = new HashMap<>(); - } - - @Expose - public long composterEmptyTime = 0; - - @Expose - public long lastComposterEmptyWarningTime = 0; - - @Expose - public FarmingWeightConfig farmingWeight = new FarmingWeightConfig(); - - public static class FarmingWeightConfig { - - @Expose - public int lastFarmingWeightLeaderboard = -1; - } - - @Expose - public Map<String, LorenzVec> npcVisitorLocations = new HashMap<>(); - } - - @Expose - public GhostCounter ghostCounter = new GhostCounter(); - - public static class GhostCounter { - - @Expose - public Map<GhostData.Option, Double> data = new HashMap<>(); - - @Expose - public boolean ctDataImported = false; - - @Expose - public double bestiaryNextLevel = 0; - - @Expose - public double bestiaryCurrentKill = 0; - - @Expose - public double bestiaryKillNeeded = 0; - - @Expose - public double totalMF = 0; - - @Expose - public int configUpdateVersion = 0; - - } - - @Expose - public PowderTracker.Data powderTracker = new PowderTracker.Data(); - - @Expose - public FrozenTreasureTracker.Data frozenTreasureTracker = new FrozenTreasureTracker.Data(); - - @Expose - public EnderNodeTracker.Data enderNodeTracker = new EnderNodeTracker.Data(); - - @Expose - public RiftStorage rift = new RiftStorage(); - - public static class RiftStorage { - - @Expose - public List<KloonTerminal> completedKloonTerminals = new ArrayList<>(); - - @Expose - public VerminTracker.Data verminTracker = new VerminTracker.Data(); - - } - - @Expose - public Map<String, SlayerProfitTracker.Data> slayerProfitData = new HashMap<>(); - - @Expose - public Map<String, SlayerRngMeterStorage> slayerRngMeter = new HashMap<>(); - - public static class SlayerRngMeterStorage { - - @Expose - public long currentMeter = -1; - - @Expose - public long gainPerBoss = -1; - - @Expose - public long goalNeeded = -1; - - @Expose - public String itemGoal = "?"; - - @Override - public String toString() { - return "SlayerRngMeterStorage{" + - "currentMeter=" + currentMeter + - ", gainPerBoss=" + gainPerBoss + - ", goalNeeded=" + goalNeeded + - ", itemGoal='" + itemGoal + '\'' + - '}'; - } - } - - @Expose - public MiningConfig mining = new MiningConfig(); - - public static class MiningConfig { - - @Expose - public List<String> kingsTalkedTo = new ArrayList<>(); - } - - @Expose - public TrapperData trapperData = new TrapperData(); - - public static class TrapperData { - - @Expose - public int questsDone; - - @Expose - public int peltsGained; - - @Expose - public int killedAnimals; - - @Expose - public int selfKillingAnimals; - - @Expose - public Map<TrevorTracker.TrapperMobRarity, Integer> animalRarities = new HashMap<>(); - } - - @Expose - public DungeonStorage dungeons = new DungeonStorage(); - - public static class DungeonStorage { - - @Expose - public Map<DungeonAPI.DungeonFloor, Integer> bosses = new HashMap<>(); - - @Expose - public List<DungeonRunInfo> runs = Stream.generate(DungeonRunInfo::new) - .limit(CroesusChestTracker.Companion.getMaxChests()) - .collect(Collectors.toCollection(ArrayList::new)); - - - public static class DungeonRunInfo { - - public DungeonRunInfo() { - } - - public DungeonRunInfo(String floor) { - this.floor = floor; - this.openState = OpenedState.UNOPENED; - } - - @Nullable - @Expose - public String floor = null; - - @Expose - @Nullable - public OpenedState openState = null; - - @Expose - @Nullable - public Boolean kismetUsed = null; - - } - } - - @Expose - public FishingStorage fishing = new FishingStorage(); - - public static class FishingStorage { - - @Expose - public FishingProfitTracker.Data fishingProfitTracker = new FishingProfitTracker.Data(); - - @Expose - public SeaCreatureTracker.Data seaCreatureTracker = new SeaCreatureTracker.Data(); - - } - - @Expose - public DianaStorage diana = new DianaStorage(); - - public static class DianaStorage { - - @Expose - // TODO rename to 'profitTracker' - public DianaProfitTracker.Data dianaProfitTracker = new DianaProfitTracker.Data(); - - @Expose - // TODO renmae - public MythologicalCreatureTracker.Data mythologicalMobTracker = new MythologicalCreatureTracker.Data(); - } - - @Expose - public Map<SkillType, SkillAPI.SkillInfo> skillData = new HashMap<>(); - } -} diff --git a/src/main/java/at/hannibal2/skyhanni/config/storage/PlayerSpecificStorage.java b/src/main/java/at/hannibal2/skyhanni/config/storage/PlayerSpecificStorage.java new file mode 100644 index 000000000..1007168a9 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/storage/PlayerSpecificStorage.java @@ -0,0 +1,75 @@ +package at.hannibal2.skyhanni.config.storage; + +import at.hannibal2.skyhanni.features.bingo.card.goals.BingoGoal; +import at.hannibal2.skyhanni.utils.NEUInternalName; +import com.google.gson.annotations.Expose; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +public class PlayerSpecificStorage { + + @Expose + public Map<String, ProfileSpecificStorage> profiles = new HashMap<>(); // profile name + + @Expose + public Integer gardenCommunityUpgrade = -1; + + @Expose + public long nextCityProjectParticipationTime = 0L; + + @Expose + public String currentAccountUpgrade = null; + + @Expose + public long nextAccountUpgradeCompletionTime = -1L; + + @Expose + public List<String> guildMembers = new ArrayList<>(); + + @Expose + public WinterStorage winter = new WinterStorage(); + + public static class WinterStorage { + + @Expose + public Set<String> playersThatHaveBeenGifted = new HashSet<>(); + + @Expose + public int amountGifted = 0; + + @Expose + public int cakeCollectedYear = 0; + } + + @Expose + public Map<Long, BingoSession> bingoSessions = new HashMap<>(); + + public static class BingoSession { + + @Expose + public Set<NEUInternalName> tierOneMinionsDone = new HashSet<>(); + + @Expose + public Map<Integer, BingoGoal> goals = new HashMap<>(); + } + + @Expose + public LimboStats limbo = new LimboStats(); + + public static class LimboStats { + + @Expose + public int playtime = 0; + + @Expose + public int personalBest = 0; + + @Expose + public float userLuck = 0f; + } +} diff --git a/src/main/java/at/hannibal2/skyhanni/config/storage/ProfileSpecificStorage.java b/src/main/java/at/hannibal2/skyhanni/config/storage/ProfileSpecificStorage.java new file mode 100644 index 000000000..43b2cbfbc --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/storage/ProfileSpecificStorage.java @@ -0,0 +1,459 @@ +package at.hannibal2.skyhanni.config.storage; + +import at.hannibal2.skyhanni.api.SkillAPI; +import at.hannibal2.skyhanni.data.model.ComposterUpgrade; +import at.hannibal2.skyhanni.features.combat.endernodetracker.EnderNodeTracker; +import at.hannibal2.skyhanni.features.combat.ghostcounter.GhostData; +import at.hannibal2.skyhanni.features.dungeon.CroesusChestTracker; +import at.hannibal2.skyhanni.features.dungeon.DungeonAPI; +import at.hannibal2.skyhanni.features.event.diana.DianaProfitTracker; +import at.hannibal2.skyhanni.features.event.diana.MythologicalCreatureTracker; +import at.hannibal2.skyhanni.features.event.jerry.frozentreasure.FrozenTreasureTracker; +import at.hannibal2.skyhanni.features.fishing.tracker.FishingProfitTracker; +import at.hannibal2.skyhanni.features.fishing.tracker.SeaCreatureTracker; +import at.hannibal2.skyhanni.features.fishing.trophy.TrophyRarity; +import at.hannibal2.skyhanni.features.garden.CropAccessory; +import at.hannibal2.skyhanni.features.garden.CropType; +import at.hannibal2.skyhanni.features.garden.GardenPlotAPI; +import at.hannibal2.skyhanni.features.garden.farming.ArmorDropTracker; +import at.hannibal2.skyhanni.features.garden.farming.DicerRngDropTracker; +import at.hannibal2.skyhanni.features.garden.fortuneguide.FarmingItems; +import at.hannibal2.skyhanni.features.garden.visitor.VisitorReward; +import at.hannibal2.skyhanni.features.mining.powdertracker.PowderTracker; +import at.hannibal2.skyhanni.features.misc.trevor.TrevorTracker; +import at.hannibal2.skyhanni.features.rift.area.westvillage.VerminTracker; +import at.hannibal2.skyhanni.features.rift.area.westvillage.kloon.KloonTerminal; +import at.hannibal2.skyhanni.features.skillprogress.SkillType; +import at.hannibal2.skyhanni.features.slayer.SlayerProfitTracker; +import at.hannibal2.skyhanni.utils.LorenzVec; +import at.hannibal2.skyhanni.utils.NEUInternalName; +import com.google.gson.annotations.Expose; +import jline.internal.Nullable; +import net.minecraft.item.ItemStack; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +public class ProfileSpecificStorage { + + @Expose + public String currentPet = ""; + + @Expose + public MaxwellPowerStorage maxwell = new MaxwellPowerStorage(); + + public static class MaxwellPowerStorage { + @Expose + public String currentPower = null; + + @Expose + public int magicalPower = -1; + } + + @Expose + public ArrowsStorage arrows = new ArrowsStorage(); + + public static class ArrowsStorage { + @Expose + public String currentArrow = null; + + @Expose + public Map<NEUInternalName, Float> arrowAmount = new HashMap<>(); + } + + @Expose + public BitsStorage bits = new BitsStorage(); + + public static class BitsStorage { + @Expose + public int bits = -1; + + @Expose + public int bitsToClaim = -1; + } + + @Expose + public Map<LorenzVec, MinionConfig> minions = new HashMap<>(); + + public static class MinionConfig { + + @Expose + public String displayName = ""; + + @Expose + public long lastClicked = -1; + + @Override + public String toString() { + return "MinionConfig{" + + "displayName='" + displayName + '\'' + + ", lastClicked=" + lastClicked + + '}'; + } + } + + @Expose + public CrimsonIsleStorage crimsonIsle = new CrimsonIsleStorage(); + + public static class CrimsonIsleStorage { + + @Expose + public List<String> quests = new ArrayList<>(); + + @Expose + public List<String> miniBossesDoneToday = new ArrayList<>(); + + @Expose + public List<String> kuudraTiersDone = new ArrayList<>(); + + @Expose + public Map<String, Map<TrophyRarity, Integer>> trophyFishes = new HashMap<>(); + } + + @Expose + public GardenStorage garden = new GardenStorage(); + + public static class GardenStorage { + + @Expose + public Long experience = null; + + @Expose + public Map<CropType, Long> cropCounter = new HashMap<>(); + + @Expose + public Map<CropType, Integer> cropUpgrades = new HashMap<>(); + + @Expose + public Map<CropType, Integer> cropsPerSecond = new HashMap<>(); + + @Expose + public Map<CropType, Double> latestBlocksPerSecond = new HashMap<>(); + + @Expose + public Map<CropType, Double> latestTrueFarmingFortune = new HashMap<>(); + + @Expose + public CropAccessory savedCropAccessory = null; + + @Expose + public DicerRngDropTracker.Data dicerDropTracker = new DicerRngDropTracker.Data(); + + @Expose + public long informedAboutLowMatter = 0; + + @Expose + public long informedAboutLowFuel = 0; + + @Expose + public long visitorInterval = 15 * 60_000L; + + @Expose + public long nextSixthVisitorArrival = 0; + + @Expose + public ArmorDropTracker.Data armorDropTracker = new ArmorDropTracker.Data(); + + @Expose + public Map<ComposterUpgrade, Integer> composterUpgrades = new HashMap<>(); + + @Expose + public Map<CropType, Boolean> toolWithBountiful = new HashMap<>(); + + @Expose + public NEUInternalName composterCurrentOrganicMatterItem = NEUInternalName.Companion.getNONE(); + + @Expose + public NEUInternalName composterCurrentFuelItem = NEUInternalName.Companion.getNONE(); + + @Expose + public int uniqueVisitors = 0; + + @Expose + public GardenStorage.VisitorDrops visitorDrops = new GardenStorage.VisitorDrops(); + + public static class VisitorDrops { + @Expose + public int acceptedVisitors = 0; + + @Expose + public int deniedVisitors = 0; + + @Expose + public List<Long> visitorRarities = new ArrayList<>(); + + @Expose + public int copper = 0; + + @Expose + public long farmingExp = 0; + + @Expose + public int gardenExp = 0; + + @Expose + public long coinsSpent = 0; + + @Expose + public long bits = 0; + + @Expose + public long mithrilPowder = 0; + + @Expose + public long gemstonePowder = 0; + + @Expose + public Map<VisitorReward, Integer> rewardsCount = new HashMap<>(); + } + + @Expose + public GardenStorage.PlotIcon plotIcon = new GardenStorage.PlotIcon(); + + public static class PlotIcon { + @Expose + public Map<Integer, NEUInternalName> plotList = new HashMap<>(); + } + + @Expose + public Map<Integer, GardenPlotAPI.PlotData> plotData = new HashMap<>(); + + @Expose + public Map<CropType, LorenzVec> cropStartLocations = new HashMap<>(); + + @Expose + public GardenStorage.Fortune fortune = new GardenStorage.Fortune(); + + public static class Fortune { + + @Expose + public Map<FarmingItems, Boolean> outdatedItems = new HashMap<>(); + + @Expose + public int anitaUpgrade = -1; + + @Expose + public int farmingStrength = -1; + + @Expose + public int farmingLevel = -1; + + @Expose + public int plotsUnlocked = -1; + + @Expose + public long cakeExpiring = -1L; + + @Expose + public boolean carrotFortune = false; + + @Expose + public boolean pumpkinFortune = false; + + @Expose + public Map<FarmingItems, ItemStack> farmingItems = new HashMap<>(); + } + + @Expose + public long composterEmptyTime = 0; + + @Expose + public long lastComposterEmptyWarningTime = 0; + + @Expose + public GardenStorage.FarmingWeightConfig farmingWeight = new GardenStorage.FarmingWeightConfig(); + + public static class FarmingWeightConfig { + + @Expose + public int lastFarmingWeightLeaderboard = -1; + } + + @Expose + public Map<String, LorenzVec> npcVisitorLocations = new HashMap<>(); + } + + @Expose + public GhostCounter ghostCounter = new GhostCounter(); + + public static class GhostCounter { + + @Expose + public Map<GhostData.Option, Double> data = new HashMap<>(); + + @Expose + public boolean ctDataImported = false; + + @Expose + public double bestiaryNextLevel = 0; + + @Expose + public double bestiaryCurrentKill = 0; + + @Expose + public double bestiaryKillNeeded = 0; + + @Expose + public double totalMF = 0; + + @Expose + public int configUpdateVersion = 0; + + } + + @Expose + public PowderTracker.Data powderTracker = new PowderTracker.Data(); + + @Expose + public FrozenTreasureTracker.Data frozenTreasureTracker = new FrozenTreasureTracker.Data(); + + @Expose + public EnderNodeTracker.Data enderNodeTracker = new EnderNodeTracker.Data(); + + @Expose + public RiftStorage rift = new RiftStorage(); + + public static class RiftStorage { + + @Expose + public List<KloonTerminal> completedKloonTerminals = new ArrayList<>(); + + @Expose + public VerminTracker.Data verminTracker = new VerminTracker.Data(); + + } + + @Expose + public Map<String, SlayerProfitTracker.Data> slayerProfitData = new HashMap<>(); + + @Expose + public Map<String, SlayerRngMeterStorage> slayerRngMeter = new HashMap<>(); + + public static class SlayerRngMeterStorage { + + @Expose + public long currentMeter = -1; + + @Expose + public long gainPerBoss = -1; + + @Expose + public long goalNeeded = -1; + + @Expose + public String itemGoal = "?"; + + @Override + public String toString() { + return "SlayerRngMeterStorage{" + + "currentMeter=" + currentMeter + + ", gainPerBoss=" + gainPerBoss + + ", goalNeeded=" + goalNeeded + + ", itemGoal='" + itemGoal + '\'' + + '}'; + } + } + + @Expose + public MiningConfig mining = new MiningConfig(); + + public static class MiningConfig { + + @Expose + public List<String> kingsTalkedTo = new ArrayList<>(); + } + + @Expose + public TrapperData trapperData = new TrapperData(); + + public static class TrapperData { + + @Expose + public int questsDone; + + @Expose + public int peltsGained; + + @Expose + public int killedAnimals; + + @Expose + public int selfKillingAnimals; + + @Expose + public Map<TrevorTracker.TrapperMobRarity, Integer> animalRarities = new HashMap<>(); + } + + @Expose + public DungeonStorage dungeons = new DungeonStorage(); + + public static class DungeonStorage { + + @Expose + public Map<DungeonAPI.DungeonFloor, Integer> bosses = new HashMap<>(); + + @Expose + public List<DungeonStorage.DungeonRunInfo> runs = Stream.generate(DungeonStorage.DungeonRunInfo::new) + .limit(CroesusChestTracker.Companion.getMaxChests()) + .collect(Collectors.toCollection(ArrayList::new)); + + + public static class DungeonRunInfo { + + public DungeonRunInfo() { + } + + public DungeonRunInfo(String floor) { + this.floor = floor; + this.openState = CroesusChestTracker.OpenedState.UNOPENED; + } + + @Nullable + @Expose + public String floor = null; + + @Expose + @Nullable + public CroesusChestTracker.OpenedState openState = null; + + @Expose + @Nullable + public Boolean kismetUsed = null; + + } + } + + @Expose + public FishingStorage fishing = new FishingStorage(); + + public static class FishingStorage { + + @Expose + public FishingProfitTracker.Data fishingProfitTracker = new FishingProfitTracker.Data(); + + @Expose + public SeaCreatureTracker.Data seaCreatureTracker = new SeaCreatureTracker.Data(); + + } + + @Expose + public DianaStorage diana = new DianaStorage(); + + public static class DianaStorage { + + @Expose + // TODO rename to 'profitTracker' + public DianaProfitTracker.Data dianaProfitTracker = new DianaProfitTracker.Data(); + + @Expose + // TODO renmae + public MythologicalCreatureTracker.Data mythologicalMobTracker = new MythologicalCreatureTracker.Data(); + } + + @Expose + public Map<SkillType, SkillAPI.SkillInfo> skillData = new HashMap<>(); +} diff --git a/src/main/java/at/hannibal2/skyhanni/config/storage/Storage.java b/src/main/java/at/hannibal2/skyhanni/config/storage/Storage.java new file mode 100644 index 000000000..5256d33ea --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/storage/Storage.java @@ -0,0 +1,50 @@ +package at.hannibal2.skyhanni.config.storage; + +import at.hannibal2.skyhanni.features.misc.visualwords.VisualWord; +import at.hannibal2.skyhanni.utils.LorenzVec; +import at.hannibal2.skyhanni.utils.tracker.SkyHanniTracker; +import com.google.gson.annotations.Expose; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +public class Storage { + + @Expose + public boolean hasPlayedBefore = false; + + @Expose + public Float savedMouselockedSensitivity = .5f; + + @Expose + public Float savedMouseloweredSensitivity = .5f; + + @Deprecated + @Expose + public Map<String, List<String>> knownFeatureToggles = new HashMap<>(); + + @Expose + public List<VisualWord> modifiedWords = new ArrayList<>(); + + @Expose + public boolean visualWordsImported = false; + + @Expose + public Boolean contestSendingAsked = false; + + @Expose + public Map<String, SkyHanniTracker.DisplayMode> trackerDisplayModes = new HashMap<>(); + + @Expose + public List<LorenzVec> foundDianaBurrowLocations = new ArrayList<>(); + + @Expose + public Map<UUID, PlayerSpecificStorage> players = new HashMap<>(); + + @Expose + public String currentFameRank = null; + +} diff --git a/src/main/java/at/hannibal2/skyhanni/data/ProfileStorageData.kt b/src/main/java/at/hannibal2/skyhanni/data/ProfileStorageData.kt index 29a32d066..606928196 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/ProfileStorageData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/ProfileStorageData.kt @@ -2,7 +2,8 @@ package at.hannibal2.skyhanni.data import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.SackData -import at.hannibal2.skyhanni.config.Storage +import at.hannibal2.skyhanni.config.storage.PlayerSpecificStorage +import at.hannibal2.skyhanni.config.storage.ProfileSpecificStorage import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.HypixelJoinEvent import at.hannibal2.skyhanni.events.LorenzTickEvent @@ -20,8 +21,8 @@ import kotlin.time.Duration.Companion.seconds object ProfileStorageData { - var playerSpecific: Storage.PlayerSpecific? = null - var profileSpecific: Storage.ProfileSpecific? = null + var playerSpecific: PlayerSpecificStorage? = null + var profileSpecific: ProfileSpecificStorage? = null var loaded = false private var noTabListTime = SimpleTimeMark.farPast() @@ -83,12 +84,12 @@ object ProfileStorageData { } private fun loadProfileSpecific( - playerSpecific: Storage.PlayerSpecific, + playerSpecific: PlayerSpecificStorage, sackProfile: SackData.PlayerSpecific, profileName: String, ) { noTabListTime = SimpleTimeMark.farPast() - profileSpecific = playerSpecific.profiles.getOrPut(profileName) { Storage.ProfileSpecific() } + profileSpecific = playerSpecific.profiles.getOrPut(profileName) { ProfileSpecificStorage() } sackProfiles = sackProfile.profiles.getOrPut(profileName) { SackData.ProfileSpecific() } loaded = true ConfigLoadEvent().postAndCatch() @@ -97,7 +98,7 @@ object ProfileStorageData { @SubscribeEvent fun onHypixelJoin(event: HypixelJoinEvent) { val playerUuid = LorenzUtils.getRawPlayerUuid() - playerSpecific = SkyHanniMod.feature.storage.players.getOrPut(playerUuid) { Storage.PlayerSpecific() } + playerSpecific = SkyHanniMod.feature.storage.players.getOrPut(playerUuid) { PlayerSpecificStorage() } sackPlayers = SkyHanniMod.sackData.players.getOrPut(playerUuid) { SackData.PlayerSpecific() } ConfigLoadEvent().postAndCatch() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoAPI.kt index bee916507..f5361e09a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoAPI.kt @@ -1,6 +1,6 @@ package at.hannibal2.skyhanni.features.bingo -import at.hannibal2.skyhanni.config.Storage.PlayerSpecific.BingoSession +import at.hannibal2.skyhanni.config.storage.PlayerSpecificStorage.BingoSession import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.data.jsonobjects.repo.BingoJson import at.hannibal2.skyhanni.data.jsonobjects.repo.BingoRanksJson diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusChestTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusChestTracker.kt index 8623e3fc5..082175794 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusChestTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusChestTracker.kt @@ -1,7 +1,7 @@ package at.hannibal2.skyhanni.features.dungeon import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.config.Storage.ProfileSpecific.DungeonStorage.DungeonRunInfo +import at.hannibal2.skyhanni.config.storage.ProfileSpecificStorage.DungeonStorage.DungeonRunInfo import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.data.SackAPI import at.hannibal2.skyhanni.events.DungeonCompleteEvent @@ -265,11 +265,11 @@ class CroesusChestTracker { it.floor != null && (it.openState == OpenedState.UNOPENED || (includeDungeonKey && it.openState == OpenedState.OPENED)) } ?: -1) + 1 + } - enum class OpenedState { - UNOPENED, - OPENED, - KEY_USED, - } + enum class OpenedState { + UNOPENED, + OPENED, + KEY_USED, } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt index c9e872d1d..edf3cb8a2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt @@ -1,6 +1,6 @@ package at.hannibal2.skyhanni.features.garden.fortuneguide -import at.hannibal2.skyhanni.config.Storage +import at.hannibal2.skyhanni.config.storage.ProfileSpecificStorage import at.hannibal2.skyhanni.data.PetAPI import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.events.GardenToolChangeEvent @@ -183,7 +183,7 @@ object CaptureFarmingGear { private fun anita( items: Map<Int, ItemStack>, - storage: Storage.ProfileSpecific.GardenStorage.Fortune, + storage: ProfileSpecificStorage.GardenStorage.Fortune, ) { var level = -1 for ((_, item) in items) { @@ -205,7 +205,7 @@ object CaptureFarmingGear { private fun configurePlots( items: Map<Int, ItemStack>, - storage: Storage.ProfileSpecific.GardenStorage.Fortune, + storage: ProfileSpecificStorage.GardenStorage.Fortune, ) { var plotsUnlocked = 24 for (slot in items) { @@ -232,7 +232,7 @@ object CaptureFarmingGear { private fun skills( items: Map<Int, ItemStack>, - storage: Storage.ProfileSpecific.GardenStorage.Fortune, + storage: ProfileSpecificStorage.GardenStorage.Fortune, ) { for ((_, item) in items) { if (item.displayName.contains("Farming ")) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt index 4b74271e4..994146d7b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt @@ -1,8 +1,8 @@ package at.hannibal2.skyhanni.features.garden.visitor import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator -import at.hannibal2.skyhanni.config.Storage import at.hannibal2.skyhanni.config.features.garden.visitor.DropsStatisticsConfig.DropsStatisticsTextEntry +import at.hannibal2.skyhanni.config.storage.ProfileSpecificStorage import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.GuiRenderEvent @@ -155,7 +155,7 @@ object GardenVisitorDropStatistics { /** * Do not change the order of the elements getting added to the list. See DropsStatisticsTextEntry for the order. */ - private fun drawDisplay(storage: Storage.ProfileSpecific.GardenStorage.VisitorDrops) = buildList<List<Any>> { + private fun drawDisplay(storage: ProfileSpecificStorage.GardenStorage.VisitorDrops) = buildList<List<Any>> { addAsSingletonList("§e§lVisitor Statistics") addAsSingletonList(format(totalVisitors, "Total", "§e", "")) val visitorRarities = storage.visitorRarities diff --git a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt index bbb9ae874..93ba7e540 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt @@ -2,7 +2,7 @@ package at.hannibal2.skyhanni.features.minion import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator -import at.hannibal2.skyhanni.config.Storage +import at.hannibal2.skyhanni.config.storage.ProfileSpecificStorage import at.hannibal2.skyhanni.data.ClickType import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.data.ProfileStorageData @@ -176,7 +176,7 @@ class MinionFeatures { val name = getMinionName(openInventory) if (!minions.contains(entity) && LorenzUtils.skyBlockIsland != IslandType.HUB) { MinionFeatures.minions = minions.editCopy { - this[entity] = Storage.ProfileSpecific.MinionConfig().apply { + this[entity] = ProfileSpecificStorage.MinionConfig().apply { displayName = name lastClicked = 0 } @@ -288,7 +288,7 @@ class MinionFeatures { } if (message.startsWith("§bYou placed a minion!") && newMinion != null) { minions = minions?.editCopy { - this[newMinion!!] = Storage.ProfileSpecific.MinionConfig().apply { + this[newMinion!!] = ProfileSpecificStorage.MinionConfig().apply { displayName = newMinionName lastClicked = 0 } @@ -376,7 +376,7 @@ class MinionFeatures { var minionInventoryOpen = false var minionStorageInventoryOpen = false - private var minions: Map<LorenzVec, Storage.ProfileSpecific.MinionConfig>? + private var minions: Map<LorenzVec, ProfileSpecificStorage.MinionConfig>? get() { return ProfileStorageData.profileSpecific?.minions } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorTracker.kt index 60c28e1b6..73aee171e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorTracker.kt @@ -1,7 +1,7 @@ package at.hannibal2.skyhanni.features.misc.trevor import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.config.Storage +import at.hannibal2.skyhanni.config.storage.ProfileSpecificStorage import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.LorenzChatEvent @@ -113,7 +113,7 @@ object TrevorTracker { display = formatDisplay(drawTrapperDisplay(storage)) } - private fun drawTrapperDisplay(storage: Storage.ProfileSpecific.TrapperData) = buildList<List<Any>> { + private fun drawTrapperDisplay(storage: ProfileSpecificStorage.TrapperData) = buildList<List<Any>> { addAsSingletonList("§b§lTrevor Data Tracker") addAsSingletonList("§b${storage.questsDone.addSeparators()} §9Quests Started") addAsSingletonList("§b${storage.peltsGained.addSeparators()} §5Total Pelts Gained") diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailykuudra/DailyKuudraBossHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailykuudra/DailyKuudraBossHelper.kt index 977085457..5c7208c62 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailykuudra/DailyKuudraBossHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailykuudra/DailyKuudraBossHelper.kt @@ -1,7 +1,7 @@ package at.hannibal2.skyhanni.features.nether.reputationhelper.dailykuudra import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.config.Storage +import at.hannibal2.skyhanni.config.storage.ProfileSpecificStorage import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.data.ScoreboardData import at.hannibal2.skyhanni.data.jsonobjects.repo.CrimsonIsleReputationJson.ReputationQuest @@ -93,7 +93,7 @@ class DailyKuudraBossHelper(private val reputationHelper: CrimsonIsleReputationH updateAllKuudraDone() } - fun saveConfig(storage: Storage.ProfileSpecific.CrimsonIsleStorage) { + fun saveConfig(storage: ProfileSpecificStorage.CrimsonIsleStorage) { storage.kuudraTiersDone.clear() kuudraTiers.filter { it.doneToday } @@ -115,7 +115,7 @@ class DailyKuudraBossHelper(private val reputationHelper: CrimsonIsleReputationH } } - fun loadData(storage: Storage.ProfileSpecific.CrimsonIsleStorage) { + fun loadData(storage: ProfileSpecificStorage.CrimsonIsleStorage) { if (kuudraTiers.isEmpty()) return for (name in storage.kuudraTiersDone) { getByDisplayName(name)!!.doneToday = true diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt index 9b420ba9c..b443997c1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt @@ -1,7 +1,7 @@ package at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.config.Storage +import at.hannibal2.skyhanni.config.storage.ProfileSpecificStorage import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.data.SackAPI import at.hannibal2.skyhanni.data.SackStatus @@ -284,12 +284,12 @@ class DailyQuestHelper(val reputationHelper: CrimsonIsleReputationHelper) { quests.clear() } - fun load(storage: Storage.ProfileSpecific.CrimsonIsleStorage) { + fun load(storage: ProfileSpecificStorage.CrimsonIsleStorage) { reset() questLoader.loadConfig(storage) } - fun saveConfig(storage: Storage.ProfileSpecific.CrimsonIsleStorage) { + fun saveConfig(storage: ProfileSpecificStorage.CrimsonIsleStorage) { storage.quests.clear() for (quest in quests) { val builder = StringBuilder() diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/QuestLoader.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/QuestLoader.kt index 20497e75d..e6753ffc5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/QuestLoader.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/QuestLoader.kt @@ -1,6 +1,6 @@ package at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest -import at.hannibal2.skyhanni.config.Storage +import at.hannibal2.skyhanni.config.storage.ProfileSpecificStorage import at.hannibal2.skyhanni.data.jsonobjects.repo.CrimsonIsleReputationJson.ReputationQuest import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.quest.DojoQuest @@ -170,7 +170,7 @@ class QuestLoader(private val dailyQuestHelper: DailyQuestHelper) { } } - fun loadConfig(storage: Storage.ProfileSpecific.CrimsonIsleStorage) { + fun loadConfig(storage: ProfileSpecificStorage.CrimsonIsleStorage) { if (dailyQuestHelper.greatSpook) return if (storage.quests.toList().any { hasGreatSpookLine(it) }) { dailyQuestHelper.greatSpook = true diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt index 257e5d9b2..deb4c64dd 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt @@ -1,7 +1,7 @@ package at.hannibal2.skyhanni.features.nether.reputationhelper.miniboss import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.config.Storage +import at.hannibal2.skyhanni.config.storage.ProfileSpecificStorage import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.data.jsonobjects.repo.CrimsonIsleReputationJson.ReputationQuest import at.hannibal2.skyhanni.events.LorenzChatEvent @@ -90,7 +90,7 @@ class DailyMiniBossHelper(private val reputationHelper: CrimsonIsleReputationHel } } - fun saveConfig(storage: Storage.ProfileSpecific.CrimsonIsleStorage) { + fun saveConfig(storage: ProfileSpecificStorage.CrimsonIsleStorage) { storage.miniBossesDoneToday.clear() miniBosses.filter { it.doneToday } @@ -107,7 +107,7 @@ class DailyMiniBossHelper(private val reputationHelper: CrimsonIsleReputationHel } } - fun loadData(storage: Storage.ProfileSpecific.CrimsonIsleStorage) { + fun loadData(storage: ProfileSpecificStorage.CrimsonIsleStorage) { if (miniBosses.isEmpty()) return for (name in storage.miniBossesDoneToday) { getByDisplayName(name)!!.doneToday = true diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt index 1ed123b51..fefc5cf0c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt @@ -2,7 +2,7 @@ package at.hannibal2.skyhanni.features.slayer import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator -import at.hannibal2.skyhanni.config.Storage +import at.hannibal2.skyhanni.config.storage.ProfileSpecificStorage import at.hannibal2.skyhanni.data.SlayerAPI import at.hannibal2.skyhanni.data.jsonobjects.repo.SlayerProfitTrackerItemsJson import at.hannibal2.skyhanni.events.GuiRenderEvent @@ -108,7 +108,7 @@ object SlayerProfitTracker { if (itemLogCategory == "") return null return trackers.getOrPut(itemLogCategory) { - val getStorage: (Storage.ProfileSpecific) -> Data = { + val getStorage: (ProfileSpecificStorage) -> Data = { it.slayerProfitData.getOrPut( itemLogCategory ) { Data() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt index 558d421d0..e2ae877bb 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt @@ -1,7 +1,7 @@ package at.hannibal2.skyhanni.features.slayer import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.config.Storage +import at.hannibal2.skyhanni.config.storage.ProfileSpecificStorage import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.data.SlayerAPI import at.hannibal2.skyhanni.events.GuiRenderEvent @@ -111,9 +111,9 @@ class SlayerRngMeterDisplay { update() } - private fun getStorage(): Storage.ProfileSpecific.SlayerRngMeterStorage? { + private fun getStorage(): ProfileSpecificStorage.SlayerRngMeterStorage? { return ProfileStorageData.profileSpecific?.slayerRngMeter?.getOrPut(getCurrentSlayer()) { - Storage.ProfileSpecific.SlayerRngMeterStorage() + ProfileSpecificStorage.SlayerRngMeterStorage() } } diff --git a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt index 3f4afe94f..d40d52d99 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniConfigSearchResetCommand.kt @@ -224,7 +224,7 @@ object SkyHanniConfigSearchResetCommand { if (!classFilter(className)) continue val objectName = obj.getObjectName() if (obj !is Runnable && objectName.startsWith(className) && (objectName.startsWith("at.hannibal2.skyhanni.config.features.") || - objectName.startsWith("at.hannibal2.skyhanni.config.Storage")) + objectName.startsWith("at.hannibal2.skyhanni.config.storage.Storage")) ) { "<category>" } else if (onlyValue) { diff --git a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt index e8045d70a..d6f888bad 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniItemTracker.kt @@ -1,8 +1,8 @@ package at.hannibal2.skyhanni.utils.tracker import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.config.Storage import at.hannibal2.skyhanni.config.features.misc.TrackerConfig.PriceFromEntry +import at.hannibal2.skyhanni.config.storage.ProfileSpecificStorage import at.hannibal2.skyhanni.data.SlayerAPI import at.hannibal2.skyhanni.test.PriceSource import at.hannibal2.skyhanni.utils.ChatUtils @@ -22,7 +22,7 @@ import kotlin.time.Duration.Companion.seconds class SkyHanniItemTracker<Data : ItemTrackerData>( name: String, createNewSession: () -> Data, - getStorage: (Storage.ProfileSpecific) -> Data, + getStorage: (ProfileSpecificStorage) -> Data, drawDisplay: (Data) -> List<List<Any>>, ) : SkyHanniTracker<Data>(name, createNewSession, getStorage, drawDisplay) { diff --git a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt index 226e00dfa..8f477ae59 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt @@ -1,9 +1,9 @@ package at.hannibal2.skyhanni.utils.tracker import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.config.Storage import at.hannibal2.skyhanni.config.core.config.Position import at.hannibal2.skyhanni.config.features.misc.TrackerConfig.PriceFromEntry +import at.hannibal2.skyhanni.config.storage.ProfileSpecificStorage import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.data.TrackerManager import at.hannibal2.skyhanni.features.inventory.bazaar.BazaarApi.Companion.getBazaarData @@ -24,13 +24,13 @@ import kotlin.time.Duration.Companion.seconds open class SkyHanniTracker<Data : TrackerData>( val name: String, private val createNewSession: () -> Data, - private val getStorage: (Storage.ProfileSpecific) -> Data, + private val getStorage: (ProfileSpecificStorage) -> Data, private val drawDisplay: (Data) -> List<List<Any>>, ) { private var inventoryOpen = false private var displayMode: DisplayMode? = null - private val currentSessions = mutableMapOf<Storage.ProfileSpecific, Data>() + private val currentSessions = mutableMapOf<ProfileSpecificStorage, Data>() private var display = emptyList<List<Any>>() private var sessionResetTime = SimpleTimeMark.farPast() private var dirty = false @@ -144,9 +144,9 @@ open class SkyHanniTracker<Data : TrackerData>( SharedTracker(it.getTotal(), it.getCurrentSession()) } - private fun Storage.ProfileSpecific.getCurrentSession() = currentSessions.getOrPut(this) { createNewSession() } + private fun ProfileSpecificStorage.getCurrentSession() = currentSessions.getOrPut(this) { createNewSession() } - private fun Storage.ProfileSpecific.getTotal(): Data = getStorage(this) + private fun ProfileSpecificStorage.getTotal(): Data = getStorage(this) private fun reset(displayMode: DisplayMode, message: String) { getSharedTracker()?.let { |