Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ public class Constants {
public static final boolean DEBUG = Platform.getInstance().isDevelopmentEnvironment();

// Miscellaneous
// Minecraft considers limits >=260 as infinite

// Minimum limit, for lower FPS we cancel frames
public static final int MIN_FRAME_RATE_LIMIT = 15;
// Minecraft considers limits >=260 as unlimited
public static final int NO_FRAME_RATE_LIMIT = 260;

// The Cloth Config mod ID has changed a few times
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@ private static boolean checkForRender(long timeSinceLastRender) {
return false;
}

// Disable frame rate limiting
if (frameRateTarget == Constants.NO_FRAME_RATE_LIMIT) {
// Disable mod-side frame rate limiting
if (frameRateTarget >= Constants.MIN_FRAME_RATE_LIMIT) {
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ private void getFramerateLimit(CallbackInfoReturnable<Integer> callbackInfo) {
if (state != PowerState.FOCUSED) {
// Instruct Minecraft to render a minimum of 15 FPS
// Going lower here makes resuming again feel sluggish
callbackInfo.setReturnValue(Math.max(this.getFramerateTarget(), 15));
callbackInfo.setReturnValue(Math.max(this.getFramerateTarget(), Constants.MIN_FRAME_RATE_LIMIT));
} else {
IdleCondition condition = DynamicFPSConfig.INSTANCE.idle().condition();

Expand Down