fixed min speed, item throwing should be smoother

This commit is contained in:
GameHerobrine 2023-12-29 01:00:16 +03:00
parent a6f2c7e257
commit f8c3f9cae3
3 changed files with 5 additions and 5 deletions

View file

@ -1331,7 +1331,7 @@ class Player{
if(EventHandler::callEvent(new DataPacketReceiveEvent($this, $packet)) === BaseEvent::DENY){ if(EventHandler::callEvent(new DataPacketReceiveEvent($this, $packet)) === BaseEvent::DENY){
return; return;
} }
ConsoleAPI::debug("Got packet: {$packet->pid()}");
switch($packet->pid()){ switch($packet->pid()){
case 0x01: case 0x01:
break; break;

View file

@ -5,7 +5,7 @@ class Entity extends Position
const TYPE = - 1; const TYPE = - 1;
const CLASS_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 $counter = 0;
public $fallDistance = 0; public $fallDistance = 0;
public static $updateOnTick, $allowedAI; public static $updateOnTick, $allowedAI;

View file

@ -17,9 +17,9 @@ class SetEntityMotionPacket extends RakNetDataPacket{
public function encode(){ public function encode(){
$this->reset(); $this->reset();
$this->putInt($this->eid); $this->putInt($this->eid);
$this->putShort((int) ($this->speedX * 400)); $this->putShort((int) ($this->speedX * 8000));
$this->putShort((int) ($this->speedY * 400)); $this->putShort((int) ($this->speedY * 8000));
$this->putShort((int) ($this->speedZ * 400)); $this->putShort((int) ($this->speedZ * 8000));
} }
} }