Package api.client.debug
Class DebugInfoSection
java.lang.Object
api.client.debug.DebugInfoSection
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEntry(IDebugInfoProvider provider) Example 1:voidaddEntryWithIndex(IDebugInfoProvider provider, int index) Example 1:getID()intvoidorderSection(ResourceLocation afterSectionID) Example:orderSection(B)-> "this section should be after section B"voidorderSection(ResourceLocation afterSectionID, int priority) Example:orderSection(B, n)-> "this section should be after section B with a priority 'n' "voidremoveEntry(int entryOrdinal) Example:voidsetOrderPriority(int priority)
-
Constructor Details
-
DebugInfoSection
-
-
Method Details
-
getID
-
setOrderPriority
public void setOrderPriority(int priority) -
getOrderPriority
public int getOrderPriority() -
addEntry
Example 1:mcSection.addEntry((mc, isExtended) -> Optional.of("test"));This will add the string 'test' to the entries of the sectionmcSection.
Example 2:mcSection.addEntry((mc, isExtended) -> { String username = mc.thePlayer.username; if(isExtended) { return Optional.of(username); } else { return Optional.empty(); }});This will add the username of the player to the sectionmcSectionifisExtendedistrueand iffalse, will return an emptyOptionalwhich result in no text added to the section. -
addEntryWithIndex
Example 1:mcSection.addEntryWithIndex((mc, isExtendedDebug) -> Optional.of("test"), 3);This will add the string 'test' at the 4th line of the sectionmcSectionand move next lines by 1 (starts at 0).
Example 2:mcSection.addEntryWithIndex((mc, isExtended) -> { String username = mc.thePlayer.username; if(isExtended) { return Optional.of(username); } else { return Optional.empty(); }}, 3);This will add the username of the player at the 4th line of the sectionmcSectionifisExtendedistrueand iffalse, will return an emptyOptionalwhich result in no text added to the section. -
removeEntry
public void removeEntry(int entryOrdinal) Example:mcSection.removeEntry(1);This will remove the second entry ofmcSection(start at 0).- Parameters:
entryOrdinal- entry's ordinal that need to be removed from this section's entries.- Throws:
RuntimeException- If the game try to remove a non-existing entry.
-
orderSection
Example:orderSection(B)-> "this section 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- Parameters:
afterSectionID- section's id after which current section will be placed.
-
orderSection
Example:orderSection(B, n)-> "this section should be after section B with a priority 'n' "The highest priority section will be placed first.
The highest priority section will be placed first.- Parameters:
afterSectionID- section's id after which current section will be placed.
-
getLines
- Parameters:
mc- The Minecraft instance.isExtendedDebug- Whether extended debug info is enabled.- Returns:
- a list of
Stringto draw in this section.
-