i commited a crime

This commit is contained in:
GameHerobrine 2023-08-28 23:32:37 +03:00
parent c96a8f3491
commit be12c3a3bf
3 changed files with 2 additions and 5 deletions

View file

@ -256,7 +256,6 @@ class Player{
if($this->connected === false){ if($this->connected === false){
return false; return false;
} }
if(EventHandler::callEvent(new DataPacketSendEvent($this, $packet)) === BaseEvent::DENY){ if(EventHandler::callEvent(new DataPacketSendEvent($this, $packet)) === BaseEvent::DENY){
return; return;
} }

View file

@ -736,7 +736,7 @@ class Entity extends Position
if($this->lastHeadYaw != $this->headYaw){ if($this->lastHeadYaw != $this->headYaw){
$this->sendHeadYaw(); $this->sendHeadYaw();
} }
if($this->class !== ENTITY_PLAYER && $update){ if($this->class === ENTITY_PLAYER || $update){
$this->updateMovement(); $this->updateMovement();
} }
@ -770,14 +770,13 @@ class Entity extends Position
$pk = new MovePlayerPacket(); $pk = new MovePlayerPacket();
$pk->eid = $this->eid; $pk->eid = $this->eid;
$pk->x = $this->x; $pk->x = $this->x;
$pk->y = $this->y + $this->getEyeHeight(); $pk->y = $this->y;
$pk->z = $this->z; $pk->z = $this->z;
$pk->yaw = $this->yaw; $pk->yaw = $this->yaw;
$pk->pitch = $this->pitch; $pk->pitch = $this->pitch;
$pk->bodyYaw = $this->yaw; $pk->bodyYaw = $this->yaw;
$this->server->api->player->broadcastPacket($players, $pk); $this->server->api->player->broadcastPacket($players, $pk);
} else{ } else{
$pk = new MoveEntityPacket; $pk = new MoveEntityPacket;
$pk->entities = [[$this->eid, $this->x, $this->y, $this->z, $this->yaw, $this->pitch]]; $pk->entities = [[$this->eid, $this->x, $this->y, $this->z, $this->yaw, $this->pitch]];
$this->server->api->player->broadcastPacket($players, $pk); $this->server->api->player->broadcastPacket($players, $pk);

View file

@ -21,7 +21,6 @@ class MovePlayerPacket extends RakNetDataPacket{
$this->yaw = $this->getFloat(); $this->yaw = $this->getFloat();
$this->pitch = $this->getFloat(); $this->pitch = $this->getFloat();
$this->bodyYaw = $this->getFloat(); $this->bodyYaw = $this->getFloat();
$flags = $this->getByte();
$this->teleport = ($this->getByte() & 0x80) > 0; $this->teleport = ($this->getByte() & 0x80) > 0;
} }