diff --git a/src/main/java/com/drtshock/playervaults/PlayerVaults.java b/src/main/java/com/drtshock/playervaults/PlayerVaults.java index c7f247c..45ec7d4 100644 --- a/src/main/java/com/drtshock/playervaults/PlayerVaults.java +++ b/src/main/java/com/drtshock/playervaults/PlayerVaults.java @@ -362,10 +362,12 @@ public class PlayerVaults extends JavaPlugin { try { Path langPath = this.getDataFolder().toPath().resolve("lang.conf"); - List lines = Files.readAllLines(langPath); - List updatedLines = new ArrayList<>(); - lines.forEach(line -> updatedLines.add(line.replaceAll("\\{(vault|player|price|count|item)}", "<$1>"))); - Files.write(langPath, updatedLines.stream().collect(Collectors.joining("\n")).getBytes()); + if (Files.exists(langPath)) { + List lines = Files.readAllLines(langPath); + List updatedLines = new ArrayList<>(); + lines.forEach(line -> updatedLines.add(line.replaceAll("\\{(vault|player|price|count|item)}", "<$1>"))); + Files.write(langPath, updatedLines.stream().collect(Collectors.joining("\n")).getBytes()); + } Loader.loadAndSave("lang", this.translation); } catch (IOException | IllegalAccessException e) { this.getLogger().log(Level.SEVERE, "Could not load lang.", e);