diff --git a/src/entity/Human.php b/src/entity/Human.php index 31170149436..ab6d141e72a 100644 --- a/src/entity/Human.php +++ b/src/entity/Human.php @@ -180,10 +180,10 @@ public function jump() : void{ } } - public function emote(string $emoteId, int $emoteLengthTicks) : void{ + public function emote(string $emoteId) : void{ NetworkBroadcastUtils::broadcastEntityEvent( $this->getViewers(), - fn(EntityEventBroadcaster $broadcaster, array $recipients) => $broadcaster->onEmote($recipients, $this, $emoteId, $emoteLengthTicks) + fn(EntityEventBroadcaster $broadcaster, array $recipients) => $broadcaster->onEmote($recipients, $this, $emoteId) ); } diff --git a/src/network/mcpe/EntityEventBroadcaster.php b/src/network/mcpe/EntityEventBroadcaster.php index b38338ce32e..252563149cb 100644 --- a/src/network/mcpe/EntityEventBroadcaster.php +++ b/src/network/mcpe/EntityEventBroadcaster.php @@ -89,5 +89,5 @@ public function onPickUpItem(array $recipients, Entity $collector, Entity $picke /** * @param NetworkSession[] $recipients */ - public function onEmote(array $recipients, Human $from, string $emoteId, int $emoteLengthTicks) : void; + public function onEmote(array $recipients, Human $from, string $emoteId) : void; } diff --git a/src/network/mcpe/handler/InGamePacketHandler.php b/src/network/mcpe/handler/InGamePacketHandler.php index 4cd61b43597..6e808073681 100644 --- a/src/network/mcpe/handler/InGamePacketHandler.php +++ b/src/network/mcpe/handler/InGamePacketHandler.php @@ -77,7 +77,6 @@ use pocketmine\network\mcpe\protocol\PlayerHotbarPacket; use pocketmine\network\mcpe\protocol\PlayerInputPacket; use pocketmine\network\mcpe\protocol\PlayerSkinPacket; -use pocketmine\network\mcpe\protocol\ProtocolInfo; use pocketmine\network\mcpe\protocol\RequestChunkRadiusPacket; use pocketmine\network\mcpe\protocol\ServerSettingsRequestPacket; use pocketmine\network\mcpe\protocol\SetActorMotionPacket; @@ -1031,7 +1030,7 @@ public function handleLevelSoundEvent(LevelSoundEventPacket $packet) : bool{ } public function handleEmote(EmotePacket $packet) : bool{ - $this->player->emote($packet->getEmoteId(), $this->session->getProtocolId() >= ProtocolInfo::PROTOCOL_1_21_30 ? $packet->getEmoteLengthTicks() : 0); + $this->player->emote($packet->getEmoteId()); return true; } } diff --git a/src/network/mcpe/handler/ResourcePacksPacketHandler.php b/src/network/mcpe/handler/ResourcePacksPacketHandler.php index 1c2c981e454..23a8cc8c5fe 100644 --- a/src/network/mcpe/handler/ResourcePacksPacketHandler.php +++ b/src/network/mcpe/handler/ResourcePacksPacketHandler.php @@ -117,9 +117,11 @@ public function setUp() : void{ //TODO: support forcing server packs $this->session->sendDataPacket(ResourcePacksInfoPacket::create( resourcePackEntries: $resourcePackEntries, + behaviorPackEntries: [], mustAccept: $this->mustAccept, hasAddons: false, hasScripts: false, + forceServerPacks: false, cdnUrls: [] )); $this->session->getLogger()->debug("Waiting for client to accept resource packs"); diff --git a/src/player/Player.php b/src/player/Player.php index 3b7b6456e54..efb5db0c4ea 100644 --- a/src/player/Player.php +++ b/src/player/Player.php @@ -2019,7 +2019,7 @@ public function toggleSwim(bool $swim) : bool{ return true; } - public function emote(string $emoteId, int $emoteLengthTicks) : void{ + public function emote(string $emoteId) : void{ $currentTick = $this->server->getTick(); if($currentTick - $this->lastEmoteTick > 5){ $this->lastEmoteTick = $currentTick; @@ -2027,7 +2027,7 @@ public function emote(string $emoteId, int $emoteLengthTicks) : void{ $event->call(); if(!$event->isCancelled()){ $emoteId = $event->getEmoteId(); - parent::emote($emoteId, $emoteLengthTicks); + parent::emote($emoteId); } } }