Add configurable sound volume for all Mekanism sounds
This commit is contained in:
parent
eb8e02a39a
commit
8289af18fd
3 changed files with 3 additions and 0 deletions
|
@ -135,6 +135,7 @@ public class ClientProxy extends CommonProxy
|
|||
Mekanism.configuration.load();
|
||||
MekanismClient.enableSounds = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EnableSounds", true).getBoolean(true);
|
||||
MekanismClient.fancyUniversalCableRender = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "FancyUniversalCableRender", true).getBoolean(true);
|
||||
MekanismClient.baseSoundVolume = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "baseSoundVolume", 1).getDouble(1);
|
||||
Mekanism.configuration.save();
|
||||
}
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ public class MekanismClient extends Mekanism
|
|||
//General Configuration
|
||||
public static boolean enableSounds = true;
|
||||
public static boolean fancyUniversalCableRender = true;
|
||||
public static double baseSoundVolume = 1;
|
||||
|
||||
public static long ticksPassed = 0;
|
||||
|
||||
|
|
|
@ -146,6 +146,7 @@ public abstract class Sound
|
|||
|
||||
double distance = entityplayer.getDistance(getLocation().x, getLocation().y, getLocation().z);
|
||||
volume = (float)Math.min(Math.max(masterVolume-((distance*.08F)*masterVolume), 0)*multiplier, 1);
|
||||
volume *= Math.max(0, Math.min(1, MekanismClient.baseSoundVolume));
|
||||
|
||||
if(SoundHandler.getSoundSystem() != null)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue