aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2025-07-17 13:26:09 +0200
committerLinnea Gräf <nea@nea.moe>2025-07-17 13:26:09 +0200
commited30e4b9739da70b1a94e363a8bf588ca4118746 (patch)
tree38f341f4f6507d7e37f8dad2ec6ca8223d2b4ac8 /src
parent25f0e7fd62db22036969120843165f4759530b8f (diff)
downloadFirmament-ed30e4b9739da70b1a94e363a8bf588ca4118746.tar.gz
Firmament-ed30e4b9739da70b1a94e363a8bf588ca4118746.tar.bz2
Firmament-ed30e4b9739da70b1a94e363a8bf588ca4118746.zip
fix: re-enable rei with builds
Diffstat (limited to 'src')
-rw-r--r--src/compat/rei/java/moe/nea/firmament/compat/rei/recipes/SBReforgeRecipe.kt56
1 files changed, 28 insertions, 28 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 fca3edf..cc05861 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
@@ -74,13 +74,37 @@ class SBReforgeRecipe(
val inputSlot = Widgets.createSlot(Point(bounds.minX + 10, bounds.centerY - 9))
.markInput().entries(display.inputItems)
list.add(inputSlot)
+ list.add(Widgets.createSlot(Point(bounds.minX + 10 + 24 + 24, bounds.centerY - 9))
+ .markInput().entries(display.outputItems))
+ val statToLineMappings = mutableListOf<Pair<String, Label>>()
+ 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))
+ .horizontalAlignment(Label.LEFT_ALIGNED)
+ statToLineMappings.add(statId to label)
+ list.add(label)
+ }
+ fun updateStatLines() {
+ val entry = inputSlot.currentEntry?.castValue<SBItemStack>() ?: return
+ 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]
+ ).reconstitute(7)
+ }
+ }
+ updateStatLines()
+ inputSlot.withEntriesListener { updateStatLines() }
if (display.reforgeStone != null) {
list.add(Widgets.createSlot(Point(bounds.minX + 10 + 24, bounds.centerY - 9 - 10))
- .markInput().entry(display.reforgeStone))
+ .markInput().entry(display.reforgeStone))
list.add(Widgets.withTooltip(
- Widgets.withTranslate(Widgets.wrapRenderer(
+ Widgets.wrapRenderer(
Rectangle(Point(bounds.minX + 10 + 24, bounds.centerY - 9 + 10), Dimension(16, 16)),
- SBItemEntryDefinition.getEntry(SkyBlockItems.REFORGE_ANVIL)), 0.0, 0.0, 150.0),
+ SBItemEntryDefinition.getEntry(SkyBlockItems.REFORGE_ANVIL)),
Rarity.entries.mapNotNull { rarity ->
display.reforge.reforgeCosts?.get(rarity)?.let { rarity to it }
}.map { (rarity, cost) ->
@@ -102,33 +126,9 @@ class SBReforgeRecipe(
dimension
),
tr("firmament.recipecategory.reforge.basic",
- "This is a basic reforge, available at the Blacksmith.").grey()
+ "This is a basic reforge, available at the Blacksmith.").grey()
))
}
- list.add(Widgets.createSlot(Point(bounds.minX + 10 + 24 + 24, bounds.centerY - 9))
- .markInput().entries(display.outputItems))
- val statToLineMappings = mutableListOf<Pair<String, Label>>()
- 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))
- .horizontalAlignment(Label.LEFT_ALIGNED)
- statToLineMappings.add(statId to label)
- list.add(label)
- }
- fun updateStatLines() {
- val entry = inputSlot.currentEntry?.castValue<SBItemStack>() ?: return
- 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]
- ).reconstitute(7)
- }
- }
- updateStatLines()
- inputSlot.withEntriesListener { updateStatLines() }
return list
}
}