diff options
author | Linnea Gräf <nea@nea.moe> | 2024-11-17 20:13:20 +0100 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-11-17 20:13:20 +0100 |
commit | 067c90d4362a57313a4e2d59f3639cba383433ed (patch) | |
tree | d4dc5b6eb86a93d2c13a22bbb56b56add58a0cce /src/main/kotlin/features | |
parent | 3954f51abcc2f3985be1550128c46f1ea26c3647 (diff) | |
download | Firmament-067c90d4362a57313a4e2d59f3639cba383433ed.tar.gz Firmament-067c90d4362a57313a4e2d59f3639cba383433ed.tar.bz2 Firmament-067c90d4362a57313a4e2d59f3639cba383433ed.zip |
feat: Add item rarities into all storage overlay pages
Diffstat (limited to 'src/main/kotlin/features')
-rw-r--r-- | src/main/kotlin/features/inventory/storageoverlay/StorageOverlayScreen.kt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/kotlin/features/inventory/storageoverlay/StorageOverlayScreen.kt b/src/main/kotlin/features/inventory/storageoverlay/StorageOverlayScreen.kt index d6f3645..4c624ef 100644 --- a/src/main/kotlin/features/inventory/storageoverlay/StorageOverlayScreen.kt +++ b/src/main/kotlin/features/inventory/storageoverlay/StorageOverlayScreen.kt @@ -13,6 +13,7 @@ import net.minecraft.client.gui.screen.ingame.HandledScreen import net.minecraft.screen.slot.Slot import net.minecraft.text.Text import net.minecraft.util.Identifier +import moe.nea.firmament.events.SlotRenderEvents import moe.nea.firmament.gui.EmptyComponent import moe.nea.firmament.gui.FirmButtonComponent import moe.nea.firmament.util.MC @@ -21,6 +22,7 @@ import moe.nea.firmament.util.MoulConfigUtils.clickMCComponentInPlace import moe.nea.firmament.util.MoulConfigUtils.drawMCComponentInPlace import moe.nea.firmament.util.assertTrueOr import moe.nea.firmament.util.customgui.customGui +import moe.nea.firmament.util.mc.FakeSlot import moe.nea.firmament.util.render.drawGuiTexture class StorageOverlayScreen : Screen(Text.literal("")) { @@ -356,9 +358,12 @@ class StorageOverlayScreen : Screen(Text.literal("")) { inv.stacks.forEachIndexed { index, stack -> val slotX = (index % 9) * SLOT_SIZE + x + 1 val slotY = (index / 9) * SLOT_SIZE + y + 4 + textRenderer.fontHeight + 1 + val fakeSlot = FakeSlot(stack, slotX, slotY) if (slots == null) { + SlotRenderEvents.Before.publish(SlotRenderEvents.Before(context, fakeSlot)) context.drawItem(stack, slotX, slotY) context.drawStackOverlay(textRenderer, stack, slotX, slotY) + SlotRenderEvents.After.publish(SlotRenderEvents.After(context, fakeSlot)) } else { val slot = slots[index] slot.x = slotX - slotOffset.x |