Add the ability to skip the version check for a specific MC version.
Dieser Commit ist enthalten in:
Ursprung
7845a844d4
Commit
b135bf86c3
@ -93,6 +93,14 @@ class MinecraftVersion implements Comparable<MinecraftVersion> {
|
|||||||
return build;
|
return build;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve the version String (major.minor.build) only.
|
||||||
|
* @return A normal version string.
|
||||||
|
*/
|
||||||
|
public String getVersion() {
|
||||||
|
return String.format("%s.%s.%s", major, minor, build);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(MinecraftVersion o) {
|
public int compareTo(MinecraftVersion o) {
|
||||||
if (o == null)
|
if (o == null)
|
||||||
@ -131,7 +139,7 @@ class MinecraftVersion implements Comparable<MinecraftVersion> {
|
|||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
// Convert to a String that we can parse back again
|
// Convert to a String that we can parse back again
|
||||||
return String.format("(MC: %s.%s.%s)", major, minor, build);
|
return String.format("(MC: %s)", getVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -235,9 +235,9 @@ public class ProtocolLibrary extends JavaPlugin {
|
|||||||
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);
|
||||||
MinecraftVersion current = new MinecraftVersion(getServer());
|
MinecraftVersion current = new MinecraftVersion(getServer());
|
||||||
|
|
||||||
// Skip certain versions
|
// Skip certain versions
|
||||||
if (!config.getIgnoreVersionCheck().equals(current.toString())) {
|
if (!config.getIgnoreVersionCheck().equals(current.getVersion())) {
|
||||||
// We'll just warn the user for now
|
// We'll just warn the user for now
|
||||||
if (current.compareTo(minimum) < 0)
|
if (current.compareTo(minimum) < 0)
|
||||||
logger.warning("Version " + current + " is lower than the minimum " + minimum);
|
logger.warning("Version " + current + " is lower than the minimum " + minimum);
|
||||||
|
@ -12,4 +12,7 @@ global:
|
|||||||
metrics: true
|
metrics: true
|
||||||
|
|
||||||
# Automatically compile structure modifiers
|
# Automatically compile structure modifiers
|
||||||
background compiler: true
|
background compiler: true
|
||||||
|
|
||||||
|
# Disable version checking for the given Minecraft version. Backup your world first!
|
||||||
|
ignore version check:
|
In neuem Issue referenzieren
Einen Benutzer sperren