aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/misc
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-08-09 16:01:11 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-08-09 16:01:11 +0200
commitf6d917fce6ef289789c9e594dbb1b911f86ef8bd (patch)
tree03c98dd4fc032328b73280b93ec17bed85017808 /src/main/java/at/hannibal2/skyhanni/features/misc
parent9cd32579cfec4fbfdd710442841c6e712a786c53 (diff)
downloadskyhanni-f6d917fce6ef289789c9e594dbb1b911f86ef8bd.tar.gz
skyhanni-f6d917fce6ef289789c9e594dbb1b911f86ef8bd.tar.bz2
skyhanni-f6d917fce6ef289789c9e594dbb1b911f86ef8bd.zip
code cleanup
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/misc')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/EnderNodeTracker.kt9
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/ghostcounter/GhostCounter.kt9
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt2
3 files changed, 13 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/EnderNodeTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/EnderNodeTracker.kt
index 549776a40..62cc85eae 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/EnderNodeTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/EnderNodeTracker.kt
@@ -20,7 +20,7 @@ import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
class EnderNodeTracker {
- private val config get() = SkyHanniMod.feature.misc.enderNodeTracker;
+ private val config get() = SkyHanniMod.feature.misc.enderNodeTracker
private var totalNodesMined = 0
private var totalEndermiteNests = 0
@@ -154,6 +154,7 @@ class EnderNodeTracker {
"§5Ender Boots",
"§5Ender Necklace",
"§5Ender Gauntlet" -> true
+
else -> false
}
@@ -179,8 +180,10 @@ class EnderNodeTracker {
addAsSingletonList("§b$count ${item.displayName} §7(§6$profit§7)")
}
addAsSingletonList(" ")
- addAsSingletonList("§b${totalEnderArmor.addSeparators()} §5Ender Armor " +
- "§7(§6${format(totalEnderArmor * 10_000)}§7)")
+ addAsSingletonList(
+ "§b${totalEnderArmor.addSeparators()} §5Ender Armor " +
+ "§7(§6${format(totalEnderArmor * 10_000)}§7)"
+ )
for (item in EnderNode.entries.subList(11, 16)) {
val count = (lootCount[item] ?: 0).addSeparators()
val profit = format(lootProfit[item] ?: 0.0)
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/ghostcounter/GhostCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/ghostcounter/GhostCounter.kt
index 580fc7691..c6bbdab9f 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/ghostcounter/GhostCounter.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/ghostcounter/GhostCounter.kt
@@ -83,6 +83,9 @@ object GhostCounter {
private var currentSkill = ""
private var currentSkillLevel = -1
private const val CONFIG_VALUE_VERSION = 1
+ private val SORROW = "SORROW".asInternalName()
+ private val PLASMA = "PLASMA".asInternalName()
+ private val VOLTA = "VOLTA".asInternalName()
@SubscribeEvent
fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) {
@@ -224,10 +227,10 @@ object GhostCounter {
addAsSingletonList(etaFormatting.base.formatText(eta).formatText(killETA))
val rate = 0.12 * (1 + (avgMagicFind.toDouble() / 100))
- val sorrowValue = ("SORROW".asInternalName().getBazaarData()?.buyPrice ?: 0).toLong()
+ val sorrowValue = SORROW.getBazaarData()?.buyPrice?.toLong() ?: 0L
val final: String = (killInterp * sorrowValue * (rate / 100)).toLong().addSeparators()
- val plasmaValue = ("PLASMA".asInternalName().getBazaarData()?.buyPrice ?: 0).toLong()
- val voltaValue = ("VOLTA".asInternalName().getBazaarData()?.buyPrice ?: 0).toLong()
+ val plasmaValue = PLASMA.getBazaarData()?.buyPrice?.toLong() ?: 0L
+ val voltaValue = VOLTA.getBazaarData()?.buyPrice?.toLong() ?: 0L
var moneyMade: Long = 0
val priceMap = listOf(
Triple("Sorrow", SORROWCOUNT.getInt(), sorrowValue),
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt
index 2027e68ce..d6886200e 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt
@@ -81,7 +81,7 @@ object EstimatedItemValue {
val item = event.stack
val oldData = cache[item]
- if (oldData != null && false) {
+ if (oldData != null) {
display = oldData
lastToolTipTime = System.currentTimeMillis()
return