From f8c3f9cae331d850bb928b1ebb0a424587dfdf0e Mon Sep 17 00:00:00 2001 From: GameHerobrine Date: Fri, 29 Dec 2023 01:00:16 +0300 Subject: [PATCH] fixed min speed, item throwing should be smoother --- src/Player.php | 2 +- src/entity/Entity.php | 2 +- src/network/protocol/packet/SetEntityMotionPacket.php | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Player.php b/src/Player.php index cbef3f66..9dc50e4f 100755 --- a/src/Player.php +++ b/src/Player.php @@ -1331,7 +1331,7 @@ class Player{ if(EventHandler::callEvent(new DataPacketReceiveEvent($this, $packet)) === BaseEvent::DENY){ return; } - ConsoleAPI::debug("Got packet: {$packet->pid()}"); + switch($packet->pid()){ case 0x01: break; diff --git a/src/entity/Entity.php b/src/entity/Entity.php index fe77bf4c..f19480c9 100644 --- a/src/entity/Entity.php +++ b/src/entity/Entity.php @@ -5,7 +5,7 @@ class Entity extends Position const TYPE = - 1; const CLASS_TYPE = - 1; - const MIN_POSSIBLE_SPEED = 1/400; //anything below will send 0 to player + const MIN_POSSIBLE_SPEED = 1/8000; //anything below will send 0 to player public $counter = 0; public $fallDistance = 0; public static $updateOnTick, $allowedAI; diff --git a/src/network/protocol/packet/SetEntityMotionPacket.php b/src/network/protocol/packet/SetEntityMotionPacket.php index 1df1cbbf..e4cf70b9 100644 --- a/src/network/protocol/packet/SetEntityMotionPacket.php +++ b/src/network/protocol/packet/SetEntityMotionPacket.php @@ -17,9 +17,9 @@ class SetEntityMotionPacket extends RakNetDataPacket{ public function encode(){ $this->reset(); $this->putInt($this->eid); - $this->putShort((int) ($this->speedX * 400)); - $this->putShort((int) ($this->speedY * 400)); - $this->putShort((int) ($this->speedZ * 400)); + $this->putShort((int) ($this->speedX * 8000)); + $this->putShort((int) ($this->speedY * 8000)); + $this->putShort((int) ($this->speedZ * 8000)); } } \ No newline at end of file