Add EntityLoadCrossbowEvent
This commit is contained in:
@@ -29,3 +29,24 @@
|
||||
stack.hurtAndBreak(this.getDurabilityUse(itemstack1), shooter, LivingEntity.getSlotForHand(hand));
|
||||
if (stack.isEmpty()) {
|
||||
break;
|
||||
@@ -93,6 +109,11 @@
|
||||
}
|
||||
|
||||
protected static List<ItemStack> draw(ItemStack stack, ItemStack projectileStack, LivingEntity shooter) {
|
||||
+ // Paper start
|
||||
+ return draw(stack, projectileStack, shooter, true);
|
||||
+ }
|
||||
+ protected static List<ItemStack> draw(ItemStack stack, ItemStack projectileStack, LivingEntity shooter, boolean consume) {
|
||||
+ // Paper end
|
||||
if (projectileStack.isEmpty()) {
|
||||
return List.of();
|
||||
} else {
|
||||
@@ -112,7 +133,7 @@
|
||||
ItemStack itemstack2 = projectileStack.copy();
|
||||
|
||||
for (int k = 0; k < j; ++k) {
|
||||
- ItemStack itemstack3 = ProjectileWeaponItem.useAmmo(stack, k == 0 ? projectileStack : itemstack2, shooter, k > 0);
|
||||
+ ItemStack itemstack3 = ProjectileWeaponItem.useAmmo(stack, k == 0 ? projectileStack : itemstack2, shooter, k > 0 || !consume); // Paper
|
||||
|
||||
if (!itemstack3.isEmpty()) {
|
||||
list.add(itemstack3);
|
||||
|
||||
Reference in New Issue
Block a user