Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement: Move Cookies and rabbits #1599

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
Original file line number Diff line number Diff line change
Expand Up @@ -125,19 +125,6 @@ import at.hannibal2.skyhanni.features.dungeon.DungeonTeammateOutlines
import at.hannibal2.skyhanni.features.dungeon.HighlightDungeonDeathmite
import at.hannibal2.skyhanni.features.dungeon.TerracottaPhase
import at.hannibal2.skyhanni.features.event.UniqueGiftingOpportunitiesFeatures
import at.hannibal2.skyhanni.features.event.chocolatefactory.ChocolateFactoryAPI
import at.hannibal2.skyhanni.features.event.chocolatefactory.ChocolateFactoryBarnManager
import at.hannibal2.skyhanni.features.event.chocolatefactory.ChocolateFactoryShortcut
import at.hannibal2.skyhanni.features.event.chocolatefactory.hoppity.HoppityCollectionStats
import at.hannibal2.skyhanni.features.event.chocolatefactory.hoppity.HoppityEggLocator
import at.hannibal2.skyhanni.features.event.chocolatefactory.hoppity.HoppityEggsManager
import at.hannibal2.skyhanni.features.event.chocolatefactory.hoppity.HoppityEggsShared
import at.hannibal2.skyhanni.features.event.chocolatefactory.hoppity.HoppityNpc
import at.hannibal2.skyhanni.features.event.chocolatefactory.menu.ChocolateFactoryInventory
import at.hannibal2.skyhanni.features.event.chocolatefactory.menu.ChocolateFactoryStats
import at.hannibal2.skyhanni.features.event.chocolatefactory.menu.ChocolateFactoryTimeTowerManager
import at.hannibal2.skyhanni.features.event.chocolatefactory.menu.ChocolateFactoryTooltip
import at.hannibal2.skyhanni.features.event.chocolatefactory.menu.ChocolateFactoryTooltipCompact
import at.hannibal2.skyhanni.features.event.diana.AllBurrowsList
import at.hannibal2.skyhanni.features.event.diana.BurrowWarpHelper
import at.hannibal2.skyhanni.features.event.diana.DianaProfitTracker
Expand All @@ -148,6 +135,11 @@ import at.hannibal2.skyhanni.features.event.diana.HighlightInquisitors
import at.hannibal2.skyhanni.features.event.diana.InquisitorWaypointShare
import at.hannibal2.skyhanni.features.event.diana.MythologicalCreatureTracker
import at.hannibal2.skyhanni.features.event.diana.SoopyGuessBurrow
import at.hannibal2.skyhanni.features.event.hoppity.HoppityCollectionStats
import at.hannibal2.skyhanni.features.event.hoppity.HoppityEggLocator
import at.hannibal2.skyhanni.features.event.hoppity.HoppityEggsManager
import at.hannibal2.skyhanni.features.event.hoppity.HoppityEggsShared
import at.hannibal2.skyhanni.features.event.hoppity.HoppityNpc
import at.hannibal2.skyhanni.features.event.jerry.HighlightJerries
import at.hannibal2.skyhanni.features.event.jerry.frozentreasure.FrozenTreasureTracker
import at.hannibal2.skyhanni.features.event.lobby.waypoints.christmas.PresentWaypoints
Expand Down Expand Up @@ -276,6 +268,14 @@ import at.hannibal2.skyhanni.features.inventory.bazaar.BazaarCancelledBuyOrderCl
import at.hannibal2.skyhanni.features.inventory.bazaar.BazaarOpenPriceWebsite
import at.hannibal2.skyhanni.features.inventory.bazaar.BazaarOrderHelper
import at.hannibal2.skyhanni.features.inventory.bazaar.CraftMaterialsFromBazaar
import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactoryAPI
import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactoryBarnManager
import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactoryInventory
import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactoryShortcut
import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactoryStats
import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactoryTimeTowerManager
import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactoryTooltip
import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactoryTooltipCompact
import at.hannibal2.skyhanni.features.inventory.tiarelay.TiaRelayHelper
import at.hannibal2.skyhanni.features.inventory.tiarelay.TiaRelayWaypoints
import at.hannibal2.skyhanni.features.itemabilities.ChickenHeadTimer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import com.google.gson.JsonPrimitive
object ConfigUpdaterMigrator {

val logger = LorenzLogger("ConfigMigration")
const val CONFIG_VERSION = 43
const val CONFIG_VERSION = 44
fun JsonElement.at(chain: List<String>, init: Boolean): JsonElement? {
if (chain.isEmpty()) return this
if (this !is JsonObject) return null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public class EventConfig {
public WinterConfig winter = new WinterConfig();

@Expose
@Category(name = "Hoppity", desc = "Features for the Hoppity event and the chocolate factory.")
public ChocolateFactoryConfig chocolateFactory = new ChocolateFactoryConfig();
@Category(name = "Hoppity Eggs", desc = "Features for the Hoppity event.")
public HoppityEggsConfig hoppityEggs = new HoppityEggsConfig();

@ConfigOption(name = "City Project", desc = "")
@Accordion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,10 @@ public class HoppityEggsConfig {
@Expose
@ConfigLink(owner = HoppityEggsConfig.class, field = "showClaimedEggs")
public Position position = new Position(33, 72, false, true);

@Expose
@ConfigOption(name = "Highlight Hoppity Shop", desc = "Highlight items that haven't been bought from the Hoppity shop yet.")
@ConfigEditorBoolean
@FeatureToggle
public boolean highlightHoppityShop = true;
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package at.hannibal2.skyhanni.config.features.event;
package at.hannibal2.skyhanni.config.features.inventory;

import at.hannibal2.skyhanni.config.FeatureToggle;
import at.hannibal2.skyhanni.config.core.config.Position;
import at.hannibal2.skyhanni.features.event.chocolatefactory.menu.ChocolateFactoryStats.ChocolateFactoryStat;
import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactoryStats.ChocolateFactoryStat;
import com.google.gson.annotations.Expose;
import io.github.notenoughupdates.moulconfig.annotations.Accordion;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDraggableList;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorSlider;
Expand All @@ -17,11 +16,6 @@

public class ChocolateFactoryConfig {

@Expose
@ConfigOption(name = "Hoppity Eggs", desc = "")
@Accordion
public HoppityEggsConfig hoppityEggs = new HoppityEggsConfig();

@Expose
@ConfigOption(name = "Chocolate Factory Features", desc = "Global toggle for all chocolate factory features.")
@ConfigEditorBoolean
Expand Down Expand Up @@ -92,33 +86,17 @@ public class ChocolateFactoryConfig {
@FeatureToggle
public boolean extraTooltipStats = true;

@Expose
@ConfigOption(name = "Hoppity Collection Stats", desc = "Shows info about your hoppity rabbit collection.")
@ConfigEditorBoolean
@FeatureToggle
public boolean hoppityCollectionStats = true;

@Expose
@ConfigOption(name = "Time Tower Warning", desc = "Notification when you have a new time tower usage available and " +
"continuously warn when your time tower is full.")
@ConfigEditorBoolean
@FeatureToggle
public boolean timeTowerWarning = false;

@Expose
@ConfigOption(name = "Hoppity Menu Shortcut", desc = "Add a Chocolate Factory button in the SkyBlock Menu that runs /chocolatefactory on click.")
@ConfigEditorBoolean
@FeatureToggle
public boolean hoppityMenuShortcut = true;

@Expose
@ConfigLink(owner = ChocolateFactoryConfig.class, field = "statsDisplay")
public Position position = new Position(163, 160, false, true);

@Expose
@ConfigLink(owner = ChocolateFactoryConfig.class, field = "hoppityCollectionStats")
public Position hoppityStatsPosition = new Position(163, 160, false, true);

@Expose
@ConfigOption(name = "Compact On Click", desc = "Compact the item toolip when clicking on the chocolate.")
@ConfigEditorBoolean
Expand All @@ -141,8 +119,18 @@ public class ChocolateFactoryConfig {
public Position tooltipMovePosition = new Position(-380, 150, false, true);

@Expose
@ConfigOption(name = "Highlight Hoppity Shop", desc = "Highlight items that haven't been bought from the Hoppity shop yet.")
@ConfigOption(name = "Hoppity Collection Stats", desc = "Shows info about your hoppity rabbit collection.")
@ConfigEditorBoolean
@FeatureToggle
public boolean highlightHoppityShop = true;
public boolean hoppityCollectionStats = true;

@Expose
@ConfigLink(owner = ChocolateFactoryConfig.class, field = "hoppityCollectionStats")
public Position hoppityStatsPosition = new Position(163, 160, false, true);

@Expose
@ConfigOption(name = "Hoppity Menu Shortcut", desc = "Add a Chocolate Factory button in the SkyBlock Menu that runs /chocolatefactory on click.")
@ConfigEditorBoolean
@FeatureToggle
public boolean hoppityMenuShortcut = true;
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ public class InventoryConfig {
@Category(name = "Item Abilities", desc = "Stuff about item abilities.")
public ItemAbilityConfig itemAbilities = new ItemAbilityConfig();

@Expose
@Category(name = "Chocolate Factory", desc = "The chocolate factory")
public ChocolateFactoryConfig chocolateFactory = new ChocolateFactoryConfig();

@Expose
@ConfigOption(name = "Not Clickable Items", desc = "")
@Accordion
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package at.hannibal2.skyhanni.features.event.chocolatefactory.hoppity
package at.hannibal2.skyhanni.features.event.hoppity

import at.hannibal2.skyhanni.events.GuiRenderEvent
import at.hannibal2.skyhanni.events.InventoryCloseEvent
import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent
import at.hannibal2.skyhanni.events.ProfileJoinEvent
import at.hannibal2.skyhanni.features.event.chocolatefactory.ChocolateFactoryAPI
import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactoryAPI
import at.hannibal2.skyhanni.utils.DisplayTableEntry
import at.hannibal2.skyhanni.utils.ItemUtils.getLore
import at.hannibal2.skyhanni.utils.LorenzUtils
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package at.hannibal2.skyhanni.features.event.chocolatefactory.hoppity
package at.hannibal2.skyhanni.features.event.hoppity

import at.hannibal2.skyhanni.data.IslandType
import at.hannibal2.skyhanni.events.DebugDataCollectEvent
import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent
import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
import at.hannibal2.skyhanni.events.ReceiveParticleEvent
import at.hannibal2.skyhanni.features.event.chocolatefactory.ChocolateFactoryAPI
import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactoryAPI
import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled
import at.hannibal2.skyhanni.utils.InventoryUtils
import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName
Expand All @@ -26,7 +26,7 @@ import kotlin.time.Duration.Companion.seconds

object HoppityEggLocator {

private val config get() = ChocolateFactoryAPI.config.hoppityEggs
private val config get() = HoppityEggsManager.config

private val locatorItem = "EGGLOCATOR".asInternalName()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package at.hannibal2.skyhanni.features.event.chocolatefactory.hoppity
package at.hannibal2.skyhanni.features.event.hoppity

import io.github.moulberry.notenoughupdates.util.SkyBlockTime

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package at.hannibal2.skyhanni.features.event.chocolatefactory.hoppity
package at.hannibal2.skyhanni.features.event.hoppity

import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator
import at.hannibal2.skyhanni.events.GuiRenderEvent
import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
import at.hannibal2.skyhanni.events.SecondPassedEvent
import at.hannibal2.skyhanni.features.event.chocolatefactory.ChocolateFactoryAPI
import at.hannibal2.skyhanni.features.fame.ReminderUtils
import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactoryAPI
import at.hannibal2.skyhanni.test.command.ErrorManager
import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.DelayedRun
Expand All @@ -20,7 +22,7 @@ import kotlin.time.Duration.Companion.seconds

object HoppityEggsManager {

private val config get() = ChocolateFactoryAPI.config.hoppityEggs
val config get() = SkyHanniMod.feature.event.hoppityEggs

private val eggFoundPattern by ChocolateFactoryAPI.patternGroup.pattern(
"egg.found",
Expand Down Expand Up @@ -115,4 +117,14 @@ object HoppityEggsManager {
fun onSecondPassed(event: SecondPassedEvent) {
HoppityEggType.checkClaimed()
}

@SubscribeEvent
fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) {
event.move(
44,
"event.chocolateFactory.highlightHoppityShop",
"event.chocolateFactory.hoppityEggs.highlightHoppityShop"
)
event.move(44, "event.chocolateFactory.hoppityEggs", "event.hoppityEggs")
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package at.hannibal2.skyhanni.features.event.chocolatefactory.hoppity
package at.hannibal2.skyhanni.features.event.hoppity

import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.features.event.chocolatefactory.ChocolateFactoryAPI
import at.hannibal2.skyhanni.features.event.chocolatefactory.hoppity.HoppityEggsManager.getEggType
import at.hannibal2.skyhanni.features.event.hoppity.HoppityEggsManager.getEggType
import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactoryAPI
import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.LorenzVec
Expand All @@ -13,7 +13,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent

object HoppityEggsShared {

private val config get() = ChocolateFactoryAPI.config.hoppityEggs
private val config get() = HoppityEggsManager.config

/**
* REGEX-TEST: CalMWolfs: [SkyHanni] Breakfast Chocolate Egg located at x: 142, y: 71, z: -453
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package at.hannibal2.skyhanni.features.event.chocolatefactory.hoppity
package at.hannibal2.skyhanni.features.event.hoppity

import at.hannibal2.skyhanni.events.GuiContainerEvent
import at.hannibal2.skyhanni.events.InventoryCloseEvent
import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent
import at.hannibal2.skyhanni.events.InventoryUpdatedEvent
import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
import at.hannibal2.skyhanni.features.event.chocolatefactory.ChocolateFactoryAPI
import at.hannibal2.skyhanni.utils.InventoryUtils
import at.hannibal2.skyhanni.utils.ItemUtils.getLore
import at.hannibal2.skyhanni.utils.LorenzColor
Expand All @@ -15,7 +14,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent

object HoppityNpc {

private val config get() = ChocolateFactoryAPI.config
private val config get() = HoppityEggsManager.config

private var slotsToHighlight = mutableSetOf<Int>()
private var inShop = false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package at.hannibal2.skyhanni.features.event.chocolatefactory.menu
package at.hannibal2.skyhanni.features.inventory.chocolatefactory

import at.hannibal2.skyhanni.features.event.chocolatefactory.ChocolateFactoryAPI
import at.hannibal2.skyhanni.features.event.chocolatefactory.ChocolateFactoryAPI.profileStorage
import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactoryAPI.profileStorage
import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators
import at.hannibal2.skyhanni.utils.SimpleTimeMark
import at.hannibal2.skyhanni.utils.TimeUtils.format
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package at.hannibal2.skyhanni.features.event.chocolatefactory
package at.hannibal2.skyhanni.features.inventory.chocolatefactory

import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.config.features.event.ChocolateFactoryConfig
import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator
import at.hannibal2.skyhanni.config.storage.ProfileSpecificStorage.ChocolateFactoryStorage
import at.hannibal2.skyhanni.data.ProfileStorageData
import at.hannibal2.skyhanni.data.jsonobjects.repo.HoppityEggLocationsJson
Expand All @@ -10,11 +10,7 @@ import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent
import at.hannibal2.skyhanni.events.InventoryUpdatedEvent
import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
import at.hannibal2.skyhanni.events.RepositoryReloadEvent
import at.hannibal2.skyhanni.features.event.chocolatefactory.hoppity.HoppityEggLocator
import at.hannibal2.skyhanni.features.event.chocolatefactory.menu.ChocolateAmount
import at.hannibal2.skyhanni.features.event.chocolatefactory.menu.ChocolateFactoryStats
import at.hannibal2.skyhanni.features.event.chocolatefactory.menu.ChocolateFactoryTimeTowerManager
import at.hannibal2.skyhanni.features.event.chocolatefactory.menu.ChocolateFactoryTooltip
import at.hannibal2.skyhanni.features.event.hoppity.HoppityEggLocator
import at.hannibal2.skyhanni.utils.CollectionUtils.nextAfter
import at.hannibal2.skyhanni.utils.DelayedRun
import at.hannibal2.skyhanni.utils.InventoryUtils
Expand All @@ -39,8 +35,7 @@ import net.minecraft.item.ItemStack
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent

object ChocolateFactoryAPI {

val config: ChocolateFactoryConfig get() = SkyHanniMod.feature.event.chocolateFactory
val config get() = SkyHanniMod.feature.inventory.chocolateFactory
val profileStorage: ChocolateFactoryStorage? get() = ProfileStorageData.profileSpecific?.chocolateFactory

val patternGroup = RepoPattern.group("misc.chocolatefactory")
Expand Down Expand Up @@ -332,6 +327,30 @@ object ChocolateFactoryAPI {
ChocolateFactoryTooltip.updateIgnoredSlots()
}

@SubscribeEvent
fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) {
val old = "event.chocolateFactory"
val new = "inventory.chocolateFactory"
event.move(44, "$old.enabled", "$new.enabled")
event.move(44, "$old.statsDisplay", "$new.statsDisplay")
event.move(44, "$old.statsDisplayList", "$new.statsDisplayList")
event.move(44, "$old.showStackSizes", "$new.showStackSizes")
event.move(44, "$old.highlightUpgrades", "$new.highlightUpgrades")
event.move(44, "$old.useMiddleClick", "$new.useMiddleClick")
event.move(44, "$old.rabbitWarning", "$new.rabbitWarning")
event.move(44, "$old.barnCapacityThreshold", "$new.barnCapacityThreshold")
event.move(44, "$old.extraTooltipStats", "$new.extraTooltipStats")
event.move(44, "$old.timeTowerWarning", "$new.timeTowerWarning")
event.move(44, "$old.position", "$new.position")
event.move(44, "$old.compactOnClick", "$new.compactOnClick")
event.move(44, "$old.compactOnClickAlways", "$new.compactOnClickAlways")
event.move(44, "$old.tooltipMove", "$new.tooltipMove")
event.move(44, "$old.tooltipMovePosition", "$new.tooltipMovePosition")
event.move(44, "$old.hoppityMenuShortcut", "$new.hoppityMenuShortcut")
event.move(44, "$old.hoppityCollectionStats", "$new.hoppityCollectionStats")
event.move(44, "$old.hoppityStatsPosition", "$new.hoppityStatsPosition")
}

fun getChocolateUpgradeCost(lore: List<String>): Long? {
val nextLine = lore.nextAfter({ UtilsPatterns.costLinePattern.matches(it) }) ?: return null
return chocolateAmountPattern.matchMatcher(nextLine.removeColor()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package at.hannibal2.skyhanni.features.event.chocolatefactory
package at.hannibal2.skyhanni.features.inventory.chocolatefactory

import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.features.event.chocolatefactory.hoppity.HoppityEggsManager
import at.hannibal2.skyhanni.features.event.hoppity.HoppityEggsManager
import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.HypixelCommands
import at.hannibal2.skyhanni.utils.LorenzUtils
Expand Down
Loading
Loading