From 7775cd00735c8ee3e78b38265db9146842386eca Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Fri, 21 May 2021 00:35:19 +0200 Subject: [PATCH] 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/` --- Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java | 2 +- Core/src/main/java/com/plotsquared/core/PlotSquared.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java b/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java index 4d014c736..b9fd5ac0e 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java @@ -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) { } } diff --git a/Core/src/main/java/com/plotsquared/core/PlotSquared.java b/Core/src/main/java/com/plotsquared/core/PlotSquared.java index 67d52c72e..561bfd301 100644 --- a/Core/src/main/java/com/plotsquared/core/PlotSquared.java +++ b/Core/src/main/java/com/plotsquared/core/PlotSquared.java @@ -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");