Fix lang load bug
This commit is contained in:
@@ -362,10 +362,12 @@ public class PlayerVaults extends JavaPlugin {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Path langPath = this.getDataFolder().toPath().resolve("lang.conf");
|
Path langPath = this.getDataFolder().toPath().resolve("lang.conf");
|
||||||
|
if (Files.exists(langPath)) {
|
||||||
List<String> lines = Files.readAllLines(langPath);
|
List<String> lines = Files.readAllLines(langPath);
|
||||||
List<String> updatedLines = new ArrayList<>();
|
List<String> updatedLines = new ArrayList<>();
|
||||||
lines.forEach(line -> updatedLines.add(line.replaceAll("\\{(vault|player|price|count|item)}", "<$1>")));
|
lines.forEach(line -> updatedLines.add(line.replaceAll("\\{(vault|player|price|count|item)}", "<$1>")));
|
||||||
Files.write(langPath, updatedLines.stream().collect(Collectors.joining("\n")).getBytes());
|
Files.write(langPath, updatedLines.stream().collect(Collectors.joining("\n")).getBytes());
|
||||||
|
}
|
||||||
Loader.loadAndSave("lang", this.translation);
|
Loader.loadAndSave("lang", this.translation);
|
||||||
} catch (IOException | IllegalAccessException e) {
|
} catch (IOException | IllegalAccessException e) {
|
||||||
this.getLogger().log(Level.SEVERE, "Could not load lang.", e);
|
this.getLogger().log(Level.SEVERE, "Could not load lang.", e);
|
||||||
|
|||||||
Reference in New Issue
Block a user