aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/util/customgui
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2025-11-17 19:55:02 +0100
committerLinnea Gräf <nea@nea.moe>2025-11-17 19:55:02 +0100
commitc93a04a001b0f66b2724d46b04b6d1ed49a08d07 (patch)
tree5869ca70acc482ef0362f27785c3d3f1cbb9ffae /src/main/kotlin/util/customgui
parentaf9893b59407c69d31ebd2ed513f0396ab4d2dc9 (diff)
downloadFirmament-c93a04a001b0f66b2724d46b04b6d1ed49a08d07.tar.gz
Firmament-c93a04a001b0f66b2724d46b04b6d1ed49a08d07.tar.bz2
Firmament-c93a04a001b0f66b2724d46b04b6d1ed49a08d07.zip
refactor: port to mojmaps
Diffstat (limited to 'src/main/kotlin/util/customgui')
-rw-r--r--src/main/kotlin/util/customgui/CoordRememberingSlot.kt2
-rw-r--r--src/main/kotlin/util/customgui/CustomGui.kt34
-rw-r--r--src/main/kotlin/util/customgui/HasCustomGui.kt4
3 files changed, 20 insertions, 20 deletions
diff --git a/src/main/kotlin/util/customgui/CoordRememberingSlot.kt b/src/main/kotlin/util/customgui/CoordRememberingSlot.kt
index c61c711..e565850 100644
--- a/src/main/kotlin/util/customgui/CoordRememberingSlot.kt
+++ b/src/main/kotlin/util/customgui/CoordRememberingSlot.kt
@@ -1,7 +1,7 @@
package moe.nea.firmament.util.customgui
-import net.minecraft.screen.slot.Slot
+import net.minecraft.world.inventory.Slot
interface CoordRememberingSlot {
fun rememberCoords_firmament()
diff --git a/src/main/kotlin/util/customgui/CustomGui.kt b/src/main/kotlin/util/customgui/CustomGui.kt
index 457632b..f64bf4d 100644
--- a/src/main/kotlin/util/customgui/CustomGui.kt
+++ b/src/main/kotlin/util/customgui/CustomGui.kt
@@ -1,11 +1,11 @@
package moe.nea.firmament.util.customgui
import me.shedaniel.math.Rectangle
-import net.minecraft.client.gui.Click
-import net.minecraft.client.gui.DrawContext
-import net.minecraft.client.input.CharInput
-import net.minecraft.client.input.KeyInput
-import net.minecraft.screen.slot.Slot
+import net.minecraft.client.input.MouseButtonEvent
+import net.minecraft.client.gui.GuiGraphics
+import net.minecraft.client.input.CharacterEvent
+import net.minecraft.client.input.KeyEvent
+import net.minecraft.world.inventory.Slot
import moe.nea.firmament.annotations.Subscribe
import moe.nea.firmament.events.HandledScreenPushREIEvent
@@ -26,19 +26,19 @@ abstract class CustomGui {
}
open fun render(
- drawContext: DrawContext,
- delta: Float,
- mouseX: Int,
- mouseY: Int
+ drawContext: GuiGraphics,
+ delta: Float,
+ mouseX: Int,
+ mouseY: Int
) {
}
- open fun mouseClick(click: Click, doubled: Boolean): Boolean {
+ open fun mouseClick(click: MouseButtonEvent, doubled: Boolean): Boolean {
return false
}
- open fun afterSlotRender(context: DrawContext, slot: Slot) {}
- open fun beforeSlotRender(context: DrawContext, slot: Slot) {}
+ open fun afterSlotRender(context: GuiGraphics, slot: Slot) {}
+ open fun beforeSlotRender(context: GuiGraphics, slot: Slot) {}
open fun mouseScrolled(mouseX: Double, mouseY: Double, horizontalAmount: Double, verticalAmount: Double): Boolean {
return false
}
@@ -72,23 +72,23 @@ abstract class CustomGui {
return true
}
- open fun mouseReleased(click: Click): Boolean {
+ open fun mouseReleased(click: MouseButtonEvent): Boolean {
return false
}
- open fun mouseDragged(click: Click, offsetX: Double, offsetY: Double): Boolean {
+ open fun mouseDragged(click: MouseButtonEvent, offsetX: Double, offsetY: Double): Boolean {
return false
}
- open fun keyPressed(input: KeyInput): Boolean {
+ open fun keyPressed(input: KeyEvent): Boolean {
return false
}
- open fun charTyped(input: CharInput): Boolean {
+ open fun charTyped(input: CharacterEvent): Boolean {
return false
}
- open fun keyReleased(input: KeyInput): Boolean {
+ open fun keyReleased(input: KeyEvent): Boolean {
return false
}
}
diff --git a/src/main/kotlin/util/customgui/HasCustomGui.kt b/src/main/kotlin/util/customgui/HasCustomGui.kt
index edead2e..7182979 100644
--- a/src/main/kotlin/util/customgui/HasCustomGui.kt
+++ b/src/main/kotlin/util/customgui/HasCustomGui.kt
@@ -1,7 +1,7 @@
package moe.nea.firmament.util.customgui
-import net.minecraft.client.gui.screen.ingame.HandledScreen
+import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen
@Suppress("FunctionName")
interface HasCustomGui {
@@ -9,7 +9,7 @@ interface HasCustomGui {
fun setCustomGui_Firmament(gui: CustomGui?)
}
-var <T : HandledScreen<*>> T.customGui: CustomGui?
+var <T : AbstractContainerScreen<*>> T.customGui: CustomGui?
get() = (this as HasCustomGui).getCustomGui_Firmament()
set(value) {
(this as HasCustomGui).setCustomGui_Firmament(value)