diff --git a/client/net/minecraftforge/client/GuiIngameForge.java b/client/net/minecraftforge/client/GuiIngameForge.java index 24ac8a865..93eabfef9 100644 --- a/client/net/minecraftforge/client/GuiIngameForge.java +++ b/client/net/minecraftforge/client/GuiIngameForge.java @@ -723,12 +723,19 @@ public class GuiIngameForge extends GuiIngame protected void renderChat(int width, int height) { - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, (float)(height - 48), 0.0F); mc.mcProfiler.startSection("chat"); + + RenderGameOverlayEvent.Chat event = new RenderGameOverlayEvent.Chat(eventParent, 0, height - 48); + if (MinecraftForge.EVENT_BUS.post(event)) return; + + GL11.glPushMatrix(); + GL11.glTranslatef((float)event.posX, (float)event.posY, 0.0F); persistantChatGUI.drawChat(updateCounter); - mc.mcProfiler.endSection(); GL11.glPopMatrix(); + + post(CHAT); + + mc.mcProfiler.endSection(); } protected void renderPlayerList(int width, int height) diff --git a/client/net/minecraftforge/client/event/RenderGameOverlayEvent.java b/client/net/minecraftforge/client/event/RenderGameOverlayEvent.java index 68ab5f73f..0c7ca2758 100644 --- a/client/net/minecraftforge/client/event/RenderGameOverlayEvent.java +++ b/client/net/minecraftforge/client/event/RenderGameOverlayEvent.java @@ -24,7 +24,8 @@ public class RenderGameOverlayEvent extends Event EXPERIENCE, TEXT, HEALTHMOUNT, - JUMPBAR + JUMPBAR, + CHAT } public final float partialTicks; @@ -79,4 +80,17 @@ public class RenderGameOverlayEvent extends Event this.right = right; } } + + public static class Chat extends Pre + { + public int posX; + public int posY; + + public Chat(RenderGameOverlayEvent parent, int posX, int posY) + { + super(parent, ElementType.CHAT); + this.posX = posX; + this.posY = posY; + } + } }