Misc changes

This commit is contained in:
ME1312 2018-07-19 15:34:58 -04:00
parent 6eb82f27bc
commit 08a7d6d176
No known key found for this signature in database
GPG Key ID: FEFFE2F698E88FA8
36 changed files with 80 additions and 49 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

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 Waterfall.jar
Main-Class: net.ME1312.SubServers.Bungee.Launch
Implementation-Title: SubServers.Bungee
Specification-Title: 18w29bf
Specification-Title: 18w29bn

View File

@ -105,7 +105,7 @@ public class InternalSubCreator extends SubCreator {
}
}
if (spversion == null)
throw new InvalidServerException("Cannot find sponge version for Minecraft " + version.toString());
throw new InvalidServerException("Cannot find Sponge version for Minecraft " + version.toString());
System.out.println(name + File.separator + "Creator > Found \"spongeforge-" + spversion.toString() + '"');
NodeList mcfnodeList = forgexml.getElementsByTagName("version");
@ -119,7 +119,7 @@ public class InternalSubCreator extends SubCreator {
}
}
if (mcfversion == null)
throw new InvalidServerException("Cannot find forge version for Sponge " + spversion.toString());
throw new InvalidServerException("Cannot find Forge version for Sponge " + spversion.toString());
System.out.println(name + File.separator + "Creator > Found \"forge-" + mcfversion.toString() + '"');
version = new Version(mcfversion.toString() + " " + spversion.toString());

View File

@ -61,7 +61,7 @@ public final class Launch {
System.out.println(System.getProperty("os.name") + " " + System.getProperty("os.version") + ',');
System.out.println("Java " + System.getProperty("java.version") + ",");
System.out.println("BungeeCord" + ((patched)?" [Patched] ":" ") + net.md_5.bungee.Bootstrap.class.getPackage().getImplementationVersion() + ',');
System.out.println("SubServers.Bungee v" + SubPlugin.version.toExtendedString() + ((build)?" [" + SubPlugin.class.getPackage().getSpecificationTitle() + ']':""));
System.out.println("SubServers.Bungee v" + SubPlugin.version.toExtendedString() + ((build)?" (" + SubPlugin.class.getPackage().getSpecificationTitle() + ')':""));
System.out.println("");
} else {
System.out.println("");
@ -104,6 +104,7 @@ public final class Launch {
if (!Util.isException(() -> proprietary.set(Class.forName("io.github.waterfallmc.waterfall.console.WaterfallConsole") != null)) && proprietary.get()) {
Class.forName("io.github.waterfallmc.waterfall.console.WaterfallConsole").getMethod("readCommands").invoke(null);
} else {
plugin.canSudo = true;
String line;
while (plugin.isRunning && (line = plugin.getConsoleReader().readLine(">")) != null) {
if (plugin.sudo == null) {

View File

@ -189,7 +189,8 @@ public class YAMLValue {
* @return Unparsed String
*/
public String asRawString() {
return (String) obj;
if (obj != null) return obj.toString();
else return null;
}
/**
@ -198,7 +199,13 @@ public class YAMLValue {
* @return Unparsed String List
*/
public List<String> asRawStringList() {
return (List<String>) obj;
if (obj != null) {
List<String> values = new ArrayList<String>();
for (Object value : (List<?>) obj) {
values.add(value.toString());
}
return values;
} else return null;
}
/**
@ -207,7 +214,7 @@ public class YAMLValue {
* @return String
*/
public String asString() {
if (obj != null) return Util.unescapeJavaString((String) obj);
if (obj != null) return Util.unescapeJavaString(asRawString());
else return null;
}
@ -219,7 +226,7 @@ public class YAMLValue {
public List<String> asStringList() {
if (obj != null) {
List<String> values = new ArrayList<String>();
for (String value : (List<String>) obj) {
for (String value : asRawStringList()) {
values.add(Util.unescapeJavaString(value));
}
return values;
@ -234,7 +241,7 @@ public class YAMLValue {
*/
public String asColoredString(char color) {
if (Util.isNull(color)) throw new NullPointerException();
if (obj != null) return ChatColor.translateAlternateColorCodes(color, Util.unescapeJavaString((String) obj));
if (obj != null) return ChatColor.translateAlternateColorCodes(color, asString());
else return null;
}
@ -248,8 +255,8 @@ public class YAMLValue {
if (obj != null) {
if (Util.isNull(color)) throw new NullPointerException();
List<String> values = new ArrayList<String>();
for (String value : (List<String>) obj) {
values.add(ChatColor.translateAlternateColorCodes(color, Util.unescapeJavaString(value)));
for (String value : asStringList()) {
values.add(ChatColor.translateAlternateColorCodes(color, value));
}
return values;
} else return null;

View File

@ -14,7 +14,7 @@ Hosts:
Display: 'Default'
Driver: 'BUILT-IN'
Address: '127.0.0.1'
Directory: './'
Directory: './SubServers/Servers'
Git-Bash: '%ProgramFiles%\Git'
Servers:

View File

@ -80,7 +80,7 @@ public final class SubCommand extends CommandX {
sender.sendMessage(" " + System.getProperty("os.name") + ' ' + System.getProperty("os.version") + ',');
sender.sendMessage(" Java " + System.getProperty("java.version") + ',');
sender.sendMessage(" " + plugin.getBungeeName() + ((plugin.isPatched)?" [Patched] ":" ") + net.md_5.bungee.Bootstrap.class.getPackage().getImplementationVersion() + ',');
sender.sendMessage(" SubServers.Bungee v" + SubPlugin.version.toExtendedString() + ((build)?" [" + SubPlugin.class.getPackage().getSpecificationTitle() + ']':""));
sender.sendMessage(" SubServers.Bungee v" + SubPlugin.version.toExtendedString() + ((build)?" (" + SubPlugin.class.getPackage().getSpecificationTitle() + ')':""));
sender.sendMessage("");
new Thread(() -> {
try {

View File

@ -62,7 +62,7 @@ public final class SubPlugin extends BungeeCord implements Listener {
public static final Version version = new Version(Version.fromString("2.13a/pr5"), VersionType.SNAPSHOT, (SubPlugin.class.getPackage().getSpecificationTitle() == null)?"undefined":SubPlugin.class.getPackage().getSpecificationTitle()); // TODO Snapshot Version
public boolean redis = false;
public boolean canSudo = true;
public boolean canSudo = false;
public final boolean isPatched;
public long resetDate = 0;
private boolean running = false;

Binary file not shown.

View File

@ -1,3 +1,3 @@
Manifest-Version: 1.0
Implementation-Title: SubServers.Client.Bukkit
Specification-Title: 18w29bf
Specification-Title: 18w29bn

View File

@ -192,7 +192,8 @@ public class YAMLValue {
* @return Unparsed String
*/
public String asRawString() {
return (String) obj;
if (obj != null) return obj.toString();
else return null;
}
/**
@ -201,7 +202,13 @@ public class YAMLValue {
* @return Unparsed String List
*/
public List<String> asRawStringList() {
return (List<String>) obj;
if (obj != null) {
List<String> values = new ArrayList<String>();
for (Object value : (List<?>) obj) {
values.add(value.toString());
}
return values;
} else return null;
}
/**
@ -210,7 +217,7 @@ public class YAMLValue {
* @return String
*/
public String asString() {
if (obj != null) return Util.unescapeJavaString((String) obj);
if (obj != null) return Util.unescapeJavaString(asRawString());
else return null;
}
@ -222,7 +229,7 @@ public class YAMLValue {
public List<String> asStringList() {
if (obj != null) {
List<String> values = new ArrayList<String>();
for (String value : (List<String>) obj) {
for (String value : asRawStringList()) {
values.add(Util.unescapeJavaString(value));
}
return values;
@ -237,7 +244,7 @@ public class YAMLValue {
*/
public String asColoredString(char color) {
if (Util.isNull(color)) throw new NullPointerException();
if (obj != null) return ChatColor.translateAlternateColorCodes(color, Util.unescapeJavaString((String) obj));
if (obj != null) return ChatColor.translateAlternateColorCodes(color, asString());
else return null;
}
@ -251,8 +258,8 @@ public class YAMLValue {
if (obj != null) {
if (Util.isNull(color)) throw new NullPointerException();
List<String> values = new ArrayList<String>();
for (String value : (List<String>) obj) {
values.add(ChatColor.translateAlternateColorCodes(color, Util.unescapeJavaString(value)));
for (String value : asStringList()) {
values.add(ChatColor.translateAlternateColorCodes(color, value));
}
return values;
} else return null;

View File

@ -62,7 +62,7 @@ public final class SubCommand implements CommandExecutor {
sender.sendMessage(ChatColor.WHITE + " " + System.getProperty("os.name") + ' ' + System.getProperty("os.version") + ChatColor.RESET + ',');
sender.sendMessage(ChatColor.WHITE + " Java " + System.getProperty("java.version") + ChatColor.RESET + ',');
sender.sendMessage(ChatColor.WHITE + " " + Bukkit.getName() + ' ' + Bukkit.getVersion() + ChatColor.RESET + ',');
sender.sendMessage(ChatColor.WHITE + " SubServers.Client.Bukkit v" + plugin.version.toExtendedString() + ((build)?" [" + SubPlugin.class.getPackage().getSpecificationTitle() + ']':""));
sender.sendMessage(ChatColor.WHITE + " SubServers.Client.Bukkit v" + plugin.version.toExtendedString() + ((build)?" (" + SubPlugin.class.getPackage().getSpecificationTitle() + ')':""));
sender.sendMessage("");
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
try {

View File

@ -1,3 +1,3 @@
Manifest-Version: 1.0
Implementation-Title: SubServers.Client
Specification-Title: 18w29bf
Specification-Title: 18w29bn

View File

@ -43,7 +43,7 @@
<properties>
<foreground color="-14144467"/>
<horizontalScrollBarPolicy value="31"/>
<verticalScrollBarPolicy value="22"/>
<verticalScrollBarPolicy value="20"/>
</properties>
<border type="none">
<font/>

View File

@ -59,6 +59,7 @@ public final class ConsoleWindow implements SubLogFilter {
HTMLEditorKit kit = (HTMLEditorKit) log.getEditorKit();
HTMLDocument doc = (HTMLDocument) log.getDocument();
kit.insertHTML(doc, doc.getLength() - 2, new String(stream.toByteArray(), "UTF-8"), 0, 0, null);
hScroll();
} catch (BadLocationException e) {
e.printStackTrace();
}
@ -265,6 +266,7 @@ public final class ConsoleWindow implements SubLogFilter {
}
});
vScroll.setBorder(BorderFactory.createEmptyBorder());
hScroll.setVisible(false);
new SmartScroller(vScroll, SmartScroller.VERTICAL, SmartScroller.END);
log.setContentType("text/html");
log.setEditorKit(new HTMLEditorKit());
@ -417,7 +419,7 @@ public final class ConsoleWindow implements SubLogFilter {
} else {
input.setVisible(false);
hScroll.setVisible(false);
vScroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
vScroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
}
logger.registerFilter(this);
@ -430,6 +432,7 @@ public final class ConsoleWindow implements SubLogFilter {
hScroll.setMaximum(vScroll.getHorizontalScrollBar().getMaximum());
hScroll.setMinimum(vScroll.getHorizontalScrollBar().getMinimum());
hScroll.setVisibleAmount(vScroll.getHorizontalScrollBar().getVisibleAmount());
hScroll.setVisible(input.isVisible() && hScroll.getVisibleAmount() < hScroll.getMaximum());
}
private void loadContent() {
@ -460,7 +463,6 @@ public final class ConsoleWindow implements SubLogFilter {
public void log(Date date, String message) {
try {
stream.write(('\u00A0' + new SimpleDateFormat("hh:mm:ss").format(date) + ' ' + ((ansi)?message:message.replaceAll("\u001B\\[[;\\d]*m", "")) + "\u00A0\n").getBytes("UTF-8"));
} catch (IOException e) {
e.printStackTrace();

Binary file not shown.

View File

@ -1,4 +1,4 @@
Manifest-Version: 1.0
Main-Class: net.ME1312.SubServers.Host.ExHost
Implementation-Title: SubServers.Host
Specification-Title: 18w29bf
Specification-Title: 18w29bn

View File

@ -88,7 +88,7 @@ public final class ExHost {
System.out.println("");
System.out.println(System.getProperty("os.name") + " " + System.getProperty("os.version") + ',');
System.out.println("Java " + System.getProperty("java.version") + ",");
System.out.println("SubServers.Host v" + version.toExtendedString() + ((build)?" [" + ExHost.class.getPackage().getSpecificationTitle() + ']':""));
System.out.println("SubServers.Host v" + version.toExtendedString() + ((build)?" (" + ExHost.class.getPackage().getSpecificationTitle() + ')':""));
System.out.println("");
} else {
new ExHost(options);

View File

@ -229,7 +229,7 @@ public class SubCreator {
}
}
if (spversion == null)
throw new InvalidServerException("Cannot find sponge version for Minecraft " + version.toString());
throw new InvalidServerException("Cannot find Sponge version for Minecraft " + version.toString());
thread.name().logger.info.println("Found \"spongeforge-" + spversion.toString() + '"');
host.subdata.sendPacket(new PacketOutExLogMessage(address, "Found \"spongeforge-" + spversion.toString() + '"'));
@ -244,7 +244,7 @@ public class SubCreator {
}
}
if (mcfversion == null)
throw new InvalidServerException("Cannot find forge version for Sponge " + spversion.toString());
throw new InvalidServerException("Cannot find Forge version for Sponge " + spversion.toString());
thread.name().logger.info.println("Found \"forge-" + mcfversion.toString() + '"');
host.subdata.sendPacket(new PacketOutExLogMessage(address, "Found \"forge-" + mcfversion.toString() + '"'));

View File

@ -192,7 +192,8 @@ public class YAMLValue {
* @return Unparsed String
*/
public String asRawString() {
return (String) obj;
if (obj != null) return obj.toString();
else return null;
}
/**
@ -201,7 +202,13 @@ public class YAMLValue {
* @return Unparsed String List
*/
public List<String> asRawStringList() {
return (List<String>) obj;
if (obj != null) {
List<String> values = new ArrayList<String>();
for (Object value : (List<?>) obj) {
values.add(value.toString());
}
return values;
} else return null;
}
/**
@ -210,7 +217,7 @@ public class YAMLValue {
* @return String
*/
public String asString() {
if (obj != null) return Util.unescapeJavaString((String) obj);
if (obj != null) return Util.unescapeJavaString(asRawString());
else return null;
}
@ -222,7 +229,7 @@ public class YAMLValue {
public List<String> asStringList() {
if (obj != null) {
List<String> values = new ArrayList<String>();
for (String value : (List<String>) obj) {
for (String value : asRawStringList()) {
values.add(Util.unescapeJavaString(value));
}
return values;
@ -237,7 +244,7 @@ public class YAMLValue {
*/
public String asColoredString(char color) {
if (Util.isNull(color)) throw new NullPointerException();
if (obj != null) return TextColor.parseColor(color, Util.unescapeJavaString((String) obj));
if (obj != null) return TextColor.parseColor(color, asString());
else return null;
}
@ -251,8 +258,8 @@ public class YAMLValue {
if (obj != null) {
if (Util.isNull(color)) throw new NullPointerException();
List<String> values = new ArrayList<String>();
for (String value : (List<String>) obj) {
values.add(TextColor.parseColor(color, Util.unescapeJavaString(value)));
for (String value : asStringList()) {
values.add(TextColor.parseColor(color, value));
}
return values;
} else return null;

View File

@ -43,7 +43,7 @@ public class SubCommand {
"These are the platforms and versions that are running " + ((args.length == 0)?"SubServers.Host":host.api.plugins.get(args[0].toLowerCase()).getName()) +":",
" " + System.getProperty("os.name") + ' ' + System.getProperty("os.version") + ',',
" Java " + System.getProperty("java.version") + ',',
" SubServers.Host v" + host.version.toExtendedString() + ((build)?" [" + ExHost.class.getPackage().getSpecificationTitle() + ']':"") + ((args.length == 0)?"":","));
" SubServers.Host v" + host.version.toExtendedString() + ((build)?" (" + ExHost.class.getPackage().getSpecificationTitle() + ')':"") + ((args.length == 0)?"":","));
if (args.length == 0) {
host.log.message.println("");
new Thread(() -> {

Binary file not shown.

View File

@ -2,4 +2,4 @@ Manifest-Version: 1.0
Class-Path: BungeeCord.jar Waterfall.jar
Main-Class: net.ME1312.SubServers.Sync.Launch
Implementation-Title: SubServers.Sync
Specification-Title: 18w29bf
Specification-Title: 18w29bn

View File

@ -61,7 +61,7 @@ public final class Launch {
System.out.println(System.getProperty("os.name") + " " + System.getProperty("os.version") + ',');
System.out.println("Java " + System.getProperty("java.version") + ",");
System.out.println("BungeeCord" + ((patched)?" [Patched] ":" ") + net.md_5.bungee.Bootstrap.class.getPackage().getImplementationVersion() + ',');
System.out.println("SubServers.Sync v" + SubPlugin.version.toExtendedString() + ((build)?" [" + SubPlugin.class.getPackage().getSpecificationTitle() + ']':""));
System.out.println("SubServers.Sync v" + SubPlugin.version.toExtendedString() + ((build)?" (" + SubPlugin.class.getPackage().getSpecificationTitle() + ')':""));
System.out.println("");
} else {
System.out.println("");

View File

@ -192,7 +192,8 @@ public class YAMLValue {
* @return Unparsed String
*/
public String asRawString() {
return (String) obj;
if (obj != null) return obj.toString();
else return null;
}
/**
@ -201,7 +202,13 @@ public class YAMLValue {
* @return Unparsed String List
*/
public List<String> asRawStringList() {
return (List<String>) obj;
if (obj != null) {
List<String> values = new ArrayList<String>();
for (Object value : (List<?>) obj) {
values.add(value.toString());
}
return values;
} else return null;
}
/**
@ -210,7 +217,7 @@ public class YAMLValue {
* @return String
*/
public String asString() {
if (obj != null) return Util.unescapeJavaString((String) obj);
if (obj != null) return Util.unescapeJavaString(asRawString());
else return null;
}
@ -222,7 +229,7 @@ public class YAMLValue {
public List<String> asStringList() {
if (obj != null) {
List<String> values = new ArrayList<String>();
for (String value : (List<String>) obj) {
for (String value : asRawStringList()) {
values.add(Util.unescapeJavaString(value));
}
return values;
@ -237,7 +244,7 @@ public class YAMLValue {
*/
public String asColoredString(char color) {
if (Util.isNull(color)) throw new NullPointerException();
if (obj != null) return ChatColor.translateAlternateColorCodes(color, Util.unescapeJavaString((String) obj));
if (obj != null) return ChatColor.translateAlternateColorCodes(color, asString());
else return null;
}
@ -251,8 +258,8 @@ public class YAMLValue {
if (obj != null) {
if (Util.isNull(color)) throw new NullPointerException();
List<String> values = new ArrayList<String>();
for (String value : (List<String>) obj) {
values.add(ChatColor.translateAlternateColorCodes(color, Util.unescapeJavaString(value)));
for (String value : asStringList()) {
values.add(ChatColor.translateAlternateColorCodes(color, value));
}
return values;
} else return null;

View File

@ -80,7 +80,7 @@ public final class SubCommand extends CommandX {
sender.sendMessage(" " + System.getProperty("os.name") + ' ' + System.getProperty("os.version") + ',');
sender.sendMessage(" Java " + System.getProperty("java.version") + ',');
sender.sendMessage(" " + plugin.getBungeeName() + ((plugin.isPatched)?" [Patched] ":" ") + net.md_5.bungee.Bootstrap.class.getPackage().getImplementationVersion() + ',');
sender.sendMessage(" SubServers.Sync v" + SubPlugin.version.toExtendedString() + ((build)?" [" + SubPlugin.class.getPackage().getSpecificationTitle() + ']':""));
sender.sendMessage(" SubServers.Sync v" + SubPlugin.version.toExtendedString() + ((build)?" (" + SubPlugin.class.getPackage().getSpecificationTitle() + ')':""));
sender.sendMessage("");
new Thread(() -> {
try {