Give actually helpful error message for attempts to load on 1.7

This commit is contained in:
vemacs 2015-06-05 16:46:33 -06:00
parent 5e605f992a
commit 480055b3d7

View file

@ -136,6 +136,15 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
@Override
public void onEnable() {
try {
String serverString = Bukkit.getServer().getClass().getName();
for (int i = 1; i <= 7; i++) {
if (serverString.contains(".v1_" + i + "_R")) {
throw new Error("Outdated server. This version of Essentials will only work on Bukkit 1.8 or higher.");
}
}
if (serverString.contains(".v1_8_R1.")) {
getLogger().warning("Detected Bukkit 1.8.0. Spawners will not work properly until you upgrade to 1.8.3 or higher.");
}
LOGGER.setParent(this.getLogger());
execTimer = new ExecuteTimer();
execTimer.start();