Remove unnecessary shouldUpdate method in Entity

This commit is contained in:
Felix Cravic 2020-12-10 18:12:05 +01:00
parent 30a7843018
commit 62ab0a2007

View File

@ -105,7 +105,6 @@ public abstract class Entity implements Viewable, EventHandler, DataContainer, P
private long scheduledRemoveTime;
private final Set<Entity> passengers = new CopyOnWriteArraySet<>();
private long lastUpdate;
protected EntityType entityType; // UNSAFE to change, modify at your own risk
// Network synchronization, send the absolute position of the entity each X milliseconds
@ -461,8 +460,7 @@ public abstract class Entity implements Viewable, EventHandler, DataContainer, P
}
// Entity tick
if (shouldUpdate(time)) {
this.lastUpdate = time;
{
// Velocity
boolean applyVelocity = false;
@ -1417,10 +1415,6 @@ public abstract class Entity implements Viewable, EventHandler, DataContainer, P
this.lastAbsoluteSynchronizationTime = 0;
}
private boolean shouldUpdate(long time) {
return (float) (time - lastUpdate) >= MinecraftServer.TICK_MS * 0.9f; // Margin of error
}
private enum Pose {
STANDING,
FALL_FLYING,