mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-19 15:35:52 +00:00
Workaround for entities glitching through the floor on the client-side
This commit is contained in:
parent
48f591e5ce
commit
6f1f201c41
@ -33,7 +33,6 @@ use pocketmine\event\entity\EntityMoveEvent;
|
||||
use pocketmine\event\entity\EntityRegainHealthEvent;
|
||||
use pocketmine\event\entity\EntitySpawnEvent;
|
||||
use pocketmine\event\entity\EntityTeleportEvent;
|
||||
use pocketmine\event\player\PlayerMotionEvent;
|
||||
use pocketmine\event\Timings;
|
||||
use pocketmine\level\format\Chunk;
|
||||
use pocketmine\level\format\FullChunk;
|
||||
@ -166,7 +165,7 @@ abstract class Entity extends Position implements Metadatable{
|
||||
$this->timings = Timings::getEntityTimings($this);
|
||||
|
||||
if($this->eyeHeight === null){
|
||||
$this->eyeHeight = $this->height;
|
||||
$this->eyeHeight = $this->height / 2 + 0.1;
|
||||
}
|
||||
|
||||
$this->id = Entity::$entityCount++;
|
||||
@ -534,7 +533,7 @@ abstract class Entity extends Position implements Metadatable{
|
||||
$pk = new MovePlayerPacket;
|
||||
$pk->eid = $this->id;
|
||||
$pk->x = $this->x;
|
||||
$pk->y = $this->y; //teleport from head
|
||||
$pk->y = $this->y;
|
||||
$pk->z = $this->z;
|
||||
$pk->yaw = $this->yaw;
|
||||
$pk->pitch = $this->pitch;
|
||||
@ -543,7 +542,7 @@ abstract class Entity extends Position implements Metadatable{
|
||||
//TODO: add to move list
|
||||
$pk = new MoveEntityPacket();
|
||||
$pk->entities = [
|
||||
[$this->id, $this->x, $this->y, $this->z, $this->yaw, $this->pitch]
|
||||
[$this->id, $this->x, $this->y + $this->getEyeHeight(), $this->z, $this->yaw, $this->pitch]
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user