Skip to content

Commit

Permalink
Remove outdated try-catches
Browse files Browse the repository at this point in the history
  • Loading branch information
necrodoom authored and khobbits committed Aug 10, 2014
1 parent 38837bb commit bad3881
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 48 deletions.
19 changes: 6 additions & 13 deletions Essentials/src/com/earth2me/essentials/Enchantments.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,20 +142,13 @@ public class Enchantments
ALIASENCHANTMENTS.put("unlimitedarrows", Enchantment.ARROW_INFINITE);
ALIASENCHANTMENTS.put("ai", Enchantment.ARROW_INFINITE);

try // 1.7 update
{
ENCHANTMENTS.put("luck", Enchantment.LUCK);
ALIASENCHANTMENTS.put("luckofsea", Enchantment.LUCK);
ALIASENCHANTMENTS.put("luckofseas", Enchantment.LUCK);
ALIASENCHANTMENTS.put("rodluck", Enchantment.LUCK);
ENCHANTMENTS.put("luck", Enchantment.LUCK);
ALIASENCHANTMENTS.put("luckofsea", Enchantment.LUCK);
ALIASENCHANTMENTS.put("luckofseas", Enchantment.LUCK);
ALIASENCHANTMENTS.put("rodluck", Enchantment.LUCK);

ENCHANTMENTS.put("lure", Enchantment.LURE);
ALIASENCHANTMENTS.put("rodlure", Enchantment.LURE);
}
catch (java.lang.NoSuchFieldError e)
{
Essentials.wrongVersion();
}
ENCHANTMENTS.put("lure", Enchantment.LURE);
ALIASENCHANTMENTS.put("rodlure", Enchantment.LURE);
}

public static Enchantment getByName(String name)
Expand Down
37 changes: 11 additions & 26 deletions Essentials/src/com/earth2me/essentials/Potions.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,35 +100,20 @@ 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);

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("absorption", PotionEffectType.ABSORPTION);
ALIASPOTIONS.put("absorb", PotionEffectType.ABSORPTION);

POTIONS.put("saturation", PotionEffectType.SATURATION);
ALIASPOTIONS.put("food", PotionEffectType.SATURATION);
}
catch (java.lang.NoSuchFieldError e)
{
Essentials.wrongVersion();
}
POTIONS.put("saturation", PotionEffectType.SATURATION);
ALIASPOTIONS.put("food", PotionEffectType.SATURATION);

try // 1.7 update
{
POTIONS.put("waterbreathing", PotionEffectType.WATER_BREATHING);
ALIASPOTIONS.put("underwaterbreathing", PotionEffectType.WATER_BREATHING);
ALIASPOTIONS.put("waterbreath", PotionEffectType.WATER_BREATHING);
ALIASPOTIONS.put("underwaterbreath", PotionEffectType.WATER_BREATHING);
ALIASPOTIONS.put("air", PotionEffectType.WATER_BREATHING);
}
catch (java.lang.NoSuchFieldError e)
{
Essentials.wrongVersion();
}
POTIONS.put("waterbreathing", PotionEffectType.WATER_BREATHING);
ALIASPOTIONS.put("underwaterbreathing", PotionEffectType.WATER_BREATHING);
ALIASPOTIONS.put("waterbreath", PotionEffectType.WATER_BREATHING);
ALIASPOTIONS.put("underwaterbreath", PotionEffectType.WATER_BREATHING);
ALIASPOTIONS.put("air", PotionEffectType.WATER_BREATHING);
}

public static PotionEffectType getByName(String name)
Expand Down
10 changes: 1 addition & 9 deletions Essentials/src/com/earth2me/essentials/utils/LocationUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,7 @@ public class LocationUtil
HOLLOW_MATERIALS.add(Material.FENCE_GATE.getId());
HOLLOW_MATERIALS.add(Material.WATER_LILY.getId());
HOLLOW_MATERIALS.add(Material.NETHER_WARTS.getId());

try // 1.6 update
{
HOLLOW_MATERIALS.add(Material.CARPET.getId());
}
catch (java.lang.NoSuchFieldError e)
{
Essentials.wrongVersion();
}
HOLLOW_MATERIALS.add(Material.CARPET.getId());

for (Integer integer : HOLLOW_MATERIALS)
{
Expand Down

0 comments on commit bad3881

Please sign in to comment.