aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/features/inventory/storageoverlay
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2025-11-25 00:23:57 +0100
committerLinnea Gräf <nea@nea.moe>2025-11-25 00:23:57 +0100
commit707652b59e10371cf4826f9f65d653cac528c6bb (patch)
tree65edeffdc0c14703771035222e18d7ff1cfd65b5 /src/main/kotlin/features/inventory/storageoverlay
parent6dd14e7225ff60361fe9f87020c424c0eb89a68b (diff)
downloadFirmament-707652b59e10371cf4826f9f65d653cac528c6bb.tar.gz
Firmament-707652b59e10371cf4826f9f65d653cac528c6bb.tar.bz2
Firmament-707652b59e10371cf4826f9f65d653cac528c6bb.zip
feat: add item list
Diffstat (limited to 'src/main/kotlin/features/inventory/storageoverlay')
-rw-r--r--src/main/kotlin/features/inventory/storageoverlay/StorageOverlayCustom.kt7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/kotlin/features/inventory/storageoverlay/StorageOverlayCustom.kt b/src/main/kotlin/features/inventory/storageoverlay/StorageOverlayCustom.kt
index f291dba..98e8085 100644
--- a/src/main/kotlin/features/inventory/storageoverlay/StorageOverlayCustom.kt
+++ b/src/main/kotlin/features/inventory/storageoverlay/StorageOverlayCustom.kt
@@ -11,6 +11,7 @@ import net.minecraft.client.input.KeyEvent
import net.minecraft.world.entity.player.Inventory
import net.minecraft.world.inventory.Slot
import moe.nea.firmament.mixins.accessor.AccessorHandledScreen
+import moe.nea.firmament.util.accessors.castAccessor
import moe.nea.firmament.util.customgui.CustomGui
import moe.nea.firmament.util.focusedItemStack
@@ -42,7 +43,7 @@ class StorageOverlayCustom(
override fun onInit() {
overview.init(Minecraft.getInstance(), screen.width, screen.height)
overview.init()
- screen as AccessorHandledScreen
+ screen.castAccessor()
screen.x_Firmament = overview.measurements.x
screen.y_Firmament = overview.measurements.y
screen.backgroundWidth_Firmament = overview.measurements.totalWidth
@@ -96,7 +97,7 @@ class StorageOverlayCustom(
delta,
(handler as? StorageBackingHandle.Page)?.storagePageSlot,
screen.menu.slots.take(screen.menu.rowCount * 9).drop(9),
- Point((screen as AccessorHandledScreen).x_Firmament, screen.y_Firmament)
+ Point((screen.castAccessor()).x_Firmament, screen.y_Firmament)
)
overview.drawScrollBar(drawContext)
overview.drawControls(drawContext, mouseX, mouseY)
@@ -106,7 +107,7 @@ class StorageOverlayCustom(
val index = slot.containerSlot
if (index in 0..<36) {
val (x, y) = overview.getPlayerInventorySlotPosition(index)
- slot.x = x - (screen as AccessorHandledScreen).x_Firmament
+ slot.x = x - (screen.castAccessor()).x_Firmament
slot.y = y - screen.y_Firmament
} else {
slot.x = -100000