DataPacket now encapsulates NetworkBinaryStream instead of extending it

ultimately the goal is to remove the NetworkBinaryStream crap entirely, but this change has most of the same benefits and is less disruptive.
This commit is contained in:
Dylan K. Taylor
2020-02-24 18:59:54 +00:00
parent 7c2741e4f5
commit ce0af8b040
146 changed files with 1249 additions and 1269 deletions

View File

@ -595,7 +595,7 @@ class NetworkBinaryStream extends BinaryStream{
/**
* @throws BinaryDataException
*/
protected function getEntityLink() : EntityLink{
public function getEntityLink() : EntityLink{
$link = new EntityLink();
$link->fromEntityUniqueId = $this->getEntityUniqueId();
@ -606,7 +606,7 @@ class NetworkBinaryStream extends BinaryStream{
return $link;
}
protected function putEntityLink(EntityLink $link) : void{
public function putEntityLink(EntityLink $link) : void{
$this->putEntityUniqueId($link->fromEntityUniqueId);
$this->putEntityUniqueId($link->toEntityUniqueId);
$this->putByte($link->type);
@ -616,7 +616,7 @@ class NetworkBinaryStream extends BinaryStream{
/**
* @throws BinaryDataException
*/
protected function getCommandOriginData() : CommandOriginData{
public function getCommandOriginData() : CommandOriginData{
$result = new CommandOriginData();
$result->type = $this->getUnsignedVarInt();
@ -630,7 +630,7 @@ class NetworkBinaryStream extends BinaryStream{
return $result;
}
protected function putCommandOriginData(CommandOriginData $data) : void{
public function putCommandOriginData(CommandOriginData $data) : void{
$this->putUnsignedVarInt($data->type);
$this->putUUID($data->uuid);
$this->putString($data->requestId);
@ -640,7 +640,7 @@ class NetworkBinaryStream extends BinaryStream{
}
}
protected function getStructureSettings() : StructureSettings{
public function getStructureSettings() : StructureSettings{
$result = new StructureSettings();
$result->paletteName = $this->getString();
@ -660,7 +660,7 @@ class NetworkBinaryStream extends BinaryStream{
return $result;
}
protected function putStructureSettings(StructureSettings $structureSettings) : void{
public function putStructureSettings(StructureSettings $structureSettings) : void{
$this->putString($structureSettings->paletteName);
$this->putBool($structureSettings->ignoreEntities);