Fix slots hidden behind by other panels still being visible to "lookup recipes" keybind
This commit is contained in:
parent
c1fbdfa1a6
commit
6ff737a315
@ -21,9 +21,10 @@ class Panel2ClickableIngredient<P : EditablePanel<*>, T>(val panel: P, val ingre
|
||||
inline fun <reified P : EditablePanel<*>, T : Any> find(mouseX: Double, mouseY: Double, type: IIngredientType<T>, source: Collection<EditablePanel<*>>, noinline provider: (P) -> T): Optional<IClickableIngredient<*>> {
|
||||
return source
|
||||
.stream()
|
||||
.map { it.panelOfTypeUnderCursor<P>(mouseX.toFloat(), mouseY.toFloat(), ignoreMouseInputLock = true).panel }
|
||||
.filterNotNull()
|
||||
.findAny()
|
||||
.map { it.panelOfTypeUnderCursor<P>(mouseX.toFloat(), mouseY.toFloat(), ignoreMouseInputLock = true) }
|
||||
.filter { it.interrupt }
|
||||
.findFirst()
|
||||
.flatMap { Optional.ofNullable(it.panel) }
|
||||
.flatMap { a -> JEIPlugin.helpers.ingredientManager.createTypedIngredient(type, provider(a)).map { a to it } }
|
||||
.map { Panel2ClickableIngredient(it.first!!, it.second) }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user