@@ -0,0 +1,2385 @@
+package net.darkhax.bookshelf.api.util;%0A%0Aimport com.mojang.blaze3d.vertex.PoseStack;%0Aimport net.minecraft.client.Minecraft;%0Aimport net.minecraft.client.gui.Font;%0Aimport net.minecraft.network.chat.FormattedText;%0Aimport net.minecraft.util.FormattedCharSequence;%0A%0Aimport java.util.List;%0A%0Apublic class RenderHelper %7B%0A    %0A    public static void renderLinesWrapped (PoseStack matrix, int x, int y, FormattedText text, int textWidth) %7B%0A%0A        final Font font = Minecraft.getInstance().font;%0A        renderLinesWrapped(matrix, font, x, y, font.lineHeight, 0, text, textWidth);%0A    %7D%0A%0A    public static void renderLinesWrapped (PoseStack matrix, Font fontRenderer, int x, int y, int spacing, int defaultColor, FormattedText text, int textWidth) %7B%0A%0A        renderLinesWrapped(matrix, fontRenderer, x, y, spacing, defaultColor, fontRenderer.split(text, textWidth));%0A    %7D%0A%0A    public static void renderLinesWrapped (PoseStack matrix, Font fontRenderer, int x, int y, int spacing, int defaultColor, List%3CFormattedCharSequence%3E lines) %7B%0A%0A        for (int lineNum = 0; lineNum %3C lines.size(); lineNum++) %7B%0A%0A            final FormattedCharSequence lineFragment = lines.get(lineNum);%0A            fontRenderer.draw(matrix, lineFragment, x, y + lineNum * spacing, defaultColor);%0A        %7D%0A    %7D%0A%0A    public static int renderLinesReversed (PoseStack matrix, int x, int y, FormattedText text, int textWidth) %7B%0A%0A        final Font font = Minecraft.getInstance().font;%0A        return renderLinesReversed(matrix, font, x, y, font.lineHeight, 0xffffff, text, textWidth);%0A    %7D%0A%0A    public static int renderLinesReversed (PoseStack matrix, Font fontRenderer, int x, int y, int spacing, int defaultColor, FormattedText text, int textWidth) %7B%0A%0A        return renderLinesReversed(matrix, fontRenderer, x, y, spacing, defaultColor, fontRenderer.split(text, textWidth));%0A    %7D%0A%0A    public static int renderLinesReversed (PoseStack matrix, Font fontRenderer, int x, int y, int spacing, int defaultColor, List%3CFormattedCharSequence%3E lines) %7B%0A%0A        final int lineCount = lines.size();%0A        for (int lineNum = lineCount - 1; lineNum %3E= 0; lineNum--) %7B%0A%0A            final FormattedCharSequence lineFragment = lines.get(lineCount - 1 - lineNum);%0A            fontRenderer.draw(matrix, lineFragment, x, y - (lineNum + 1) * (spacing + 1), defaultColor);%0A        %7D%0A%0A        return lineCount * (spacing + 1);%0A    %7D%0A%7D%0A

Add helpers for rendering wrapped text.