Jump to content

-TheLittleGuy

Members
  • Posts

    26
  • Joined

  • Last visited

Everything posted by -TheLittleGuy

  1. Hello, I have recently gotten into using forge for a mod I am working on and i would like to change the style of some of the game's default gui elements. These include things like the tab overlay and chat elements. I would like to override the tab overlay specifically to display the numeric value of the player's Ping Like this example so far i have gotten tab to display the numeric values, however due to a reason im unsure of, the header and footer of the tab is not displayed (the areas above and below the player list - servers commonly have text displayed here) Currently, i created a class that extended GuiPlayerTabOverlay (called GuiTabOverride), added the necessary modifications, and then called the render method inside of an event listener like so: @SubscribeEvent public void overrideTab(RenderGameOverlayEvent.Pre event) { GuiTabOverride tab = new GuiTabOverride(mc, guiIngame); if(event.getType() == ElementType.PLAYER_LIST) { event.setCanceled(true); /** Here we disable the normal tab Element */ Scoreboard scoreboard = this.mc.world.getScoreboard(); ScaledResolution scaledresolution = new ScaledResolution(this.mc); int i = scaledresolution.getScaledWidth(); tab.renderPlayerlist(i, scoreboard, null); } } This does work, but once again, the header/footer of the tab doesn't get rendered, only the player list. Presumably it has something to do with the 3rd parameter in renderPlayerList being null since the real method is called inside GuiIngame and the 3rd parameter is the score objective. In order to fix this issue, would i have to create a class that overrides GuiIngame as well? Any help would be greatly appreciated!
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.