--- a/net/minecraft/enchantment/EnchantmentHelper.java
+++ b/net/minecraft/enchantment/EnchantmentHelper.java
@@ -274,7 +274,7 @@
 
    public static int func_77514_a(Random p_77514_0_, int p_77514_1_, int p_77514_2_, ItemStack p_77514_3_) {
       Item item = p_77514_3_.func_77973_b();
-      int i = item.func_77619_b();
+      int i = p_77514_3_.getItemEnchantability();
       if (i <= 0) {
          return 0;
       } else {
@@ -312,7 +312,7 @@
    public static List<EnchantmentData> func_77513_b(Random p_77513_0_, ItemStack p_77513_1_, int p_77513_2_, boolean p_77513_3_) {
       List<EnchantmentData> list = Lists.newArrayList();
       Item item = p_77513_1_.func_77973_b();
-      int i = item.func_77619_b();
+      int i = p_77513_1_.getItemEnchantability();
       if (i <= 0) {
          return list;
       } else {
@@ -365,7 +365,7 @@
       boolean flag = p_185291_1_.func_77973_b() == Items.field_151122_aG;
 
       for(Enchantment enchantment : Registry.field_212628_q) {
-         if ((!enchantment.func_185261_e() || p_185291_2_) && enchantment.func_230310_i_() && (enchantment.field_77351_y.func_77557_a(item) || flag)) {
+         if ((!enchantment.func_185261_e() || p_185291_2_) && enchantment.func_230310_i_() && (enchantment.canApplyAtEnchantingTable(p_185291_1_) || (flag && enchantment.isAllowedOnBooks()))) {
             for(int i = enchantment.func_77325_b(); i > enchantment.func_77319_d() - 1; --i) {
                if (p_185291_0_ >= enchantment.func_77321_a(i) && p_185291_0_ <= enchantment.func_223551_b(i)) {
                   list.add(new EnchantmentData(enchantment, i));
