diff --git a/src/main/java/world/bentobox/bentobox/versions/ServerCompatibility.java b/src/main/java/world/bentobox/bentobox/versions/ServerCompatibility.java index 010564112..1eac21784 100644 --- a/src/main/java/world/bentobox/bentobox/versions/ServerCompatibility.java +++ b/src/main/java/world/bentobox/bentobox/versions/ServerCompatibility.java @@ -5,6 +5,8 @@ import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.Nullable; import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; /** * Checks and ensures the current server software is compatible with BentoBox. @@ -122,6 +124,20 @@ public class ServerCompatibility { public String toString() { return super.toString().substring(1).replace("_", "."); } + + /** + * @since 1.5.0 + */ + @NonNull + public static List getVersions(@NonNull Compatibility... compatibility) { + List versions = new LinkedList<>(); + for (ServerVersion version : values()) { + if (Arrays.asList(compatibility).contains(version.getCompatibility())) { + versions.add(version); + } + } + return versions; + } } /**