Fix error

This commit is contained in:
zimzaza4
2025-03-09 02:10:03 +08:00
parent d7fdbc3f77
commit 104aa9e346

View File

@@ -154,6 +154,7 @@ public class EntityTask {
} }
public void sendScale(Collection<Player> players, boolean firstSend) { public void sendScale(Collection<Player> players, boolean firstSend) {
try {
if (players.isEmpty()) { if (players.isEmpty()) {
return; return;
} }
@@ -167,6 +168,9 @@ public class EntityTask {
EntityUtils.sendCustomScale(player, model.getEntity().getEntityId(), average); EntityUtils.sendCustomScale(player, model.getEntity().getEntityId(), average);
} }
lastScale = average; lastScale = average;
} catch (Throwable t) {
// ignore
}
} }
public void sendColor(Collection<Player> players, boolean firstSend) { public void sendColor(Collection<Player> players, boolean firstSend) {
@@ -375,8 +379,12 @@ public class EntityTask {
sendHitBoxToAll(); sendHitBoxToAll();
Runnable asyncTask = () -> { Runnable asyncTask = () -> {
try {
checkViewers(model.getViewers()); checkViewers(model.getViewers());
runAsync(); runAsync();
} catch (Throwable t) {
}
}; };
scheduledFuture = GeyserModelEngine.getInstance().getScheduler().scheduleAtFixedRate(asyncTask, 0, 20, TimeUnit.MILLISECONDS); scheduledFuture = GeyserModelEngine.getInstance().getScheduler().scheduleAtFixedRate(asyncTask, 0, 20, TimeUnit.MILLISECONDS);