aboutsummaryrefslogtreecommitdiff
path: root/src/compat/rei/java
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2025-03-17 22:49:49 +0100
committerLinnea Gräf <nea@nea.moe>2025-03-17 22:49:49 +0100
commitaacd527cb8e226b92e5ad28d8d075da06fd79ec4 (patch)
tree2a2745cd528e0302aa9ebe46d6a46a04c80507c4 /src/compat/rei/java
parent207161dc5e2ae93648b563bae7b7427ec2524d64 (diff)
downloadFirmament-aacd527cb8e226b92e5ad28d8d075da06fd79ec4.tar.gz
Firmament-aacd527cb8e226b92e5ad28d8d075da06fd79ec4.tar.bz2
Firmament-aacd527cb8e226b92e5ad28d8d075da06fd79ec4.zip
refactor: Refactor stat blocks
Diffstat (limited to 'src/compat/rei/java')
-rw-r--r--src/compat/rei/java/moe/nea/firmament/compat/rei/recipes/SBReforgeRecipe.kt12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/compat/rei/java/moe/nea/firmament/compat/rei/recipes/SBReforgeRecipe.kt b/src/compat/rei/java/moe/nea/firmament/compat/rei/recipes/SBReforgeRecipe.kt
index b8313a6..8e86967 100644
--- a/src/compat/rei/java/moe/nea/firmament/compat/rei/recipes/SBReforgeRecipe.kt
+++ b/src/compat/rei/java/moe/nea/firmament/compat/rei/recipes/SBReforgeRecipe.kt
@@ -31,6 +31,7 @@ import moe.nea.firmament.repo.ReforgeStore
import moe.nea.firmament.repo.RepoItemTypeCache
import moe.nea.firmament.repo.RepoManager
import moe.nea.firmament.repo.SBItemStack
+import moe.nea.firmament.repo.item.StatBlock
import moe.nea.firmament.util.AprilFoolsUtil
import moe.nea.firmament.util.FirmFormatters
import moe.nea.firmament.util.SkyblockId
@@ -106,7 +107,10 @@ class SBReforgeRecipe(
for ((i, statId) in display.reforge.statUniverse.withIndex()) {
val label = Widgets.createLabel(
Point(bounds.minX + 10 + 24 + 24 + 20, bounds.minY + 8 + i * 11),
- SBItemStack.Companion.StatLine(SBItemStack.statIdToName(statId), null).reconstitute(7))
+ StatBlock.StatLine( // TODO: add helper methods for constructing stat lines
+ StatBlock.findStatFormatting(SBItemStack.statIdToName(statId)),
+ 0.0
+ ).reconstitute(7))
.horizontalAlignment(Label.LEFT_ALIGNED)
statToLineMappings.add(statId to label)
list.add(label)
@@ -116,9 +120,9 @@ class SBReforgeRecipe(
val stats = display.reforge.reforgeStats?.get(entry.rarity) ?: mapOf()
for ((stat, label) in statToLineMappings) {
label.message =
- SBItemStack.Companion.StatLine(
- SBItemStack.statIdToName(stat), null,
- valueNum = stats[stat]
+ StatBlock.StatLine(
+ StatBlock.findStatFormatting(SBItemStack.statIdToName(stat)),
+ stats[stat] ?: 0.0
).reconstitute(7)
}
}