diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
2 files changed, 6 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/chocolatefactory/HoppityEggLocator.kt b/src/main/java/at/hannibal2/skyhanni/features/event/chocolatefactory/HoppityEggLocator.kt index eee3abc34..ff271b2b4 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/chocolatefactory/HoppityEggLocator.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/chocolatefactory/HoppityEggLocator.kt @@ -14,6 +14,7 @@ import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.round import at.hannibal2.skyhanni.utils.LorenzVec import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName +import at.hannibal2.skyhanni.utils.RecalculatingValue import at.hannibal2.skyhanni.utils.RenderUtils.draw3DLine import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText import at.hannibal2.skyhanni.utils.SimpleTimeMark @@ -207,7 +208,10 @@ object HoppityEggLocator { && ChocolateFactoryAPI.isHoppityEvent() private val ItemStack.isLocatorItem get() = getInternalName() == locatorItem - fun hasLocatorInInventory() = InventoryUtils.getItemsInOwnInventory().any { it.isLocatorItem } + + fun hasLocatorInInventory() = RecalculatingValue(1.seconds) { + LorenzUtils.inSkyBlock && InventoryUtils.getItemsInOwnInventory().any { it.isLocatorItem } + }.getValue() private fun LorenzVec.getEggLocationWeight(firstPoint: LorenzVec, secondPoint: LorenzVec): Double { val distToLine = this.distanceToLine(firstPoint, secondPoint) diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/chocolatefactory/HoppityEggsManager.kt b/src/main/java/at/hannibal2/skyhanni/features/event/chocolatefactory/HoppityEggsManager.kt index caaabc8c5..f11fb426d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/chocolatefactory/HoppityEggsManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/chocolatefactory/HoppityEggsManager.kt @@ -10,7 +10,6 @@ import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.DelayedRun import at.hannibal2.skyhanni.utils.LocationUtils import at.hannibal2.skyhanni.utils.LorenzUtils -import at.hannibal2.skyhanni.utils.RecalculatingValue import at.hannibal2.skyhanni.utils.RenderUtils.renderStrings import at.hannibal2.skyhanni.utils.SimpleTimeMark.Companion.fromNow import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher @@ -94,17 +93,13 @@ object HoppityEggsManager { } } - private val hasLocatorInInventory = RecalculatingValue(1.seconds) { - LorenzUtils.inSkyBlock && HoppityEggLocator.hasLocatorInInventory() - } - @SubscribeEvent fun onRenderOverlay(event: GuiRenderEvent.GuiOverlayRenderEvent) { if (!LorenzUtils.inSkyBlock) return if (!config.showClaimedEggs) return if (ReminderUtils.isBusy()) return if (!ChocolateFactoryAPI.isHoppityEvent()) return - if (!hasLocatorInInventory.getValue()) return + if (!HoppityEggLocator.hasLocatorInInventory()) return val displayList = HoppityEggType.entries .filter { !it.isClaimed() } |