aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/features
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2025-07-27 18:34:12 +0200
committerLinnea Gräf <nea@nea.moe>2025-07-27 18:34:12 +0200
commit5247d98d3b768b34880640214f702c026c8c883b (patch)
tree1ff3d32ac0fcd8fcf4b52b30c0ec0d5ead2ee89a /src/main/kotlin/features
parent120cab808b9a6f8c8c935360b470a7a214f0b7bc (diff)
downloadFirmament-5247d98d3b768b34880640214f702c026c8c883b.tar.gz
Firmament-5247d98d3b768b34880640214f702c026c8c883b.tar.bz2
Firmament-5247d98d3b768b34880640214f702c026c8c883b.zip
fix: slots in storage overlay being messed up
Diffstat (limited to 'src/main/kotlin/features')
-rw-r--r--src/main/kotlin/features/inventory/storageoverlay/StorageOverlayScreen.kt5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/main/kotlin/features/inventory/storageoverlay/StorageOverlayScreen.kt b/src/main/kotlin/features/inventory/storageoverlay/StorageOverlayScreen.kt
index 267799d..0baa099 100644
--- a/src/main/kotlin/features/inventory/storageoverlay/StorageOverlayScreen.kt
+++ b/src/main/kotlin/features/inventory/storageoverlay/StorageOverlayScreen.kt
@@ -20,7 +20,6 @@ import net.minecraft.item.ItemStack
import net.minecraft.screen.slot.Slot
import net.minecraft.text.Text
import net.minecraft.util.Identifier
-import moe.nea.firmament.annotations.Subscribe
import moe.nea.firmament.events.SlotRenderEvents
import moe.nea.firmament.gui.EmptyComponent
import moe.nea.firmament.gui.FirmButtonComponent
@@ -498,7 +497,7 @@ class StorageOverlayScreen : Screen(Text.literal("")) {
return 18
}
assertTrueOr(slots == null || slots.size == inv.stacks.size) { return 0 }
- val name = page.defaultName()
+ val name = inventory.title
val pageHeight = inv.rows * SLOT_SIZE + 8 + textRenderer.fontHeight
if (slots != null && StorageOverlay.TConfig.outlineActiveStoragePage)
context.drawBorder(
@@ -522,8 +521,8 @@ class StorageOverlayScreen : Screen(Text.literal("")) {
inv.stacks.forEachIndexed { index, stack ->
val slotX = (index % 9) * SLOT_SIZE + x + 3
val slotY = (index / 9) * SLOT_SIZE + y + 5 + textRenderer.fontHeight + 1
- val fakeSlot = FakeSlot(stack, slotX, slotY)
if (slots == null) {
+ val fakeSlot = FakeSlot(stack, slotX, slotY)
SlotRenderEvents.Before.publish(SlotRenderEvents.Before(context, fakeSlot))
context.drawItem(stack, slotX, slotY)
context.drawStackOverlay(textRenderer, stack, slotX, slotY)