Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ import tech.thatgravyboat.repolib.api.recipes.Recipe
import tech.thatgravyboat.repolib.api.recipes.ShopRecipe
import tech.thatgravyboat.skyblockapi.api.remote.api.SkyBlockId.Companion.getSkyBlockId
import tech.thatgravyboat.skyblockapi.helpers.McClient
import tech.thatgravyboat.skyblockapi.utils.extentions.cleanName
import tech.thatgravyboat.skyblockapi.utils.text.Text
import tech.thatgravyboat.skyblockapi.utils.text.Text.send
import tech.thatgravyboat.skyblockapi.utils.text.TextBuilder.append
import tech.thatgravyboat.skyblockapi.utils.text.TextColor
import tech.thatgravyboat.skyblockapi.utils.text.TextStyle.color
import kotlin.jvm.optionals.getOrNull

class RecipeScreen(val parent: Screen?, val recipes: List<AbstractRecipeWidget>) : Screen(Text.of("Recipe Screen")) {
Expand Down Expand Up @@ -99,6 +104,12 @@ class RecipeScreen(val parent: Screen?, val recipes: List<AbstractRecipeWidget>)
val matchingRecipes = SkyBlockRecipeAPI.getRecipesForId(targetId)
if (matchingRecipes.isNotEmpty()) {
openRecipe(matchingRecipes, parent)
} else {
Text.of("No recipes found for ") {
color = TextColor.RED
append(stack.cleanName, TextColor.LIGHT_PURPLE)
append("!")
}.send()
}
}

Expand All @@ -108,6 +119,12 @@ class RecipeScreen(val parent: Screen?, val recipes: List<AbstractRecipeWidget>)
val matchingRecipes = SkyBlockRecipeAPI.getUsagesForId(targetId)
if (matchingRecipes.isNotEmpty()) {
openRecipe(matchingRecipes, parent)
} else {
Text.of("No usages found for ") {
color = TextColor.RED
append(stack.cleanName, TextColor.LIGHT_PURPLE)
append("!")
}.send()
}
}

Expand Down