diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-09 01:41:59 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-09 01:41:59 +0100 |
commit | 071a215e9f55b2bf90bcdc8be5fc25ae9fe981cb (patch) | |
tree | 2e1ceb8b206b725c8bd864b658b8fa292032f566 /src/main/java/at/hannibal2/skyhanni | |
parent | f8257877d76a61d41b7fc69987c5ac3a77b77174 (diff) | |
download | skyhanni-071a215e9f55b2bf90bcdc8be5fc25ae9fe981cb.tar.gz skyhanni-071a215e9f55b2bf90bcdc8be5fc25ae9fe981cb.tar.bz2 skyhanni-071a215e9f55b2bf90bcdc8be5fc25ae9fe981cb.zip |
Prevent spamming the command /shclearcontestdata
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt index 391680208..ed87e6da7 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt @@ -38,6 +38,7 @@ import at.hannibal2.skyhanni.utils.OSUtils import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText import at.hannibal2.skyhanni.utils.RenderUtils.renderString import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems +import at.hannibal2.skyhanni.utils.SimpleTimeMark import at.hannibal2.skyhanni.utils.SoundUtils import kotlinx.coroutines.launch import net.minecraft.client.Minecraft @@ -47,6 +48,7 @@ import net.minecraftforge.client.event.GuiScreenEvent import net.minecraftforge.common.MinecraftForge import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.io.File +import kotlin.time.Duration.Companion.seconds class SkyHanniDebugsAndTests { @@ -260,7 +262,15 @@ class SkyHanniDebugsAndTests { LorenzUtils.chat("§eYou are not in Skyblock.") } + private var lastManualContestDataUpdate = SimpleTimeMark.farPast() + fun clearContestData() { + if (lastManualContestDataUpdate.passedSince() < 30.seconds) { + LorenzUtils.userError("§cYou already cleared Jacob's Contest data recently!") + return + } + lastManualContestDataUpdate = SimpleTimeMark.now() + GardenNextJacobContest.contests.clear() GardenNextJacobContest.fetchedFromElite = false GardenNextJacobContest.isFetchingContests = true |