Skip to content

Commit

Permalink
Tweak item name offset
Browse files Browse the repository at this point in the history
  • Loading branch information
NeRdTheNed committed Feb 21, 2021
1 parent c6cb628 commit f5a8d5f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public abstract class RecipeRenderer {
protected final static FontRenderer fontRendererRef = mineCraft.fontRenderer;

protected final static int itemSize = 18;
/** :/ This magic number aligns the item descriptions with the crafting grid. */
private final static int magicOffsetNumber = 3;

private final static File minecraftRecipesDir = new File(Minecraft.getMinecraft().mcDataDir, "recipes");

Expand All @@ -49,7 +51,7 @@ private static void drawItemsAndText(int x, int y, int width, ItemStack[] stacks
for (final ItemStack stack : stacks) {
if (stack != null) {
drawItemStackAtLocationWithGLBoilerplate(x, y + (itemSize / 4), stack);
y += drawStringWrapped(x + itemSize, y, width - itemSize, stack.getDisplayName()) + fontRendererRef.FONT_HEIGHT;
y += drawStringWrapped(x + (itemSize + magicOffsetNumber), y, width - (itemSize + magicOffsetNumber), stack.getDisplayName()) + fontRendererRef.FONT_HEIGHT;
}
}
}
Expand Down

0 comments on commit f5a8d5f

Please sign in to comment.