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.
This commit is contained in:
Connor Colenso committed 2026-11-26 23:48:17 +00:00
1 parent b784769426
commit addb2f92e1
1 file changed
+8
@@ -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 <M extends MouseContext> void afterDraw(Rectangle4i rect, M mouseContext) {
drawStackSize(rect);