Skip to content

Commit

Permalink
Moa sound fixed lol
Browse files Browse the repository at this point in the history
  • Loading branch information
MrXBlade committed Nov 11, 2024
1 parent 477f5e8 commit 6df548c
Show file tree
Hide file tree
Showing 16 changed files with 16 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,8 @@ public void attemptMoaSound()
if (this.random.nextFloat() < 0.2f + this.soundChance) {
if (this.random.nextFloat() > 0.05f + this.songChance || isBaby()) {
//Small chirp
this.moaSoundCallCooldown = 160 + this.random.nextInt(155);
this.songChance += MathHelper.clamp(this.random.nextFloat(), 0.1f, 0.04f);
this.moaSoundCallCooldown = (int) getRandomFloat(60, 150);
this.songChance += getRandomFloat(0.04f, 0.1f);

if (!isBaby()) {
this.getWorld().playSound(null, this.getX(), this.getY(), this.getZ(), ParadiseLostSoundEvents.ENTITY_MOA_AMBIENT, SoundCategory.NEUTRAL, 0.15f, getRandomFloat(0.85f, 0.92f));
Expand All @@ -349,24 +349,26 @@ public void attemptMoaSound()
}
} else {
//Play little song sometimes so it doesn't get annoying
this.moaSoundCallCooldown = 200 + this.random.nextInt(25);
this.moaSoundCallCooldown = (int) getRandomFloat(60, 150);
this.songChance = 0;
this.getWorld().playSound(null, this.getX(), this.getY(), this.getZ(), ParadiseLostSoundEvents.ENTITY_MOA_AMBIENT_SING, SoundCategory.NEUTRAL, 0.23f, getRandomFloat(0.98f, 1.02f));
}
} else {
if (isSaddled()) {
this.moaSoundCallCooldown = 150 + this.random.nextInt(150);
this.soundChance += getRandomFloat(0.04f, 0.13f);
this.moaSoundCallCooldown = (int) getRandomFloat(60, 150);
this.soundChance += getRandomFloat(0.02f, 0.06f);
} else {
this.moaSoundCallCooldown = 100 + this.random.nextInt(250);
this.soundChance += getRandomFloat(0.04f, 0.16f);
this.moaSoundCallCooldown = (int) getRandomFloat(30, 90);
this.soundChance += getRandomFloat(0.02f, 0.09f);
}
}
}
private boolean canFlap = true;
public void attemptMoaFlap(boolean bypassFlapCheck) {
if (getWingRoll() > 0.8 && canFlap || bypassFlapCheck) {
this.getWorld().playSound(null, this.getX(), this.getY(), this.getZ(), ParadiseLostSoundEvents.ENTITY_MOA_GLIDING, SoundCategory.NEUTRAL, 0.6F, getRandomFloat(0.9f, 0.97f));
if (!this.getWorld().isClient) {
this.getWorld().playSound(null, this.getX(), this.getY(), this.getZ(), ParadiseLostSoundEvents.ENTITY_MOA_GLIDING, SoundCategory.NEUTRAL, 0.8F, getRandomFloat(0.9f, 0.97f));
}
this.canFlap = false;
} else if (getWingRoll() < -0.3f) {
this.canFlap = true;
Expand All @@ -387,10 +389,12 @@ protected void playHurtSound(DamageSource source) {
public void tick() {
isInAir = !isOnGround();

if (this.moaSoundCallCooldown > 0) {
this.moaSoundCallCooldown--;
} else {
this.attemptMoaSound();
if (!this.getWorld().isClient) {
if (this.moaSoundCallCooldown > 0) {
this.moaSoundCallCooldown--;
} else {
this.attemptMoaSound();
}
}

if (flapCount > 0 && !isSaddled()) {
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 6df548c

Please sign in to comment.