aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/notenoughupdates/rei/NEUItemEntryRenderer.kt
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-05-04 15:24:22 +0200
committernea <nea@nea.moe>2023-05-04 15:24:22 +0200
commit857427b0766fe68590589c22e86dbcf1196b4ed5 (patch)
treef2709a31611bad37be170123ed35b830b0e1f9be /src/main/kotlin/moe/nea/notenoughupdates/rei/NEUItemEntryRenderer.kt
parent720cfdd1ed9fc203dd65bbcdc368e124dd35d3cf (diff)
downloadfirmament-857427b0766fe68590589c22e86dbcf1196b4ed5.tar.gz
firmament-857427b0766fe68590589c22e86dbcf1196b4ed5.tar.bz2
firmament-857427b0766fe68590589c22e86dbcf1196b4ed5.zip
Split REI classes
Diffstat (limited to 'src/main/kotlin/moe/nea/notenoughupdates/rei/NEUItemEntryRenderer.kt')
-rw-r--r--src/main/kotlin/moe/nea/notenoughupdates/rei/NEUItemEntryRenderer.kt34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/main/kotlin/moe/nea/notenoughupdates/rei/NEUItemEntryRenderer.kt b/src/main/kotlin/moe/nea/notenoughupdates/rei/NEUItemEntryRenderer.kt
new file mode 100644
index 0000000..e794039
--- /dev/null
+++ b/src/main/kotlin/moe/nea/notenoughupdates/rei/NEUItemEntryRenderer.kt
@@ -0,0 +1,34 @@
+package moe.nea.notenoughupdates.rei
+
+import io.github.moulberry.repo.data.NEUItem
+import me.shedaniel.math.Rectangle
+import me.shedaniel.rei.api.client.entry.renderer.EntryRenderer
+import me.shedaniel.rei.api.client.gui.widgets.Tooltip
+import me.shedaniel.rei.api.client.gui.widgets.TooltipContext
+import me.shedaniel.rei.api.common.entry.EntryStack
+import me.shedaniel.rei.api.common.entry.type.VanillaEntryTypes
+import moe.nea.notenoughupdates.rei.NEUReiPlugin.Companion.asItemEntry
+import net.minecraft.client.util.math.MatrixStack
+
+object NEUItemEntryRenderer : EntryRenderer<NEUItem> {
+ override fun render(
+ entry: EntryStack<NEUItem>,
+ matrices: MatrixStack,
+ bounds: Rectangle,
+ mouseX: Int,
+ mouseY: Int,
+ delta: Float
+ ) {
+ VanillaEntryTypes.ITEM.definition.renderer
+ .render(
+ entry.asItemEntry(),
+ matrices, bounds, mouseX, mouseY, delta
+ )
+ }
+
+ override fun getTooltip(entry: EntryStack<NEUItem>, tooltipContext: TooltipContext): Tooltip? {
+ return VanillaEntryTypes.ITEM.definition.renderer
+ .getTooltip(entry.asItemEntry(), tooltipContext)
+ }
+
+}