diff options
author | KHobbits <rob@khobbits.co.uk> | 2013-11-15 00:22:10 +0000 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2013-11-15 00:22:10 +0000 |
commit | 53b1526906f80e7da20441a9b29c61557e8336ca (patch) | |
tree | 979500e1364d9279c312e4495779ef7ca72acdc3 | |
parent | 82be7546d5e316577957241f0ab3f1b040a66333 (diff) | |
download | Essentials-53b1526906f80e7da20441a9b29c61557e8336ca.tar Essentials-53b1526906f80e7da20441a9b29c61557e8336ca.tar.gz Essentials-53b1526906f80e7da20441a9b29c61557e8336ca.tar.lz Essentials-53b1526906f80e7da20441a9b29c61557e8336ca.tar.xz Essentials-53b1526906f80e7da20441a9b29c61557e8336ca.zip |
Throw meaningful warnings when wrong Essentials version is used with unsupported mod packs.stable-2.12.2
3 files changed, 34 insertions, 11 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 044f8bc93..c7bf6c307 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -158,10 +158,7 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials final int versionNumber = Integer.parseInt(versionMatch.group(1)); if (versionNumber < BUKKIT_VERSION && versionNumber > 100) { - LOGGER.log(Level.SEVERE, " * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! *"); - LOGGER.log(Level.SEVERE, _("notRecommendedBukkit")); - LOGGER.log(Level.SEVERE, _("requiredBukkit", Integer.toString(BUKKIT_VERSION))); - LOGGER.log(Level.SEVERE, " * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! *"); + wrongVersion(); this.setEnabled(false); return; } @@ -570,6 +567,14 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials } } + static public void wrongVersion() + { + LOGGER.log(Level.SEVERE, " * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! *"); + LOGGER.log(Level.SEVERE, _("notRecommendedBukkit")); + LOGGER.log(Level.SEVERE, _("requiredBukkit", Integer.toString(BUKKIT_VERSION))); + LOGGER.log(Level.SEVERE, " * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! *"); + } + @Override public BukkitScheduler getScheduler() { diff --git a/Essentials/src/com/earth2me/essentials/Potions.java b/Essentials/src/com/earth2me/essentials/Potions.java index a01774a5a..7cc967ecb 100644 --- a/Essentials/src/com/earth2me/essentials/Potions.java +++ b/Essentials/src/com/earth2me/essentials/Potions.java @@ -100,14 +100,22 @@ public class Potions POTIONS.put("wither", PotionEffectType.WITHER); ALIASPOTIONS.put("decay", PotionEffectType.WITHER); - POTIONS.put("healthboost", PotionEffectType.HEALTH_BOOST); - ALIASPOTIONS.put("boost", PotionEffectType.HEALTH_BOOST); - POTIONS.put("absorption", PotionEffectType.ABSORPTION); - ALIASPOTIONS.put("absorb", PotionEffectType.ABSORPTION); + try // 1.6 update + { + POTIONS.put("healthboost", PotionEffectType.HEALTH_BOOST); + ALIASPOTIONS.put("boost", PotionEffectType.HEALTH_BOOST); + + POTIONS.put("absorption", PotionEffectType.ABSORPTION); + ALIASPOTIONS.put("absorb", PotionEffectType.ABSORPTION); - POTIONS.put("saturation", PotionEffectType.SATURATION); - ALIASPOTIONS.put("food", PotionEffectType.SATURATION); + POTIONS.put("saturation", PotionEffectType.SATURATION); + ALIASPOTIONS.put("food", PotionEffectType.SATURATION); + } + catch (java.lang.NoSuchFieldError e) + { + Essentials.wrongVersion(); + } } public static PotionEffectType getByName(String name) diff --git a/Essentials/src/com/earth2me/essentials/utils/LocationUtil.java b/Essentials/src/com/earth2me/essentials/utils/LocationUtil.java index 0059e9f8c..66a2ef581 100644 --- a/Essentials/src/com/earth2me/essentials/utils/LocationUtil.java +++ b/Essentials/src/com/earth2me/essentials/utils/LocationUtil.java @@ -1,5 +1,6 @@ package com.earth2me.essentials.utils; +import com.earth2me.essentials.Essentials; import static com.earth2me.essentials.I18n._; import java.util.ArrayList; import java.util.Collections; @@ -60,7 +61,15 @@ public class LocationUtil HOLLOW_MATERIALS.add(Material.FENCE_GATE.getId()); HOLLOW_MATERIALS.add(Material.WATER_LILY.getId()); HOLLOW_MATERIALS.add(Material.NETHER_WARTS.getId()); - HOLLOW_MATERIALS.add(Material.CARPET.getId()); + + try // 1.6 update + { + HOLLOW_MATERIALS.add(Material.CARPET.getId()); + } + catch (java.lang.NoSuchFieldError e) + { + Essentials.wrongVersion(); + } for (Integer integer : HOLLOW_MATERIALS) { @@ -160,6 +169,7 @@ public class LocationUtil public int x; public int y; public int z; + public Vector3D(int x, int y, int z) { this.x = x; |