GenisysPro  for Minecraft PE/Windows 10 v1.1.x
Feature-rich server software for Minecraft PE and Windows 10 Edition
ContainerSetContentPacket Class Reference

Public Member Functions

 clean ()
 
 decode ()
 
 encode ()
 
 getName ()
 
- Public Member Functions inherited from DataPacket
 pid ()
 
 encode ()
 
 decode ()
 
 reset ()
 
 clean ()
 
 __debugInfo ()
 
 getEntityMetadata (bool $types=true)
 
 putEntityMetadata (array $metadata)
 
 getName ()
 
- Public Member Functions inherited from BinaryStream
 __construct ($buffer="", $offset=0)
 
 reset ()
 
 setBuffer ($buffer=null, $offset=0)
 
 getOffset ()
 
 getBuffer ()
 
 get ($len)
 
 put ($str)
 
 getBool ()
 
 putBool ($v)
 
 getLong ()
 
 putLong ($v)
 
 getInt ()
 
 putInt ($v)
 
 getLLong ()
 
 putLLong ($v)
 
 getLInt ()
 
 putLInt ($v)
 
 getSignedShort ()
 
 putShort ($v)
 
 getShort ()
 
 putSignedShort ($v)
 
 getFloat (int $accuracy=-1)
 
 putFloat ($v)
 
 getLShort ($signed=true)
 
 putLShort ($v)
 
 getLFloat (int $accuracy=-1)
 
 putLFloat ($v)
 
 getTriad ()
 
 putTriad ($v)
 
 getLTriad ()
 
 putLTriad ($v)
 
 getByte ()
 
 putByte ($v)
 
 getUUID ()
 
 putUUID (UUID $uuid)
 
 getSlot ()
 
 putSlot (Item $item)
 
 getString ()
 
 putString ($v)
 
 getUnsignedVarInt ()
 
 putUnsignedVarInt ($v)
 
 getVarInt ()
 
 putVarInt ($v)
 
 getEntityId ()
 
 putEntityId ($v)
 
 getBlockCoords (&$x, &$y, &$z)
 
 putBlockCoords ($x, $y, $z)
 
 getVector3f (&$x, &$y, &$z)
 
 putVector3f ($x, $y, $z)
 
 feof ()
 

Data Fields

const NETWORK_ID = ProtocolInfo::CONTAINER_SET_CONTENT_PACKET
 
const SPECIAL_INVENTORY = 0
 
const SPECIAL_ARMOR = 0x78
 
const SPECIAL_CREATIVE = 0x79
 
const SPECIAL_HOTBAR = 0x7a
 
const SPECIAL_FIXED_INVENTORY = 0x7b
 
 $windowid
 
 $targetEid
 
 $slots = []
 
 $hotbar = []
 
- Data Fields inherited from DataPacket
const NETWORK_ID = 0
 
 $isEncoded = false
 
- Data Fields inherited from BinaryStream
 $offset
 
 $buffer
 

Member Function Documentation

◆ clean()

clean ( )
Returns
$this
45  {
46  $this->slots = [];
47  $this->hotbar = [];
48 
49  return parent::clean();
50  }

◆ decode()

decode ( )
55  {
56  $this->windowid = $this->getUnsignedVarInt();
57  $this->targetEid = $this->getEntityId();
58  $count = $this->getUnsignedVarInt();
59  for($s = 0; $s < $count and !$this->feof(); ++$s){
60  $this->slots[$s] = $this->getSlot();
61  }
62  if($this->windowid === self::SPECIAL_INVENTORY){
63  $count = $this->getUnsignedVarInt();
64  for($s = 0; $s < $count and !$this->feof(); ++$s){
65  $this->hotbar[$s] = $this->getVarInt();
66  }
67  }
68  }

◆ encode()

encode ( )
73  {
74  $this->reset();
75  $this->putUnsignedVarInt($this->windowid);
76  $this->putEntityId($this->targetEid);
77  $this->putUnsignedVarInt(count($this->slots));
78  foreach($this->slots as $slot){
79  $this->putSlot($slot);
80  }
81  if($this->windowid === self::SPECIAL_INVENTORY and count($this->hotbar) > 0){
82  $this->putUnsignedVarInt(count($this->hotbar));
83  foreach($this->hotbar as $slot){
84  $this->putVarInt($slot);
85  }
86  }else{
87  $this->putUnsignedVarInt(0);
88  }
89  }

◆ getName()

getName ( )
Returns
PacketName|string
94  {
95  return "ContainerSetContentPacket";
96  }

Field Documentation

◆ $hotbar

$hotbar = []

◆ $slots

$slots = []

◆ $targetEid

$targetEid

◆ $windowid

$windowid

◆ NETWORK_ID

◆ SPECIAL_ARMOR

const SPECIAL_ARMOR = 0x78

◆ SPECIAL_CREATIVE

const SPECIAL_CREATIVE = 0x79

◆ SPECIAL_FIXED_INVENTORY

const SPECIAL_FIXED_INVENTORY = 0x7b

◆ SPECIAL_HOTBAR

const SPECIAL_HOTBAR = 0x7a

◆ SPECIAL_INVENTORY

const SPECIAL_INVENTORY = 0

The documentation for this class was generated from the following file: