From 262c7779fe1193489e27b48cbc3800bfa4f3f1ab Mon Sep 17 00:00:00 2001 From: md_5 Date: Wed, 10 Dec 2014 15:57:27 +1100 Subject: Fix crash with null thorns damager --- nms-patches/EnchantmentThorns.patch | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 nms-patches/EnchantmentThorns.patch (limited to 'nms-patches') diff --git a/nms-patches/EnchantmentThorns.patch b/nms-patches/EnchantmentThorns.patch new file mode 100644 index 00000000..13386c76 --- /dev/null +++ b/nms-patches/EnchantmentThorns.patch @@ -0,0 +1,11 @@ +--- ../work/decompile-8eb82bde/net/minecraft/server/EnchantmentThorns.java 2014-12-10 15:53:01.980344940 +1100 ++++ src/main/java/net/minecraft/server/EnchantmentThorns.java 2014-12-10 15:52:50.688364236 +1100 +@@ -29,7 +29,7 @@ + Random random = entityliving.bb(); + ItemStack itemstack = EnchantmentManager.a(Enchantment.THORNS, entityliving); + +- if (a(i, random)) { ++ if (entity != null && a(i, random)) { // CraftBukkit + entity.damageEntity(DamageSource.a(entityliving), (float) b(i, random)); + entity.makeSound("damage.thorns", 0.5F, 1.0F); + if (itemstack != null) { -- cgit v1.2.3