<commit_before>/*
 ** 2014 August 01
 **
 ** The author disclaims copyright to this source code.  In place of
 ** a legal notice, here is a blessing:
 **    May you do good and not evil.
 **    May you find forgiveness for yourself and forgive others.
 **    May you share freely, never taking more than you give.
 */
package info.ata4.minecraft.minema.client.modules;

import info.ata4.minecraft.minema.client.config.MinemaConfig;
import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.GameSettings;

/**
 *
 * @author <NAME> <barracuda415 at yahoo.de>
 */
public class GameSettingsModifier extends ACaptureModule {

	private static final Minecraft MC = Minecraft.getMinecraft();

	private int limitFramerate;
	private boolean pauseOnLostFocus;

	public GameSettingsModifier(final MinemaConfig cfg) {
		super(cfg);
	}

	@Override
	protected void doEnable() throws Exception {
		final GameSettings gs = MC.gameSettings;

		// disable build-in framerate limit
		this.limitFramerate = gs.limitFramerate;
		gs.limitFramerate = Integer.MAX_VALUE;

		// don't pause when losing focus
		this.pauseOnLostFocus = gs.pauseOnLostFocus;
		gs.pauseOnLostFocus = false;

	}

	@Override
	protected void doDisable() throws Exception {
		// restore game settings
		final GameSettings gs = MC.gameSettings;
		gs.limitFramerate = this.limitFramerate;
		gs.pauseOnLostFocus = this.pauseOnLostFocus;
	}

}<commit_msg>Disable new vSync setting while recording<commit_after>/*
 ** 2014 August 01
 **
 ** The author disclaims copyright to this source code.  In place of
 ** a legal notice, here is a blessing:
 **    May you do good and not evil.
 **    May you find forgiveness for yourself and forgive others.
 **    May you share freely, never taking more than you give.
 */
package info.ata4.minecraft.minema.client.modules;

import info.ata4.minecraft.minema.client.config.MinemaConfig;
import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.GameSettings;

/**
 *
 * @author <NAME> <barracuda415 at yahoo.de>
 */
public class GameSettingsModifier extends ACaptureModule {

	private static final Minecraft MC = Minecraft.getMinecraft();

	private int framerateLimit;
	private boolean vSync;
	private boolean pauseOnLostFocus;

	public GameSettingsModifier(final MinemaConfig cfg) {
		super(cfg);
	}

	@Override
	protected void doEnable() throws Exception {
		final GameSettings gs = MC.gameSettings;

		// disable build-in framerate limit
		this.framerateLimit = gs.limitFramerate;
		gs.limitFramerate = Integer.MAX_VALUE;

		// disable vSync
		this.vSync = gs.enableVsync;
		gs.enableVsync = false;

		// don't pause when losing focus
		this.pauseOnLostFocus = gs.pauseOnLostFocus;
		gs.pauseOnLostFocus = false;

	}

	@Override
	protected void doDisable() throws Exception {
		// restore everything
		final GameSettings gs = MC.gameSettings;
		gs.limitFramerate = this.framerateLimit;
		gs.pauseOnLostFocus = this.pauseOnLostFocus;
		gs.enableVsync = this.vSync;
	}

}
{'fraction_non_alphanumeric': 0.08887403942532576, 'fraction_numerical': 0.007350484463748747, 'mean_word_length': 4.135506003430532, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5399474', 'n_tokens_mistral': 977, 'n_tokens_neox': 907, 'n_words': 269}