mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2024-11-24 11:36:51 +01:00
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.
This commit is contained in:
parent
e4c193440e
commit
c2abc4277b
@ -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_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_REGISTER_COMMAND = new ReportType("Cannot register command %s: %s");
|
||||
|
||||
@ -367,9 +367,10 @@ public class ProtocolLibrary extends JavaPlugin {
|
||||
|
||||
// Used to check Minecraft version
|
||||
private MinecraftVersion verifyMinecraftVersion() {
|
||||
MinecraftVersion minimum = new MinecraftVersion(MINIMUM_MINECRAFT_VERSION);
|
||||
MinecraftVersion maximum = new MinecraftVersion(MAXIMUM_MINECRAFT_VERSION);
|
||||
|
||||
try {
|
||||
MinecraftVersion minimum = new MinecraftVersion(MINIMUM_MINECRAFT_VERSION);
|
||||
MinecraftVersion maximum = new MinecraftVersion(MAXIMUM_MINECRAFT_VERSION);
|
||||
MinecraftVersion current = new MinecraftVersion(getServer());
|
||||
|
||||
// Skip certain versions
|
||||
@ -383,11 +384,12 @@ public class ProtocolLibrary extends JavaPlugin {
|
||||
return current;
|
||||
|
||||
} 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 - just assume it is the latest
|
||||
return maximum;
|
||||
}
|
||||
|
||||
// Unknown version
|
||||
return null;
|
||||
}
|
||||
|
||||
private void checkConflictingVersions() {
|
||||
|
@ -218,7 +218,7 @@ public class MinecraftVersion implements Comparable<MinecraftVersion> {
|
||||
compare(getBuild(), o.getBuild()).
|
||||
// No development String means it's a release
|
||||
compare(getDevelopmentStage(), o.getDevelopmentStage(), Ordering.natural().nullsLast()).
|
||||
compare(getSnapshot(), o.getSnapshot()).
|
||||
compare(getSnapshot(), o.getSnapshot(), Ordering.natural().nullsFirst()).
|
||||
result();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user