Make the fade-in times match the old Mek sound system, give some things a fade-out of 0.5s because it sounds nice that way.

This commit is contained in:
Ben Spiers 2014-08-30 01:08:05 +01:00
parent e83f3ee042
commit 3a0d0d2208
4 changed files with 10 additions and 13 deletions

View file

@ -11,8 +11,8 @@ public class GasMaskSound extends PlayerSound
public GasMaskSound(EntityPlayer player)
{
super(player, new ResourceLocation("mekanism", "item.gasMask"));
setFadeIn(0);
setFadeOut(0);
setFadeIn(30);
setFadeOut(10);
}
@Override

View file

@ -11,8 +11,8 @@ public class JetpackSound extends PlayerSound
public JetpackSound(EntityPlayer player)
{
super(player, new ResourceLocation("mekanism", "item.jetpack"));
setFadeIn(0);
setFadeOut(0);
setFadeIn(30);
setFadeOut(10);
}
@Override

View file

@ -1,7 +1,5 @@
package mekanism.client.sound;
import mekanism.common.Mekanism;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
@ -12,8 +10,8 @@ public abstract class PlayerSound extends Sound implements IResettableSound
boolean beginFadeOut;
boolean donePlaying = true;
int ticks = 0;
int fadeIn = 50;
int fadeOut = 50;
int fadeIn;
int fadeOut;
float baseVolume = 0.3F;
@ -58,12 +56,12 @@ public abstract class PlayerSound extends Sound implements IResettableSound
public float getFadeInMultiplier() {
return ticks >= fadeIn ? 1 : (float) (ticks / (float) fadeIn);
return ticks >= fadeIn ? 1 : (ticks / (float) fadeIn);
}
public float getFadeOutMultiplier() {
return ticks >= fadeOut ? 0 : (float) ((fadeOut - ticks) / (float) fadeOut);
return ticks >= fadeOut ? 0 : ((fadeOut - ticks) / (float) fadeOut);
}
@Override
@ -90,7 +88,6 @@ public abstract class PlayerSound extends Sound implements IResettableSound
if(multiplier <= 0)
{
Mekanism.logger.info("Sound Stopping. " + this);
donePlaying = true;
}
}

View file

@ -8,8 +8,8 @@ public class TileSound extends Sound implements IResettableSound {
boolean beginFadeOut;
boolean donePlaying = true;
int ticks = 0;
int fadeIn = 50;
int fadeOut = 50;
int fadeIn = 30;
int fadeOut = 10;
float baseVolume = 1.0F;
public TileSound(IHasSound source, ISoundSource values)