Archiviert
13
0

Fix a critial bug that prevents PB from loading.

This was caused by a previous patch that corrected the version parser 
for special Spigot versions with a snapshot protocol enabled. 
Unfortunately, this also causes the comparer to fail on normal 
version ...

Somehow, that got through testing.
Dieser Commit ist enthalten in:
Kristian S. Stangeland 2013-10-06 02:31:55 +02:00
Ursprung e4c193440e
Commit c2abc4277b
2 geänderte Dateien mit 10 neuen und 8 gelöschten Zeilen

Datei anzeigen

@ -71,7 +71,7 @@ public class ProtocolLibrary extends JavaPlugin {
public static final ReportType REPORT_METRICS_IO_ERROR = new ReportType("Unable to enable metrics due to network problems."); public static final ReportType REPORT_METRICS_IO_ERROR = new ReportType("Unable to enable metrics due to network problems.");
public static final ReportType REPORT_METRICS_GENERIC_ERROR = new ReportType("Unable to enable metrics due to network problems."); public static final ReportType REPORT_METRICS_GENERIC_ERROR = new ReportType("Unable to enable metrics due to network problems.");
public static final ReportType REPORT_CANNOT_PARSE_MINECRAFT_VERSION = new ReportType("Unable to retrieve current Minecraft version."); public static final ReportType REPORT_CANNOT_PARSE_MINECRAFT_VERSION = new ReportType("Unable to retrieve current Minecraft version. Assuming %s");
public static final ReportType REPORT_CANNOT_DETECT_CONFLICTING_PLUGINS = new ReportType("Unable to detect conflicting plugin versions."); public static final ReportType REPORT_CANNOT_DETECT_CONFLICTING_PLUGINS = new ReportType("Unable to detect conflicting plugin versions.");
public static final ReportType REPORT_CANNOT_REGISTER_COMMAND = new ReportType("Cannot register command %s: %s"); public static final ReportType REPORT_CANNOT_REGISTER_COMMAND = new ReportType("Cannot register command %s: %s");
@ -367,9 +367,10 @@ public class ProtocolLibrary extends JavaPlugin {
// Used to check Minecraft version // Used to check Minecraft version
private MinecraftVersion verifyMinecraftVersion() { private MinecraftVersion verifyMinecraftVersion() {
try {
MinecraftVersion minimum = new MinecraftVersion(MINIMUM_MINECRAFT_VERSION); MinecraftVersion minimum = new MinecraftVersion(MINIMUM_MINECRAFT_VERSION);
MinecraftVersion maximum = new MinecraftVersion(MAXIMUM_MINECRAFT_VERSION); MinecraftVersion maximum = new MinecraftVersion(MAXIMUM_MINECRAFT_VERSION);
try {
MinecraftVersion current = new MinecraftVersion(getServer()); MinecraftVersion current = new MinecraftVersion(getServer());
// Skip certain versions // Skip certain versions
@ -383,11 +384,12 @@ public class ProtocolLibrary extends JavaPlugin {
return current; return current;
} catch (Exception e) { } catch (Exception e) {
reporter.reportWarning(this, Report.newBuilder(REPORT_CANNOT_PARSE_MINECRAFT_VERSION).error(e)); reporter.reportWarning(this,
} Report.newBuilder(REPORT_CANNOT_PARSE_MINECRAFT_VERSION).error(e).messageParam(maximum));
// Unknown version // Unknown version - just assume it is the latest
return null; return maximum;
}
} }
private void checkConflictingVersions() { private void checkConflictingVersions() {

Datei anzeigen

@ -218,7 +218,7 @@ public class MinecraftVersion implements Comparable<MinecraftVersion> {
compare(getBuild(), o.getBuild()). compare(getBuild(), o.getBuild()).
// No development String means it's a release // No development String means it's a release
compare(getDevelopmentStage(), o.getDevelopmentStage(), Ordering.natural().nullsLast()). compare(getDevelopmentStage(), o.getDevelopmentStage(), Ordering.natural().nullsLast()).
compare(getSnapshot(), o.getSnapshot()). compare(getSnapshot(), o.getSnapshot(), Ordering.natural().nullsFirst()).
result(); result();
} }