mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Add exception handling to the scoreboard updater
This commit is contained in:
parent
1316f6e1da
commit
c115afba85
1 changed files with 60 additions and 54 deletions
|
@ -62,6 +62,7 @@ public final class ScoreboardUpdater extends Thread {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
while (!connector.isShuttingDown()) {
|
while (!connector.isShuttingDown()) {
|
||||||
|
try {
|
||||||
long timeTillAction = getTimeTillNextAction();
|
long timeTillAction = getTimeTillNextAction();
|
||||||
if (timeTillAction > 0) {
|
if (timeTillAction > 0) {
|
||||||
sleepFor(timeTillAction);
|
sleepFor(timeTillAction);
|
||||||
|
@ -138,6 +139,11 @@ public final class ScoreboardUpdater extends Thread {
|
||||||
|
|
||||||
long timeTillNextAction = getTimeTillNextAction();
|
long timeTillNextAction = getTimeTillNextAction();
|
||||||
sleepFor(timeTillNextAction);
|
sleepFor(timeTillNextAction);
|
||||||
|
} catch (Throwable e) {
|
||||||
|
connector.getLogger().error("Error while translating scoreboard information!", e);
|
||||||
|
// Wait so we don't try to run the scoreboard immediately after this
|
||||||
|
sleepFor(FIRST_MILLIS_BETWEEN_UPDATES);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue