2025-11-24 22:52:51 +03:00

32 lines
1.1 KiB
Java

/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* org.jspecify.annotations.Nullable
*/
package net.minecraft.client.gui.components.debug;
import net.minecraft.ChatFormatting;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.components.debug.DebugScreenDisplayer;
import net.minecraft.client.gui.components.debug.DebugScreenEntry;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.chunk.LevelChunk;
import org.jspecify.annotations.Nullable;
public class DebugEntryGpuUtilization
implements DebugScreenEntry {
@Override
public void display(DebugScreenDisplayer displayer, @Nullable Level serverOrClientLevel, @Nullable LevelChunk clientChunk, @Nullable LevelChunk serverChunk) {
Minecraft minecraft = Minecraft.getInstance();
String gpuUtilizationString = "GPU: " + (minecraft.getGpuUtilization() > 100.0 ? String.valueOf(ChatFormatting.RED) + "100%" : Math.round(minecraft.getGpuUtilization()) + "%");
displayer.addLine(gpuUtilizationString);
}
@Override
public boolean isAllowed(boolean reducedDebugInfo) {
return true;
}
}