1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-19 19:25:48 +00:00

Cleaned up Supported Versions Check

This commit is contained in:
mrCookieSlime 2016-08-06 01:11:32 +02:00
parent 4fc109f7d5
commit 870ad1a40e

View File

@ -97,13 +97,25 @@ public class SlimefunStartup extends JavaPlugin {
private boolean clearlag = false;
// Supported Versions of Minecraft
final String[] supported = {"v1_9_", "v1_10_", "PluginBukkitBridge"};
@SuppressWarnings("deprecation")
@Override
public void onEnable() {
CSCoreLibLoader loader = new CSCoreLibLoader(this);
if (loader.load()) {
if (!ReflectionUtils.getVersion().startsWith("v1_9_") && !ReflectionUtils.getVersion().startsWith("v1_10_") && !ReflectionUtils.getVersion().startsWith("PluginBukkitBridge")) {
boolean compatibleVersion = false;
for (String version: supported) {
if (ReflectionUtils.getVersion().startsWith(version)) {
compatibleVersion = true;
break;
}
}
if (!compatibleVersion) {
System.err.println("### Slimefun failed to load!");
System.err.println("###");
System.err.println("### You are using the wrong Version of Minecraft!!!");