Don't launch VoiceClient unless VoiceServerEnabled is set to true
This commit is contained in:
parent
2fb13e1f3d
commit
d8a4ecb986
1 changed files with 20 additions and 11 deletions
|
@ -31,30 +31,39 @@ public class ClientConnectionHandler implements IConnectionHandler
|
|||
|
||||
@Override
|
||||
public void connectionOpened(NetHandler netClientHandler, String server, int port, INetworkManager manager)
|
||||
{
|
||||
if(Mekanism.voiceServerEnabled)
|
||||
{
|
||||
try {
|
||||
voiceClient = new VoiceClient(server, 36123);
|
||||
voiceClient.run();
|
||||
} catch(Exception e) {}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void connectionOpened(NetHandler netClientHandler, MinecraftServer server, INetworkManager manager)
|
||||
{
|
||||
if(Mekanism.voiceServerEnabled)
|
||||
{
|
||||
try {
|
||||
voiceClient = new VoiceClient(InetAddress.getLocalHost().getHostAddress(), 36123);
|
||||
voiceClient.run();
|
||||
} catch(Exception e) {}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void connectionClosed(INetworkManager manager)
|
||||
{
|
||||
if(Mekanism.voiceServerEnabled)
|
||||
{
|
||||
if(voiceClient != null)
|
||||
{
|
||||
voiceClient.disconnect();
|
||||
voiceClient = null;
|
||||
}
|
||||
}
|
||||
|
||||
Mekanism.proxy.unloadSoundHandler();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue