mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
Updated references and submodules
This commit is contained in:
@ -84,7 +84,7 @@ class NBT{
|
||||
return $len === 1 ? $this->buffer{$this->offset++} : substr($this->buffer, ($this->offset += $len) - $len, $len);
|
||||
}
|
||||
|
||||
public function put(&$v){
|
||||
public function put($v){
|
||||
$this->buffer .= $v;
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ class NBT{
|
||||
|
||||
public function read($buffer, $doMultiple = false){
|
||||
$this->offset = 0;
|
||||
$this->buffer =& $buffer;
|
||||
$this->buffer = $buffer;
|
||||
$this->data = $this->readTag();
|
||||
if($doMultiple and $this->offset < strlen($this->buffer)){
|
||||
$this->data = [$this->data];
|
||||
@ -117,24 +117,24 @@ class NBT{
|
||||
/**
|
||||
* @return string|bool
|
||||
*/
|
||||
public function &write(){
|
||||
public function write(){
|
||||
$this->offset = 0;
|
||||
$data = false;
|
||||
if($this->data instanceof Compound){
|
||||
$this->writeTag($this->data);
|
||||
|
||||
$data =& $this->buffer;
|
||||
$data = $this->buffer;
|
||||
}elseif(is_array($this->data)){
|
||||
foreach($this->data as $tag){
|
||||
$this->writeTag($tag);
|
||||
}
|
||||
$data =& $this->buffer;
|
||||
$data = $this->buffer;
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function &writeCompressed($compression = ZLIB_ENCODING_GZIP, $level = 7){
|
||||
public function writeCompressed($compression = ZLIB_ENCODING_GZIP, $level = 7){
|
||||
$data = false;
|
||||
if(($write = $this->write()) !== false){
|
||||
$data = zlib_encode($write, $compression, $level);
|
||||
@ -258,7 +258,7 @@ class NBT{
|
||||
return $this->get($this->getShort());
|
||||
}
|
||||
|
||||
public function putString(&$v){
|
||||
public function putString($v){
|
||||
$this->putShort(strlen($v));
|
||||
$this->buffer .= $v;
|
||||
}
|
||||
|
@ -27,13 +27,6 @@ use pocketmine\nbt\NBT;
|
||||
|
||||
class ByteArray extends NamedTag{
|
||||
|
||||
public function __construct($name = "", &$value = null){
|
||||
$this->name = $name;
|
||||
if($value !== null){
|
||||
$this->value =& $value;
|
||||
}
|
||||
}
|
||||
|
||||
public function getType(){
|
||||
return NBT::TAG_ByteArray;
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ abstract class NamedTag extends Tag{
|
||||
}
|
||||
}
|
||||
|
||||
public function &getName(){
|
||||
public function getName(){
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ class String extends NamedTag{
|
||||
public function __construct($name = "", $value = null){
|
||||
$this->name = $name;
|
||||
if($value !== null){
|
||||
$this->value =& $value;
|
||||
$this->value = $value;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user