From d7339ec3adbbffad9e177b101b0f3f384f8a4909 Mon Sep 17 00:00:00 2001 From: Fabrizio La Rosa Date: Tue, 4 Aug 2020 21:57:07 +0200 Subject: [PATCH] Small improvements in file manager --- .../songoda/skyblock/config/FileManager.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/songoda/skyblock/config/FileManager.java b/src/main/java/com/songoda/skyblock/config/FileManager.java index e267af6b..f974181e 100644 --- a/src/main/java/com/songoda/skyblock/config/FileManager.java +++ b/src/main/java/com/songoda/skyblock/config/FileManager.java @@ -161,13 +161,13 @@ public class FileManager { final ConfigurationSection section = config.getFileConfiguration().createSection(path); section.set("world", location.getWorld().getName()); - section.set("x", Double.valueOf(location.getX())); - section.set("y", Double.valueOf(location.getY())); - section.set("z", Double.valueOf(location.getZ())); + section.set("x", location.getX()); + section.set("y", location.getY()); + section.set("z", location.getZ()); if (direction) { - section.set("yaw", Float.valueOf(location.getYaw())); - section.set("pitch", Float.valueOf(location.getPitch())); + section.set("yaw", location.getYaw()); + section.set("pitch", location.getPitch()); } try { @@ -272,10 +272,10 @@ public class FileManager { while ((currentLine = bufferedReader.readLine()) != null) { if (currentLine.contains("#")) { addLine = currentLine.replace("[!]", "IMPORTANT").replace(":", "-").replaceFirst("#", pluginName + "_COMMENT_" + commentNum + ":"); - whole.append(addLine + "\n"); + whole.append(addLine).append("\n"); commentNum++; } else { - whole.append(currentLine + "\n"); + whole.append(currentLine).append("\n"); } } @@ -311,9 +311,9 @@ public class FileManager { for (String line : lines) { if (line.contains(plugin.getDescription().getName() + "_COMMENT")) { - config.append(line.replace("IMPORTANT", "[!]").replace("\n", "").replace(plugin.getDescription().getName() + "_COMMENT_", "#").replaceAll("[0-9]+:", "") + "\n"); + config.append(line.replace("IMPORTANT", "[!]").replace("\n", "").replace(plugin.getDescription().getName() + "_COMMENT_", "#").replaceAll("[0-9]+:", "")).append("\n"); } else if (line.contains(":")) { - config.append(line + "\n"); + config.append(line).append("\n"); } }