Catch throwable for spawnerutil, move nasty warning to spawnerutil

This commit is contained in:
vemacs 2015-06-12 11:22:11 -06:00
parent bfa93cc189
commit 20a59ddb6e
2 changed files with 3 additions and 5 deletions

View File

@ -148,9 +148,6 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
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.");
}
final PluginManager pm = getServer().getPluginManager();
for (Plugin plugin : pm.getPlugins()) {
if (plugin.getDescription().getName().startsWith("Essentials") && !plugin.getDescription().getVersion().equals(this.getDescription().getVersion()) && !plugin.getDescription().getName().equals("EssentialsAntiCheat")) {

View File

@ -33,13 +33,14 @@ public class SpawnerUtil {
ItemStack is = new ItemStack(Material.MOB_SPAWNER, 1);
ItemMeta meta = is.getItemMeta();
useMeta = meta instanceof BlockStateMeta;
} catch (Exception e) {
} catch (Throwable e) {
useMeta = false;
}
if (useMeta) {
ess.getLogger().info("Using BlockStateMeta for spawners");
} else {
ess.getLogger().info("Using legacy item data for spawners");
ess.getLogger().warning("Using legacy item data for spawners");
ess.getLogger().warning(ChatColor.RED + "UPGRADE TO SPIGOT 1.8.3 OR HIGHER FOR WORKING SPAWNERS");
}
}