diff --git a/src/pocketmine/entity/Entity.php b/src/pocketmine/entity/Entity.php index d0dab36bd..e44870866 100644 --- a/src/pocketmine/entity/Entity.php +++ b/src/pocketmine/entity/Entity.php @@ -279,6 +279,8 @@ abstract class Entity extends Location implements Metadatable{ public $width; public $length; + protected $baseOffset = 0.0; + /** @var int */ private $health = 20; private $maxHealth = 20; @@ -1116,7 +1118,7 @@ abstract class Entity extends Location implements Metadatable{ $diffMotion = ($this->motionX - $this->lastMotionX) ** 2 + ($this->motionY - $this->lastMotionY) ** 2 + ($this->motionZ - $this->lastMotionZ) ** 2; - if($diffPosition > 0.04 or $diffRotation > 2.25 and ($diffMotion > 0.0001 and $this->getMotion()->lengthSquared() <= 0.00001)){ //0.2 ** 2, 1.5 ** 2 + if($diffPosition > 0.0001 or $diffRotation > 1.0){ $this->lastX = $this->x; $this->lastY = $this->y; $this->lastZ = $this->z; @@ -1124,7 +1126,7 @@ abstract class Entity extends Location implements Metadatable{ $this->lastYaw = $this->yaw; $this->lastPitch = $this->pitch; - $this->level->addEntityMovement($this->chunk->getX(), $this->chunk->getZ(), $this->id, $this->x, $this->y, $this->z, $this->yaw, $this->pitch, $this->yaw); + $this->level->addEntityMovement($this->chunk->getX(), $this->chunk->getZ(), $this->id, $this->x, $this->y + $this->baseOffset, $this->z, $this->yaw, $this->pitch, $this->yaw); } if($diffMotion > 0.0025 or ($diffMotion > 0.0001 and $this->getMotion()->lengthSquared() <= 0.0001)){ //0.05 ** 2 diff --git a/src/pocketmine/entity/Item.php b/src/pocketmine/entity/Item.php index 349b55c0f..71a1549ce 100644 --- a/src/pocketmine/entity/Item.php +++ b/src/pocketmine/entity/Item.php @@ -43,6 +43,8 @@ class Item extends Entity{ public $width = 0.25; public $length = 0.25; public $height = 0.25; + protected $baseOffset = 0.125; + protected $gravity = 0.04; protected $drag = 0.02; diff --git a/src/pocketmine/entity/PrimedTNT.php b/src/pocketmine/entity/PrimedTNT.php index c03ef1772..d547d5bb9 100644 --- a/src/pocketmine/entity/PrimedTNT.php +++ b/src/pocketmine/entity/PrimedTNT.php @@ -35,6 +35,8 @@ class PrimedTNT extends Entity implements Explosive{ public $length = 0.98; public $height = 0.98; + protected $baseOffset = 0.49; + protected $gravity = 0.04; protected $drag = 0.02;