mirror of
https://github.com/ME1312/SubServers-2.git
synced 2024-11-25 11:46:50 +01:00
Don't recreate default templates
This commit is contained in:
parent
f6274317d6
commit
693b6e8394
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
Manifest-Version: 1.0
|
||||
Class-Path: BungeeCord.jar
|
||||
Main-Class: net.ME1312.SubServers.Bungee.Launch
|
||||
Implementation-Version: 2.12c
|
||||
Specification-Version: 0
|
||||
Implementation-Version: 2.12d
|
||||
Specification-Version: 1
|
||||
|
@ -58,7 +58,7 @@ public class ExternalSubCreator extends SubCreator {
|
||||
final SubCreateEvent event = new SubCreateEvent(player, host, name, template, version, port);
|
||||
host.plugin.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
ExternalSubLogger logger = new ExternalSubLogger(this, name + "/Creator", new Container<Boolean>(host.plugin.config.get().getSection("Settings").getBoolean("Log-Creator")), null);
|
||||
ExternalSubLogger logger = new ExternalSubLogger(this, name + File.separator + "Creator", new Container<Boolean>(host.plugin.config.get().getSection("Settings").getBoolean("Log-Creator")), null);
|
||||
thread.put(name.toLowerCase(), logger);
|
||||
logger.start();
|
||||
host.queue(new PacketExCreateServer(name, template, version, port, logger.getExternalAddress(), (JSONCallback) json -> {
|
||||
|
@ -229,7 +229,7 @@ public class InternalSubCreator extends SubCreator {
|
||||
final SubCreateEvent event = new SubCreateEvent(player, host, name, template, version, port);
|
||||
host.plugin.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
NamedContainer<Thread, NamedContainer<InternalSubLogger, Process>> thread = new NamedContainer<Thread, NamedContainer<InternalSubLogger, Process>>(new Thread(() -> InternalSubCreator.this.run(player, name, event.getTemplate(), event.getVersion(), port)), new NamedContainer<InternalSubLogger, Process>(new InternalSubLogger(null, this, name + "/Creator", new Container<Boolean>(false), null), null));
|
||||
NamedContainer<Thread, NamedContainer<InternalSubLogger, Process>> thread = new NamedContainer<Thread, NamedContainer<InternalSubLogger, Process>>(new Thread(() -> InternalSubCreator.this.run(player, name, event.getTemplate(), event.getVersion(), port)), new NamedContainer<InternalSubLogger, Process>(new InternalSubLogger(null, this, name + File.separator + "Creator", new Container<Boolean>(false), null), null));
|
||||
this.thread.put(name.toLowerCase(), thread);
|
||||
thread.name().start();
|
||||
return true;
|
||||
|
@ -63,7 +63,7 @@ public final class SubDataServer {
|
||||
|
||||
private void loadDefaults() {
|
||||
defaults = true;
|
||||
for (String s : plugin.config.get().getSection("Settings").getSection("SubData").getStringList("Allowed-Connections")) {
|
||||
for (String s : plugin.config.get().getSection("Settings").getSection("SubData").getStringList("Allowed-Connections", new ArrayList<String>())) {
|
||||
try {
|
||||
allowedAddresses.add(InetAddress.getByName(s));
|
||||
} catch (Exception e) {
|
||||
|
@ -88,30 +88,33 @@ public final class SubPlugin extends BungeeCord {
|
||||
}
|
||||
lang = new YAMLConfig(new UniversalFile(dir, "lang.yml"));
|
||||
|
||||
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").exists())) {
|
||||
new UniversalFile(dir, "Templates").mkdirs();
|
||||
|
||||
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");
|
||||
} else if ((new Version((new YAMLConfig(new UniversalFile(dir, "Templates:Vanilla:template.yml"))).get().getString("Version", "0")).compareTo(new Version("2.12b+"))) != 0) {
|
||||
Files.move(new UniversalFile(dir, "Templates:Vanilla").toPath(), new UniversalFile(dir, "Templates:Vanilla.old" + Math.round(Math.random() * 100000)).toPath());
|
||||
Util.unzip(SubPlugin.class.getResourceAsStream("/net/ME1312/SubServers/Bungee/Library/Files/Templates/vanilla.zip"), new UniversalFile(dir, "Templates"));
|
||||
System.out.println("SubServers > Updated ~/SubServers/Templates/Vanilla");
|
||||
}
|
||||
if (!(new UniversalFile(dir, "Templates:Spigot:template.yml").exists())) {
|
||||
|
||||
Util.unzip(SubPlugin.class.getResourceAsStream("/net/ME1312/SubServers/Bungee/Library/Files/Templates/spigot.zip"), new UniversalFile(dir, "Templates"));
|
||||
System.out.println("SubServers > Created ~/SubServers/Templates/Spigot");
|
||||
} else if ((new Version((new YAMLConfig(new UniversalFile(dir, "Templates:Spigot:template.yml"))).get().getString("Version", "0")).compareTo(new Version("2.11.2m+"))) != 0) {
|
||||
Files.move(new UniversalFile(dir, "Templates:Vanilla").toPath(), new UniversalFile(dir, "Templates:Spigot.old" + Math.round(Math.random() * 100000)).toPath());
|
||||
Util.unzip(SubPlugin.class.getResourceAsStream("/net/ME1312/SubServers/Bungee/Library/Files/Templates/spigot.zip"), new UniversalFile(dir, "Templates"));
|
||||
System.out.println("SubServers > Updated ~/SubServers/Templates/Spigot");
|
||||
}
|
||||
if (!(new UniversalFile(dir, "Templates:Sponge:template.yml").exists())) {
|
||||
|
||||
Util.unzip(SubPlugin.class.getResourceAsStream("/net/ME1312/SubServers/Bungee/Library/Files/Templates/sponge.zip"), new UniversalFile(dir, "Templates"));
|
||||
System.out.println("SubServers > Created ~/SubServers/Templates/Sponge");
|
||||
} else if ((new Version((new YAMLConfig(new UniversalFile(dir, "Templates:Sponge:template.yml"))).get().getString("Version", "0")).compareTo(new Version("2.11.2m+"))) != 0) {
|
||||
Files.move(new UniversalFile(dir, "Templates:Vanilla").toPath(), new UniversalFile(dir, "Templates:Sponge.old" + Math.round(Math.random() * 100000)).toPath());
|
||||
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");
|
||||
} else {
|
||||
if (new UniversalFile(dir, "Templates:Vanilla:template.yml").exists() && (new Version((new YAMLConfig(new UniversalFile(dir, "Templates:Vanilla:template.yml"))).get().getString("Version", "0")).compareTo(new Version("2.12b+"))) != 0) {
|
||||
Files.move(new UniversalFile(dir, "Templates:Vanilla").toPath(), new UniversalFile(dir, "Templates:Vanilla.old" + Math.round(Math.random() * 100000)).toPath());
|
||||
Util.unzip(SubPlugin.class.getResourceAsStream("/net/ME1312/SubServers/Bungee/Library/Files/Templates/vanilla.zip"), new UniversalFile(dir, "Templates"));
|
||||
System.out.println("SubServers > Updated ~/SubServers/Templates/Vanilla");
|
||||
}
|
||||
if (new UniversalFile(dir, "Templates:Spigot:template.yml").exists() && (new Version((new YAMLConfig(new UniversalFile(dir, "Templates:Spigot:template.yml"))).get().getString("Version", "0")).compareTo(new Version("2.11.2m+"))) != 0) {
|
||||
Files.move(new UniversalFile(dir, "Templates:Vanilla").toPath(), new UniversalFile(dir, "Templates:Spigot.old" + Math.round(Math.random() * 100000)).toPath());
|
||||
Util.unzip(SubPlugin.class.getResourceAsStream("/net/ME1312/SubServers/Bungee/Library/Files/Templates/spigot.zip"), new UniversalFile(dir, "Templates"));
|
||||
System.out.println("SubServers > Updated ~/SubServers/Templates/Spigot");
|
||||
}
|
||||
if (new UniversalFile(dir, "Templates:Sponge:template.yml").exists() && (new Version((new YAMLConfig(new UniversalFile(dir, "Templates:Sponge:template.yml"))).get().getString("Version", "0")).compareTo(new Version("2.11.2m+"))) != 0) {
|
||||
Files.move(new UniversalFile(dir, "Templates:Vanilla").toPath(), new UniversalFile(dir, "Templates:Sponge.old" + Math.round(Math.random() * 100000)).toPath());
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
if (new UniversalFile(dir, "Recently Deleted").exists()) {
|
||||
|
Loading…
Reference in New Issue
Block a user