--- ../src-base/minecraft/net/minecraft/inventory/ContainerRepair.java
+++ ../src-work/minecraft/net/minecraft/inventory/ContainerRepair.java
@@ -73,6 +73,8 @@
                     p_82870_1_.func_82242_a(-ContainerRepair.this.field_82854_e);
                 }
 
+                float breakChance = net.minecraftforge.common.ForgeHooks.onAnvilRepair(p_82870_1_, p_82870_2_, ContainerRepair.this.field_82853_g.func_70301_a(0), ContainerRepair.this.field_82853_g.func_70301_a(1));
+
                 ContainerRepair.this.field_82853_g.func_70299_a(0, (ItemStack)null);
 
                 if (ContainerRepair.this.field_82856_l > 0)
@@ -97,7 +99,7 @@
                 ContainerRepair.this.field_82854_e = 0;
                 IBlockState iblockstate = p_i45807_2_.func_180495_p(p_i45807_3_);
 
-                if (!p_82870_1_.field_71075_bZ.field_75098_d && !p_i45807_2_.field_72995_K && iblockstate.func_177230_c() == Blocks.field_150467_bQ && p_82870_1_.func_70681_au().nextFloat() < 0.12F)
+                if (!p_82870_1_.field_71075_bZ.field_75098_d && !p_i45807_2_.field_72995_K && iblockstate.func_177230_c() == Blocks.field_150467_bQ && p_82870_1_.func_70681_au().nextFloat() < breakChance)
                 {
                     int k = ((Integer)iblockstate.func_177229_b(BlockAnvil.field_176505_b)).intValue();
                     ++k;
@@ -177,6 +179,7 @@
 
             if (itemstack2 != null)
             {
+                if (!net.minecraftforge.common.ForgeHooks.onAnvilChange(this, itemstack, itemstack2, field_82852_f, field_82857_m, i2)) return;
                 flag7 = itemstack2.func_77973_b() == Items.field_151134_bR && Items.field_151134_bR.func_92110_g(itemstack2).func_74745_c() > 0;
                 int k;
                 int l;
@@ -322,6 +325,8 @@
                 }
             }
 
+            if (flag7 && !itemstack1.func_77973_b().isBookEnchantable(itemstack1, itemstack2)) itemstack1 = null;
+
             if (StringUtils.isBlank(this.field_82857_m))
             {
                 if (itemstack.func_82837_s())
