mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
Anvil fixes, improved memory settings
This commit is contained in:
@ -65,7 +65,8 @@ class AddEntityPacket extends DataPacket{
|
||||
$this->putFloat($this->speedZ);
|
||||
$this->putFloat($this->yaw);
|
||||
$this->putFloat($this->pitch);
|
||||
$this->put(Binary::writeMetadata($this->metadata));
|
||||
$meta = Binary::writeMetadata($this->metadata);
|
||||
$this->put($meta);
|
||||
$this->putShort(count($this->links));
|
||||
foreach($this->links as $link){
|
||||
$this->putLong($link[0]);
|
||||
|
@ -78,7 +78,8 @@ class AddPlayerPacket extends DataPacket{
|
||||
$this->putShort($this->meta);
|
||||
$this->putByte($this->slim ? 1 : 0);
|
||||
$this->putString($this->skin);
|
||||
$this->put(Binary::writeMetadata($this->metadata));
|
||||
$meta = Binary::writeMetadata($this->metadata);
|
||||
$this->put($meta);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -57,9 +57,9 @@ abstract class DataPacket extends \stdClass{
|
||||
return $this->channel;
|
||||
}
|
||||
|
||||
public function setBuffer($buffer = ""){
|
||||
public function setBuffer(&$buffer = null, $offset = 0){
|
||||
$this->buffer =& $buffer;
|
||||
$this->offset = 0;
|
||||
$this->offset = (int) $offset;
|
||||
}
|
||||
|
||||
public function getOffset(){
|
||||
@ -81,7 +81,7 @@ abstract class DataPacket extends \stdClass{
|
||||
return $len === 1 ? $this->buffer{$this->offset++} : substr($this->buffer, ($this->offset += $len) - $len, $len);
|
||||
}
|
||||
|
||||
protected function put($str){
|
||||
protected function put(&$str){
|
||||
$this->buffer .= $str;
|
||||
}
|
||||
|
||||
@ -179,7 +179,7 @@ abstract class DataPacket extends \stdClass{
|
||||
return $this->get($this->getShort());
|
||||
}
|
||||
|
||||
protected function putString($v){
|
||||
protected function putString(&$v){
|
||||
$this->putShort(strlen($v));
|
||||
$this->put($v);
|
||||
}
|
||||
|
@ -46,7 +46,8 @@ class SetEntityDataPacket extends DataPacket{
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putLong($this->eid);
|
||||
$this->put(Binary::writeMetadata($this->metadata));
|
||||
$meta = Binary::writeMetadata($this->metadata);
|
||||
$this->put($meta);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user