import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; import java.util.Scanner; /** * This program searches a file to find every unique string that appears within parentheses * (on a single line) somewhere in the file. It is useful for finding bugs in the credits. * To use this program, extract credits.json from the Minecraft JAR and place it in the same * folder as this program. Then run this program. A file called output.txt will be created * that lists all of the unique strings that were found. * * @author pine1needle */ public class CreditsSearcher { public static void main(String[] args) throws IOException { //find credits file and create scanner to read from it File credits = new File("credits.json"); Scanner scnr = new Scanner(credits); //declare variables ArrayList companyNames = new ArrayList(); String line = ""; //search for unique company names while(scnr.hasNextLine()) { line = scnr.nextLine(); //iterate over the line to see if and when parentheses start for (int i=0; i