mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-11 12:27:51 +00:00
better fix for 1.14.30 movement bug
This commit is contained in:
parent
2d7f37ac47
commit
365d4a1592
@ -1595,8 +1595,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
|||||||
if($to->distanceSquared($ev->getTo()) > 0.01){ //If plugins modify the destination
|
if($to->distanceSquared($ev->getTo()) > 0.01){ //If plugins modify the destination
|
||||||
$this->teleport($ev->getTo());
|
$this->teleport($ev->getTo());
|
||||||
}else{
|
}else{
|
||||||
//TODO: workaround 1.14.30 bug: MoveActor(Absolute|Delta)Packet don't work on players anymore :(
|
$this->broadcastMovement();
|
||||||
$this->sendPosition($this, $this->yaw, $this->pitch, MovePlayerPacket::MODE_NORMAL, $this->hasSpawned);
|
|
||||||
|
|
||||||
$distance = sqrt((($from->x - $to->x) ** 2) + (($from->z - $to->z) ** 2));
|
$distance = sqrt((($from->x - $to->x) ** 2) + (($from->z - $to->z) ** 2));
|
||||||
//TODO: check swimming (adds 0.015 exhaustion in MCPE)
|
//TODO: check swimming (adds 0.015 exhaustion in MCPE)
|
||||||
|
@ -835,7 +835,11 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
|||||||
$pk->headYaw = $this->yaw;
|
$pk->headYaw = $this->yaw;
|
||||||
$pk->mode = $teleport ? MovePlayerPacket::MODE_TELEPORT : MovePlayerPacket::MODE_NORMAL;
|
$pk->mode = $teleport ? MovePlayerPacket::MODE_TELEPORT : MovePlayerPacket::MODE_NORMAL;
|
||||||
|
|
||||||
$this->level->addChunkPacket($this->getFloorX() >> 4, $this->getFloorZ() >> 4, $pk);
|
//we can't assume that everyone who is using our chunk wants to see this movement,
|
||||||
|
//because this human might be a player who shouldn't be receiving his own movement.
|
||||||
|
//this didn't matter when we were able to use MoveActorPacket because
|
||||||
|
//the client just ignored MoveActor for itself, but it doesn't ignore MovePlayer for itself.
|
||||||
|
$this->server->broadcastPacket($this->hasSpawned, $pk);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function close() : void{
|
public function close() : void{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user