Skip to content

Commit

Permalink
Fix changes from the last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ME1312 committed Jul 29, 2018
1 parent 319618f commit 98ac267
Show file tree
Hide file tree
Showing 15 changed files with 35 additions and 33 deletions.
Expand Up @@ -26,7 +26,7 @@ public final class Launch {
public static void main(String[] args) throws Exception {
System.setProperty("apple.laf.useScreenMenuBar", "true");

if (Util.getDespiteException(() -> Class.forName("net.md_5.bungee.BungeeCord") != null, false)) {
if (Util.getDespiteException(() -> Class.forName("net.md_5.bungee.BungeeCord") == null, true)) {
System.out.println("");
System.out.println("*******************************************");
System.out.println("*** Error: BungeeCord.jar Doesn't Exist ***");
Expand Down Expand Up @@ -99,7 +99,7 @@ public static void main(String[] args) throws Exception {

if (!options.has("noconsole")) {
try {
if (!Util.getDespiteException(() -> Class.forName("io.github.waterfallmc.waterfall.console.WaterfallConsole") != null, false)) {
if (Util.getDespiteException(() -> Class.forName("io.github.waterfallmc.waterfall.console.WaterfallConsole") != null, false)) {
Class.forName("io.github.waterfallmc.waterfall.console.WaterfallConsole").getMethod("readCommands").invoke(null);
} else {
plugin.canSudo = true;
Expand Down
Expand Up @@ -677,12 +677,12 @@ public Version[] getGameVersion() {
if (GAME_VERSION == null) {
if (System.getProperty("subservers.minecraft.version", "").length() > 0) {
return new Version[]{new Version(System.getProperty("subservers.minecraft.version"))};
} else if (!Util.getDespiteException(() -> ProtocolConstants.SUPPORTED_VERSIONS != null, false)) {
} else if (Util.getDespiteException(() -> ProtocolConstants.SUPPORTED_VERSIONS != null, false)) {
List<Version> versions = new LinkedList<Version>();
for (String version : ProtocolConstants.SUPPORTED_VERSIONS) versions.add(new Version(version));
Collections.sort(versions);
return versions.toArray(new Version[versions.size()]);
} else if (!Util.getDespiteException(() -> plugin.getGameVersion() != null, false)) {
} else if (Util.getDespiteException(() -> plugin.getGameVersion() != null, false)) {
String raw = plugin.getGameVersion();
if (raw.contains("-") || raw.contains(",")) {
List<Version> versions = new LinkedList<Version>();
Expand Down
Expand Up @@ -93,7 +93,7 @@ public void execute(CommandSender sender, String[] args) {
int updcount = 0;
for (YAMLSection tag : tags.getSectionList("tags")) {
Version version = Version.fromString(tag.getString("ref").substring(10));
if (!version.equals(version) && version.compareTo(updversion) > 0) {
if (version.compareTo(updversion) > 0) {
updversion = version;
updcount++;
}
Expand Down
Expand Up @@ -58,8 +58,8 @@ public final class SubPlugin extends BungeeCord implements Listener {
public final SubAPI api = new SubAPI(this);
public SubDataServer subdata = null;
public SubServer sudo = null;
public static final Version version = Version.fromString("2.13a");
//public static final Version version = new Version(Version.fromString("2.13a"), VersionType.SNAPSHOT, (SubPlugin.class.getPackage().getSpecificationTitle() == null)?"custom":SubPlugin.class.getPackage().getSpecificationTitle()); // TODO Snapshot Version
//public static final Version version = Version.fromString("2.13b");
public static final Version version = new Version(Version.fromString("2.13b"), VersionType.SNAPSHOT, (SubPlugin.class.getPackage().getSpecificationTitle() == null)?"custom":SubPlugin.class.getPackage().getSpecificationTitle()); // TODO Snapshot Version

public boolean redis = false;
public boolean canSudo = false;
Expand Down Expand Up @@ -508,12 +508,14 @@ private void post() {
public void run() {
try {
YAMLSection tags = new YAMLSection(new Gson().fromJson("{\"tags\":" + Util.readAll(new BufferedReader(new InputStreamReader(new URL("https://api.github.com/repos/ME1312/SubServers-2/git/refs/tags").openStream(), Charset.forName("UTF-8")))) + '}', Map.class));
List<Version> versions = new LinkedList<Version>();

Version updversion = version;
int updcount = 0;
for (YAMLSection tag : tags.getSectionList("tags")) {
Version version = Version.fromString(tag.getString("ref").substring(10));
if (!version.equals(version) && version.compareTo(updversion) > 0) {
for (YAMLSection tag : tags.getSectionList("tags")) versions.add(Version.fromString(tag.getString("ref").substring(10)));
Collections.sort(versions);
for (Version version : versions) {
if (version.compareTo(updversion) > 0) {
updversion = version;
updcount++;
}
Expand Down
Expand Up @@ -75,7 +75,7 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
int updcount = 0;
for (YAMLSection tag : tags.getSectionList("tags")) {
Version version = Version.fromString(tag.getString("ref").substring(10));
if (!version.equals(version) && version.compareTo(updversion) > 0) {
if (version.compareTo(updversion) > 0) {
updversion = version;
updcount++;
}
Expand All @@ -92,7 +92,7 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
plugin.subdata.sendPacket(new PacketDownloadServerList(null, null, data -> {
int i = 0;
boolean sent = false;
if (!Util.getDespiteException(() -> Class.forName("org.spigotmc.SpigotConfig") != null, false) && sender instanceof Player) {
if (Util.getDespiteException(() -> Class.forName("org.spigotmc.SpigotConfig") != null, false) && sender instanceof Player) {
net.md_5.bungee.api.chat.TextComponent div = new net.md_5.bungee.api.chat.TextComponent(plugin.api.getLang("SubServers", "Command.List.Divider"));
if (data.getSection("groups").getKeys().size() > 0) {
sender.sendMessage(plugin.api.getLang("SubServers", "Command.List.Group-Header"));
Expand Down
Expand Up @@ -46,8 +46,8 @@ public final class SubPlugin extends JavaPlugin {

public SubPlugin() {
super();
version = Version.fromString(getDescription().getVersion());
//version = new Version(Version.fromString(getDescription().getVersion()), VersionType.SNAPSHOT, (SubPlugin.class.getPackage().getSpecificationTitle() == null)?"custom":SubPlugin.class.getPackage().getSpecificationTitle()); // TODO Snapshot Version
//version = Version.fromString(getDescription().getVersion());
version = new Version(Version.fromString(getDescription().getVersion()), VersionType.SNAPSHOT, (SubPlugin.class.getPackage().getSpecificationTitle() == null)?"custom":SubPlugin.class.getPackage().getSpecificationTitle()); // TODO Snapshot Version
}

/**
Expand Down Expand Up @@ -100,7 +100,7 @@ public void onEnable() {
int updcount = 0;
for (YAMLSection tag : tags.getSectionList("tags")) {
Version version = Version.fromString(tag.getString("ref").substring(10));
if (!version.equals(version) && version.compareTo(updversion) > 0) {
if (version.compareTo(updversion) > 0) {
updversion = version;
updcount++;
}
Expand Down
2 changes: 1 addition & 1 deletion SubServers.Client/Bukkit/src/plugin.yml
@@ -1,6 +1,6 @@
name: 'SubServers-Client-Bukkit'
main: 'net.ME1312.SubServers.Client.Bukkit.SubPlugin'
version: '2.13a'
version: '2.13b'
authors: [ME1312]
softdepend: [Vault, TitleManager]
website: 'https://github.com/ME1312/SubServers-2'
Expand Down
Expand Up @@ -179,7 +179,7 @@ public CommandResult execute(CommandSource sender, CommandContext args) throws C
int updcount = 0;
for (YAMLSection tag : tags.getSectionList("tags")) {
Version version = Version.fromString(tag.getString("ref").substring(10));
if (!version.equals(version) && version.compareTo(updversion) > 0) {
if (version.compareTo(updversion) > 0) {
updversion = version;
updcount++;
}
Expand Down
Expand Up @@ -44,7 +44,7 @@
/**
* SubServers Client Plugin Class
*/
@Plugin(id = "subservers-client-sponge", name = "SubServers-Client-Sponge", authors = "ME1312", version = "2.13a", url = "https://github.com/ME1312/SubServers-2", description = "Access your SubServers from Anywhere")
@Plugin(id = "subservers-client-sponge", name = "SubServers-Client-Sponge", authors = "ME1312", version = "2.13b", url = "https://github.com/ME1312/SubServers-2", description = "Access your SubServers from Anywhere")
public final class SubPlugin {
protected NamedContainer<Long, Map<String, Map<String, String>>> lang = null;
public YAMLConfig config;
Expand All @@ -62,8 +62,8 @@ public final class SubPlugin {
@Listener
public void setup(GamePreInitializationEvent event) {
if (plugin.getVersion().isPresent()) {
version = Version.fromString(plugin.getVersion().get());
//version = new Version(Version.fromString(plugin.getVersion().get()), VersionType.SNAPSHOT, (SubPlugin.class.getPackage().getSpecificationTitle() == null)?"custom":SubPlugin.class.getPackage().getSpecificationTitle()); // TODO Snapshot Version
//version = Version.fromString(plugin.getVersion().get());
version = new Version(Version.fromString(plugin.getVersion().get()), VersionType.SNAPSHOT, (SubPlugin.class.getPackage().getSpecificationTitle() == null)?"custom":SubPlugin.class.getPackage().getSpecificationTitle()); // TODO Snapshot Version
} else version = new Version("Custom");
}

Expand Down Expand Up @@ -115,7 +115,7 @@ public void enable(GameInitializationEvent event) {
int updcount = 0;
for (YAMLSection tag : tags.getSectionList("tags")) {
Version version = Version.fromString(tag.getString("ref").substring(10));
if (!version.equals(version) && version.compareTo(updversion) > 0) {
if (version.compareTo(updversion) > 0) {
updversion = version;
updcount++;
}
Expand Down
6 changes: 3 additions & 3 deletions SubServers.Host/src/net/ME1312/SubServers/Host/ExHost.java
Expand Up @@ -55,8 +55,8 @@ public final class ExHost {
public SubDataClient subdata = null;

public final SubAPI api = new SubAPI(this);
public static final Version version = Version.fromString("2.13a");
//public static final Version version = new Version(Version.fromString("2.13a"), VersionType.SNAPSHOT, (ExHost.class.getPackage().getSpecificationTitle() == null)?"custom":ExHost.class.getPackage().getSpecificationTitle()); // TODO Snapshot Version
//public static final Version version = Version.fromString("2.13b");
public static final Version version = new Version(Version.fromString("2.13b"), VersionType.SNAPSHOT, (ExHost.class.getPackage().getSpecificationTitle() == null)?"custom":ExHost.class.getPackage().getSpecificationTitle()); // TODO Snapshot Version

private ConsoleReader jline;
private boolean running = false;
Expand Down Expand Up @@ -422,7 +422,7 @@ public void run() {
int updcount = 0;
for (YAMLSection tag : tags.getSectionList("tags")) {
Version version = Version.fromString(tag.getString("ref").substring(10));
if (!version.equals(version) && version.compareTo(updversion) > 0) {
if (version.compareTo(updversion) > 0) {
updversion = version;
updcount++;
}
Expand Down
Expand Up @@ -56,7 +56,7 @@ public void command(String handle, String[] args) {
int updcount = 0;
for (YAMLSection tag : tags.getSectionList("tags")) {
Version version = Version.fromString(tag.getString("ref").substring(10));
if (!version.equals(version) && version.compareTo(updversion) > 0) {
if (version.compareTo(updversion) > 0) {
updversion = version;
updcount++;
}
Expand Down
4 changes: 2 additions & 2 deletions SubServers.Sync/src/net/ME1312/SubServers/Sync/Launch.java
Expand Up @@ -26,7 +26,7 @@ public final class Launch {
public static void main(String[] args) throws Exception {
System.setProperty("apple.laf.useScreenMenuBar", "true");

if (Util.getDespiteException(() -> Class.forName("net.md_5.bungee.BungeeCord") != null, false)) {
if (Util.getDespiteException(() -> Class.forName("net.md_5.bungee.BungeeCord") == null, true)) {
System.out.println("");
System.out.println("*******************************************");
System.out.println("*** Error: BungeeCord.jar Doesn't Exist ***");
Expand Down Expand Up @@ -99,7 +99,7 @@ public static void main(String[] args) throws Exception {

if (!options.has("noconsole")) {
try {
if (!Util.getDespiteException(() -> Class.forName("io.github.waterfallmc.waterfall.console.WaterfallConsole") != null, false)) {
if (Util.getDespiteException(() -> Class.forName("io.github.waterfallmc.waterfall.console.WaterfallConsole") != null, false)) {
Class.forName("io.github.waterfallmc.waterfall.console.WaterfallConsole").getMethod("readCommands").invoke(null);
} else {
String line;
Expand Down
4 changes: 2 additions & 2 deletions SubServers.Sync/src/net/ME1312/SubServers/Sync/SubAPI.java
Expand Up @@ -359,12 +359,12 @@ public Version[] getGameVersion() {
if (GAME_VERSION == null) {
if (System.getProperty("subservers.minecraft.version", "").length() > 0) {
return new Version[]{new Version(System.getProperty("subservers.minecraft.version"))};
} else if (!Util.getDespiteException(() -> ProtocolConstants.SUPPORTED_VERSIONS != null, false)) {
} else if (Util.getDespiteException(() -> ProtocolConstants.SUPPORTED_VERSIONS != null, false)) {
List<Version> versions = new LinkedList<Version>();
for (String version : ProtocolConstants.SUPPORTED_VERSIONS) versions.add(new Version(version));
Collections.sort(versions);
return versions.toArray(new Version[versions.size()]);
} else if (!Util.getDespiteException(() -> plugin.getGameVersion() != null, false)) {
} else if (Util.getDespiteException(() -> plugin.getGameVersion() != null, false)) {
String raw = plugin.getGameVersion();
if (raw.contains("-") || raw.contains(",")) {
List<Version> versions = new LinkedList<Version>();
Expand Down
Expand Up @@ -93,7 +93,7 @@ public void execute(CommandSender sender, String[] args) {
int updcount = 0;
for (YAMLSection tag : tags.getSectionList("tags")) {
Version version = Version.fromString(tag.getString("ref").substring(10));
if (!version.equals(version) && version.compareTo(updversion) > 0) {
if (version.compareTo(updversion) > 0) {
updversion = version;
updcount++;
}
Expand Down
6 changes: 3 additions & 3 deletions SubServers.Sync/src/net/ME1312/SubServers/Sync/SubPlugin.java
Expand Up @@ -49,8 +49,8 @@ public final class SubPlugin extends BungeeCord implements Listener {
public boolean redis = false;
public final SubAPI api = new SubAPI(this);
public SubDataClient subdata = null;
public static final Version version = Version.fromString("2.13a");
//public static final Version version = new Version(Version.fromString("2.13a"), VersionType.SNAPSHOT, (SubPlugin.class.getPackage().getSpecificationTitle() == null)?"custom":SubPlugin.class.getPackage().getSpecificationTitle()); // TODO Snapshot Version
//public static final Version version = Version.fromString("2.13b");
public static final Version version = new Version(Version.fromString("2.13b"), VersionType.SNAPSHOT, (SubPlugin.class.getPackage().getSpecificationTitle() == null)?"custom":SubPlugin.class.getPackage().getSpecificationTitle()); // TODO Snapshot Version

public final boolean isPatched;
public long lastReload = -1;
Expand Down Expand Up @@ -140,7 +140,7 @@ public void run() {
int updcount = 0;
for (YAMLSection tag : tags.getSectionList("tags")) {
Version version = Version.fromString(tag.getString("ref").substring(10));
if (!version.equals(version) && version.compareTo(updversion) > 0) {
if (version.compareTo(updversion) > 0) {
updversion = version;
updcount++;
}
Expand Down

0 comments on commit 98ac267

Please sign in to comment.