From 1ddd58fd3bade9ef9278474704710b230bd96b42 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Thu, 9 Apr 2015 18:50:34 +0200 Subject: [PATCH] Fixed a few issues --- src/pocketmine/Player.php | 8 ++++---- src/pocketmine/entity/Entity.php | 4 ++-- src/pocketmine/level/particle/FloatingTextParticle.php | 2 ++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index e84ec2772f..00e2a37d58 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -1130,7 +1130,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{ $this->teleport($ev->getTo()); }else{ foreach($this->hasSpawned as $player){ - $player->addEntityMovement($this->id, $this->x, $this->y + $this->height, $this->z, $this->yaw, $this->pitch, $this->yaw); + $player->addEntityMovement($this->id, $this->x, $this->y + $this->getEyeHeight(), $this->z, $this->yaw, $this->pitch, $this->yaw); } } } @@ -1153,7 +1153,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{ $pk = new MovePlayerPacket(); $pk->eid = $this->getId(); $pk->x = $from->x; - $pk->y = $from->y + $this->height; + $pk->y = $from->y + $this->getEyeHeight(); $pk->z = $from->z; $pk->bodyYaw = $from->yaw; $pk->pitch = $from->pitch; @@ -1527,7 +1527,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{ $pk = new MovePlayerPacket(); $pk->eid = $this->getId(); $pk->x = $this->forceMovement->x; - $pk->y = $this->forceMovement->y + $this->height; + $pk->y = $this->forceMovement->y + $this->getEyeHeight(); $pk->z = $this->forceMovement->z; $pk->bodyYaw = $packet->bodyYaw; $pk->pitch = $packet->pitch; @@ -2699,7 +2699,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{ $pk = new MovePlayerPacket(); $pk->eid = $this->getId(); $pk->x = $this->x; - $pk->y = $this->y + $this->height; + $pk->y = $this->y + $this->getEyeHeight(); $pk->z = $this->z; $pk->bodyYaw = $this->yaw; $pk->pitch = $this->pitch; diff --git a/src/pocketmine/entity/Entity.php b/src/pocketmine/entity/Entity.php index dc82bf8833..27f7db0c97 100644 --- a/src/pocketmine/entity/Entity.php +++ b/src/pocketmine/entity/Entity.php @@ -795,7 +795,7 @@ abstract class Entity extends Location implements Metadatable{ if(!($this instanceof Player)){ foreach($this->hasSpawned as $player){ - $player->addEntityMovement($this->id, $this->x, $this->y + $this->height, $this->z, $this->yaw, $this->pitch, $this->yaw); + $player->addEntityMovement($this->id, $this->x, $this->y + $this->getEyeHeight(), $this->z, $this->yaw, $this->pitch, $this->yaw); } } } @@ -1396,7 +1396,7 @@ abstract class Entity extends Location implements Metadatable{ $this->lastPitch = $this->pitch; foreach($this->hasSpawned as $player){ - $player->addEntityMovement($this->getId(), $this->x, $this->y + $this->height, $this->z, $this->yaw, $this->pitch, $this->yaw); + $player->addEntityMovement($this->getId(), $this->x, $this->y + $this->getEyeHeight(), $this->z, $this->yaw, $this->pitch, $this->yaw); } return true; diff --git a/src/pocketmine/level/particle/FloatingTextParticle.php b/src/pocketmine/level/particle/FloatingTextParticle.php index 75d3dd1080..55483f1aff 100644 --- a/src/pocketmine/level/particle/FloatingTextParticle.php +++ b/src/pocketmine/level/particle/FloatingTextParticle.php @@ -82,6 +82,8 @@ class FloatingTextParticle extends Particle{ $pk->pitch = 0; $pk->item = 0; $pk->meta = 0; + $pk->slim = false; + $pk->skin = str_repeat("\x00", 64 * 32 * 4); $pk->metadata = [ Entity::DATA_FLAGS => [Entity::DATA_TYPE_BYTE, 1 << Entity::DATA_FLAG_INVISIBLE], Entity::DATA_AIR => [Entity::DATA_TYPE_SHORT, 300],