public int getWidth() { int width = 0; for (TextChunk chunk : chunks) { width += chunk.getWidth() + getFontRenderer().getCharWidth(' '); } return width; }
protected int calculateWidth(TextChunk before, TextChunk main, TextChunk after) { if (after != null && (after.getText().matches("[.,!\"')}]"))) { return main.getWidth(); } if (main.getText().matches("[({]")) { return main.getWidth(); } else { return main.getWidth() + getFontRenderer().getCharWidth(' '); } }