mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2024-11-28 05:35:28 +01:00
Add the ability to skip the version check for a specific MC version.
This commit is contained in:
parent
7845a844d4
commit
b135bf86c3
@ -93,6 +93,14 @@ class MinecraftVersion implements Comparable<MinecraftVersion> {
|
||||
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
|
||||
public int compareTo(MinecraftVersion o) {
|
||||
if (o == null)
|
||||
@ -131,7 +139,7 @@ class MinecraftVersion implements Comparable<MinecraftVersion> {
|
||||
@Override
|
||||
public String toString() {
|
||||
// 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());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -237,7 +237,7 @@ public class ProtocolLibrary extends JavaPlugin {
|
||||
MinecraftVersion current = new MinecraftVersion(getServer());
|
||||
|
||||
// Skip certain versions
|
||||
if (!config.getIgnoreVersionCheck().equals(current.toString())) {
|
||||
if (!config.getIgnoreVersionCheck().equals(current.getVersion())) {
|
||||
// We'll just warn the user for now
|
||||
if (current.compareTo(minimum) < 0)
|
||||
logger.warning("Version " + current + " is lower than the minimum " + minimum);
|
||||
|
@ -13,3 +13,6 @@ global:
|
||||
|
||||
# Automatically compile structure modifiers
|
||||
background compiler: true
|
||||
|
||||
# Disable version checking for the given Minecraft version. Backup your world first!
|
||||
ignore version check:
|
Loading…
Reference in New Issue
Block a user