Skip to content

Commit

Permalink
Improved chimp eating sounds
Browse files Browse the repository at this point in the history
Chimps will now make the eating sound of the item they're eating.
  • Loading branch information
Markus1002 committed Apr 24, 2022
1 parent 3a1d7cc commit 6f22fb1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.UseAnim;
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelAccessor;
Expand Down Expand Up @@ -466,7 +467,11 @@ private void spawnParticles() {
}
}

this.playSound(NeapolitanSoundEvents.ENTITY_CHIMPANZEE_EAT.get(), 0.25F + 0.5F * (float) this.random.nextInt(2), (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F);
if (food.getUseAnimation() == UseAnim.DRINK) {
this.playSound(food.getDrinkingSound(), 0.5F, this.random.nextFloat() * 0.1F + 0.9F);
} else {
this.playSound(food.getEatingSound(), 0.5F + 0.5F * (float)this.random.nextInt(2), (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F);
}
}
} else if (this.isDoingAction(ChimpanzeeAction.CRYING)) {
if (this.level.isClientSide) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public class NeapolitanSoundEvents {

public static final RegistryObject<SoundEvent> ENTITY_CHIMPANZEE_SCREAM = HELPER.createSoundEvent("entity.chimpanzee.scream");
public static final RegistryObject<SoundEvent> ENTITY_CHIMPANZEE_DEATH = HELPER.createSoundEvent("entity.chimpanzee.death");
public static final RegistryObject<SoundEvent> ENTITY_CHIMPANZEE_EAT = HELPER.createSoundEvent("entity.chimpanzee.eat");
public static final RegistryObject<SoundEvent> ENTITY_CHIMPANZEE_HOWL = HELPER.createSoundEvent("entity.chimpanzee.howl");
public static final RegistryObject<SoundEvent> ENTITY_CHIMPANZEE_HURT = HELPER.createSoundEvent("entity.chimpanzee.hurt");
public static final RegistryObject<SoundEvent> ENTITY_CHIMPANZEE_AMBIENT = HELPER.createSoundEvent("entity.chimpanzee.ambient");
Expand Down
17 changes: 0 additions & 17 deletions src/main/resources/assets/neapolitan/sounds.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,6 @@
],
"subtitle": "subtitles.neapolitan.entity.chimpanzee.death"
},
"entity.chimpanzee.eat": {
"sounds": [
{
"name": "minecraft:random/eat1",
"volume": 0.65
},
{
"name": "minecraft:random/eat2",
"volume": 0.65
},
{
"name": "minecraft:random/eat3",
"volume": 0.65
}
],
"subtitle": "subtitles.neapolitan.entity.chimpanzee.eat"
},
"entity.chimpanzee.howl": {
"sounds": [
"neapolitan:mob/chimpanzee/howl1",
Expand Down

0 comments on commit 6f22fb1

Please sign in to comment.