Micro optimization to movement update checking

No need to keep abs()ing this, because next time we have a movement update, motion < 0.00001 will be flattened to zero anyway.
This commit is contained in:
Dylan K. Taylor 2017-08-23 10:42:07 +01:00
parent d1852834de
commit a7674c52e6

View File

@ -1322,9 +1322,9 @@ abstract class Entity extends Location implements Metadatable{
final public function hasMovementUpdate() : bool{
return (
$this->forceMovementUpdate or
abs($this->motionX) > self::MOTION_THRESHOLD or
abs($this->motionY) > self::MOTION_THRESHOLD or
abs($this->motionZ) > self::MOTION_THRESHOLD or
$this->motionX != 0 or
$this->motionY != 0 or
$this->motionZ != 0 or
!$this->onGround
);
}