hotbar fixes

This commit is contained in:
GameHerobrine 2024-11-15 11:52:14 +03:00
parent 053ac5abb9
commit a4a5f1dfdf
6 changed files with 16 additions and 9 deletions

View file

@ -14,7 +14,7 @@ class PlayerEquipmentPacket extends RakNetDataPacket{
$this->eid = $this->getInt();
$this->item = $this->getShort();
$this->meta = $this->getShort();
$this->slot = $this->getByte();
$this->slot = $this->getSignedByte();
}
public function encode(){

View file

@ -123,7 +123,12 @@ abstract class RakNetDataPacket extends stdClass{
protected function getShort($unsigned = false){
return Utils::readShort($this->get(2), $unsigned);
}
public function getSignedByte(){
$b = ord($this->get(1));
return $b >= 0x80 ? ($b-256) : $b;
}
protected function getByte(){
return ord($this->get(1));
}