network: explicitly specify @return void

This commit is contained in:
Dylan K. Taylor
2020-01-18 19:35:01 +00:00
parent ca86ec2ec2
commit b42966f61b
15 changed files with 122 additions and 0 deletions

View File

@ -102,6 +102,12 @@ class AdventureSettingsPacket extends DataPacket{
return ($this->flags & $flag) !== 0;
}
/**
* @param int $flag
* @param bool $value
*
* @return void
*/
public function setFlag(int $flag, bool $value){
if($flag & self::BITFLAG_SECOND_SET){
$flagSet =& $this->flags2;

View File

@ -77,6 +77,8 @@ class BatchPacket extends DataPacket{
/**
* @param DataPacket $packet
*
* @return void
*/
public function addPacket(DataPacket $packet){
if(!$packet->canBeBatched()){
@ -107,6 +109,11 @@ class BatchPacket extends DataPacket{
return $this->compressionLevel;
}
/**
* @param int $level
*
* @return void
*/
public function setCompressionLevel(int $level){
$this->compressionLevel = $level;
}

View File

@ -86,6 +86,11 @@ class CommandOutputPacket extends DataPacket{
}
}
/**
* @param CommandOutputMessage $message
*
* @return void
*/
protected function putCommandMessage(CommandOutputMessage $message){
$this->putBool($message->isInternal);
$this->putString($message->messageId);

View File

@ -238,14 +238,29 @@ class CraftingDataPacket extends DataPacket{
return $result;
}
/**
* @param ShapelessRecipe $recipe
*
* @return void
*/
public function addShapelessRecipe(ShapelessRecipe $recipe){
$this->entries[] = $recipe;
}
/**
* @param ShapedRecipe $recipe
*
* @return void
*/
public function addShapedRecipe(ShapedRecipe $recipe){
$this->entries[] = $recipe;
}
/**
* @param FurnaceRecipe $recipe
*
* @return void
*/
public function addFurnaceRecipe(FurnaceRecipe $recipe){
$this->entries[] = $recipe;
}

View File

@ -30,6 +30,9 @@ class PacketPool{
/** @var \SplFixedArray<DataPacket> */
protected static $pool = null;
/**
* @return void
*/
public static function init(){
static::$pool = new \SplFixedArray(256);
@ -179,6 +182,8 @@ class PacketPool{
/**
* @param DataPacket $packet
*
* @return void
*/
public static function registerPacket(DataPacket $packet){
static::$pool[$packet->pid()] = clone $packet;

View File

@ -115,6 +115,7 @@ class NetworkInventoryAction{
/**
* @param InventoryTransactionPacket $packet
* @return void
*/
public function write(InventoryTransactionPacket $packet){
$packet->putUnsignedVarInt($this->sourceType);