Skip to content

Commit e61bb59

Browse files
committed
Fix clearing combined inventory rows
1 parent 3007bfc commit e61bb59

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

interfaces/src/main/kotlin/com/noxcrew/interfaces/utilities/CollapsablePaneMap.kt

+2-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import com.noxcrew.interfaces.pane.convertToEmptyCompletedPane
66

77
/** A collection of completed panes that can be collapsed to create a new merged [CompletedPane]. */
88
internal class CollapsablePaneMap private constructor(
9-
private val rows: Int,
109
// pass in a pane from the view so that we can persist
1110
// ordering, used in the listeners.
1211
private val basePane: Pane,
@@ -16,9 +15,8 @@ internal class CollapsablePaneMap private constructor(
1615
) : MutableMap<Int, CompletedPane> by internal {
1716

1817
internal companion object {
19-
/** Creates a new collapsable map with [rows] rows and a [basePane]. */
20-
internal fun create(rows: Int, basePane: Pane) = CollapsablePaneMap(
21-
rows,
18+
/** Creates a new collapsable map with [basePane]. */
19+
internal fun create(basePane: Pane) = CollapsablePaneMap(
2220
basePane,
2321
sortedMapOf(Comparator.reverseOrder())
2422
)

interfaces/src/main/kotlin/com/noxcrew/interfaces/view/AbstractInterfaceView.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public abstract class AbstractInterfaceView<I : InterfacesInventory, P : Pane>(
6767
private val pendingTransforms = ConcurrentHashMap.newKeySet<AppliedTransform<P>>()
6868
private val debouncedTransforms = ConcurrentHashMap.newKeySet<AppliedTransform<P>>()
6969

70-
private val panes = CollapsablePaneMap.create(backing.totalRows(), backing.createPane())
70+
private val panes = CollapsablePaneMap.create(backing.createPane())
7171
internal lateinit var pane: CompletedPane
7272

7373
protected lateinit var currentInventory: I
@@ -269,7 +269,7 @@ public abstract class AbstractInterfaceView<I : InterfacesInventory, P : Pane>(
269269
protected open fun drawPaneToInventory(drawNormalInventory: Boolean, drawPlayerInventory: Boolean) {
270270
// Determine all slots we need to clear if unused
271271
val leftovers = mutableListOf<Pair<Int, Int>>()
272-
forEachInGrid(backing.rows, COLUMNS_IN_CHEST) { row, column ->
272+
forEachInGrid(backing.totalRows(), COLUMNS_IN_CHEST) { row, column ->
273273
leftovers += row to column
274274
}
275275

0 commit comments

Comments
 (0)