aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-03-10 13:00:27 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-03-10 13:00:27 +0100
commitdf1a6dd8fcf348dfb97ba85e6590fdd40207fcd8 (patch)
tree2d278de37976436a3a338cf943224ed8c83c3318 /src/main/java/at/hannibal2
parent25c12047459340005912df2a4cd8ae3fa1c17323 (diff)
downloadskyhanni-df1a6dd8fcf348dfb97ba85e6590fdd40207fcd8.tar.gz
skyhanni-df1a6dd8fcf348dfb97ba85e6590fdd40207fcd8.tar.bz2
skyhanni-df1a6dd8fcf348dfb97ba85e6590fdd40207fcd8.zip
Fixed bug in garden level calculation
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt
index f40b4edc3..afef573e3 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt
@@ -13,6 +13,7 @@ import at.hannibal2.skyhanni.utils.RenderUtils.renderString
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import java.util.regex.Pattern
+import kotlin.math.roundToInt
class GardenLevelDisplay {
private val config get() = SkyHanniMod.feature.garden
@@ -57,7 +58,7 @@ class GardenLevelDisplay {
for (line in item.getLore()) {
val matcher = overflowPattern.matcher(line)
if (matcher.matches()) {
- overflow = matcher.group(1).replace(",", "").toInt()
+ overflow = matcher.group(1).replace(",", "").toDouble().roundToInt()
break
}
}