mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 16:59:44 +00:00
Fixed player knockback not working since 531c6344fe6bd920ef2b6639b7ff649cfe8bf11c
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:
parent
15a2fd6e4f
commit
a91710b199
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user