SubServers v2.11.2l

This commit is contained in:
ME1312 2017-05-25 15:55:47 -04:00
parent 2b1f355a6c
commit e238add62c
12 changed files with 21 additions and 7 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -2,4 +2,4 @@ Manifest-Version: 1.0
Class-Path: BungeeCord.jar Class-Path: BungeeCord.jar
Main-Class: net.ME1312.SubServers.Bungee.Launch Main-Class: net.ME1312.SubServers.Bungee.Launch
Implementation-Version: 2.11.2l Implementation-Version: 2.11.2l
Specification-Version: 2 Specification-Version: 0

View File

@ -254,9 +254,9 @@ public class InternalSubCreator extends SubCreator {
private void generateClient(File dir, String name, ServerType type) throws IOException { private void generateClient(File dir, String name, ServerType type) throws IOException {
if (type == ServerType.SPIGOT) { if (type == ServerType.SPIGOT) {
new UniversalFile(dir, "plugins:SubServers-Client-Bukkit").mkdirs(); new UniversalFile(dir, "plugins:SubServers-Client").mkdirs();
Util.copyFromJar(SubPlugin.class.getClassLoader(), "net/ME1312/SubServers/Bungee/Library/Files/bukkit.jar", new UniversalFile(dir, "plugins:SubServers.Client.jar").getPath()); Util.copyFromJar(SubPlugin.class.getClassLoader(), "net/ME1312/SubServers/Bungee/Library/Files/bukkit.jar", new UniversalFile(dir, "plugins:SubServers.Client.jar").getPath());
YAMLConfig config = new YAMLConfig(new UniversalFile(dir, "plugins:Subservers-Client-Bukkit:config.yml")); YAMLConfig config = new YAMLConfig(new UniversalFile(dir, "plugins:Subservers-Client:config.yml"));
YAMLSection settings = new YAMLSection(); YAMLSection settings = new YAMLSection();
settings.set("Version", "2.11.2a+"); settings.set("Version", "2.11.2a+");
settings.set("Ingame-Access", true); settings.set("Ingame-Access", true);

View File

@ -29,7 +29,7 @@ public final class SubCommand extends Command implements TabExecutor {
protected SubCommand(SubPlugin plugin, String command) { protected SubCommand(SubPlugin plugin, String command) {
super(command); super(command);
this.plugin = plugin; this.plugin = plugin;
this.label = "/" + command; this.label = '/' + command;
} }
/** /**

View File

@ -14,6 +14,7 @@ import org.bukkit.plugin.java.JavaPlugin;
import java.io.*; import java.io.*;
import java.net.InetAddress; import java.net.InetAddress;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
/** /**
* SubServers Client Plugin Class * SubServers Client Plugin Class
@ -25,7 +26,7 @@ public final class SubPlugin extends JavaPlugin {
public UIHandler gui = null; public UIHandler gui = null;
public final Version version; public final Version version;
public final Version bversion = new Version(2); public final Version bversion = null;
public final SubAPI api = new SubAPI(this); public final SubAPI api = new SubAPI(this);
public SubPlugin() { public SubPlugin() {
@ -41,6 +42,10 @@ public final class SubPlugin extends JavaPlugin {
try { try {
Bukkit.getLogger().info("SubServers > Loading SubServers v" + version.toString() + " Libraries... "); Bukkit.getLogger().info("SubServers > Loading SubServers v" + version.toString() + " Libraries... ");
getDataFolder().mkdirs(); getDataFolder().mkdirs();
if (new UniversalFile(getDataFolder().getParentFile(), "SubServers-Client:config.yml").exists()) {
Files.move(new UniversalFile(getDataFolder().getParentFile(), "SubServers-Client:config.yml").toPath(), new UniversalFile(getDataFolder(), "config.yml").toPath(), StandardCopyOption.REPLACE_EXISTING);
Util.deleteDirectory(new UniversalFile(getDataFolder().getParentFile(), "SubServers-Client"));
}
if (!(new UniversalFile(getDataFolder(), "config.yml").exists())) { if (!(new UniversalFile(getDataFolder(), "config.yml").exists())) {
Util.copyFromJar(SubPlugin.class.getClassLoader(), "config.yml", new UniversalFile(getDataFolder(), "config.yml").getPath()); Util.copyFromJar(SubPlugin.class.getClassLoader(), "config.yml", new UniversalFile(getDataFolder(), "config.yml").getPath());
Bukkit.getLogger().info("SubServers > Created ~/plugins/SubServers/config.yml"); Bukkit.getLogger().info("SubServers > Created ~/plugins/SubServers/config.yml");

View File

@ -1,4 +1,4 @@
name: SubServers-Console name: SubServers-Console
main: net.ME1312.SubServers.Console.ConsolePlugin main: net.ME1312.SubServers.Console.ConsolePlugin
version: 2.11.2a version: 2.11.2b
author: ME1312 author: ME1312

View File

@ -35,7 +35,16 @@ public final class ConsoleWindow implements SubLogFilter {
private int findI = 0; private int findI = 0;
private boolean open = false; private boolean open = false;
private SubLogger logger; private SubLogger logger;
private boolean[] kpressed = new boolean[65535];
private KeyEventDispatcher keys = event -> { private KeyEventDispatcher keys = event -> {
switch (event.getID()) {
case KeyEvent.KEY_PRESSED:
kpressed[event.getKeyCode()] = true;
break;
case KeyEvent.KEY_RELEASED:
kpressed[event.getKeyCode()] = false;
break;
}
if (window.isVisible() && window.isFocused()) { if (window.isVisible() && window.isFocused()) {
if (event.getID() == KeyEvent.KEY_PRESSED) switch (event.getKeyCode()) { if (event.getID() == KeyEvent.KEY_PRESSED) switch (event.getKeyCode()) {
case KeyEvent.VK_UP: case KeyEvent.VK_UP:
@ -55,7 +64,7 @@ public final class ConsoleWindow implements SubLogFilter {
break; break;
case KeyEvent.VK_ENTER: case KeyEvent.VK_ENTER:
if (find.isVisible() && !ifocus) if (find.isVisible() && !ifocus)
find(true); find(kpressed[KeyEvent.VK_SHIFT] != Boolean.TRUE);
break; break;
case KeyEvent.VK_TAB: case KeyEvent.VK_TAB:
if (!ifocus) input.requestFocusInWindow(); if (!ifocus) input.requestFocusInWindow();