mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 04:29:43 +00:00
Conver High ItemID to Old ItemId
This commit is contained in:
parent
6b7563d8ea
commit
fd23ba04ec
9 changed files with 36 additions and 10 deletions
|
|
@ -21,7 +21,7 @@ class AddItemEntityPacket extends RakNetDataPacket{
|
|||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putInt($this->eid);
|
||||
$this->putSlot($this->item);
|
||||
$this->putSlot($this->PROTOCOL, $this->item);
|
||||
$this->putFloat($this->x);
|
||||
$this->putFloat($this->y);
|
||||
$this->putFloat($this->z);
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class ContainerSetContentPacket extends RakNetDataPacket{
|
|||
$this->putByte($this->windowid);
|
||||
$this->putShort(count($this->slots));
|
||||
foreach($this->slots as $slot){
|
||||
$this->putSlot($slot);
|
||||
$this->putSlot($this->PROTOCOL, $slot);
|
||||
}
|
||||
if($this->windowid === 0 and count($this->hotbar) > 0){
|
||||
$this->putShort(count($this->hotbar));//null
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class ContainerSetSlotPacket extends RakNetDataPacket{
|
|||
$this->reset();
|
||||
$this->putByte($this->windowid);
|
||||
$this->putShort($this->slot);
|
||||
$this->putSlot($this->item);
|
||||
$this->putSlot($this->PROTOCOL, $this->item);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -32,7 +32,7 @@ class PlaceBlockPacket extends RakNetDataPacket{
|
|||
$this->putInt($this->x);
|
||||
$this->putInt($this->z);
|
||||
$this->putByte($this->y);
|
||||
$this->putByte($this->block);
|
||||
$this->putByte(BlockAPI::convertHighItemIdsToOldItemIds($this->PROTOCOL, $this->block));
|
||||
$this->putByte($this->meta);
|
||||
$this->putByte($this->face);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class PlayerEquipmentPacket extends RakNetDataPacket{
|
|||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putInt($this->eid);
|
||||
$this->putShort($this->item);
|
||||
$this->putShort(BlockAPI::convertHighItemIdsToOldItemIds($this->PROTOCOL, $this->item));
|
||||
$this->putShort($this->meta);
|
||||
if($this->PROTOCOL === ProtocolInfo::CURRENT_PROTOCOL){$this->putByte($this->slot);}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,11 +37,11 @@ class SendInventoryPacket extends RakNetDataPacket{
|
|||
$this->putByte($this->windowid);
|
||||
$this->putShort(count($this->slots));
|
||||
foreach($this->slots as $slot){
|
||||
$this->putSlot($slot);
|
||||
$this->putSlot($this->PROTOCOL, $slot);
|
||||
}
|
||||
if($this->windowid === 1 and count($this->armor) === 4){
|
||||
for($s = 0; $s < 4; ++$s){
|
||||
$this->putSlot($this->armor[$s]);
|
||||
$this->putSlot($this->PROTOCOL, $this->armor[$s]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class UpdateBlockPacket extends RakNetDataPacket{
|
|||
$this->putInt($this->x);
|
||||
$this->putInt($this->z);
|
||||
$this->putByte($this->y);
|
||||
$this->putByte($this->block);
|
||||
$this->putByte(BlockAPI::convertHighItemIdsToOldItemIds($this->PROTOCOL, $this->block));
|
||||
$this->putByte($this->meta);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue