Do not generate default templates if the templates folder already exists

This commit is contained in:
Kyle Melton 2017-07-28 04:12:27 -06:00
parent 8b65ec04dd
commit 83bd4e8fff

View File

@ -88,7 +88,8 @@ public final class SubPlugin extends BungeeCord {
} }
lang = new YAMLConfig(new UniversalFile(dir, "lang.yml")); lang = new YAMLConfig(new UniversalFile(dir, "lang.yml"));
if (!(new UniversalFile(dir, "Templates").exists())) new UniversalFile(dir, "Templates").mkdirs(); if (!(new UniversalFile(dir, "Templates").exists())) {
new UniversalFile(dir, "Templates").mkdirs();
if (!(new UniversalFile(dir, "Templates:Vanilla:template.yml").exists())) { if (!(new UniversalFile(dir, "Templates:Vanilla:template.yml").exists())) {
Util.unzip(SubPlugin.class.getResourceAsStream("/net/ME1312/SubServers/Bungee/Library/Files/Templates/vanilla.zip"), new UniversalFile(dir, "Templates")); Util.unzip(SubPlugin.class.getResourceAsStream("/net/ME1312/SubServers/Bungee/Library/Files/Templates/vanilla.zip"), new UniversalFile(dir, "Templates"));
System.out.println("SubServers > Created ~/SubServers/Templates/Vanilla"); System.out.println("SubServers > Created ~/SubServers/Templates/Vanilla");
@ -113,6 +114,7 @@ public final class SubPlugin extends BungeeCord {
Util.unzip(SubPlugin.class.getResourceAsStream("/net/ME1312/SubServers/Bungee/Library/Files/Templates/sponge.zip"), new UniversalFile(dir, "Templates")); Util.unzip(SubPlugin.class.getResourceAsStream("/net/ME1312/SubServers/Bungee/Library/Files/Templates/sponge.zip"), new UniversalFile(dir, "Templates"));
System.out.println("SubServers > Updated ~/SubServers/Templates/Sponge"); System.out.println("SubServers > Updated ~/SubServers/Templates/Sponge");
} }
}
if (new UniversalFile(dir, "Recently Deleted").exists()) { if (new UniversalFile(dir, "Recently Deleted").exists()) {
int f = new UniversalFile(dir, "Recently Deleted").listFiles().length; int f = new UniversalFile(dir, "Recently Deleted").listFiles().length;