aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/PetExpTooltip.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt4
2 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/PetExpTooltip.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/PetExpTooltip.kt
index c29387925..7b54d9d95 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/PetExpTooltip.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/PetExpTooltip.kt
@@ -11,12 +11,13 @@ import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators
import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getPetExp
import at.hannibal2.skyhanni.utils.StringUtils
import net.minecraftforge.event.entity.player.ItemTooltipEvent
+import net.minecraftforge.fml.common.eventhandler.EventPriority
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
class PetExpTooltip {
private val config get() = SkyHanniMod.feature.misc.petExperienceToolTip
- @SubscribeEvent
+ @SubscribeEvent(priority = EventPriority.LOWEST)
fun onItemTooltipLow(event: ItemTooltipEvent) {
if (!LorenzUtils.inSkyBlock) return
if (!config.petDisplay) return
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
index d60a1c9ce..d42b597e6 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
@@ -139,15 +139,15 @@ object StringUtils {
var inMissingArea = false
builder.append(prefix)
for (i in 0..steps) {
- builder.append(step)
val toDouble = i.toDouble()
val stepPercentage = toDouble / steps
- if (stepPercentage > percentage) {
+ if (stepPercentage >= percentage) {
if (!inMissingArea) {
builder.append(missing)
inMissingArea = true
}
}
+ builder.append(step)
}
builder.append(end)
return builder.toString()