aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com>2024-06-02 01:14:50 +1000
committerGitHub <noreply@github.com>2024-06-01 17:14:50 +0200
commitdfcf68f339582b3aa5278603f1adf9e1ad6c6f85 (patch)
treef30506b1c483248b7bf8b4ce8863c78fc1c376f2
parent309f255cd687d9c85bdc816f66d148924b0a37d2 (diff)
downloadNotEnoughUpdates-dfcf68f339582b3aa5278603f1adf9e1ad6c6f85.tar.gz
NotEnoughUpdates-dfcf68f339582b3aa5278603f1adf9e1ad6c6f85.tar.bz2
NotEnoughUpdates-dfcf68f339582b3aa5278603f1adf9e1ad6c6f85.zip
meta: Fix skyhanni lava feature flicking during neu item caching (#1194)
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/listener/NEUEventListener.java9
1 files changed, 8 insertions, 1 deletions
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();