From 5d8f9e37b4492190248b073ef652a8dc972205c2 Mon Sep 17 00:00:00 2001 From: Sollace Date: Fri, 1 Nov 2024 14:11:13 +0000 Subject: [PATCH] Fixed ghost item drops when hitting an entity. Closes #513 --- .../unicopia/projectile/PhysicsBodyProjectileEntity.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/projectile/PhysicsBodyProjectileEntity.java b/src/main/java/com/minelittlepony/unicopia/projectile/PhysicsBodyProjectileEntity.java index 183720b7..000b556c 100644 --- a/src/main/java/com/minelittlepony/unicopia/projectile/PhysicsBodyProjectileEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/projectile/PhysicsBodyProjectileEntity.java @@ -167,11 +167,11 @@ public class PhysicsBodyProjectileEntity extends PersistentProjectileEntity impl stack.damage(1 + random.nextInt(10), sw, null, i -> { playSound(USounds.Vanilla.ENTITY_ITEM_BREAK, 1, 1); }); + if (!stack.isEmpty()) { + dropStack(stack); + } + discard(); } - if (!stack.isEmpty()) { - dropStack(stack); - } - setStack(ItemStack.EMPTY); } } super.onEntityHit(hit);