Skip to content

Commit 6bba47c

Browse files
committed
fix: stop ch keybind working on items without a sbid
Signed-off-by: J10a1n15 <45315647+j10a1n15@users.noreply.github.com>
1 parent 7f74601 commit 6bba47c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/main/kotlin/me/owdding/skyocean/features/recipe/crafthelper/CraftHelperManager.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import tech.thatgravyboat.skyblockapi.api.events.base.predicates.TimePassed
1919
import tech.thatgravyboat.skyblockapi.api.events.screen.ScreenKeyReleasedEvent
2020
import tech.thatgravyboat.skyblockapi.api.events.time.TickEvent
2121
import tech.thatgravyboat.skyblockapi.api.remote.api.SkyBlockId
22+
import tech.thatgravyboat.skyblockapi.api.remote.api.SkyBlockId.Companion.getSkyBlockId
2223
import tech.thatgravyboat.skyblockapi.helpers.McScreen
2324
import tech.thatgravyboat.skyblockapi.utils.extentions.getHoveredSlot
2425
import tech.thatgravyboat.skyblockapi.utils.text.Text
@@ -76,6 +77,15 @@ object CraftHelperManager {
7677
val mcScreenHovered = McScreen.asMenu?.getHoveredSlot()?.item?.takeUnless { it.isEmpty }
7778
val item = mcScreenHovered ?: reiHovered ?: return
7879

80+
if (item.getSkyBlockId() == null) {
81+
Text.of("Item ") {
82+
append(item.hoverName)
83+
append(" does not have a SkyBlockId, cannot be selected as CraftHelper item")
84+
color = TextColor.RED
85+
}.sendWithPrefix("crafthelper_no_id")
86+
return
87+
}
88+
7989
setSelected(SkyBlockId.fromItem(item))
8090
McScreen.refreshScreen()
8191

0 commit comments

Comments
 (0)