Basically Fixed Inventory

This commit is contained in:
yefengeeeeeeeeeee 2026-04-12 19:20:59 +08:00
parent dcb8732335
commit 8aacc27795
3 changed files with 36 additions and 17 deletions

View file

@ -23,7 +23,7 @@ class PlayerEquipmentPacket extends RakNetDataPacket{
$this->eid = $this->getInt();
$this->item = $this->getShort();
$this->meta = $this->getShort();
if($this->PROTOCOL === ProtocolInfo::CURRENT_PROTOCOL){$this->slot = $this->getSignedByte();}
if($this->PROTOCOL >= ProtocolInfo12::CURRENT_PROTOCOL_12){$this->slot = $this->getSignedByte();}
}
public function encode(){
@ -31,7 +31,7 @@ class PlayerEquipmentPacket extends RakNetDataPacket{
$this->putInt($this->eid);
$this->putShort(BlockAPI::convertHighItemIdsToOldItemIds($this->PROTOCOL, $this->item));
$this->putShort($this->meta);
if($this->PROTOCOL === ProtocolInfo::CURRENT_PROTOCOL){$this->putByte($this->slot);}
if($this->PROTOCOL >= ProtocolInfo12::CURRENT_PROTOCOL_12){$this->putByte($this->slot);}
}
public function eidsToGlobal(Player $p){

View file

@ -41,10 +41,6 @@ class UseItemPacket extends RakNetDataPacket{
$this->item = $this->getShort();
$this->meta = $this->getByte();
$this->eid = $this->getInt();
if ($this->PROTOCOL > ProtocolInfo9::CURRENT_PROTOCOL_9) {
$this->unknownInt1 = $this->getInt();
return;
}
$this->fx = $this->getFloat();
$this->fy = $this->getFloat();
$this->fz = $this->getFloat();
@ -56,15 +52,7 @@ class UseItemPacket extends RakNetDataPacket{
}
public function encode(){
/*$this->reset();
$this->putInt($this->x);
$this->putInt($this->y);
$this->putInt($this->z);
$this->putInt($this->face);
$this->putShort($this->item);
$this->putByte($this->meta);
$this->putInt($this->eid);
$this->putInt($this->unknownInt1);*/
}
public function eidsToGlobal(Player $p){
if($this->localEids){