Class DebugSpecialElement

java.lang.Object
api.client.debug.DebugSpecialElement

public class DebugSpecialElement extends Object
  • Constructor Details

  • Method Details

    • getID

      public ResourceLocation getID()
    • addEntry

      public void addEntry(IDebugSpecialProvider provider)
      Example:
           
          DebugSpecialElement graphs = DebugRegistryUtils.registerSpecialElement(new ResourceLocation("btw:graphs"));
          graphs.addEntry(((mc, isExtendedDebug) ->{
       			ScaledResolution scaledresolution = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
       			int width = scaledresolution.getScaledWidth();
      
       			drawMetricsData(mc, mc.getFpsMetricsData(), 0, 0, width / 2, (byte) 1);
       		 }
       		 ));
           
       
      The code inside .addEntry((mc, isExtendedDebug) -> {}); will run when all special elements are drawn on the debug screen.
      In this case, it will draw the fps graph when the special element: graphs's entries are drawn.
      See Also:
    • removeEntry

      public void removeEntry(int entryOrdinal)
      Example:
           graphs.removeEntry(1);
           This will remove the second entry of the special debug element graphs (starts at 0).
       
      Parameters:
      entryOrdinal - entry's ordinal that need to be removed from this special element's entries.
      Throws:
      RuntimeException - If the game try to remove a non-existing entry.
    • drawSpecialElement

      public void drawSpecialElement(Minecraft mc, boolean isExtendedDebug)
      Draws all entries of this special debug element.
      Parameters:
      mc - The Minecraft instance.
      isExtendedDebug - Whether extended debug info is enabled.