screens stuffs

This commit is contained in:
mewhenthe
2026-04-18 16:24:51 +02:00
parent 8634bdb4ce
commit d48c7c3035
8 changed files with 121 additions and 103 deletions

View File

@@ -60,7 +60,7 @@ interface GenericContainer : Container {
}
}
abstract class GenericContainerMenu(menuType: MenuType<*>, id: Int, var container: Container): AbstractContainerMenu(menuType, id) {
abstract class GenericContainerMenu(menuType: MenuType<*>, id: Int, var container: Container?): AbstractContainerMenu(menuType, id) {
fun addInventorySlots(inventory: Inventory, x: Int, y: Int) {
// Based off the code in ChestMenu
for (i in 0..2) {
@@ -86,7 +86,7 @@ abstract class GenericContainerMenu(menuType: MenuType<*>, id: Int, var containe
val stack = slot.item
val copied = stack.copy()
val contSize = container.containerSize
val contSize = container!!.containerSize
if(i < contSize) {
if(!this.moveItemStackTo(stack, contSize, slots.size, true)) {
@@ -106,7 +106,7 @@ abstract class GenericContainerMenu(menuType: MenuType<*>, id: Int, var containe
}
override fun stillValid(player: Player): Boolean {
return container.stillValid(player)
return container!!.stillValid(player)
}
}