|
| | __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 () |
| |
◆ __construct()
| __construct |
( |
|
$buffer = "", |
|
|
|
$offset = 0 |
|
) |
| |
◆ feof()
- Returns
- bool
476 return !isset($this->buffer{$this->offset});
◆ get()
- Parameters
-
- Returns
- bool|string
81 $this->offset = strlen($this->buffer) - 1;
84 }elseif($len ===
true){
85 $str = substr($this->buffer, $this->offset);
86 $this->offset = strlen($this->buffer);
91 return $len === 1 ? $this->buffer{$this->offset++} : substr($this->buffer, ($this->offset += $len) - $len, $len);
◆ getBlockCoords()
| getBlockCoords |
( |
& |
$x, |
|
|
& |
$y, |
|
|
& |
$z |
|
) |
| |
◆ getBool()
- Returns
- bool
105 return (
bool) $this->
getByte();
◆ getBuffer()
◆ getByte()
- Returns
- int
279 return ord($this->buffer{$this->offset++});
◆ getEntityId()
◆ getFloat()
| getFloat |
( |
int |
$accuracy = -1 | ) |
|
◆ getInt()
◆ getLFloat()
| getLFloat |
( |
int |
$accuracy = -1 | ) |
|
◆ getLInt()
◆ getLLong()
◆ getLong()
◆ getLShort()
| getLShort |
( |
|
$signed = true | ) |
|
◆ getLTriad()
◆ getOffset()
◆ getShort()
◆ getSignedShort()
◆ getSlot()
- Returns
- Item
313 $data = $auxValue >> 8;
314 if($data === 0x7fff){
317 $cnt = $auxValue & 0xff;
323 $nbt = $this->
get($nbtLen);
328 for($i = 0; $i < $canPlaceOn; ++$i){
335 for($i = 0; $i < $canDestroy; ++$i){
340 return Item::get($id, $data, $cnt, $nbt);
◆ getString()
◆ getTriad()
◆ getUnsignedVarInt()
Reads an unsigned varint32 from the stream.
◆ getUUID()
◆ getVarInt()
Reads a signed varint32 from the stream.
◆ getVector3f()
| getVector3f |
( |
& |
$x, |
|
|
& |
$y, |
|
|
& |
$z |
|
) |
| |
◆ put()
- Parameters
-
98 $this->buffer .= $str;
◆ putBlockCoords()
| putBlockCoords |
( |
|
$x, |
|
|
|
$y, |
|
|
|
$z |
|
) |
| |
◆ putBool()
◆ putByte()
- Parameters
-
286 $this->buffer .= chr($v);
◆ putEntityId()
◆ putFloat()
◆ putInt()
◆ putLFloat()
◆ putLInt()
◆ putLLong()
◆ putLong()
◆ putLShort()
◆ putLTriad()
◆ putShort()
◆ putSignedShort()
◆ putSlot()
- Parameters
-
348 if($item->getId() === 0){
355 $auxValue = (($item->getDamage() & 0x7fff) << 8) | $item->getCount();
357 $nbt = $item->getCompoundTag();
◆ putString()
◆ putTriad()
◆ putUnsignedVarInt()
Writes an unsigned varint32 to the stream.
- Parameters
-
◆ putUUID()
- Parameters
-
300 $this->
put($uuid->toBinary());
◆ putVarInt()
Writes a signed varint32 to the stream.
- Parameters
-
◆ putVector3f()
| putVector3f |
( |
|
$x, |
|
|
|
$y, |
|
|
|
$z |
|
) |
| |
◆ reset()
◆ setBuffer()
| setBuffer |
( |
|
$buffer = null, |
|
|
|
$offset = 0 |
|
) |
| |
◆ $buffer
◆ $offset
The documentation for this class was generated from the following file:
- src/pocketmine/utils/BinaryStream.php