(feature) limit unfocused fps

This commit is contained in:
kirillsaint 2024-01-21 15:04:19 +06:00
parent 006737e127
commit 1d11f5a65b
2 changed files with 7 additions and 3 deletions

View File

@ -332,8 +332,8 @@ public abstract class MinecraftMixin implements MinecraftExt {
{
if (this.theWorld == null && this.currentScreen != null) return this.currentScreen instanceof SilentScreen ? ((SilentScreen) this.currentScreen).getFpsLimit() : 30;
if(!Display.isActive()) {
return 60;
if(!Display.isActive() && Client.getInstance().getSettingsManager().getSettingByClass(FPSBoostMod.class, "Limit Unfocused FPS").getValBoolean()) {
return Client.getInstance().getSettingsManager().getSettingByClass(FPSBoostMod.class, "Unfocused FPS Limit").getValInt();
}
return this.gameSettings.limitFramerate;

View File

@ -38,6 +38,8 @@ public class FPSBoostMod extends Mod {
@Override
public void setup() {
this.setUpdated(true);
ArrayList<String> lazyLoading = new ArrayList<String>();
lazyLoading.add("Off");
@ -57,6 +59,8 @@ public class FPSBoostMod extends Mod {
this.addBooleanSetting("Low Graphics Mode", this, false); // ready
this.addBooleanSetting("Hud Optimization", this, false); // ready
this.addBooleanSetting("Optimized Entity Movement", this, true);
this.addBooleanSetting("Limit Unfocused FPS", this, true);
this.addSliderSetting("Unfocused FPS Limit", this, 60, 10, 200, true);
this.addModeSetting("Lazy Chunk Loading", this, "Balance", lazyLoading); // ready
this.addModeSetting("Occlusion Culling", this, "Balance", entityCulling); // ready
this.addBooleanSetting("Hide Tall Grass", this, false); // ready
@ -107,7 +111,7 @@ public class FPSBoostMod extends Mod {
return;
}
if(setting.getName().equals("Optimized Entity Movement") || setting.getName().equals("Low Graphics Mode") || !setting.isCheck() || setting.getName().equals("Check glError") || setting.getName().equals("Do memory debug")) {
if(setting.getName().equals("Optimized Entity Movement") || setting.getName().equals("Low Graphics Mode") || !setting.isCheck() || setting.getName().equals("Check glError") || setting.getName().equals("Do memory debug") || setting.getName().equals("Limit Unfocused FPS")) {
return;
}