Skip to content

Commit

Permalink
feat: uncap frame rate if synchronizeIntegratedServer is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
decahedron1 committed Jan 20, 2024
1 parent 8b9f7fa commit b9f18f6
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import com.mojang.blaze3d.platform.Window;
import net.minecraft.client.Minecraft;
import net.minecraft.client.Option;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.server.IntegratedServer;
import net.minecraft.server.MinecraftServer;
Expand Down Expand Up @@ -32,12 +33,12 @@ public class MinecraftMixin {
@Shadow
public ClientLevel level;

@Overwrite // override frame rate limit to 20 (server ticks per second) if SYNCHRONIZE_INTEGRATED_SERVER is enabled
@Overwrite // uncap frame rate limit if SYNCHRONIZE_INTEGRATED_SERVER is enabled
private int getFramerateLimit() {
if (this.level == null) {
return 60;
} else if (Config.SYNCHRONIZE_INTEGRATED_SERVER.getValue()) {
return 20;
return (int)Option.FRAMERATE_LIMIT.getMaxValue();
}

return this.window.getFramerateLimit();
Expand Down

0 comments on commit b9f18f6

Please sign in to comment.