Skip to content

Commit

Permalink
Honor client.enableMachineSounds to address EnigmaticaModpacks/Enigma…
Browse files Browse the repository at this point in the history
  • Loading branch information
dizzyd committed Mar 17, 2019
1 parent ae2619c commit 3942422
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import mekanism.client.sound.SoundHandler;
import mekanism.common.Mekanism;
import mekanism.common.base.IActiveState;
import mekanism.common.config.MekanismConfig;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.ISound;
import net.minecraft.util.ResourceLocation;
Expand Down Expand Up @@ -49,6 +50,11 @@ protected void setSoundEvent(SoundEvent event) {

@SideOnly(Side.CLIENT)
private void updateSound() {
// If machine sounds are disabled, noop
if (!MekanismConfig.client.enableMachineSounds) {
return;
}

if (getActive() && !isInvalid()) {
// If sounds are being muted, we can attempt to start them on every tick, only to have them
// denied by the event bus, so use a cooldown period that ensures we're only trying once every
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import mekanism.common.MekanismFluids;
import mekanism.common.base.IActiveState;
import mekanism.common.base.TileNetworkList;
import mekanism.common.config.MekanismConfig;
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.TileUtils;
Expand Down Expand Up @@ -110,6 +111,11 @@ public void onUpdate() {

@SideOnly(Side.CLIENT)
private void updateSound() {
// If machine sounds are disabled, noop
if (!MekanismConfig.client.enableMachineSounds) {
return;
}

if (getActive() && !isInvalid()) {
// If sounds are being muted, we can attempt to start them on every tick, only to have them
// denied by the event bus, so use a cooldown period that ensures we're only trying once every
Expand Down

0 comments on commit 3942422

Please sign in to comment.