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:
Ursprung
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_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() {
|
||||||
|
MinecraftVersion minimum = new MinecraftVersion(MINIMUM_MINECRAFT_VERSION);
|
||||||
|
MinecraftVersion maximum = new MinecraftVersion(MAXIMUM_MINECRAFT_VERSION);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
MinecraftVersion minimum = new MinecraftVersion(MINIMUM_MINECRAFT_VERSION);
|
|
||||||
MinecraftVersion maximum = new MinecraftVersion(MAXIMUM_MINECRAFT_VERSION);
|
|
||||||
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 - just assume it is the latest
|
||||||
|
return maximum;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unknown version
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkConflictingVersions() {
|
private void checkConflictingVersions() {
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren