mirror of
https://github.com/GeyserExtensionists/GeyserModelEngine.git
synced 2025-12-19 15:09:18 +00:00
Fix error
This commit is contained in:
@@ -154,19 +154,23 @@ public class EntityTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void sendScale(Collection<Player> players, boolean firstSend) {
|
public void sendScale(Collection<Player> players, boolean firstSend) {
|
||||||
if (players.isEmpty()) {
|
try {
|
||||||
return;
|
if (players.isEmpty()) {
|
||||||
}
|
return;
|
||||||
Vector3f scale = model.getActiveModel().getScale();
|
}
|
||||||
float average = (scale.x + scale.y + scale.z) / 3;
|
Vector3f scale = model.getActiveModel().getScale();
|
||||||
|
float average = (scale.x + scale.y + scale.z) / 3;
|
||||||
|
|
||||||
if (!firstSend) {
|
if (!firstSend) {
|
||||||
if (average == lastScale) return;
|
if (average == lastScale) return;
|
||||||
|
}
|
||||||
|
for (Player player : players) {
|
||||||
|
EntityUtils.sendCustomScale(player, model.getEntity().getEntityId(), average);
|
||||||
|
}
|
||||||
|
lastScale = average;
|
||||||
|
} catch (Throwable t) {
|
||||||
|
// ignore
|
||||||
}
|
}
|
||||||
for (Player player : players) {
|
|
||||||
EntityUtils.sendCustomScale(player, model.getEntity().getEntityId(), average);
|
|
||||||
}
|
|
||||||
lastScale = average;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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 = () -> {
|
||||||
checkViewers(model.getViewers());
|
try {
|
||||||
runAsync();
|
checkViewers(model.getViewers());
|
||||||
|
runAsync();
|
||||||
|
} catch (Throwable t) {
|
||||||
|
|
||||||
|
}
|
||||||
};
|
};
|
||||||
scheduledFuture = GeyserModelEngine.getInstance().getScheduler().scheduleAtFixedRate(asyncTask, 0, 20, TimeUnit.MILLISECONDS);
|
scheduledFuture = GeyserModelEngine.getInstance().getScheduler().scheduleAtFixedRate(asyncTask, 0, 20, TimeUnit.MILLISECONDS);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user