From 8deeeec0ac9cef2361a7096cbcc774122ff114d5 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 5 May 2019 16:18:29 +1000 Subject: [PATCH] SPIGOT-4870: Server crashes while charging crossbow --- nms-patches/ItemCrossbow.patch | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/nms-patches/ItemCrossbow.patch b/nms-patches/ItemCrossbow.patch index d69f560cce..0d3ef271dc 100644 --- a/nms-patches/ItemCrossbow.patch +++ b/nms-patches/ItemCrossbow.patch @@ -18,7 +18,19 @@ } @Override -@@ -203,11 +207,27 @@ +@@ -88,6 +92,11 @@ + itemstack1 = new ItemStack(Items.ARROW); + itemstack2 = itemstack1.cloneItemStack(); + } ++ // CraftBukkit start - SPIGOT-4870, MC-150847 ++ else if (itemstack1.isEmpty()) { ++ return; ++ } ++ // CraftBukkit end + + a(entityliving, itemstack, itemstack1, k > 0, flag); + } +@@ -203,11 +212,27 @@ vector3fa.a(quaternion); ((IProjectile) object).shoot((double) vector3fa.a(), (double) vector3fa.b(), (double) vector3fa.c(), f1, f2); }