Prevent constant NPE exceptions being thrown and ignored (which caused extremely high CPU load)

This commit is contained in:
johni0702
2015-05-17 12:18:46 +02:00
parent f27d31dcbb
commit 2f057ce0b1

View File

@@ -31,16 +31,17 @@ public class ChatMessageHandler {
if(!alive) {
break;
}
try {
Thread.sleep(100);
player = Minecraft.getMinecraft().thePlayer;
} catch(Exception e) {
}
Thread.sleep(100);
player = Minecraft.getMinecraft().thePlayer;
}
player.addChatComponentMessage(requests.poll());
IChatComponent message = requests.poll();
if (message != null) {
player.addChatComponentMessage(message);
}
Thread.sleep(100);
} catch(Exception e) {
e.printStackTrace();
}
}