Skip to content

Commit fb2a961

Browse files
committed
chore: Remove unused old properties
1 parent b33b70a commit fb2a961

File tree

4 files changed

+2
-22
lines changed

4 files changed

+2
-22
lines changed

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

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,6 @@ public abstract class AbstractInterfaceView<I : InterfacesInventory, T : Interfa
154154
override val isTreeOpened: Boolean
155155
get() = shouldStillBeOpened || children.keys.any { it.isTreeOpened }
156156

157-
/** Whether this menu type overlaps the player inventory. */
158-
public open val overlapsPlayerInventory: Boolean
159-
get() = false
160-
161157
/** The pane of this view. */
162158
public val completedPane: CompletedPane?
163159
get() = if (::pane.isInitialized) pane else null
@@ -479,12 +475,7 @@ public abstract class AbstractInterfaceView<I : InterfacesInventory, T : Interfa
479475
pane = panes.collapse(backing.mapper, builder.allowClickingEmptySlots)
480476

481477
// Render the completed panes
482-
renderToInventory { createdNewInventory ->
483-
// send an update packet if necessary
484-
if (!createdNewInventory && requiresPlayerUpdate()) {
485-
player.updateInventory()
486-
}
487-
}
478+
renderToInventory()
488479
}
489480
}
490481
} finally {
@@ -813,9 +804,7 @@ public abstract class AbstractInterfaceView<I : InterfacesInventory, T : Interfa
813804

814805
protected open fun requiresNewInventory(): Boolean = firstPaint
815806

816-
protected open fun requiresPlayerUpdate(): Boolean = false
817-
818-
protected open suspend fun renderToInventory(callback: (Boolean) -> Unit) {
807+
protected open suspend fun renderToInventory() {
819808
// If the menu has since been requested to close we ignore all this
820809
if (!shouldBeOpened.get()) return
821810

@@ -866,7 +855,6 @@ public abstract class AbstractInterfaceView<I : InterfacesInventory, T : Interfa
866855
// ended up being opened.
867856
val isOpen = isOpen()
868857
drawPaneToInventory(drawNormalInventory = true, drawPlayerInventory = isOpen)
869-
callback(createdInventory)
870858
InterfacesProfiler.log(this, "finished rendering to inventory")
871859

872860
if (this is PlayerInterfaceView) {

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ public class ChestInterfaceView internal constructor(
4444
titleState.current = backing.titleSupplier?.invoke(player)
4545
}
4646

47-
override fun requiresPlayerUpdate(): Boolean = false
48-
4947
override fun requiresNewInventory(): Boolean = super.requiresNewInventory() || titleState.hasChanged
5048

5149
override fun getInventory(): Inventory = currentInventory.chestInventory

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ public class CombinedInterfaceView internal constructor(
2424

2525
private val titleState = TitleState()
2626

27-
override val overlapsPlayerInventory: Boolean = true
28-
2927
override fun title(value: Component) {
3028
titleState.current = value
3129
}
@@ -47,8 +45,6 @@ public class CombinedInterfaceView internal constructor(
4745
titleState.current = backing.titleSupplier?.invoke(player)
4846
}
4947

50-
override fun requiresPlayerUpdate(): Boolean = false
51-
5248
override fun requiresNewInventory(): Boolean = super.requiresNewInventory() || titleState.hasChanged
5349

5450
override fun getInventory(): Inventory = currentInventory.chestInventory

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ public class PlayerInterfaceView internal constructor(
2121
null
2222
) {
2323

24-
override val overlapsPlayerInventory: Boolean = true
25-
2624
override fun title(value: Component) {
2725
error("PlayerInventoryView's cannot have a title")
2826
}

0 commit comments

Comments
 (0)