From ffd2fbcc84056d603902386e797b06c67023a1c3 Mon Sep 17 00:00:00 2001 From: LexManos Date: Tue, 13 Aug 2013 15:25:09 -0700 Subject: [PATCH] Fix NPE in enchangint books. --- .../net/minecraft/enchantment/EnchantmentHelper.java.patch | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch b/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch index 33fbe30e8..8fe6cc8cf 100644 --- a/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch +++ b/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch @@ -1,12 +1,14 @@ --- ../src_base/minecraft/net/minecraft/enchantment/EnchantmentHelper.java +++ ../src_work/minecraft/net/minecraft/enchantment/EnchantmentHelper.java -@@ -463,7 +463,8 @@ +@@ -463,7 +463,10 @@ { Enchantment enchantment = aenchantment[k]; - if (enchantment != null && (enchantment.type.canEnchantItem(item) || flag)) ++ if (enchantment == null) continue; ++ + flag = (par1ItemStack.itemID == Item.book.itemID) && enchantment.isAllowedOnBooks(); -+ if (enchantment != null && (enchantment.canApplyAtEnchantingTable(par1ItemStack) || flag)) ++ if (enchantment.canApplyAtEnchantingTable(par1ItemStack) || flag) { for (int l = enchantment.getMinLevel(); l <= enchantment.getMaxLevel(); ++l) {