From db0f40aabed9a29e0055c3c9e6a6b1159b1444bf Mon Sep 17 00:00:00 2001 From: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> Date: Sat, 1 Jul 2023 08:47:24 +1000 Subject: No more getItemStack() crashes hopefully (#276) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- src/main/java/at/hannibal2/skyhanni/config/Storage.java | 3 +++ .../java/at/hannibal2/skyhanni/config/commands/Commands.kt | 13 +++++++++++++ 2 files changed, 16 insertions(+) (limited to 'src/main/java/at/hannibal2/skyhanni/config') diff --git a/src/main/java/at/hannibal2/skyhanni/config/Storage.java b/src/main/java/at/hannibal2/skyhanni/config/Storage.java index a1f9fbfb1..d720b0211 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/Storage.java +++ b/src/main/java/at/hannibal2/skyhanni/config/Storage.java @@ -35,6 +35,9 @@ public class Storage { @Expose public long nextCityProjectParticipationTime = 0L; + + @Expose + public String lastRepoIssueVersion = ""; } public static class ProfileSpecific { diff --git a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt index 59b850784..b91bf4252 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt @@ -5,6 +5,7 @@ import at.hannibal2.skyhanni.config.ConfigGuiManager import at.hannibal2.skyhanni.config.commands.SimpleCommand.ProcessCommandRunnable import at.hannibal2.skyhanni.data.ApiDataLoader import at.hannibal2.skyhanni.data.GuiEditManager +import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.features.bingo.BingoCardDisplay import at.hannibal2.skyhanni.features.bingo.BingoNextStepHelper import at.hannibal2.skyhanni.features.event.diana.BurrowWarpHelper @@ -86,6 +87,7 @@ object Commands { registerCommand("shtestcomposter") { ComposterOverlay.onCommand(it) } registerCommand("shtestinquisitor") { InquisitorWaypointShare.test() } registerCommand("shshowcropmoneycalculation") { CropMoneyDisplay.toggleShowCalculation() } + registerCommand("shstoprepowarnings") { stopRepoWarnings()} // for developers - coding help registerCommand("shreloadlocalrepo") { SkyHanniMod.repo.reloadLocalRepo() } @@ -113,6 +115,17 @@ object Commands { } } + private fun stopRepoWarnings() { + val hidden = ProfileStorageData.playerSpecific?.lastRepoIssueVersion + if (hidden == SkyHanniMod.version) { + ProfileStorageData.playerSpecific?.lastRepoIssueVersion = "" + LorenzUtils.chat("§e[SkyHanni] Re-enabled repo warnings.") + } else { + ProfileStorageData.playerSpecific?.lastRepoIssueVersion = SkyHanniMod.version + LorenzUtils.chat("§e[SkyHanni] Disabled repo warnings until next update.") + } + } + private fun clearFarmingItems() { val config = GardenAPI.config?.fortune ?: return LorenzUtils.chat("§e[SkyHanni] clearing farming items") -- cgit