Class DebugRegistryUtils

java.lang.Object
api.client.debug.DebugRegistryUtils

public class DebugRegistryUtils extends Object
  • Constructor Details

    • DebugRegistryUtils

      public DebugRegistryUtils()
  • Method Details

    • registerSection

      public static DebugInfoSection registerSection(ResourceLocation identifier, DebugRegistryUtils.Side side)
      Register an empty debug section ready to accept new Optional<String> entries.
      Parameters:
      identifier - The ID of the section, in the form of a ResourceLocation, example: 'btw:debugMinecraft'.
      side - The side of the debug screen where the section should be drawn.
    • removeSection

      public static void removeSection(ResourceLocation identifier)
      Remove a section from the debug screen.
      Parameters:
      identifier - The ID of the section, in the form of a ResourceLocation, example: 'btw:debugMinecraft'.
    • getSectionWithID

      public static DebugInfoSection getSectionWithID(ResourceLocation identifier)
      Helper method to get a debug section from its ID.
      Example:
       DebugInfoSection section = DebugRegistryUtils.getSectionByID(new ResourceLocation("btw:debugMinecraft"));
       
      This get the debug section with the ID btw:debugMinecraft and save it to section.
      Parameters:
      identifier - The ID of the section wanted, in the form of a ResourceLocation, example: 'btw:debugMinecraft'.
      See Also:
    • getSortedSections

      public static List<DebugInfoSection> getSortedSections(DebugRegistryUtils.Side side)
      Parameters:
      side - The side of the debug screen that need to be sorted.
      Returns:
      a list of debug sections after being placed in determined order.
      See Also:
    • orderSection

      public static void orderSection(ResourceLocation sectionIDToMove, ResourceLocation afterSectionID)
      Example: orderSection(C, B) -> "section C should be after section B"

      By default, this order have a priority of '0', higher priority sections orders will be placed before.
      If multiple section have the same priority, the section registered first will be placed first.

    • orderSection

      public static void orderSection(ResourceLocation sectionIDToMove, ResourceLocation afterSectionID, int priority)
      Example: orderSection(C, B, n) -> "section C should be after section B with a priority 'n' "

      The highest priority section will be placed first.
      If multiple sections have the same priority, the section registered first will be placed first.

    • registerSpecialElement

      public static DebugSpecialElement registerSpecialElement(ResourceLocation identifier)
      Register a new special debug element ready to accept any entry.
      Parameters:
      identifier - The ID of the special debug element in the form of a ResourceLocation, example: 'btw:graphs'.
    • removeSpecialElement

      public static void removeSpecialElement(ResourceLocation identifier)
      Remove a special debug element from the debug screen.
      Parameters:
      identifier - The ID of the special debug element in the form of a ResourceLocation, example: 'btw:graphs'.
    • getSpecialElementByID

      public static DebugSpecialElement getSpecialElementByID(ResourceLocation identifier)
      Helper method to get a special debug element from its ID.
      Example:
       DebugSpecialElement element = DebugRegistryUtils.getSpecialElementByID(new ResourceLocation("btw:debugGraphs"));
       
      This get the special debug element with the ID btw:debugGraphs and save it to element.
      Parameters:
      identifier - The ID of the special debug element in the form of a ResourceLocation, example: 'btw:graphs'.
      See Also:
    • getSpecialElements

      public static List<DebugSpecialElement> getSpecialElements()
      Returns:
      a list of every special debug elements that need to be drawn.