I've cancelled the RenderGameOverlayEvent.Chat and copied the drawChat method into it, however I'm running into a new issue now. This is the code I currently have:
@SubscribeEvent
public void onChatRender(RenderGameOverlayEvent.Chat e) {
e.setCanceled(true);
GuiNewChat gui = mc.ingameGUI.getChatGUI();
if (mc.gameSettings.chatVisibility != EntityPlayer.EnumChatVisibility.HIDDEN) {
int j = gui.func_146232_i();
boolean flag = false;
int k = 0;
int l = gui.field_146253_i.size();
float f = mc.gameSettings.chatOpacity * 0.9F + 0.1F;
if (l > 0) {
if (gui.getChatOpen()) {
flag = true;
}
float f1 = gui.func_146244_h();
int i1 = MathHelper.ceiling_float_int((float) gui.func_146228_f() / f1);
GL11.glPushMatrix();
GL11.glTranslatef(2.0F, 20.0F, 0.0F);
GL11.glScalef(f1, f1, 1.0F);
int j1;
int k1;
int i2;
for (j1 = 0; j1 + gui.field_146250_j < gui.field_146253_i.size() && j1 < j; ++j1) {
ChatLine chatline = (ChatLine) gui.field_146253_i.get(j1 + gui.field_146250_j);
if (chatline != null) {
k1 = mc.ingameGUI.getUpdateCounter() - chatline.getUpdatedCounter();
if (k1 < 200 || flag) {
double d0 = (double) k1 / 200.0D;
d0 = 1.0D - d0;
d0 *= 10.0D;
if (d0 < 0.0D) {
d0 = 0.0D;
}
if (d0 > 1.0D) {
d0 = 1.0D;
}
d0 *= d0;
i2 = (int) (255.0D * d0);
if (flag) {
i2 = 255;
}
i2 = (int) ((float) i2 * f);
++k;
if (i2 > 3) {
byte b0 = 0;
int j2 = -j1 * 9;
GL11.glEnable(GL11.GL_BLEND);
String s = chatline.func_151461_a().getFormattedText();
mc.fontRenderer.drawStringWithShadow(s, b0, j2 - 8, 16777215 + (i2 << 24));
GL11.glDisable(GL11.GL_ALPHA_TEST);
}
}
}
}
if (flag) {
j1 = mc.fontRenderer.FONT_HEIGHT;
GL11.glTranslatef(-3.0F, 0.0F, 0.0F);
int k2 = l * j1 + l;
k1 = k * j1 + k;
int l2 = gui.field_146250_j * k1 / l;
int l1 = k1 * k1 / k2;
if (k2 != k1) {
i2 = l2 > 0 ? 170 : 96;
int i3 = gui.field_146251_k ? 13382451 : 3355562;
Gui.drawRect(0, -l2, 2, -l2 - l1, i3 + (i2 << 24));
Gui.drawRect(2, -l2, 1, -l2 - l1, 13421772 + (i2 << 24));
}
}
GL11.glPopMatrix();
}
}
}
Some fields are not visible. I found a getter method for some of them, however some fields are not visible and don't have a getter either (for example 'field_146253_i').