Don't show particles when splash events are canceled (#8637)

This commit is contained in:
Lulu13022002
2022-12-10 22:27:36 +01:00
parent f976ec6b19
commit 8b951a41ae
2 changed files with 60 additions and 5 deletions

View File

@@ -35,10 +35,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
Potion potionregistry = PotionUtils.getPotion(itemstack);
@@ -0,0 +0,0 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
if (this.isLingering()) {
this.makeAreaOfEffectCloud(itemstack, potionregistry);
showParticles = this.makeAreaOfEffectCloud(itemstack, potionregistry); // Paper
} else {
- this.applySplash(list, hitResult.getType() == HitResult.Type.ENTITY ? ((EntityHitResult) hitResult).getEntity() : null);
+ this.applySplash(list, hitResult != null && hitResult.getType() == HitResult.Type.ENTITY ? ((EntityHitResult) hitResult).getEntity() : null); // Paper - nullable hitResult
- showParticles = this.applySplash(list, hitResult.getType() == HitResult.Type.ENTITY ? ((EntityHitResult) hitResult).getEntity() : null); // Paper
+ showParticles = this.applySplash(list, hitResult != null && hitResult.getType() == HitResult.Type.ENTITY ? ((EntityHitResult) hitResult).getEntity() : null); // Paper - nullable hitResult
}
}