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

Public Member Functions

 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::ADD_ENTITY_PACKET
 
 $eid
 
 $type
 
 $x
 
 $y
 
 $z
 
 $speedX
 
 $speedY
 
 $speedZ
 
 $yaw
 
 $pitch
 
 $attributes = []
 
 $metadata = []
 
 $links = []
 
- Data Fields inherited from DataPacket
const NETWORK_ID = 0
 
 $isEncoded = false
 
- Data Fields inherited from BinaryStream
 $offset
 
 $buffer
 

Member Function Documentation

◆ decode()

decode ( )
54  {
55 
56  }

◆ encode()

encode ( )
61  {
62  $this->reset();
63  $this->putEntityId($this->eid); //EntityUniqueID - TODO: verify this
64  $this->putEntityId($this->eid);
65  $this->putUnsignedVarInt($this->type);
66  $this->putVector3f($this->x, $this->y, $this->z);
67  $this->putVector3f($this->speedX, $this->speedY, $this->speedZ);
68  $this->putLFloat($this->pitch * (256 / 360));
69  $this->putLFloat($this->yaw * (256 / 360));
70  $this->putUnsignedVarInt(count($this->attributes));
71  foreach($this->attributes as $entry){
72  $this->putString($entry->getName());
73  $this->putLFloat($entry->getMinValue());
74  $this->putLFloat($entry->getValue());
75  $this->putLFloat($entry->getMaxValue());
76  }
77  $this->putEntityMetadata($this->metadata);
78  $this->putUnsignedVarInt(count($this->links));
79  foreach($this->links as $link){
80  $this->putEntityId($link[0]);
81  $this->putEntityId($link[1]);
82  $this->putByte($link[2]);
83  }
84  }

◆ getName()

getName ( )
Returns
AddEntityPacket|string
89  {
90  return "AddEntityPacket";
91  }

Field Documentation

◆ $attributes

$attributes = []

◆ $eid

$eid

◆ $links

$links = []

◆ $metadata

$metadata = []

◆ $pitch

$pitch

◆ $speedX

$speedX

◆ $speedY

$speedY

◆ $speedZ

$speedZ

◆ $type

$type

◆ $x

$x

◆ $y

$y

◆ $yaw

$yaw

◆ $z

$z

◆ NETWORK_ID

const NETWORK_ID = ProtocolInfo::ADD_ENTITY_PACKET

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