diff --git a/launch.bat b/launch.bat index 903ce475cf..bed9d39b83 100644 --- a/launch.bat +++ b/launch.bat @@ -1,4 +1,4 @@ @echo off @title Cosmic -java -Xmx2048m -jar target\Cosmic.jar +java -Xmx2048m -Dwz-path= -jar target\Cosmic.jar pause \ No newline at end of file diff --git a/src/main/java/provider/wz/WZFiles.java b/src/main/java/provider/wz/WZFiles.java index e5073d0058..f563941118 100644 --- a/src/main/java/provider/wz/WZFiles.java +++ b/src/main/java/provider/wz/WZFiles.java @@ -17,7 +17,7 @@ public enum WZFiles { SOUND("Sound"), UI("UI"); - public static final String DIRECTORY = "wz"; + public static final String DIRECTORY = getWzDirectory(); private final String fileName; @@ -32,4 +32,15 @@ public enum WZFiles { public String getFilePath() { return getFile().getPath(); } + + private static String getWzDirectory() { + // Either provide a custom directory path through the "wz-path" property when launching the .jar, + // or don't provide one to use the default "wz" directory + String propertyPath = System.getProperty("wz-path"); + if (propertyPath != null && new File(propertyPath).isDirectory()) { + return propertyPath; + } + + return "wz"; + } }