SPIGOT-4870: Server crashes while charging crossbow

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2019-05-05 16:18:29 +10:00
parent 7a47bcf55b
commit 8f5f07be27

View File

@ -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);
}