Paper
Paper copied to clipboard
Fix duplicate egg throw sound
This fix an issue with the egg throw sound being played twice (slightly noticeable with the volume of the sound compared to other projectile) and the enderpearl that didn't reset its cooldown clientside when the PlayerLaunchProjectileEvent is cancelled.
In all the cases where the launch projectile event is fired... shouldn't we uncomment the user.awardStat(Stats.ITEM_USED.get(this)); line at the bottom and remove the one wee add? It still would be correct and less vanilla diff. The only thing we would need to handle above was the itemstack shrink. You could also just leave that at the bottom if you added a new boolean at the top that determined if the stack should shrink. I think that is cleaner.
Also, for EggItem specifically, we can leave the playSound at the bottom too since that will fire after the event anyways.