mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-25 14:24:35 +00:00
Don't launch VoiceClient unless VoiceServerEnabled is set to true
This commit is contained in:
1 parent
2fb13e1f3d
commit
d8a4ecb986
1 file changed
+20
-11
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user