diff --git a/common/mekanism/client/ClientConnectionHandler.java b/common/mekanism/client/ClientConnectionHandler.java index 9410dfe18..26a79497f 100644 --- a/common/mekanism/client/ClientConnectionHandler.java +++ b/common/mekanism/client/ClientConnectionHandler.java @@ -32,28 +32,37 @@ public class ClientConnectionHandler implements IConnectionHandler @Override public void connectionOpened(NetHandler netClientHandler, String server, int port, INetworkManager manager) { - try { - voiceClient = new VoiceClient(server, 36123); - voiceClient.run(); - } catch(Exception e) {} + if(Mekanism.voiceServerEnabled) + { + try { + voiceClient = new VoiceClient(server, 36123); + voiceClient.run(); + } catch(Exception e) {} + } } @Override public void connectionOpened(NetHandler netClientHandler, MinecraftServer server, INetworkManager manager) { - try { - voiceClient = new VoiceClient(InetAddress.getLocalHost().getHostAddress(), 36123); - voiceClient.run(); - } catch(Exception e) {} + if(Mekanism.voiceServerEnabled) + { + try { + voiceClient = new VoiceClient(InetAddress.getLocalHost().getHostAddress(), 36123); + voiceClient.run(); + } catch(Exception e) {} + } } @Override public void connectionClosed(INetworkManager manager) { - if(voiceClient != null) + if(Mekanism.voiceServerEnabled) { - voiceClient.disconnect(); - voiceClient = null; + if(voiceClient != null) + { + voiceClient.disconnect(); + voiceClient = null; + } } Mekanism.proxy.unloadSoundHandler();