diff options
| author | Linnea Gräf <nea@nea.moe> | 2025-07-17 13:26:09 +0200 |
|---|---|---|
| committer | Linnea Gräf <nea@nea.moe> | 2025-07-17 13:26:09 +0200 |
| commit | ed30e4b9739da70b1a94e363a8bf588ca4118746 (patch) | |
| tree | 38f341f4f6507d7e37f8dad2ec6ca8223d2b4ac8 | |
| parent | 25f0e7fd62db22036969120843165f4759530b8f (diff) | |
| download | Firmament-ed30e4b9739da70b1a94e363a8bf588ca4118746.tar.gz Firmament-ed30e4b9739da70b1a94e363a8bf588ca4118746.tar.bz2 Firmament-ed30e4b9739da70b1a94e363a8bf588ca4118746.zip | |
fix: re-enable rei with builds
| -rw-r--r-- | build.gradle.kts | 8 | ||||
| -rw-r--r-- | gradle/libs.versions.toml | 8 | ||||
| -rw-r--r-- | src/compat/rei/java/moe/nea/firmament/compat/rei/recipes/SBReforgeRecipe.kt | 56 |
3 files changed, 40 insertions, 32 deletions
diff --git a/build.gradle.kts b/build.gradle.kts index 9b28c22..cf08323 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -195,7 +195,7 @@ val explosiveEnhancementSourceSet = val wildfireGenderSourceSet = createIsolatedSourceSet("wildfireGender") val jadeSourceSet = createIsolatedSourceSet("jade") val modmenuSourceSet = createIsolatedSourceSet("modmenu") -val reiSourceSet = createIsolatedSourceSet("rei", isEnabled = false) +val reiSourceSet = createIsolatedSourceSet("rei") val moulconfigSourceSet = createIsolatedSourceSet("moulconfig") val customTexturesSourceSet = createIsolatedSourceSet("texturePacks", "texturePacks") @@ -250,8 +250,10 @@ dependencies { (yaclSourceSet.modImplementationConfigurationName)(libs.yacl) // Actual dependencies - (reiSourceSet.modImplementationConfigurationName)(libs.rei.api) - (reiSourceSet.modRuntimeOnlyConfigurationName)(libs.rei.fabric) + + val reiDeps = libs.rei.dev + (reiSourceSet.modImplementationConfigurationName)(reiDeps.api) + (reiSourceSet.modRuntimeOnlyConfigurationName)(reiDeps.fabric) nonModImplentation(libs.repoparser) shadowMe(libs.repoparser) fun ktor(mod: String) = "io.ktor:ktor-$mod-jvm:${libs.versions.ktor.get()}" diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 46dc698..0692daf 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -20,6 +20,7 @@ architectury = "17.0.6" modmenu = "15.0.0-beta.3" # Update from https://maven.architectury.dev/me/shedaniel/RoughlyEnoughItems-fabric/ (but is typically late) rei = "19.0.805" +reidev = "33d8900cd6621816680634fcbae2dd07f1cffbd3" # Update from https://maven.architectury.dev/dev/architectury/loom/dev.architectury.loom.gradle.plugin/ loom = "1.10.433" # TODO: port back to architectury (and) 1.9.424 @@ -109,7 +110,13 @@ fabric_api = { module = "net.fabricmc.fabric-api:fabric-api", version.ref = "fab fabric_api_deprecated = { module = "net.fabricmc.fabric-api:fabric-api-deprecated", version.ref = "fabric_api" } fabric_kotlin = { module = "net.fabricmc:fabric-language-kotlin", version.ref = "fabric_kotlin" } architectury = { module = "dev.architectury:architectury", version.ref = "architectury" } + rei_api = { module = "me.shedaniel:RoughlyEnoughItems-api", version.ref = "rei" } +rei_fabric = { module = "me.shedaniel:RoughlyEnoughItems-fabric", version.ref = "rei" } + +rei_dev_api = { module = "com.github.shedaniel.roughlyenoughitems:RoughlyEnoughItems-api", version.ref = "reidev" } +rei_dev_fabric = { module = "com.github.shedaniel.roughlyenoughitems:RoughlyEnoughItems-fabric", version.ref = "reidev" } + moulconfig = { module = "org.notenoughupdates.moulconfig:modern-1.21.7", version.ref = "moulconfig" } repoparser = { module = "moe.nea:neurepoparser", version.ref = "neurepoparser" } mixinextras = { module = "io.github.llamalad7:mixinextras-fabric", version.ref = "mixinextras" } @@ -126,7 +133,6 @@ configured = { module = "curse.maven:configured-457570", version.ref = "configur notenoughanimations = { module = "maven.modrinth:not-enough-animations", version.ref = "notenoughanimations" } hotswap = { module = "virtual.github.hotswapagent:hotswap-agent", version.ref = "hotswap_agent" } architectury_fabric = { module = "dev.architectury:architectury-fabric", version.ref = "architectury" } -rei_fabric = { module = "me.shedaniel:RoughlyEnoughItems-fabric", version.ref = "rei" } devauth = { module = "me.djtheredstoner:DevAuth-fabric", version.ref = "devauth" } modmenu = { module = "maven.modrinth:modmenu", version.ref = "modmenu" } qolify = { module = "maven.modrinth:qolify", version.ref = "qolify" } 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 } } |
