tweaked minecarts + AddEntityPacket

This commit is contained in:
GameHerobrine 2023-12-29 01:58:58 +03:00
parent f8c3f9cae3
commit 3b65160552
7 changed files with 17 additions and 32 deletions

View file

@ -28,9 +28,9 @@ class AddEntityPacket extends RakNetDataPacket{
$this->putFloat($this->z);
$this->putInt($this->did);
if($this->did > 0){
$this->putShort($this->speedX);
$this->putShort($this->speedY);
$this->putShort($this->speedZ);
$this->putShort((int)($this->speedX * 8000));
$this->putShort((int)($this->speedY * 8000));
$this->putShort((int)($this->speedZ * 8000));
}
}

View file

@ -1,6 +1,6 @@
<?php
class PlayerInputPacket extends RakNetDataPacket{
public $unk1, $unk2, $sneaking, $unk4;
public $moveStrafe, $moveForward, $isJumping, $isSneaking;
public function encode()
{
@ -13,10 +13,10 @@ class PlayerInputPacket extends RakNetDataPacket{
public function decode()
{
$this->unk1 = $this->getFloat();
$this->unk2 = $this->getFloat();
$this->sneaking = bin2hex($this->buffer)[$this->getOffset()] === 4;
$this->unk4 = bin2hex($this->buffer)[$this->getOffset()+1] === 4;
$this->moveStrafe = $this->getFloat();
$this->moveForward = $this->getFloat();
$this->isJumping = $this->getByte() != 0;
$this->isSneaking = $this->getByte() != 0;
}
}