Java 7 and 8 cleanup

Diamond operator <>
Lambdas and method references
This commit is contained in:
Tom Elfring committed 2017-08-05 17:50:38 +02:00
1 parent 3db03edbc9
commit b72d6efab3
234 files changed
+1614 -2253

No files matched your search

@@ -93,33 +93,29 @@ public class VoiceConnection extends Thread
}
//Main client listen thread
new Thread(new Runnable()
{
@Override
public void run()
{
while(open)
{
try {
short byteCount = VoiceConnection.this.input.readShort();
byte[] audioData = new byte[byteCount];
VoiceConnection.this.input.readFully(audioData);
new Thread(() ->
{
while(open)
{
try {
short byteCount = VoiceConnection.this.input.readShort();
byte[] audioData = new byte[byteCount];
VoiceConnection.this.input.readFully(audioData);
if(byteCount > 0)
{
Mekanism.voiceManager.sendToPlayers(byteCount, audioData, VoiceConnection.this);
}
} catch(Exception e) {
open = false;
}
}
if(byteCount > 0)
{
Mekanism.voiceManager.sendToPlayers(byteCount, audioData, VoiceConnection.this);
}
} catch(Exception e) {
open = false;
}
}
if(!open)
{
kill();
}
}
}).start();
if(!open)
{
kill();
}
}).start();
}
public void kill()