mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-26 19:18:12 +01:00
Remove unnecessary shouldUpdate method in Entity
This commit is contained in:
parent
30a7843018
commit
62ab0a2007
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user