mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 17:29:44 +00:00
fine, variadics are annoying and this is easy to break ...
This commit is contained in:
parent
5c5fbf9b78
commit
e07f3e8e65
@ -48,7 +48,6 @@ class ExplodePacket extends DataPacket implements ClientboundPacket{
|
||||
* @return ExplodePacket
|
||||
*/
|
||||
public static function create(Vector3 $center, float $radius, array $records) : self{
|
||||
(function(Vector3 ...$_){})(...$records);
|
||||
$result = new self;
|
||||
$result->position = $center;
|
||||
$result->radius = $radius;
|
||||
|
@ -44,7 +44,6 @@ class InventoryContentPacket extends DataPacket implements ClientboundPacket{
|
||||
* @return InventoryContentPacket
|
||||
*/
|
||||
public static function create(int $windowId, array $items) : self{
|
||||
(function(Item ...$items){})(...$items); //type check
|
||||
$result = new self;
|
||||
$result->windowId = $windowId;
|
||||
$result->items = $items;
|
||||
|
@ -44,7 +44,6 @@ class PlayerListPacket extends DataPacket implements ClientboundPacket{
|
||||
public $type;
|
||||
|
||||
public static function add(array $entries) : self{
|
||||
(function(PlayerListEntry ...$_){})(...$entries);
|
||||
$result = new self;
|
||||
$result->type = self::TYPE_ADD;
|
||||
$result->entries = $entries;
|
||||
@ -52,7 +51,6 @@ class PlayerListPacket extends DataPacket implements ClientboundPacket{
|
||||
}
|
||||
|
||||
public static function remove(array $entries) : self{
|
||||
(function(PlayerListEntry ...$_){})(...$entries);
|
||||
$result = new self;
|
||||
$result->type = self::TYPE_REMOVE;
|
||||
$result->entries = $entries;
|
||||
|
@ -54,8 +54,6 @@ class ResourcePackStackPacket extends DataPacket implements ClientboundPacket{
|
||||
* @return ResourcePackStackPacket
|
||||
*/
|
||||
public static function create(array $resourcePacks, array $behaviorPacks, bool $mustAccept, bool $isExperimental = false) : self{
|
||||
(function(ResourcePack ...$_){})(...$resourcePacks);
|
||||
(function(ResourcePack ...$_){})(...$behaviorPacks);
|
||||
$result = new self;
|
||||
$result->mustAccept = $mustAccept;
|
||||
$result->resourcePackStack = $resourcePacks;
|
||||
|
@ -51,8 +51,6 @@ class ResourcePacksInfoPacket extends DataPacket implements ClientboundPacket{
|
||||
* @return ResourcePacksInfoPacket
|
||||
*/
|
||||
public static function create(array $resourcePacks, array $behaviorPacks, bool $mustAccept, bool $hasScripts = false) : self{
|
||||
(function(ResourcePack ...$_){})(...$resourcePacks);
|
||||
(function(ResourcePack ...$_){})(...$behaviorPacks);
|
||||
$result = new self;
|
||||
$result->mustAccept = $mustAccept;
|
||||
$result->hasScripts = $hasScripts;
|
||||
|
@ -66,7 +66,6 @@ class TextPacket extends DataPacket implements ClientboundPacket, ServerboundPac
|
||||
}
|
||||
|
||||
private static function baseTranslation(int $type, string $key, array $parameters) : self{
|
||||
(function(string ...$_){})(...$parameters);
|
||||
$result = new self;
|
||||
$result->type = $type;
|
||||
$result->needsTranslation = true;
|
||||
|
@ -45,7 +45,6 @@ class UpdateAttributesPacket extends DataPacket implements ClientboundPacket{
|
||||
* @return UpdateAttributesPacket
|
||||
*/
|
||||
public static function create(int $entityRuntimeId, array $attributes) : self{
|
||||
(function(Attribute ...$attributes){})(...$attributes);
|
||||
$result = new self;
|
||||
$result->entityRuntimeId = $entityRuntimeId;
|
||||
$result->entries = $attributes;
|
||||
|
Loading…
x
Reference in New Issue
Block a user