From dfcf68f339582b3aa5278603f1adf9e1ad6c6f85 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Sun, 2 Jun 2024 01:14:50 +1000 Subject: meta: Fix skyhanni lava feature flicking during neu item caching (#1194) --- .../moulberry/notenoughupdates/listener/NEUEventListener.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/NEUEventListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/NEUEventListener.java index 47c1b545..074fde46 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/NEUEventListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/NEUEventListener.java @@ -48,6 +48,8 @@ import io.github.moulberry.notenoughupdates.util.TabSkillInfoParser; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiChest; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.resources.model.IBakedModel; import net.minecraft.event.ClickEvent; import net.minecraft.init.Items; import net.minecraft.inventory.ContainerChest; @@ -115,7 +117,12 @@ public class NEUEventListener { }); } } else if (!toPreload.isEmpty()) { - Utils.drawItemStack(toPreload.get(0), -100, -100); + RenderItem itemRender = Minecraft.getMinecraft().getRenderItem(); + ItemStack itemStack = toPreload.get(0); + if (itemStack != null && itemStack.getItem() != null) { + IBakedModel ibakedmodel = itemRender.getItemModelMesher().getItemModel(itemStack); + itemRender.renderItem(itemStack, ibakedmodel); + } toPreload.remove(0); } else { itemPreloader.shutdown(); -- cgit