mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 10:53:05 +00:00
network: explicitly specify @return void
This commit is contained in:
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -115,6 +115,7 @@ class NetworkInventoryAction{
|
||||
|
||||
/**
|
||||
* @param InventoryTransactionPacket $packet
|
||||
* @return void
|
||||
*/
|
||||
public function write(InventoryTransactionPacket $packet){
|
||||
$packet->putUnsignedVarInt($this->sourceType);
|
||||
|
Reference in New Issue
Block a user