From 7d0875bf2218c9e03712f549baa6471221ff7140 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 10 Jun 2023 11:32:32 +0200 Subject: Added City Project Daily Reminder --- CHANGELOG.md | 1 + FEATURES.md | 3 +- .../java/at/hannibal2/skyhanni/config/Storage.java | 3 + .../hannibal2/skyhanni/config/commands/Commands.kt | 2 + .../hannibal2/skyhanni/config/features/Misc.java | 5 ++ .../skyhanni/features/misc/CityProjectFeatures.kt | 91 ++++++++++++++++++---- 6 files changed, 88 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d3726601..85f848e6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ + Warns when right-clicking with a Wither Impact weapon (e.g. Hyperion) no longer gains combat exp (Kill a mob with melee-hits to fix this hypixel bug) + Added Piece of Wizard Portal show earned by player name (Contributed by HiZe) ++ City Project Daily Reminder - Remind every 24 hours to participate ### Changes + Added Options for displays Crop Milestone and Best Crop Time. diff --git a/FEATURES.md b/FEATURES.md index b363fef71..b4ef77287 100644 --- a/FEATURES.md +++ b/FEATURES.md @@ -274,10 +274,11 @@ + **Estimated Item Value** - Displays an estimated item value for the item you hover over. + **Discord RPC** - Showing stats like Location, Purse, Bits, Purse or Held Item at Discord Rich Presence. - (contributed by NetheriteMiner) + Server Restart Title -+ Added City Project Features ++ **City Project Features** + Show missing items to contribute inside the inventory + Click on the item name to open the bazaar + Highlight a component in the inventory that can be contributed + + City Project Daily Reminder - Remind every 24 hours to participate + **Command Autocomplete** + Supports tab completing for warp points when typing /warp + Supports party members, friends (need to visit all friend list pages), player on the same server diff --git a/src/main/java/at/hannibal2/skyhanni/config/Storage.java b/src/main/java/at/hannibal2/skyhanni/config/Storage.java index 1807e2e22..2de960a30 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/Storage.java +++ b/src/main/java/at/hannibal2/skyhanni/config/Storage.java @@ -186,5 +186,8 @@ public class Storage { public Map farmingItems = new HashMap<>(); } } + + @Expose + public long nextCityProjectParticipationTime = 0L; } } \ No newline at end of file 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 147734b30..bcddda8df 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt @@ -18,6 +18,7 @@ import at.hannibal2.skyhanni.features.garden.farming.GardenStartLocation import at.hannibal2.skyhanni.features.garden.fortuneguide.CaptureFarmingGear import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI import at.hannibal2.skyhanni.features.minion.MinionFeatures +import at.hannibal2.skyhanni.features.misc.CityProjectFeatures import at.hannibal2.skyhanni.features.misc.CollectionCounter import at.hannibal2.skyhanni.features.misc.MarkedPlayerManager import at.hannibal2.skyhanni.features.misc.discordrpc.DiscordRPCManager @@ -61,6 +62,7 @@ object Commands { registerCommand("shshareinquis") { InquisitorWaypointShare.sendInquisitor() } registerCommand("shrpcstart") { DiscordRPCManager.startCommand() } registerCommand("shcropstartlocation") { GardenStartLocation.setLocationCommand() } + registerCommand("shstopcityprojectreminder") { CityProjectFeatures.disable() } // for users - fix bugs registerCommand("shupdaterepo") { SkyHanniMod.repo.updateRepo() } diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java b/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java index bf2baef35..97a885cdc 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java @@ -381,6 +381,11 @@ public class Misc { @ConfigEditorBoolean public boolean showReady = true; + @Expose + @ConfigOption(name = "Daily Reminder", desc = "Remind every 24 hours to participate.") + @ConfigEditorBoolean + public boolean dailyReminder = true; + @Expose public Position pos = new Position(150, 150, false, true); } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/CityProjectFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CityProjectFeatures.kt index bc71d58a3..3d3a0035d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/CityProjectFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CityProjectFeatures.kt @@ -1,10 +1,12 @@ package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.InventoryOpenEvent +import at.hannibal2.skyhanni.features.garden.contest.FarmingContestAPI import at.hannibal2.skyhanni.utils.* import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name @@ -12,6 +14,7 @@ import at.hannibal2.skyhanni.utils.LorenzUtils.addAsSingletonList import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.RenderUtils.highlight import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems +import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.StringUtils.removeColor import at.hannibal2.skyhanni.utils.renderables.Renderable import net.minecraft.client.Minecraft @@ -20,11 +23,53 @@ import net.minecraft.client.gui.inventory.GuiEditSign import net.minecraft.inventory.ContainerChest import net.minecraft.item.ItemStack import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +import net.minecraftforge.fml.common.gameevent.TickEvent class CityProjectFeatures { - private val config get() = SkyHanniMod.feature.misc.cityProject private var display = listOf>() private var inInventory = false + private var tick = 0 + private var lastReminderSend = 0L + private val contributeAgainPattern = "§7Contribute again: §e(?