feat: use system property for configurable data folder path

Updated `getDataFolder` to allow customization via the `terra.datafolder` system property. This ensures greater flexibility for specifying the data folder location, while maintaining the default path if the property is not set.
This commit is contained in:
Christian Bergschneider 2025-01-25 04:42:52 +01:00
parent 7b29d25847
commit 3a7d1a69d0
No known key found for this signature in database
GPG Key ID: 3991F97F5FA28D3E

View File

@ -77,7 +77,9 @@ public final class MinestomPlatform extends AbstractPlatform {
@Override
public @NotNull File getDataFolder() {
File file = new File("./terra/");
String pathName = System.getProperty("terra.datafolder");
if (pathName == null) pathName = "./terra/";
File file = new File(pathName);
if(!file.exists()) file.mkdirs();
return file;
}