mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-27 05:05:20 +01:00
Early return instead of remove on a blockingdeque
This commit is contained in:
parent
4e5348ce45
commit
8a1d8e3106
@ -162,7 +162,9 @@ public class HumanController extends AbstractEntityController {
|
||||
((YggdrasilMinecraftSessionService) repo).getAuthenticationService(),
|
||||
new GameProfile(UUID.fromString(realUUID), ""), true);
|
||||
} catch (Exception e) {
|
||||
if (e.getMessage() != null && e.getMessage().contains("too many requests")) {
|
||||
if ((e.getMessage() != null && e.getMessage().contains("too many requests"))
|
||||
|| (e.getCause() != null && e.getCause().getMessage() != null && e.getCause().getMessage()
|
||||
.contains("too many requests"))) {
|
||||
SKIN_THREAD.delay();
|
||||
SKIN_THREAD.addRunnable(this);
|
||||
}
|
||||
@ -202,7 +204,7 @@ public class HumanController extends AbstractEntityController {
|
||||
Iterator<Runnable> itr = tasks.iterator();
|
||||
while (itr.hasNext()) {
|
||||
if (((SkinFetcher) itr.next()).npc.getUniqueId().equals(((SkinFetcher) r).npc.getUniqueId())) {
|
||||
itr.remove();
|
||||
return;
|
||||
}
|
||||
}
|
||||
tasks.offer(r);
|
||||
|
Loading…
Reference in New Issue
Block a user