001 package net.minecraft.src; 002 003 public enum EnumEnchantmentType 004 { 005 all, 006 armor, 007 armor_feet, 008 armor_legs, 009 armor_torso, 010 armor_head, 011 weapon, 012 digger, 013 bow; 014 015 /** 016 * Return true if the item passed can be enchanted by a enchantment of this type. 017 */ 018 public boolean canEnchantItem(Item par1Item) 019 { 020 if (this == all) 021 { 022 return true; 023 } 024 else if (par1Item instanceof ItemArmor) 025 { 026 if (this == armor) 027 { 028 return true; 029 } 030 else 031 { 032 ItemArmor var2 = (ItemArmor)par1Item; 033 return var2.armorType == 0 ? this == armor_head : (var2.armorType == 2 ? this == armor_legs : (var2.armorType == 1 ? this == armor_torso : (var2.armorType == 3 ? this == armor_feet : false))); 034 } 035 } 036 else 037 { 038 return par1Item instanceof ItemSword ? this == weapon : (par1Item instanceof ItemTool ? this == digger : (par1Item instanceof ItemBow ? this == bow : false)); 039 } 040 } 041 }