Only receive RenderGameOverlayEvent.Post, and only process when it will actually draw something

This commit is contained in:
Electroblob77
2020-03-31 23:16:21 +01:00
parent d46600ac86
commit 6ae9df1204
@@ -96,7 +96,10 @@ public class GuiSpellDisplay {
// Normally when extending Gui, you'd have to have an instance to access its methods. However, we're not actually
// using any of them, so this class may as well not bother and just be a static event handler. Neat!
@SubscribeEvent
public static void draw(RenderGameOverlayEvent event){
public static void draw(RenderGameOverlayEvent.Post event){
if(event.getType() != RenderGameOverlayEvent.ElementType.TEXT
&& event.getType() != RenderGameOverlayEvent.ElementType.HOTBAR) return;
Minecraft mc = Minecraft.getMinecraft();