Skip to content

Commit

Permalink
use RenderGameOverlayEvent to render the HUD to benefit from HUD caching
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexdoru committed Nov 17, 2024
1 parent 4750486 commit 28add2c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/mcp/mobius/waila/Waila.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void initialize(FMLInitializationEvent event) {
MinecraftForge.EVENT_BUS.register(new DecoratorRenderer());
FMLCommonHandler.instance().bus().register(new KeyEvent());
FMLCommonHandler.instance().bus().register(WailaTickHandler.instance());

MinecraftForge.EVENT_BUS.register(WailaTickHandler.instance());
}
FMLCommonHandler.instance().bus().register(new NetworkHandler());
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/mcp/mobius/waila/overlay/WailaTickHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.common.config.Configuration;

import org.lwjgl.input.Keyboard;
Expand Down Expand Up @@ -43,7 +44,7 @@ public static WailaTickHandler instance() {

@SubscribeEvent
@SideOnly(Side.CLIENT)
public void tickRender(TickEvent.RenderTickEvent event) {
public void tickRender(RenderGameOverlayEvent.Text event) {
OverlayRenderer.renderOverlay();
}

Expand Down

0 comments on commit 28add2c

Please sign in to comment.