Remove style.yml

This commit is contained in:
Alexander Söderberg 2020-07-08 15:23:33 +02:00
parent 090bd69be5
commit 9792d4cc4b
No known key found for this signature in database
GPG Key ID: C0207FF7EA146678

View File

@ -153,12 +153,10 @@ public class PlotSquared {
new UUIDPipeline(Executors.newSingleThreadExecutor()); new UUIDPipeline(Executors.newSingleThreadExecutor());
// WorldEdit instance // WorldEdit instance
public WorldEdit worldedit; public WorldEdit worldedit;
public File styleFile;
public File configFile; public File configFile;
public File worldsFile; public File worldsFile;
public File commandsFile; public File commandsFile;
public File translationFile; public File translationFile;
public YamlConfiguration style;
public YamlConfiguration worlds; public YamlConfiguration worlds;
public YamlConfiguration storage; public YamlConfiguration storage;
public YamlConfiguration commands; public YamlConfiguration commands;
@ -1777,24 +1775,6 @@ public class PlotSquared {
} catch (IOException ignored) { } catch (IOException ignored) {
PlotSquared.log("Failed to save settings.yml"); PlotSquared.log("Failed to save settings.yml");
} }
try {
this.styleFile = MainUtil.getFile(IMP.getDirectory(),
Settings.Paths.TRANSLATIONS + File.separator + "style.yml");
if (!this.styleFile.exists()) {
if (!this.styleFile.getParentFile().exists()) {
this.styleFile.getParentFile().mkdirs();
}
if (!this.styleFile.createNewFile()) {
PlotSquared.log(
"Could not create the style file, please create \"translations/style.yml\" manually");
}
}
this.style = YamlConfiguration.loadConfiguration(this.styleFile);
setupStyle();
} catch (IOException err) {
err.printStackTrace();
PlotSquared.log("Failed to save style.yml");
}
try { try {
this.storageFile = new File(folder, "storage.yml"); this.storageFile = new File(folder, "storage.yml");
if (!this.storageFile.exists() && !this.storageFile.createNewFile()) { if (!this.storageFile.exists() && !this.storageFile.createNewFile()) {
@ -1817,7 +1797,6 @@ public class PlotSquared {
PlotSquared.log("Failed to save commands.yml"); PlotSquared.log("Failed to save commands.yml");
} }
try { try {
this.style.save(this.styleFile);
this.commands.save(this.commandsFile); this.commands.save(this.commandsFile);
} catch (IOException e) { } catch (IOException e) {
PlotSquared.log("Configuration file saving failed"); PlotSquared.log("Configuration file saving failed");
@ -1859,44 +1838,6 @@ public class PlotSquared {
} }
} }
/**
* Setup the style.yml file
*/
private void setupStyle() {
if (this.version != null) {
this.style.set("Version", this.version.toString());
}
this.style.set("Information",
"Left Row: PlotSquared color codes ($), right row: Minecraft color codes (&)");
Map<String, Object> object = new HashMap<>(16);
object.put("color.1", "6");
object.put("color.2", "7");
object.put("color.3", "8");
object.put("color.4", "3");
object.put("color.5", "1");
object.put("color.6", "2");
object.put("color.7", "4");
object.put("color.8", "5");
object.put("color.9", "9");
object.put("color.10", "0");
object.put("color.11", "a");
object.put("color.12", "b");
object.put("color.13", "c");
object.put("color.14", "d");
object.put("color.15", "e");
object.put("color.16", "f");
if (!this.style.contains("color")
|| this.style.getConfigurationSection("color").getValues(false).size() != object
.size()) {
for (Entry<String, Object> node : object.entrySet()) {
this.style.set(node.getKey(), node.getValue());
}
}
if (this.style.contains("version")) {
this.style.set("version", null);
}
}
/** /**
* Gets the Java version. * Gets the Java version.
* *