diff --git a/patches/minecraft/net/minecraft/inventory/ContainerRepair.java.patch b/patches/minecraft/net/minecraft/inventory/ContainerRepair.java.patch new file mode 100644 index 000000000..a05ae4e79 --- /dev/null +++ b/patches/minecraft/net/minecraft/inventory/ContainerRepair.java.patch @@ -0,0 +1,22 @@ +--- ../src_base/minecraft/net/minecraft/inventory/ContainerRepair.java ++++ ../src_work/minecraft/net/minecraft/inventory/ContainerRepair.java +@@ -305,6 +305,11 @@ + k = Math.max(1, k / 2); + } + ++ if (flag && itemstack1!=null && !Item.itemsList[itemstack1.itemID].isBookEnchantable(itemstack1,itemstack2)) ++ { ++ itemstack1 = null; ++ } ++ + this.maximumCost = k + i; + + if (i <= 0) +@@ -322,6 +327,7 @@ + { + itemstack1 = null; + } ++ + + if (itemstack1 != null) + { diff --git a/patches/minecraft/net/minecraft/item/Item.java.patch b/patches/minecraft/net/minecraft/item/Item.java.patch index 4dbff738b..a0eae145d 100644 --- a/patches/minecraft/net/minecraft/item/Item.java.patch +++ b/patches/minecraft/net/minecraft/item/Item.java.patch @@ -47,7 +47,7 @@ Vec3 vec31 = vec3.addVector((double)f7 * d3, (double)f6 * d3, (double)f8 * d3); return par1World.rayTraceBlocks_do_do(vec3, vec31, par3, !par3); } -@@ -720,4 +730,324 @@ +@@ -720,4 +730,336 @@ { StatList.initStats(); } @@ -329,7 +329,7 @@ + + /** + * Determines if the specific ItemStack can be placed in the specified armor slot. -+ * ++ * + * @param stack The ItemStack + * @param armorType Armor slot ID: 0: Helmet, 1: Chest, 2: Legs, 3: Boots + * @return True if the given ItemStack can be inserted in the slot @@ -348,10 +348,10 @@ + + return false; + } -+ ++ + /** + * ItemStack sensitive version of isPotionIngredient -+ * ++ * + * @param stack The item stack + * @return True if this stack can be used as a potion ingredient + */ @@ -362,7 +362,7 @@ + + /** + * ItemStack sensitive version of getPotionEffect -+ * ++ * + * @param stack The item stack + * @return A string containing the bit manipulation to apply the the potion. + */ @@ -370,5 +370,17 @@ + { + return getPotionEffect(); + } ++ ++ /** ++ * Allow or forbid the specific book/item combination as an anvil enchant ++ * ++ * @param itemstack1 The item ++ * @param itemstack2 The book ++ * @return if the enchantment is allowed ++ */ ++ public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) ++ { ++ return true; ++ } + }