diff options
author | KHobbits <rob@khobbits.co.uk> | 2012-09-09 16:27:22 +0100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2012-09-09 16:27:22 +0100 |
commit | d71bd7fb713ecdd1035140faee5dfb81644848d9 (patch) | |
tree | f80ff06ed11fafdb7ca62dc417d8b354ef22e681 | |
parent | 699ec273ddca16eb04527257f26ef1547455722b (diff) | |
download | Essentials-d71bd7fb713ecdd1035140faee5dfb81644848d9.tar Essentials-d71bd7fb713ecdd1035140faee5dfb81644848d9.tar.gz Essentials-d71bd7fb713ecdd1035140faee5dfb81644848d9.tar.lz Essentials-d71bd7fb713ecdd1035140faee5dfb81644848d9.tar.xz Essentials-d71bd7fb713ecdd1035140faee5dfb81644848d9.zip |
Two sets of enchantment aliases.
-rw-r--r-- | Essentials/src/com/earth2me/essentials/Enchantments.java | 53 |
1 files changed, 29 insertions, 24 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Enchantments.java b/Essentials/src/com/earth2me/essentials/Enchantments.java index b77c1a06f..8afb0bb94 100644 --- a/Essentials/src/com/earth2me/essentials/Enchantments.java +++ b/Essentials/src/com/earth2me/essentials/Enchantments.java @@ -13,6 +13,7 @@ public class Enchantments { private static final transient Pattern NUMPATTERN = Pattern.compile("\\d+"); private static final Map<String, Enchantment> ENCHANTMENTS = new HashMap<String, Enchantment>(); + private static final Map<String, Enchantment> ALIASENCHANTMENTS = new HashMap<String, Enchantment>(); static { @@ -20,71 +21,71 @@ public class Enchantments ENCHANTMENTS.put("alldmg", Enchantment.DAMAGE_ALL); ENCHANTMENTS.put("sharpness", Enchantment.DAMAGE_ALL); ENCHANTMENTS.put("sharp", Enchantment.DAMAGE_ALL); - ENCHANTMENTS.put("dal", Enchantment.DAMAGE_ALL); + ALIASENCHANTMENTS.put("dal", Enchantment.DAMAGE_ALL); ENCHANTMENTS.put("arthropodsdamage", Enchantment.DAMAGE_ARTHROPODS); ENCHANTMENTS.put("ardmg", Enchantment.DAMAGE_ARTHROPODS); ENCHANTMENTS.put("baneofarthropods", Enchantment.DAMAGE_ARTHROPODS); - ENCHANTMENTS.put("baneofarthropod", Enchantment.DAMAGE_ARTHROPODS); + ALIASENCHANTMENTS.put("baneofarthropod", Enchantment.DAMAGE_ARTHROPODS); ENCHANTMENTS.put("arthropod", Enchantment.DAMAGE_ARTHROPODS); - ENCHANTMENTS.put("dar", Enchantment.DAMAGE_ARTHROPODS); + ALIASENCHANTMENTS.put("dar", Enchantment.DAMAGE_ARTHROPODS); ENCHANTMENTS.put("undeaddamage", Enchantment.DAMAGE_UNDEAD); ENCHANTMENTS.put("smite", Enchantment.DAMAGE_UNDEAD); - ENCHANTMENTS.put("du", Enchantment.DAMAGE_UNDEAD); + ALIASENCHANTMENTS.put("du", Enchantment.DAMAGE_UNDEAD); ENCHANTMENTS.put("digspeed", Enchantment.DIG_SPEED); ENCHANTMENTS.put("efficiency", Enchantment.DIG_SPEED); ENCHANTMENTS.put("minespeed", Enchantment.DIG_SPEED); ENCHANTMENTS.put("cutspeed", Enchantment.DIG_SPEED); - ENCHANTMENTS.put("ds", Enchantment.DIG_SPEED); + ALIASENCHANTMENTS.put("ds", Enchantment.DIG_SPEED); ENCHANTMENTS.put("durability", Enchantment.DURABILITY); ENCHANTMENTS.put("dura", Enchantment.DURABILITY); ENCHANTMENTS.put("unbreaking", Enchantment.DURABILITY); - ENCHANTMENTS.put("d", Enchantment.DURABILITY); + ALIASENCHANTMENTS.put("d", Enchantment.DURABILITY); ENCHANTMENTS.put("fireaspect", Enchantment.FIRE_ASPECT); ENCHANTMENTS.put("fire", Enchantment.FIRE_ASPECT); ENCHANTMENTS.put("meleefire", Enchantment.FIRE_ASPECT); - ENCHANTMENTS.put("meleeflame", Enchantment.FIRE_ASPECT); - ENCHANTMENTS.put("fa", Enchantment.FIRE_ASPECT); + ALIASENCHANTMENTS.put("meleeflame", Enchantment.FIRE_ASPECT); + ALIASENCHANTMENTS.put("fa", Enchantment.FIRE_ASPECT); ENCHANTMENTS.put("knockback", Enchantment.KNOCKBACK); - ENCHANTMENTS.put("k", Enchantment.KNOCKBACK); + ALIASENCHANTMENTS.put("k", Enchantment.KNOCKBACK); ENCHANTMENTS.put("blockslootbonus", Enchantment.LOOT_BONUS_BLOCKS); ENCHANTMENTS.put("fortune", Enchantment.LOOT_BONUS_BLOCKS); - ENCHANTMENTS.put("lbb", Enchantment.LOOT_BONUS_BLOCKS); + ALIASENCHANTMENTS.put("lbb", Enchantment.LOOT_BONUS_BLOCKS); ENCHANTMENTS.put("mobslootbonus", Enchantment.LOOT_BONUS_MOBS); ENCHANTMENTS.put("mobloot", Enchantment.LOOT_BONUS_MOBS); ENCHANTMENTS.put("looting", Enchantment.LOOT_BONUS_MOBS); - ENCHANTMENTS.put("lbm", Enchantment.LOOT_BONUS_MOBS); + ALIASENCHANTMENTS.put("lbm", Enchantment.LOOT_BONUS_MOBS); ENCHANTMENTS.put("oxygen", Enchantment.OXYGEN); ENCHANTMENTS.put("respiration", Enchantment.OXYGEN); ENCHANTMENTS.put("breathing", Enchantment.OXYGEN); ENCHANTMENTS.put("breath", Enchantment.OXYGEN); - ENCHANTMENTS.put("o", Enchantment.OXYGEN); + ALIASENCHANTMENTS.put("o", Enchantment.OXYGEN); ENCHANTMENTS.put("protection", Enchantment.PROTECTION_ENVIRONMENTAL); ENCHANTMENTS.put("prot", Enchantment.PROTECTION_ENVIRONMENTAL); ENCHANTMENTS.put("protect", Enchantment.PROTECTION_ENVIRONMENTAL); - ENCHANTMENTS.put("p", Enchantment.PROTECTION_ENVIRONMENTAL); + ALIASENCHANTMENTS.put("p", Enchantment.PROTECTION_ENVIRONMENTAL); ENCHANTMENTS.put("explosionsprotection", Enchantment.PROTECTION_EXPLOSIONS); ENCHANTMENTS.put("explosionprotection", Enchantment.PROTECTION_EXPLOSIONS); ENCHANTMENTS.put("expprot", Enchantment.PROTECTION_EXPLOSIONS); ENCHANTMENTS.put("blastprotection", Enchantment.PROTECTION_EXPLOSIONS); ENCHANTMENTS.put("blastprotect", Enchantment.PROTECTION_EXPLOSIONS); - ENCHANTMENTS.put("pe", Enchantment.PROTECTION_EXPLOSIONS); + ALIASENCHANTMENTS.put("pe", Enchantment.PROTECTION_EXPLOSIONS); ENCHANTMENTS.put("fallprotection", Enchantment.PROTECTION_FALL); ENCHANTMENTS.put("fallprot", Enchantment.PROTECTION_FALL); ENCHANTMENTS.put("featherfall", Enchantment.PROTECTION_FALL); ENCHANTMENTS.put("featherfalling", Enchantment.PROTECTION_FALL); - ENCHANTMENTS.put("pfa", Enchantment.PROTECTION_FALL); + ALIASENCHANTMENTS.put("pfa", Enchantment.PROTECTION_FALL); ENCHANTMENTS.put("fireprotection", Enchantment.PROTECTION_FIRE); ENCHANTMENTS.put("flameprotection", Enchantment.PROTECTION_FIRE); @@ -92,43 +93,43 @@ public class Enchantments ENCHANTMENTS.put("flameprotect", Enchantment.PROTECTION_FIRE); ENCHANTMENTS.put("fireprot", Enchantment.PROTECTION_FIRE); ENCHANTMENTS.put("flameprot", Enchantment.PROTECTION_FIRE); - ENCHANTMENTS.put("pf", Enchantment.PROTECTION_FIRE); + ALIASENCHANTMENTS.put("pf", Enchantment.PROTECTION_FIRE); ENCHANTMENTS.put("projectileprotection", Enchantment.PROTECTION_PROJECTILE); ENCHANTMENTS.put("projprot", Enchantment.PROTECTION_PROJECTILE); - ENCHANTMENTS.put("pp", Enchantment.PROTECTION_PROJECTILE); + ALIASENCHANTMENTS.put("pp", Enchantment.PROTECTION_PROJECTILE); ENCHANTMENTS.put("silktouch", Enchantment.SILK_TOUCH); ENCHANTMENTS.put("softtouch", Enchantment.SILK_TOUCH); - ENCHANTMENTS.put("st", Enchantment.SILK_TOUCH); + ALIASENCHANTMENTS.put("st", Enchantment.SILK_TOUCH); ENCHANTMENTS.put("waterworker", Enchantment.WATER_WORKER); ENCHANTMENTS.put("aquaaffinity", Enchantment.WATER_WORKER); - ENCHANTMENTS.put("ww", Enchantment.WATER_WORKER); + ALIASENCHANTMENTS.put("ww", Enchantment.WATER_WORKER); ENCHANTMENTS.put("firearrow", Enchantment.ARROW_FIRE); ENCHANTMENTS.put("flame", Enchantment.ARROW_FIRE); ENCHANTMENTS.put("flamearrow", Enchantment.ARROW_FIRE); - ENCHANTMENTS.put("af", Enchantment.ARROW_FIRE); + ALIASENCHANTMENTS.put("af", Enchantment.ARROW_FIRE); ENCHANTMENTS.put("arrowdamage", Enchantment.ARROW_DAMAGE); ENCHANTMENTS.put("power", Enchantment.ARROW_DAMAGE); ENCHANTMENTS.put("arrowpower", Enchantment.ARROW_DAMAGE); - ENCHANTMENTS.put("ad", Enchantment.ARROW_DAMAGE); + ALIASENCHANTMENTS.put("ad", Enchantment.ARROW_DAMAGE); ENCHANTMENTS.put("arrowknockback", Enchantment.ARROW_KNOCKBACK); ENCHANTMENTS.put("arrowkb", Enchantment.ARROW_KNOCKBACK); ENCHANTMENTS.put("punch", Enchantment.ARROW_KNOCKBACK); ENCHANTMENTS.put("arrowpunch", Enchantment.ARROW_KNOCKBACK); - ENCHANTMENTS.put("ak", Enchantment.ARROW_KNOCKBACK); + ALIASENCHANTMENTS.put("ak", Enchantment.ARROW_KNOCKBACK); ENCHANTMENTS.put("infinitearrows", Enchantment.ARROW_INFINITE); ENCHANTMENTS.put("infarrows", Enchantment.ARROW_INFINITE); ENCHANTMENTS.put("infinity", Enchantment.ARROW_INFINITE); - ENCHANTMENTS.put("infinite", Enchantment.ARROW_INFINITE); + ALIASENCHANTMENTS.put("infinite", Enchantment.ARROW_INFINITE); ENCHANTMENTS.put("unlimited", Enchantment.ARROW_INFINITE); ENCHANTMENTS.put("unlimitedarrows", Enchantment.ARROW_INFINITE); - ENCHANTMENTS.put("ai", Enchantment.ARROW_INFINITE); + ALIASENCHANTMENTS.put("ai", Enchantment.ARROW_INFINITE); } public static Enchantment getByName(String name) { @@ -142,6 +143,10 @@ public class Enchantments { enchantment = ENCHANTMENTS.get(name.toLowerCase(Locale.ENGLISH)); } + if (enchantment == null) + { + enchantment = ALIASENCHANTMENTS.get(name.toLowerCase(Locale.ENGLISH)); + } return enchantment; } |