added a build of CompilePackage to the repository as a jar and a simple readme.txt to go with it with instructions

This commit is contained in:
LAX1DUDE 2022-01-19 16:51:01 -08:00
parent 211e08ba7d
commit 8b98cd1101
3 changed files with 12 additions and 1 deletions

Binary file not shown.

7
epkcompiler/readme.txt Normal file
View File

@ -0,0 +1,7 @@
Use this tool like this:
java -jar CompilePackage.jar <source directory> <output file>
To recompile the assets.epk file found in /javascript, make your changes to the game's resources in /lwjgl-rundir/resources and then run this command within this /epkcompiler directory:
java -jar CompilePackage.jar "../lwjgl-rundir/resources" "../javascript/assets.epk"

View File

@ -18,6 +18,10 @@ public class CompilePackage {
private static ArrayList<File> files = new ArrayList();
public static void main(String[] args) throws IOException, NoSuchAlgorithmException {
if(args.length != 2) {
System.out.print("Usage: java -jar CompilePackage.jar <input directory> <output file>");
return;
}
File root = new File(args[0]);
listDirectory(root);
ByteArrayOutputStream osb = new ByteArrayOutputStream();
@ -47,7 +51,7 @@ public class CompilePackage {
os.writeUTF(" end");
os.flush();
os.close();
FileOutputStream out = new FileOutputStream(new File("out.epk"));
FileOutputStream out = new FileOutputStream(new File(args[1]));
out.write(osb.toByteArray());
out.close();
}