Package api.client.debug
Class DebugSpecialElement
java.lang.Object
api.client.debug.DebugSpecialElement
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEntry(IDebugSpecialProvider provider) Example:voiddrawSpecialElement(Minecraft mc, boolean isExtendedDebug) Draws all entries of this special debug element.getID()voidremoveEntry(int entryOrdinal) Example:
-
Constructor Details
-
DebugSpecialElement
-
-
Method Details
-
getID
-
addEntry
Example:The code insideDebugSpecialElement 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); } ));.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. -
removeEntry
public void removeEntry(int entryOrdinal) Example:graphs.removeEntry(1);This will remove the second entry of the special debug elementgraphs(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
Draws all entries of this special debug element.- Parameters:
mc- The Minecraft instance.isExtendedDebug- Whether extended debug info is enabled.
-