From 8e2645501bae6a821b7dddcbcf3d64adf5660e1b Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Wed, 1 Jul 2020 12:29:49 +1200 Subject: [PATCH] Fix ProtocolLib version check --- .../disguise/utilities/DisguiseUtilities.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java b/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java index ad7130fb..66f8971b 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java @@ -2117,15 +2117,15 @@ public class DisguiseUtilities { } public static boolean isOlderThan(String requiredVersion, String theirVersion) { - int[] ourVersion = getNumericVersion(requiredVersion); - int[] theirs = getNumericVersion(theirVersion); + int[] required = getNumericVersion(requiredVersion); + int[] has = getNumericVersion(theirVersion); - for (int i = 0; i < Math.min(ourVersion.length, theirs.length); i++) { - if (ourVersion[i] <= theirs[i]) { + for (int i = 0; i < Math.min(required.length, has.length); i++) { + if (required[i] == has[i]) { continue; } - return true; + return required[i] >= has[i]; } return false;