aboutsummaryrefslogtreecommitdiff
path: root/src/compat/rei/java
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2025-11-15 23:42:26 +0100
committerLinnea Gräf <nea@nea.moe>2025-11-15 23:42:26 +0100
commit5632c1d50bb0319886fb6acd54df92bf01491532 (patch)
tree6f9adb070df25a4406cfa7713714f9e348f7445e /src/compat/rei/java
parent4d8399ff4d769def62e6a8241327c4f2dac47e71 (diff)
downloadFirmament-5632c1d50bb0319886fb6acd54df92bf01491532.tar.gz
Firmament-5632c1d50bb0319886fb6acd54df92bf01491532.tar.bz2
Firmament-5632c1d50bb0319886fb6acd54df92bf01491532.zip
snapshot: full 1.21.10 build (- REI; fuck private discord builds)
Diffstat (limited to 'src/compat/rei/java')
-rw-r--r--src/compat/rei/java/moe/nea/firmament/compat/rei/recipes/SBKatRecipe.kt37
1 files changed, 16 insertions, 21 deletions
diff --git a/src/compat/rei/java/moe/nea/firmament/compat/rei/recipes/SBKatRecipe.kt b/src/compat/rei/java/moe/nea/firmament/compat/rei/recipes/SBKatRecipe.kt
index cb7877d..5de315c 100644
--- a/src/compat/rei/java/moe/nea/firmament/compat/rei/recipes/SBKatRecipe.kt
+++ b/src/compat/rei/java/moe/nea/firmament/compat/rei/recipes/SBKatRecipe.kt
@@ -18,6 +18,7 @@ import me.shedaniel.rei.api.client.gui.widgets.Widgets
import me.shedaniel.rei.api.client.registry.display.DisplayCategory
import me.shedaniel.rei.api.common.category.CategoryIdentifier
import kotlin.time.Duration.Companion.seconds
+import net.minecraft.client.gui.Click
import net.minecraft.client.gui.DrawContext
import net.minecraft.client.gui.Element
import net.minecraft.item.Items
@@ -175,56 +176,50 @@ fun wrapWidget(bounds: Rectangle, component: GuiComponent): Widget {
)
}
- override fun mouseClicked(mouseX: Double, mouseY: Double, button: Int): Boolean {
- val mouseXInt = mouseX.toInt()
- val mouseYInt = mouseY.toInt()
+ override fun mouseClicked(click: Click, doubled: Boolean): Boolean {
+ val mouseXInt = click.x.toInt()
+ val mouseYInt = click.y.toInt()
return component.mouseEvent(
- MouseEvent.Click(button, true),
+ MouseEvent.Click(click.button(), true),
GuiImmediateContext(
IMinecraft.INSTANCE.provideTopLevelRenderContext(),
bounds.minX, bounds.minY,
bounds.width, bounds.height,
mouseXInt - bounds.minX, mouseYInt - bounds.minY,
mouseXInt, mouseYInt,
- mouseX.toFloat(), mouseY.toFloat()
+ click.x.toFloat(), click.y.toFloat()
)
)
}
- override fun mouseReleased(mouseX: Double, mouseY: Double, button: Int): Boolean {
- val mouseXInt = mouseX.toInt()
- val mouseYInt = mouseY.toInt()
+ override fun mouseReleased(click: Click): Boolean {
+ val mouseXInt = click.x.toInt()
+ val mouseYInt = click.y.toInt()
return component.mouseEvent(
- MouseEvent.Click(button, false),
+ MouseEvent.Click(click.button(), false),
GuiImmediateContext(
IMinecraft.INSTANCE.provideTopLevelRenderContext(),
bounds.minX, bounds.minY,
bounds.width, bounds.height,
mouseXInt - bounds.minX, mouseYInt - bounds.minY,
mouseXInt, mouseYInt,
- mouseX.toFloat(), mouseY.toFloat()
+ click.x.toFloat(), click.y.toFloat()
)
)
}
- override fun mouseDragged(
- mouseX: Double,
- mouseY: Double,
- button: Int,
- deltaX: Double,
- deltaY: Double
- ): Boolean {
- val mouseXInt = mouseX.toInt()
- val mouseYInt = mouseY.toInt()
+ override fun mouseDragged(click: Click, offsetX: Double, offsetY: Double): Boolean {
+ val mouseXInt = click.x.toInt()
+ val mouseYInt = click.y.toInt()
return component.mouseEvent(
- MouseEvent.Move(deltaX.toFloat(), deltaY.toFloat()),
+ MouseEvent.Move(offsetX.toFloat(), offsetY.toFloat()),
GuiImmediateContext(
IMinecraft.INSTANCE.provideTopLevelRenderContext(),
bounds.minX, bounds.minY,
bounds.width, bounds.height,
mouseXInt - bounds.minX, mouseYInt - bounds.minY,
mouseXInt, mouseYInt,
- mouseX.toFloat(), mouseY.toFloat()
+ click.x.toFloat(), click.y.toFloat()
)
)