mirror of
https://github.com/GTNewHorizons/MouseTweaks.git
synced 2026-11-19 11:49:18 +00:00
29 lines
742 B
Java
29 lines
742 B
Java
package yalter.mousetweaks;
|
|
|
|
import net.minecraft.client.Minecraft;
|
|
import net.minecraft.profiler.Profiler;
|
|
|
|
public class ProfilerCustom extends Profiler {
|
|
private Minecraft minecraft;
|
|
|
|
public ProfilerCustom() {
|
|
minecraft = Minecraft.getMinecraft();
|
|
}
|
|
|
|
@Override
|
|
public void startSection(String sectionName) {
|
|
// The useProfiler check is redundant here since the OnTick method cannot change in the runtime (at the time of writing this comment).
|
|
if (Main.useProfiler && "gameRenderer".equals(sectionName)) {
|
|
Main.onUpdateInGame();
|
|
}
|
|
|
|
super.startSection(sectionName);
|
|
|
|
if (Main.optifine) {
|
|
if (!Reflection.gameSettings.setFieldValue(minecraft.gameSettings, "ofProfiler", true)) {
|
|
Main.optifine = false;
|
|
}
|
|
}
|
|
}
|
|
}
|