Ignore version formatting errors

We have so many random strings around at the moment this will be better for now
This commit is contained in:
Zach Brown 2016-02-15 08:31:45 -06:00
parent 29616a64bb
commit 577418ea75

View file

@ -1,11 +1,11 @@
From 9515fddcb7392076601abb157235deb36daaaafe Mon Sep 17 00:00:00 2001
From 386d76f2e47c4d3e3b824d6ec2c25d914fbe6e2c Mon Sep 17 00:00:00 2001
From: Zach Brown <Zbob750@live.com>
Date: Sun, 28 Dec 2014 16:28:21 -0600
Subject: [PATCH] Check PaperSpigot versions
diff --git a/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
index b55abdb..cf651fc 100644
index b55abdb..e91e1d8 100644
--- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java
+++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
@@ -185,7 +185,21 @@ public class VersionCommand extends BukkitCommand {
@ -31,7 +31,7 @@ index b55abdb..cf651fc 100644
String[] parts = version.substring("git-Spigot-".length()).split("-");
int cbVersions = getDistance("craftbukkit", parts[1].substring(0, parts[1].indexOf(' ')));
int spigotVersions = getDistance("spigot", parts[0]);
@@ -232,16 +246,19 @@ public class VersionCommand extends BukkitCommand {
@@ -232,17 +246,20 @@ public class VersionCommand extends BukkitCommand {
}
}
@ -47,15 +47,17 @@ index b55abdb..cf651fc 100644
- JSONObject obj = (JSONObject) new JSONParser().parse(reader);
- return ((Number) obj.get("totalCount")).intValue();
- } catch (ParseException ex) {
- ex.printStackTrace();
+ // PaperSpigot start
+ int newVer = Integer.decode(reader.readLine());
+ int currentVer = Integer.decode(currentVerInt);
+ return newVer - currentVer;
+ } catch (NumberFormatException ex) {
+ //ex.printStackTrace();
+ // PaperSpigot end
ex.printStackTrace();
return -1;
} finally {
reader.close();
--
2.7.1