mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Cleaned up some bad code in DataPacket, added encode/decodeHeader and made encode/decodePayload protected
This commit is contained in:
@ -36,7 +36,7 @@ class InventoryContentPacket extends DataPacket{
|
||||
/** @var Item[] */
|
||||
public $items = [];
|
||||
|
||||
public function decodePayload(){
|
||||
protected function decodePayload(){
|
||||
$this->windowId = $this->getUnsignedVarInt();
|
||||
$count = $this->getUnsignedVarInt();
|
||||
for($i = 0; $i < $count; ++$i){
|
||||
@ -44,7 +44,7 @@ class InventoryContentPacket extends DataPacket{
|
||||
}
|
||||
}
|
||||
|
||||
public function encodePayload(){
|
||||
protected function encodePayload(){
|
||||
$this->putUnsignedVarInt($this->windowId);
|
||||
$this->putUnsignedVarInt(count($this->items));
|
||||
foreach($this->items as $item){
|
||||
|
Reference in New Issue
Block a user