aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/moe/nea/firmament/mixins/customgui/PatchHandledScreen.java2
-rw-r--r--src/main/kotlin/features/inventory/storageoverlay/StorageOverlayScreen.kt5
-rw-r--r--src/main/kotlin/util/render/TranslatedScissors.kt7
3 files changed, 7 insertions, 7 deletions
diff --git a/src/main/java/moe/nea/firmament/mixins/customgui/PatchHandledScreen.java b/src/main/java/moe/nea/firmament/mixins/customgui/PatchHandledScreen.java
index 6e1090a..4d51239 100644
--- a/src/main/java/moe/nea/firmament/mixins/customgui/PatchHandledScreen.java
+++ b/src/main/java/moe/nea/firmament/mixins/customgui/PatchHandledScreen.java
@@ -134,7 +134,7 @@ public class PatchHandledScreen<T extends ScreenHandler> extends Screen implemen
}
}
- @Inject(method = "render", at = @At("HEAD"))
+ @Inject(method = "renderBackground", at = @At("HEAD"))
public void moveSlots(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
if (override != null) {
for (Slot slot : handler.slots) {
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)
diff --git a/src/main/kotlin/util/render/TranslatedScissors.kt b/src/main/kotlin/util/render/TranslatedScissors.kt
index 70565ed..a091648 100644
--- a/src/main/kotlin/util/render/TranslatedScissors.kt
+++ b/src/main/kotlin/util/render/TranslatedScissors.kt
@@ -1,5 +1,6 @@
package moe.nea.firmament.util.render
+import org.joml.Matrix3x2f
import org.joml.Vector3f
import org.joml.Vector4f
import net.minecraft.client.gui.DrawContext
@@ -9,15 +10,15 @@ fun DrawContext.enableScissorWithTranslation(x1: Float, y1: Float, x2: Float, y2
}
fun DrawContext.enableScissorWithoutTranslation(x1: Float, y1: Float, x2: Float, y2: Float) {
- val pMat = matrices.invert()
+ val pMat = Matrix3x2f(matrices).invert()
var target = Vector3f()
- target.set(x1, y1, 0f)
+ target.set(x1, y1, 1F)
target.mul(pMat)
val scissorX1 = target.x
val scissorY1 = target.y
- target.set(x2, y2, 0f)
+ target.set(x2, y2, 1F)
target.mul(pMat)
val scissorX2 = target.x
val scissorY2 = target.y