mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
Cleaned up Supported Versions Check
This commit is contained in:
parent
4fc109f7d5
commit
870ad1a40e
@ -97,13 +97,25 @@ public class SlimefunStartup extends JavaPlugin {
|
|||||||
|
|
||||||
private boolean clearlag = false;
|
private boolean clearlag = false;
|
||||||
|
|
||||||
|
// Supported Versions of Minecraft
|
||||||
|
final String[] supported = {"v1_9_", "v1_10_", "PluginBukkitBridge"};
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
CSCoreLibLoader loader = new CSCoreLibLoader(this);
|
CSCoreLibLoader loader = new CSCoreLibLoader(this);
|
||||||
if (loader.load()) {
|
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("### Slimefun failed to load!");
|
||||||
System.err.println("###");
|
System.err.println("###");
|
||||||
System.err.println("### You are using the wrong Version of Minecraft!!!");
|
System.err.println("### You are using the wrong Version of Minecraft!!!");
|
||||||
|
Loading…
Reference in New Issue
Block a user