mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-23 19:25:12 +01:00
Added ServerCompatibility.ServerVersion#getVersions(Compatibility...)
This commit is contained in:
parent
44e7004db1
commit
d91222d30b
@ -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<ServerVersion> getVersions(@NonNull Compatibility... compatibility) {
|
||||
List<ServerVersion> versions = new LinkedList<>();
|
||||
for (ServerVersion version : values()) {
|
||||
if (Arrays.asList(compatibility).contains(version.getCompatibility())) {
|
||||
versions.add(version);
|
||||
}
|
||||
}
|
||||
return versions;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user