Skip to content

Commit 6062097

Browse files
fix: update to use a different gui function
1 parent 4e63ffc commit 6062097

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

src/client/java/com/tcm/MineTale/block/workbenches/screen/BuildersWorkbenchScreen.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -224,20 +224,20 @@ private void renderIngredientList(GuiGraphics graphics, RecipeDisplayEntry entry
224224
int available = getAvailableCount(ing);
225225

226226
// Draw Item Icon
227-
ItemStack[] variants = ing.items().toArray(ItemStack[]::new);
227+
// Inside your loop
228+
ItemStack[] variants = ing.items().map(ItemStack::new).toArray(ItemStack[]::new);
228229
if (variants.length > 0) {
229-
// Cycle through variants every second
230-
ItemStack displayStack = variants[(int) (System.currentTimeMillis() / 1000 % variants.length)];
230+
long time = System.currentTimeMillis() / 1000;
231+
ItemStack displayStack = variants[(int) (time % variants.length)];
232+
231233
graphics.renderFakeItem(displayStack, startX, currentY);
232234

233-
// Draw Text (Red if lacking, White if okay)
234-
int color = (available < amountNeeded) ? 0xFF5555 : 0xFFFFFF;
235+
int color = (available < amountNeeded) ? 0xFFFF5555 : 0xFFFFFFFF; // Added alpha channel
235236
String progress = available + "/" + amountNeeded;
236-
graphics.drawString(this.font, progress, startX + 20, currentY + 4, color, true);
237+
graphics.drawString(this.font, progress, startX + 22, currentY + 4, color);
237238

238-
// Tooltip logic
239-
if (mouseX >= startX && mouseX < startX + 16 && mouseY >= currentY && mouseY < currentY + 16) {
240-
graphics.renderItemTooltip(this.font, displayStack, mouseX, mouseY);
239+
if (mouseX >= startX && mouseX <= startX + 16 && mouseY >= currentY && mouseY <= currentY + 16) {
240+
graphics.setTooltipForNextFrame(this.font, displayStack, mouseX, mouseY);
241241
}
242242
}
243243
index++;

0 commit comments

Comments
 (0)