Skip to content

Commit

Permalink
Merge branch 'zeta120' of https://github.com/VazkiiMods/Quark into ze…
Browse files Browse the repository at this point in the history
…ta120
  • Loading branch information
MehVahdJukaar committed Jan 4, 2024
2 parents 7db5549 + 81b47c1 commit e0c4d32
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,9 @@ public FeedResult tryFeedingAnimal(Animal animal) {
ItemStack stack = this.getItem(i);
if(animal.isFood(stack)) {
SoundEvent soundEvent = animal.getEatingSound(stack);
// Try and catch this in case soundEvent is null somewhere (Its cleaner then null checking soundEvent
// after warping it)
try {
if (soundEvent != null) { // Null check is kinda required, don't remove :)
animal.playSound(soundEvent, 0.5F + 0.5F * level.random.nextInt(2), (level.random.nextFloat() - level.random.nextFloat()) * 0.2F + 1.0F);
} catch (NullPointerException ignored) {}
}

this.addItemParticles(animal, stack, 16);

Expand Down

0 comments on commit e0c4d32

Please sign in to comment.