<commit_before>package com.github.antag99.aquarria.xnb;

import java.io.File;
import java.util.Map.Entry;

public final class Steam {
	private Steam() {
	}
	
	public static File correctUserDirectory(File path) {
		// Making this function recursive can result in stack overflow...
		boolean found = false;
		
		File result = null;
		
		while(!found && path != null) {
			result = seekTerrariaDirectory(path);
			if(result == null) {
				result = seekSteamDirectory(path);
			}
			if(result == null) {
				result = seekSteamParent(path);
			}
			// Try with the parent directory
			if(result == null) {
				path = path.getParentFile();
			} else {
				found = true;
			}
		}
		
		return result;
	}
	
	public static File findTerrariaDirectory() {
		try {
			if(System.getProperty("os.name").toLowerCase().contains("windows")) {
				// Check the windows registry for steam installation path
				try {
					String steamPath = WinRegistry.readString(WinRegistry.HKEY_CURRENT_USER,
							"Software\\Valve\\Steam", "SteamPath");
					File result = seekSteamDirectory(new File(steamPath));
					if(result != null) {
						return result;
					}
				} catch(Throwable ignored) {
				}
			}
			// FIXME: DO NOT INCLUDE THIS
			File _result = seekTerrariaDirectory(new File("/media/anton/OS/Program Files (x86)/Steam/steamapps/common/Terraria/"));
			if(_result == null) System.err.println("THIS SHOULD NOT BE INCLUDED (Steam.java:51)");
			else return _result;
			<commit_msg>Whoops...<commit_after>package com.github.antag99.aquarria.xnb;

import java.io.File;
import java.util.Map.Entry;

public final class Steam {
	private Steam() {
	}
	
	public static File correctUserDirectory(File path) {
		// Making this function recursive can result in stack overflow...
		boolean found = false;
		
		File result = null;
		
		while(!found && path != null) {
			result = seekTerrariaDirectory(path);
			if(result == null) {
				result = seekSteamDirectory(path);
			}
			if(result == null) {
				result = seekSteamParent(path);
			}
			// Try with the parent directory
			if(result == null) {
				path = path.getParentFile();
			} else {
				found = true;
			}
		}
		
		return result;
	}
	
	public static File findTerrariaDirectory() {
		try {
			if(System.getProperty("os.name").toLowerCase().contains("windows")) {
				// Check the windows registry for steam installation path
				try {
					String steamPath = WinRegistry.readString(WinRegistry.HKEY_CURRENT_USER,
							"Software\\Valve\\Steam", "SteamPath");
					File result = seekSteamDirectory(new File(steamPath));
					if(result != null) {
						return result;
					}
				} catch(Throwable ignored) {
				}
			}
			
{'fraction_non_alphanumeric': 0.12311746987951808, 'fraction_numerical': 0.0030120481927710845, 'mean_word_length': 3.106646058732612, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4260337', 'n_tokens_mistral': 1021, 'n_tokens_neox': 817, 'n_words': 200}