summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/misc
diff options
context:
space:
mode:
authorCalMWolfs <94038482+CalMWolfs@users.noreply.github.com>2024-04-07 21:36:08 +1000
committerGitHub <noreply@github.com>2024-04-07 13:36:08 +0200
commitfcd404d862b4b051474898076fcc06b406d1ea91 (patch)
tree7659d22a41d1529a8d4ebaa62958bc0934596431 /src/main/java/at/hannibal2/skyhanni/features/misc
parent03c416202ccdec17cc46f6d07aae111fa977771a (diff)
downloadskyhanni-fcd404d862b4b051474898076fcc06b406d1ea91.tar.gz
skyhanni-fcd404d862b4b051474898076fcc06b406d1ea91.tar.bz2
skyhanni-fcd404d862b4b051474898076fcc06b406d1ea91.zip
Backend: Remove a lot of deprecated code (#1371)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/misc')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/InGameDateDisplay.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt8
2 files changed, 5 insertions, 9 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/InGameDateDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/InGameDateDisplay.kt
index 7db11478c..50f50e819 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/InGameDateDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/InGameDateDisplay.kt
@@ -4,8 +4,8 @@ import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.data.ScoreboardData
import at.hannibal2.skyhanni.data.jsonobjects.repo.TabListJson
import at.hannibal2.skyhanni.events.GuiRenderEvent
-import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.RepositoryReloadEvent
+import at.hannibal2.skyhanni.events.SecondPassedEvent
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.RenderUtils.renderString
import at.hannibal2.skyhanni.utils.StringUtils.matches
@@ -34,10 +34,10 @@ class InGameDateDisplay {
}
@SubscribeEvent
- fun onTick(event: LorenzTickEvent) {
+ fun onSecondPassed(event: SecondPassedEvent) {
if (!isEnabled()) return
+
if (!config.useScoreboard && !event.repeatSeconds(config.refreshSeconds)) return
- if (config.useScoreboard && !event.repeatSeconds(1)) return
checkDate()
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt
index a1750e5c0..1baf781ef 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt
@@ -9,7 +9,6 @@ import at.hannibal2.skyhanni.utils.ItemUtils.isRune
import at.hannibal2.skyhanni.utils.ItemUtils.itemName
import at.hannibal2.skyhanni.utils.ItemUtils.itemNameWithoutColor
import at.hannibal2.skyhanni.utils.ItemUtils.name
-import at.hannibal2.skyhanni.utils.ItemUtils.nameWithEnchantment
import at.hannibal2.skyhanni.utils.LorenzRarity
import at.hannibal2.skyhanni.utils.NEUInternalName
import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName
@@ -480,10 +479,7 @@ object EstimatedItemValueCalculator {
return addCosmetic(internalName, list, "Rune", config.ignoreRunes)
}
- private fun NEUInternalName.getNameOrRepoError(): String? {
- val stack = getItemStackOrNull() ?: return null
- return stack.nameWithEnchantment ?: "§cItem Name Error"
- }
+ private fun NEUInternalName.getNameOrRepoError(): String? = getItemStackOrNull()?.itemName
private fun addAbilityScrolls(stack: ItemStack, list: MutableList<String>): Double {
val abilityScrolls = stack.getAbilityScrolls() ?: return 0.0
@@ -684,7 +680,7 @@ object EstimatedItemValueCalculator {
totalPrice += if (ingredient.isCoins) {
ingredient.count
} else {
- getPrice(ingredient.internalItemId) * ingredient.count
+ ingredient.internalItemId.asInternalName().getPrice() * ingredient.count
}
}