aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/features/items/recipes/EntityWidget.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/features/items/recipes/EntityWidget.kt')
-rw-r--r--src/main/kotlin/features/items/recipes/EntityWidget.kt27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/main/kotlin/features/items/recipes/EntityWidget.kt b/src/main/kotlin/features/items/recipes/EntityWidget.kt
new file mode 100644
index 0000000..4a087e5
--- /dev/null
+++ b/src/main/kotlin/features/items/recipes/EntityWidget.kt
@@ -0,0 +1,27 @@
+package moe.nea.firmament.features.items.recipes
+
+import me.shedaniel.math.Dimension
+import me.shedaniel.math.Point
+import net.minecraft.client.gui.GuiGraphics
+import net.minecraft.world.entity.LivingEntity
+import moe.nea.firmament.gui.entity.EntityRenderer
+
+class EntityWidget(
+ override var position: Point,
+ override val size: Dimension,
+ val entity: LivingEntity
+) : RecipeWidget() {
+ override fun render(
+ guiGraphics: GuiGraphics,
+ mouseX: Int,
+ mouseY: Int,
+ partialTick: Float
+ ) {
+ EntityRenderer.renderEntity(
+ entity, guiGraphics,
+ rect.x, rect.y,
+ rect.width.toDouble(), rect.height.toDouble(),
+ mouseX.toDouble(), mouseY.toDouble()
+ )
+ }
+}