Do not rely on a static file path

Doing so will cause issues with the `--plugins` flag.
E.g. `java -jar server.jar --plugins /path/to/plugins/`
This commit is contained in:
NotMyFault 2021-05-21 00:35:19 +02:00
parent cc48f273c0
commit 7775cd0073
No known key found for this signature in database
GPG Key ID: 158F5701A6AAD00C
2 changed files with 2 additions and 2 deletions

View File

@ -175,7 +175,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
static {
try {
Settings.load(new File("plugins/PlotSquared/config/settings.yml"));
Settings.load(new File(PlotSquared.platform().getDirectory(), "settings.yml"));
} catch (Throwable ignored) {
}
}

View File

@ -1365,7 +1365,7 @@ public class PlotSquared {
public boolean setupConfigs() {
File folder = new File(this.platform.getDirectory(), "config");
if (!folder.exists() && !folder.mkdirs()) {
logger.error("Failed to create the /plugins/PlotSquared/config folder. Please create it manually");
logger.error("Failed to create the {} config folder. Please create it manually", this.platform.getDirectory());
}
try {
this.worldsFile = new File(folder, "worlds.yml");