diff --git a/src/main/java/world/bentobox/bentobox/BentoBox.java b/src/main/java/world/bentobox/bentobox/BentoBox.java index 7e4837043..70140b94d 100644 --- a/src/main/java/world/bentobox/bentobox/BentoBox.java +++ b/src/main/java/world/bentobox/bentobox/BentoBox.java @@ -1,5 +1,7 @@ package world.bentobox.bentobox; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.List; import java.util.Optional; @@ -464,9 +466,16 @@ public class BentoBox extends JavaPlugin implements Listener { return false; } - log("Saving default panels..."); - this.saveResource("panels/island_creation_panel.yml", false); - this.saveResource("panels/language_panel.yml", false); + if (!Files.exists(Path.of(this.getDataFolder().getPath(), "panels", "island_creation_panel.yml"))) { + log("Saving default island_creation_panel..."); + this.saveResource("panels/island_creation_panel.yml", false); + } + + if (!Files.exists(Path.of(this.getDataFolder().getPath(), "panels", "language_panel.yml"))) { + log("Saving default language_panel..."); + this.saveResource("panels/language_panel.yml", false); + } + return true; }