mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
Fixed player knockback not working since 531c6344fe
player knockback silently depended on the chunk packet broadcast system sending the player's motion back to itself, which broadcasting to hasSpawned will not do.
This commit is contained in:
@ -90,6 +90,7 @@ use pocketmine\nbt\tag\ListTag;
|
||||
use pocketmine\network\mcpe\NetworkSession;
|
||||
use pocketmine\network\mcpe\protocol\AnimatePacket;
|
||||
use pocketmine\network\mcpe\protocol\MovePlayerPacket;
|
||||
use pocketmine\network\mcpe\protocol\SetActorMotionPacket;
|
||||
use pocketmine\network\mcpe\protocol\types\entity\EntityMetadataCollection;
|
||||
use pocketmine\network\mcpe\protocol\types\entity\EntityMetadataFlags;
|
||||
use pocketmine\network\mcpe\protocol\types\entity\EntityMetadataProperties;
|
||||
@ -1261,6 +1262,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
||||
public function setMotion(Vector3 $motion) : bool{
|
||||
if(parent::setMotion($motion)){
|
||||
$this->broadcastMotion();
|
||||
$this->networkSession->sendDataPacket(SetActorMotionPacket::create($this->id, $motion));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user