Package valorless.valorlessutils
Class Server
java.lang.Object
valorless.valorlessutils.Server
Utility class for handling and comparing Minecraft server versions.
 
 Provides methods to resolve the current server version, compare versions,
 and check version relationships (higher/equal). Versions are represented
 as the Server.Version enum.
 
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic enumEnum representing supported Minecraft server versions.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic Server.VersionAttempts to resolve the current running server version.static intVersionCompare(Server.Version version, Server.Version compareTo) Compares twoServer.Versionenums based on their ordinal order.static BooleanVersionEqualTo(Server.Version version) Checks if the current server version is exactly equal to a specified version.static BooleanVersionHigherOrEqualTo(Server.Version version) Checks if the current server version is higher than or equal to a specified version.static BooleanVersionHigherThan(Server.Version version) Checks if the current server version is strictly higher than a specified version.static BooleanVersionLowerOrEqualTo(Server.Version version) Checks if the current server version is lower than or equal to a specified version.static BooleanVersionLowerThan(Server.Version version) Checks if the current server version is strictly lower than a specified version.
- 
Constructor Details- 
Serverpublic Server()
 
- 
- 
Method Details- 
VersionCompareCompares twoServer.Versionenums based on their ordinal order.Useful for determining if one version comes before, after, or is equal to another. - Parameters:
- version- The version to compare.
- compareTo- The version to compare against.
- Returns:
- -1 if versionis lower thancompareTo, 1 ifversionis higher, or 0 if equal.
 
- 
ResolveVersionAttempts to resolve the current running server version.Uses Bukkit.getBukkitVersion()to determine the server version and converts it to the correspondingServer.Versionenum value.- Returns:
- The resolved Server.Version, orServer.Version.NULLif the resolution fails.
 
- 
VersionHigherOrEqualToChecks if the current server version is higher than or equal to a specified version.- Parameters:
- version- The version to compare against.
- Returns:
- trueif the current server version is higher than or equal to- version;- falseotherwise.
 
- 
VersionHigherThanChecks if the current server version is strictly higher than a specified version.- Parameters:
- version- The version to compare against.
- Returns:
- trueif the current server version is higher than- version;- falseotherwise.
 
- 
VersionLowerOrEqualToChecks if the current server version is lower than or equal to a specified version.- Parameters:
- version- The version to compare against.
- Returns:
- trueif the current server version is lower than or equal to- version;- falseotherwise.
 
- 
VersionLowerThanChecks if the current server version is strictly lower than a specified version.- Parameters:
- version- The version to compare against.
- Returns:
- trueif the current server version is lower than- version;- falseotherwise.
 
- 
VersionEqualToChecks if the current server version is exactly equal to a specified version.- Parameters:
- version- The version to compare against.
- Returns:
- trueif the current server version equals- version;- falseotherwise.
 
 
-