Skip to content

Commit

Permalink
fix(mc): fix minecraft version identify
Browse files Browse the repository at this point in the history
  • Loading branch information
StarWishsama committed Jul 16, 2024
1 parent 695a7f4 commit 7706b2c
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,19 @@ public boolean isMinecraftVersion(int minecraftVersion) {
* @return Whether this {@link MinecraftVersion} matches the specified version id
*/
public boolean isMinecraftVersion(int minecraftVersion, int patchVersion) {
return !isVirtual()
&& this.majorVersion == minecraftVersion
&& (this.minorVersion >= patchVersion || (this.majorVersion != 20 && this.minorVersion == -1));
if (isVirtual()) {
return false;
}

if (this.majorVersion != minecraftVersion) {
return false;
}

if (this.majorVersion == 20) {
return this.minorVersion >= patchVersion;
} else {
return this.minorVersion == -1 || this.minorVersion >= patchVersion;
}
}

/**
Expand Down

0 comments on commit 7706b2c

Please sign in to comment.