From addb2f92e19e92a2c1896edee96297a435253185 Mon Sep 17 00:00:00 2001 From: Connor Colenso Date: Thu, 26 Nov 2026 23:48:17 +0000 Subject: [PATCH] Stop craftable fluids drawing their amount twice The craftables panel drew the stack with its amount, so NEI's fluid item drew the amount and drawStackSize drew it again on top. Draw fluids without their amount, as bookmarks already do. --- src/main/java/codechicken/nei/ItemCraftablesPanel.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/codechicken/nei/ItemCraftablesPanel.java b/src/main/java/codechicken/nei/ItemCraftablesPanel.java index 78b9dc61..4b5d38b7 100644 --- a/src/main/java/codechicken/nei/ItemCraftablesPanel.java +++ b/src/main/java/codechicken/nei/ItemCraftablesPanel.java @@ -35,12 +35,15 @@ public class ItemCraftablesPanel protected final long realAmount; protected final boolean isFluidDisplay; protected final RecipeId recipeId; + protected final ItemStack drawnItemStack; public CraftablesGridSlot(int slotIndex, int itemIndex, ItemStack itemStack, RecipeId recipeId) { super(slotIndex, itemIndex, itemStack); this.realAmount = StackInfo.getAmount(itemStack); this.isFluidDisplay = StackInfo.isFluidDisplayItem(itemStack); this.recipeId = recipeId; + final ItemStack empty = this.isFluidDisplay ? StackInfo.withAmount(itemStack, 0) : null; + this.drawnItemStack = empty != null ? empty : itemStack; } @Override @@ -48,6 +51,11 @@ public class ItemCraftablesPanel return this.recipeId; } + @Override + public void drawItem(Rectangle4i rect) { + super.drawItem(this.drawnItemStack, rect); + } + @Override public void afterDraw(Rectangle4i rect, M mouseContext) { drawStackSize(rect);